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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Mon, 22 Aug 2022 10:58:10 +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=yoZMK5PjsMqjXL+DEkyIGxFZ6hqYHaW2vP69im58izw=; b=bflcjWhWmOAKgXKJltXLUvJULsLWqJeJGEuTuYa0W0M60J0mL4yaHuhN+zMO6tLo2EyxHGBClFOz64rd9HKjPnBesik7t+xOTm+19+sxEAaKC+BgeMOb+0eYzF7hJAfeBYpXFMFHs25eDaYXFgB4LfpLBrPbdKpv+nXCFJw0VXCy4rmLXuzPtXcLiDGx72FU1viOelw/iY1yIatowS5I08gmrntDr94otgaUxvF6kVK//DV0faLDVuYb8SV3Sj/fWGDysHu8Monlv9ipaEg12HgZ0jb8OJpsdhKb49nyYzDJIWjDHNdTDFYbaGYVIFMynKBVaZZM7qqI/Y20d8V3Zw==
  • 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=yoZMK5PjsMqjXL+DEkyIGxFZ6hqYHaW2vP69im58izw=; b=QHhqT1kaQY7R1xma8gp7h10FHPqCPXK3EONQx9xdxlL2usNsuwWfBberJ5HSYLtSHFqrV8u4hJM16cUpxj6+e+vUAemsAKB+Pm95B1JWwZkP0/PFVKzba5vklOS/9OPqW+gnTE2SrwjlPRYT4MeF86JMS+uxiV6eGAliKF7kubjobbRobtwk5DCUnmuaRdrLM9gq/E04MQqAMwoZcsNV88k3BNc+YqfbUQ72vsM4Fjw30BYkzgF7LZRE1smC2XtbPIrcX52aXuiVkQMO83+341g9FpPA3cuLxW7fSxiEu/Y1DjAXQxR37oNR9Ph6q58QocdCnrVgqsxORsSW0shCbw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=WVXdD2xsOpVipmihx/dXmjVu03+Mo5D8WL07WCQ+SZLZu+fvgNi9WpCjRihbAjMevNpUrSZ6MdwfEfQALipR1yk+uzYyhZgS75gZqMXKV1ngwUT0TYk13SSES3MFufRIQlocibUCIgEWB8em1wZyhnjA7CYD+sU+HMLG+IGqHmIOAxZuVANaskyJjijqRsWlwMvmg9Wh+yBbRtzWqFNLUCGnjSOMmHV2OKhZ80dz7HqxtjZhE8foLCnrBUKr3WgISu6LIw5KLP8rxqtoJhdcD3YEYroX6SybMwEG3mGQCVNaNRGg+sZIo1/b2fAJ2xQaphE/v2ZXrfUG5m1FQH7sCg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=buP/ClAO3ANRUDxcTdnqDEYYvFDlxqWfYda/CfuthUyAZ9eQ+Zk6nD4FEAMlBesgA0gZhRKMk6U+9tV1QWBf/UmOFvZ3A7VnZhrtUSBz/V3hYBLBzluUmwOj9mfwIgxzEAnY3A1lIDzfB3Cdw8LQEOkSLnMpTaeG/2re35holGV7aZyD/cnqplRE2MNSYdj5TR60IOZ+Uq+zu/Ml3kjq760uZpr8LBXtpVTMgB4tDeXU8CtujaVfcoqbnFBmC1zTX/+d9VCH+ix4AGXVqsKSr6b8LagX9JqNHHFX6QZKD8/RHNteRnjxEYVSpuSpNkRWcQxjFJmKZ/m5bMEx6L+Glw==
  • 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: Mon, 22 Aug 2022 02:59:52 +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.

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

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
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 b5c9de24ed..3363718b02 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®.