[XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device tree based NUMA

Wei Chen posted 40 patches 4 years, 6 months ago
[XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device tree based NUMA
Posted by Wei Chen 4 years, 6 months ago
Now, we can use the same function for ACPI and device tree based
NUMA to scan memory nodes.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
 xen/common/numa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/numa.c b/xen/common/numa.c
index 8ca13e27d1..d15c2fc311 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -381,7 +381,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
         return;
 #endif
 
-#ifdef CONFIG_ACPI_NUMA
+#if defined(CONFIG_ACPI_NUMA) || defined(CONFIG_DEVICE_TREE_NUMA)
     if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT,
          (u64)end_pfn << PAGE_SHIFT) )
         return;
-- 
2.25.1


Re: [XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device tree based NUMA
Posted by Julien Grall 4 years, 5 months ago
Hi Wei,

On 11/08/2021 11:24, Wei Chen wrote:
> Now, we can use the same function for ACPI and device tree based
> NUMA to scan memory nodes.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
>   xen/common/numa.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/common/numa.c b/xen/common/numa.c
> index 8ca13e27d1..d15c2fc311 100644
> --- a/xen/common/numa.c
> +++ b/xen/common/numa.c
> @@ -381,7 +381,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
>           return;
>   #endif
>   
> -#ifdef CONFIG_ACPI_NUMA
> +#if defined(CONFIG_ACPI_NUMA) || defined(CONFIG_DEVICE_TREE_NUMA)

numa.c is only built when CONFIG_NUMA is set. I don't think CONFIG_NUMA 
will ever set if neither CONFIG_ACPI_NUMA or CONFIG_DEVICE_TREE_NUMA is 
set. So do we actually need this #ifdef?

>       if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT,
>            (u64)end_pfn << PAGE_SHIFT) )
>           return;
> 

Cheers,

-- 
Julien Grall

RE: [XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device tree based NUMA
Posted by Wei Chen 4 years, 5 months ago
Hi Julien,

> -----Original Message-----
> From: Julien Grall <julien@xen.org>
> Sent: 2021年8月27日 22:19
> To: Wei Chen <Wei.Chen@arm.com>; xen-devel@lists.xenproject.org;
> sstabellini@kernel.org; jbeulich@suse.com
> Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>
> Subject: Re: [XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device
> tree based NUMA
> 
> Hi Wei,
> 
> On 11/08/2021 11:24, Wei Chen wrote:
> > Now, we can use the same function for ACPI and device tree based
> > NUMA to scan memory nodes.
> >
> > Signed-off-by: Wei Chen <wei.chen@arm.com>
> > ---
> >   xen/common/numa.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/xen/common/numa.c b/xen/common/numa.c
> > index 8ca13e27d1..d15c2fc311 100644
> > --- a/xen/common/numa.c
> > +++ b/xen/common/numa.c
> > @@ -381,7 +381,7 @@ void __init numa_initmem_init(unsigned long
> start_pfn, unsigned long end_pfn)
> >           return;
> >   #endif
> >
> > -#ifdef CONFIG_ACPI_NUMA
> > +#if defined(CONFIG_ACPI_NUMA) || defined(CONFIG_DEVICE_TREE_NUMA)
> 
> numa.c is only built when CONFIG_NUMA is set. I don't think CONFIG_NUMA
> will ever set if neither CONFIG_ACPI_NUMA or CONFIG_DEVICE_TREE_NUMA is
> set. So do we actually need this #ifdef?
> 

Yes, you're right. This check should be removed.


> >       if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT,
> >            (u64)end_pfn << PAGE_SHIFT) )
> >           return;
> >
> 
> Cheers,
> 
> --
> Julien Grall