[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 6/6] xen: introduce a Kconfig option to configure NUMA nodes number
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Wei Chen <wei.chen@xxxxxxx>
- Date: Mon, 14 Nov 2022 14:34:51 +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=BEU5rsHGyAZiILfC21Y3SzOiZY3jP1U/4HF25Ob+mHw=; b=R0CLcffvyJqv9n2ZOPHDAcmQl10zgEJAZAOadM8bSm/QODF1yduiR8Yc0Wby7XgWaNKa5YEH4ohz+lXQ1k+MtSLsDwi9cbUvHZa0+ldQnYmisk8pv9x1seiwJWOTlI2B1N6xXG95CySILbSTqF+oMmjyB4TZhD9bMxVikEQJj84szMJW+LJkfiFr+kmyOFLpI0BVa5Muo1ZDIdgz2fCKbeT0KBpqdHE5waWoo2SPOZvyULHTZS7/ertZfZG30lTLFkXgx1esXn7mVWovJOixJZxJswtsML6gEBm1qmDDGScLcyMoy2pf3KQnc8xL0mBxqsbcq8JqJlJRKtNQOGkzAg==
- 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=BEU5rsHGyAZiILfC21Y3SzOiZY3jP1U/4HF25Ob+mHw=; b=jg/Y+MGXUSlhVxVn2tP0QLzeXv0LWfJgfbOMkQmKrBsV5gmKa134q3qdqGvdN5byOTwn4xuC11d0HkV5YIYzKlV1YBKCJHdMySQXe99cjI3CO+PyqKmL4Wx4nyQF8S9cwIuh9AX34H6HYKDh3HXtqQ3yRvl2MC5Jl1QhDXOSvXxnHQvHXEMaukzXk9xanyurqCQpN/2dnpjqTAI7C2qy+T018u8S45Hdpzle2+KtqSJ91H2yGOUqVjNoCE+kV0g4ajgN1eIkUkUcxJgmCzYu0hHNLifPXuGRCwfblxkJQHWwX+lYqON33UnQWWiO+WmBJ8qReZAK4a1M6eACjEQn5Q==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KQEFoFyNuQprUxMtixpzxTQR31dmGvno4As4t+1mvBXxzoMHPdHz5g10t80MRSI7D6G8MKffVT7dlH8GGj55fjMNYU4oa9eY0ZdNAQPDyGUkYVvkH+HY7WEBxAEaHSZJHXPX0gFHXMQ7mxHG3LEXL4OWokxH3vreVa8US2Wdzxq6Zs3ugrGoqHtn1Gr3zjxJxktGfysz7/Mu5Qn/MjRgTBFtCNC7SaxPpR2rs9Ei2KRHkoLJ9/5+m4s2gUEktXHRdzo+I3X19N0GyrsfHnsnYjdPXikyXnq18t8BteJHxHq3m4Q5N7ljGNqgGnGHfxJ4eTi0yljsPlOYf6dRGsm1lA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vb4DXNcZGP9lUuO4OMcYHXCL40/YBrU30S6h1gF/EmnrG5a0tm532CO2vuCNa8njjP+EKr3UsVQTZnY4eP8xxzPakcuCb8GXViD9o9RtnOQiX8SIA72KHN5/shT/ZgZmzIyi1NFdqDga2z45a54gbG8zMxywR0ff7toBLJ3GTtHwWBgQ1oZQJ3NOJoi6PElHOoN+fTdgBQGyi9s72PqZ+Lf3mNDbOMEch4x8SlCiI1brSzRMNAlVGwxPII6Ckpi2TaMACre/6UwmdIbN7Lb9LbdYeLdah15bVbG8R/IzIoJ0LhWVJr8e7sw3jPrvp8rA5G33yldJ1AYs6R3AS82dBg==
- 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, 14 Nov 2022 06:35:35 +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>
---
v7 -> v8:
1. No change.
v6 -> v7:
1. No change.
v5 -> v6:
1. No change.
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 04ecaf7769..71a5f837b3 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
|