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

[PATCH v5 6/6] xen: introduce a Kconfig option to configure NUMA nodes number


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Tue, 20 Sep 2022 17:12:18 +0800
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XFQSEiC1wVF3SghW0Tlnd8Ag25n68oQY6R+gL/4gByY=; b=lFU8WavDFj7DZPhiOBdIoEnZqRDHyM00lJDROrZT0wKIv/dAEpr+SwhItINLS/c9QjcLbgJHtgh/XwzloJi+9gQbQvi5bl/oCRfoSykd5zJeTLqMMYDaOn9e7pnQmovUuNzUWIxqYWRsSySHjMlmYPotQVlEAa97MtdCedFUyg9Gi8t9LXf+DD+7A5e00LnePLoWRAtVopTQpkTzZ5CRxXf/3MrA7s4dL7qGKk7AIchHW1AQMkffsx/Aoh9ZMMfgdRDJwqpNLw2uFQELZ5BBROW8hBbF9RIOWAGbFcGuFXHEjnUM3cr0a3mPrtbu0i3FfVAu66BTJEC4VLQnuzkC8A==
  • 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XFQSEiC1wVF3SghW0Tlnd8Ag25n68oQY6R+gL/4gByY=; b=ThRUpxkIZfzjMmehywjqtyiJGo+Y7B84n1n++CeSOx0jfHQw0XiQyCkeA+n4/HazMKv8WSEe/S2kUG7xTvENVp21it1sjsZaojsUQfSg2GuBjRPgztcg27GPRYjr9kEx7KbEb5jroH0/VQ3ttHb1YkMwzRYHT6ARin+OXmP/0dJS3EQwRBazpxxkoxcUJ0yU6ts3a6Zt7R6azMqYk0x3dG4AMLh2UQ6zuuIRhZ3pNmPrFZOBl4UPo0S+Y3XG1LPAmNI+1U7kGpw9oA45GHmxKZgl33HFcKWSN9VcKQLONR1MQTeA8uShZBF9E+Js7Y2dlefKov+Vq/5zcVCY+/47AA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BNAqS+oVdu6cKeoZSlV0ev5QJJPBOOzuuYtfg/iAIXORGv4Caxl0qzeUpBWqL5X+QuYFJHsscj7iE6aMbSvaqsVtZ1I3FEs7AM9vICPASp+ddOeVTO2rTxhtqglYORCHhJcJ2uXDfsDwCGZa1Wfp1A7yTva65EMZ6UR5TeiELtqjtEWAvByNilCzrjlxNicPKs0jV70ZIJUIjBj6qTjFFawL4SUIkDJ9P1QTb1eqU5FEnShqYhgwjrWzR2Ppi1VIzK6IaPzaNo6NjbOzVsV8h5bamDATMstrdYUMlXIvus8ennpySrsMEj98EXvTmebOjuKT1CZD2jMLbZfrRNs4Mg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFuMSDp0e4D0vJVbEaW/Bj9Nun2dIXHsz8bOeNQ5qX1KlBCWi57+zSfZLVLvH+iFCYgZQUbmdMzjc5ji3ceCTuuIHnxfl6gi2y+p67MlA2yEaFXpkduskRCWCC84RnfqsSm24j7SCRCd25Y/wZkId98/7CnP0KI17kSJbeix5IXfIPnDviajeDKChKe+xQKmcXK5UKeePWe/sW+eRqVNenBk5j7cVjKDokXeXx0Smjr+obDkYbuRRgmfzVsRkZjhbGNv6Hsu6+E+EkjdtMfjpD5Vuw0Dew5R4P1+z18KVZiIA6tuE7II2NXVH0mbuuv3D5qOYieuMYprv9jZLGt9Qw==
  • Cc: <nd@xxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 20 Sep 2022 09:13:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Currently the maximum number of NUMA nodes is a hardcoded value.
This provides little flexibility unless changing the code.

Introduce a new Kconfig option to change the maximum number of
NUMA nodes conveniently. Also considering that not all
architectures support NUMA, this Kconfig option is only visible
on NUMA enabled architectures. Architectures not supporting NUMA
still use 1 for MAX_NUMNODES.

As NODES_SHIFT is currently unused, we're taking this
opportunity to remove it.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v4 -> v5:
1. No change.
v3 -> v4:
1. Update the commit log to follow Jan's suggestion.
2. Add Ack-by.
v2 -> v3:
1. Fix indent.
2. Use 2-64 for node range.
v1 -> v2:
1. Add NODES_SHIFT remove message in commit log
2. Change NR_NUMA_NODES upper bound from 4095 to 255.
---
 xen/arch/Kconfig                | 11 +++++++++++
 xen/arch/x86/include/asm/numa.h |  2 --
 xen/include/xen/numa.h          | 11 ++++++-----
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index f16eb0df43..7028f7b74f 100644
--- a/xen/arch/Kconfig
+++ b/xen/arch/Kconfig
@@ -17,3 +17,14 @@ config NR_CPUS
          For CPU cores which support Simultaneous Multi-Threading or similar
          technologies, this the number of logical threads which Xen will
          support.
+
+config NR_NUMA_NODES
+       int "Maximum number of NUMA nodes supported"
+       range 2 64
+       default "64"
+       depends on NUMA
+       help
+         Controls the build-time size of various arrays and bitmaps
+         associated with multiple-nodes management. It is the upper bound of
+         the number of NUMA nodes that the scheduler, memory allocation and
+         other NUMA-aware components can handle.
diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/numa.h
index 2ca3475271..7866afa408 100644
--- a/xen/arch/x86/include/asm/numa.h
+++ b/xen/arch/x86/include/asm/numa.h
@@ -3,8 +3,6 @@
 
 #include <xen/cpumask.h>
 
-#define NODES_SHIFT 6
-
 typedef u8 nodeid_t;
 
 extern int srat_rev;
diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
index a87cdc45b4..cabe8571b3 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -3,14 +3,15 @@
 
 #include <asm/numa.h>
 
-#ifndef NODES_SHIFT
-#define NODES_SHIFT     0
-#endif
-
 #define NUMA_NO_NODE     0xFF
 #define NUMA_NO_DISTANCE 0xFF
 
-#define MAX_NUMNODES    (1 << NODES_SHIFT)
+#ifdef CONFIG_NR_NUMA_NODES
+#define MAX_NUMNODES CONFIG_NR_NUMA_NODES
+#else
+#define MAX_NUMNODES 1
+#endif
+
 #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2)
 
 #define vcpu_to_node(v) (cpu_to_node((v)->processor))
-- 
2.25.1




 


Rackspace

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