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

[PATCH 02/37] xen: introduce a Kconfig option to configure NUMA nodes number


  • To: <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Thu, 23 Sep 2021 20:02:01 +0800
  • 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=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eYpFnlkmKkWIfrICpF9PJssjdhb8RblMf+bC222jYXo=; b=dwnJs9g00gRFCpbil5HynnImfid70D/qOqU02x/+EJ14TSidLGaBhZ8V+wpnIqA3334OHeCmOvkFCrSt8jM9RU6AFXVhJ3me6IV6NAtFHRC9t+axyqrQuet6ARLGBnm99pk1BO78CK4clnSlqzAzwJRzgOohT+XyBEfeGWD6qV1DGrHGJUTn+q0eyVeT/wzFxF35opK/mEUpyKIghXBvqtlUAy2X54NxnS0Q/MJpd6oYMESTUv+U1cwI5mpU6BLDXRjaJpfb9OgqMGH5LLLRbT7rlYWjXJqYAyYgtqi1VkB/xskkcM59Tyh9P4tc2ZOFfAravvQoDUmsrzk3x/wwRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Je0JyCYcCahaXGSrIylgBYfOIHGv7kRCbedNWsePEU3KwaiV7Q2/OmUiTiCxNLMKr2T9vsESnKIiBfca33IfoTeWytocXYHr9jXoLcHupLpRGlTFo6Gm2TQq0NLjO8CAlM/Htr5yHZzz98uTPvIlSsv4/HLQvtSSi9kXjonC3oxmO6OuBzR7Fx3HzE5jf4UTkKnhIAdUuRS8g2/gyXLi9Vrom6xJFQ+6vR5y7HPpvrhDz1UbqChA1B+C/o4UD46TavLgAEoam+U21bTOG5+6VzTq1gu9pe0pw/dinapuVyk2yVIeWhp9Ae7t2riT3kL2WB2yp2HOSbGNBwwOPvdUtQ==
  • Cc: <Bertrand.Marquis@xxxxxxx>
  • Delivery-date: Thu, 23 Sep 2021 12:03:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Current NUMA nodes number is a hardcode configuration. This
configuration is difficult for an administrator to change
unless changing the code.

So in this patch, we introduce this new Kconfig option for
administrators to change NUMA nodes number conveniently.
Also considering that not all architectures support NUMA,
this Kconfig option only can be visible on NUMA enabled
architectures. Non-NUMA supported architectures can still
use 1 as MAX_NUMNODES.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 xen/arch/Kconfig           | 11 +++++++++++
 xen/include/asm-x86/numa.h |  2 --
 xen/include/xen/numa.h     | 10 +++++-----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
index f16eb0df43..8a20da67ed 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 1 4095
+       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 the scheduler, memory allocation and other
+         NUMA-aware components can handle.
diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h
index bada2c0bb9..3cf26c2def 100644
--- a/xen/include/asm-x86/numa.h
+++ b/xen/include/asm-x86/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 7aef1a88dc..52950a3150 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -3,14 +3,14 @@
 
 #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 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®.