[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [XEN RFC PATCH 38/40] xen/arm: enable device tree based NUMA in system init


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Wei Chen <Wei.Chen@xxxxxxx>
  • Date: Tue, 31 Aug 2021 13:43:48 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y0leoXdtt7Cfe38f6pquOEy6M9w12Ev4ld5FUMBC4SM=; b=lEwgm57GDpZ2Pi/P4B2pG9ZKWbU7ZbmKashKTaCAgXyUnOpYohBNpg3VY89n1UJ9H+8INABHCvm0Hq3mVax/qg6zp2lSLN0fLyUmJEiATTmUyZDcguIuVCeG99ExIatuIz3AD438CrjaB+1TL3gv7/7nWQ8G4kql/eDCAT8jBZ6ngpDbGcpLHPZrM7uJ+ViCfafZW0xFkN5WXx91X3YzY1plVAUfALFXqST/gZlmO9CVECNiA6yM9uwImZHZvp4ZjhR1+zTtwbQdwb5JKzkXmH4zDSLUXVSx9OUvWpa/DZN4GwXRZbc1afXUAEiU7Md27+IQxBO/XDxGWq0JPXvnfw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IRWZPUNahqCWKPI0xL8jzkgxFcpBMt0/ar3aY/MoqjbAPV+hXItJ7gBF1bD3ekUDrzFWxsSizZyn5FVor08co+mx7cKnEFzq061HNWwCRS7gq+gQwOlufsl0oBtV+GjzGSfpCktNLXV/aIRtteFspTb0WN+mtIr3Ishw4v7J/ZtnG4p/qLNl6lo1u2Ira+2XmGwl8Gyh0W8FUY6DEJF/cWW2xa3e614Ch75z9dCWR640TVkt0yEtlToSg21hYCSknMG9w0LCay5tLTGnHLPfN/ZJEjdrFncGVp/yQQ0ix/riQayk0mZfCfWDrNkk51Pn94imRNuHVUczrxLYD896sg==
  • Authentication-results-original: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Tue, 31 Aug 2021 13:44:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHXjptQCVAwokAljU6uEdAOvxt6uKuM9/MAgADAnZA=
  • Thread-topic: [XEN RFC PATCH 38/40] xen/arm: enable device tree based NUMA in system init

Hi Stefano,

> -----Original Message-----
> From: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> Sent: 2021年8月31日 9:51
> To: Wei Chen <Wei.Chen@xxxxxxx>
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; sstabellini@xxxxxxxxxx; julien@xxxxxxx;
> jbeulich@xxxxxxxx; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
> Subject: Re: [XEN RFC PATCH 38/40] xen/arm: enable device tree based NUMA
> in system init
> 
> On Wed, 11 Aug 2021, Wei Chen wrote:
> > Everything is ready, we can remove the fake NUMA node and
> > depends on device tree to create NUMA system.
> >
> > Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> > ---
> >  xen/arch/arm/numa.c        | 45 ++++++++++++++++++++++----------------
> >  xen/include/asm-arm/numa.h |  7 ------
> >  2 files changed, 26 insertions(+), 26 deletions(-)
> >
> > diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c
> > index 2a18c97470..3b04220e60 100644
> > --- a/xen/arch/arm/numa.c
> > +++ b/xen/arch/arm/numa.c
> > @@ -18,6 +18,7 @@
> >   *
> >   */
> >  #include <xen/init.h>
> > +#include <xen/device_tree.h>
> >  #include <xen/nodemask.h>
> >  #include <xen/numa.h>
> >  #include <xen/pfn.h>
> > @@ -83,28 +84,34 @@ void __init numa_init(bool acpi_off)
> >      paddr_t ram_size = 0;
> >      paddr_t ram_end = 0;
> >
> > -    printk(XENLOG_WARNING
> > -        "NUMA has not been supported yet, NUMA off!\n");
> > -    /* Arm NUMA has not been implemented until this patch */
> > -    numa_off = true;
> > +    /* NUMA has been turned off through Xen parameters */
> > +    if ( numa_off )
> > +        goto mem_init;
> >
> > -    /*
> > -     * Set all cpu_to_node mapping to 0, this will make cpu_to_node
> > -     * function return 0 as previous fake cpu_to_node API.
> > -     */
> > -    for ( idx = 0; idx < NR_CPUS; idx++ )
> > -        cpu_to_node[idx] = 0;
> > -
> > -    /*
> > -     * Make node_to_cpumask, node_spanned_pages and node_start_pfn
> > -     * return as previous fake APIs.
> > -     */
> > -    for ( idx = 0; idx < MAX_NUMNODES; idx++ ) {
> > -        node_to_cpumask[idx] = cpu_online_map;
> > -        node_spanned_pages(idx) = (max_page - mfn_x(first_valid_mfn));
> > -        node_start_pfn(idx) = (mfn_x(first_valid_mfn));
> > +    /* Initialize NUMA from device tree when system is not ACPI booted
> */
> > +    if ( acpi_off )
> > +    {
> > +#ifdef CONFIG_DEVICE_TREE_NUMA
> > +        int ret = numa_device_tree_init(device_tree_flattened);
> > +        if ( !ret )
> > +            goto mem_init;
> > +        printk(XENLOG_WARNING
> > +               "Init NUMA from device tree failed, ret=%d\n", ret);
> > +#else
> > +        printk(XENLOG_WARNING
> > +               "CONFIG_DEVICE_TREE_NUMA is not set, NUMA off!\n");
> 
> I don't think we want to see this warning every time at boot when
> CONFIG_DEVICE_TREE_NUMA is off. I'd set it to XENLOG_DEBUG or remove it.
> 

OK

> Also given that we have many stub functions in
> xen/include/asm-arm/numa.h already, maybe we could also have a stub
> function for numa_device_tree_init so that we won'd need an #ifdef
> CONFIG_DEVICE_TREE_NUMA here.
> 

Yes, it's a good idea. I will do it.

> 
> > +#endif
> > +        numa_off = true;
> > +    }
> > +    else
> > +    {
> > +        /* We don't support NUMA for ACPI boot currently */
> > +        printk(XENLOG_WARNING
> > +               "ACPI NUMA has not been supported yet, NUMA off!\n");
> > +        numa_off = true;
> >      }
> >
> > +mem_init:
> >      /*
> >       * Find the minimal and maximum address of RAM, NUMA will
> >       * build a memory to node mapping table for the whole range.
> > diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> > index a3982a94b6..425eb9aede 100644
> > --- a/xen/include/asm-arm/numa.h
> > +++ b/xen/include/asm-arm/numa.h
> > @@ -30,13 +30,6 @@ extern int numa_device_tree_init(const void *fdt);
> >  extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t
> distance);
> >  extern void arch_numa_init_failed_fallback(void);
> >
> > -/*
> > - * Temporary for fake NUMA node, when CPU, memory and distance
> > - * matrix will be read from DTB or ACPI SRAT. The following
> > - * symbols will be removed.
> > - */
> > -extern mfn_t first_valid_mfn;
> > -
> >  #else
> >
> >  /* Fake one node for now. See also node_online_map. */
> > --
> > 2.25.1
> >

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.