[XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default

Wei Chen posted 40 patches 4 years, 5 months ago
[XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default
Posted by Wei Chen 4 years, 5 months ago
Today's Arm64 systems can reach or exceed 16 NUMA nodes, so
we set the number to 64 to match with x86.

Signed-off-by: Wei Chen <wei.chen@arm.com>
---
 xen/include/asm-arm/numa.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index 1162c702df..b2982f9053 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -5,7 +5,15 @@
 
 typedef u8 nodeid_t;
 
-#if !defined(CONFIG_NUMA)
+#if defined(CONFIG_NUMA)
+
+/*
+ * Same as x86, we set the max number of NUMA nodes to 64 and
+ * set the number of NUMA memory block number to 128.
+ */
+#define NODES_SHIFT      6
+
+#else
 
 /* Fake one node for now. See also node_online_map. */
 #define cpu_to_node(cpu) 0
-- 
2.25.1


Re: [XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default
Posted by Julien Grall 4 years, 5 months ago
Hi Wei,

On 11/08/2021 11:23, Wei Chen wrote:
> Today's Arm64 systems can reach or exceed 16 NUMA nodes, so
> we set the number to 64 to match with x86.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> ---
>   xen/include/asm-arm/numa.h | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
> index 1162c702df..b2982f9053 100644
> --- a/xen/include/asm-arm/numa.h
> +++ b/xen/include/asm-arm/numa.h
> @@ -5,7 +5,15 @@
>   
>   typedef u8 nodeid_t;
>   
> -#if !defined(CONFIG_NUMA)
> +#if defined(CONFIG_NUMA)
> +
> +/*
> + * Same as x86, we set the max number of NUMA nodes to 64 and
> + * set the number of NUMA memory block number to 128.
> + */

Such comment can rot easily if x86 decides to bump there values. But 
given the value is the same, I think it would make sense to move the 
define to xen/numa.h.

> +#define NODES_SHIFT      6
> +
> +#else
>   
>   /* Fake one node for now. See also node_online_map. */
>   #define cpu_to_node(cpu) 0
> 

Cheers,

-- 
Julien Grall

Re: [XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default
Posted by Jan Beulich 4 years, 5 months ago
On 25.08.2021 15:28, Julien Grall wrote:
> On 11/08/2021 11:23, Wei Chen wrote:
>> --- a/xen/include/asm-arm/numa.h
>> +++ b/xen/include/asm-arm/numa.h
>> @@ -5,7 +5,15 @@
>>   
>>   typedef u8 nodeid_t;
>>   
>> -#if !defined(CONFIG_NUMA)
>> +#if defined(CONFIG_NUMA)
>> +
>> +/*
>> + * Same as x86, we set the max number of NUMA nodes to 64 and
>> + * set the number of NUMA memory block number to 128.
>> + */
> 
> Such comment can rot easily if x86 decides to bump there values. But 
> given the value is the same, I think it would make sense to move the 
> define to xen/numa.h.

To be honest - if this gets moved, please at least consider making it
a proper Kconfig setting. Just as much a the number of CPUs can be
configured, the number of nodes should be possible to choose by the
build manager. Of course - if it's not too much trouble ...

Jan


RE: [XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default
Posted by Wei Chen 4 years, 5 months ago
Hi Jan, Julien,

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: 2021年8月25日 21:36
> To: Julien Grall <julien@xen.org>; Wei Chen <Wei.Chen@arm.com>
> Cc: Bertrand Marquis <Bertrand.Marquis@arm.com>; xen-
> devel@lists.xenproject.org; sstabellini@kernel.org
> Subject: Re: [XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to
> 64 by default
> 
> On 25.08.2021 15:28, Julien Grall wrote:
> > On 11/08/2021 11:23, Wei Chen wrote:
> >> --- a/xen/include/asm-arm/numa.h
> >> +++ b/xen/include/asm-arm/numa.h
> >> @@ -5,7 +5,15 @@
> >>
> >>   typedef u8 nodeid_t;
> >>
> >> -#if !defined(CONFIG_NUMA)
> >> +#if defined(CONFIG_NUMA)
> >> +
> >> +/*
> >> + * Same as x86, we set the max number of NUMA nodes to 64 and
> >> + * set the number of NUMA memory block number to 128.
> >> + */
> >
> > Such comment can rot easily if x86 decides to bump there values. But
> > given the value is the same, I think it would make sense to move the
> > define to xen/numa.h.
> 
> To be honest - if this gets moved, please at least consider making it
> a proper Kconfig setting. Just as much a the number of CPUs can be
> configured, the number of nodes should be possible to choose by the
> build manager. Of course - if it's not too much trouble ...
> 

Ok

> Jan