Message ID | 20230420112521.3272732-2-Henry.Wang@arm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Device tree based NUMA support for Arm - Part#3 | expand |
On 20.04.2023 13:25, Henry Wang wrote: > From: Wei Chen <wei.chen@arm.com> > > As a memory range described in device tree cannot be split across > multiple nodes. And it is very likely than if you have more than > 64 nodes, you may need a lot more than 2 regions per node. So the > default NR_NODE_MEMBLKS value (MAX_NUMNODES * 2) makes no sense > on Arm. > > So, for Arm, we would just define NR_NODE_MEMBLKS as an alias to > NR_MEM_BANKS. And in the future NR_MEM_BANKS will be user-configurable > via kconfig, but for now leave NR_MEM_BANKS as 128 on Arm. This > avoid to have different way to define the value based NUMA vs non-NUMA. > > Further discussions can be found here[1]. > > [1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/msg02322.html > > Signed-off-by: Wei Chen <wei.chen@arm.com> > Signed-off-by: Henry Wang <Henry.Wang@arm.com> Acked-by: Jan Beulich <jbeulich@suse.com>
diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index e2bee2bd82..7d6ae36a19 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -3,9 +3,26 @@ #include <xen/mm.h> +#include <asm/setup.h> + typedef u8 nodeid_t; -#ifndef CONFIG_NUMA +#ifdef CONFIG_NUMA + +/* + * It is very likely that if you have more than 64 nodes, you may + * need a lot more than 2 regions per node. So, for Arm, we would + * just define NR_NODE_MEMBLKS as an alias to NR_MEM_BANKS. + * And in the future NR_MEM_BANKS will be bumped for new platforms, + * but for now leave NR_MEM_BANKS as it is on Arm. This avoid to + * have different way to define the value based NUMA vs non-NUMA. + * + * Further discussions can be found here: + * https://lists.xenproject.org/archives/html/xen-devel/2021-09/msg02322.html + */ +#define NR_NODE_MEMBLKS NR_MEM_BANKS + +#else /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 29b8c2df89..b86d0851fc 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -13,7 +13,16 @@ #define MAX_NUMNODES 1 #endif +/* + * Some architectures may have different considerations for + * number of node memory blocks. They can define their + * NR_NODE_MEMBLKS in asm/numa.h to reflect their architectural + * implementation. If the arch does not have specific implementation, + * the following default NR_NODE_MEMBLKS will be used. + */ +#ifndef NR_NODE_MEMBLKS #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2) +#endif #define vcpu_to_node(v) (cpu_to_node((v)->processor))