[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 6/6] xen: introduce a Kconfig option to configure NUMA nodes number
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Wei Chen <wei.chen@xxxxxxx>
- Date: Fri, 2 Sep 2022 11:31:21 +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=c24JNM9CmKKyBmuocLYrIdMPXWfKN3aqMIKpf5afvV4=; b=gpPmPgdeccSTZIw3/DbbOgh6DxsDjxoViRjikyq1I3NqzPl7VuBCSRGKd0ld0+V0aOe+YsgWVbS+dDmUCUQpTD7FjYsaSUEm7/SlL4EgjAU4z4CxXeGs+1SDyLH+GpKiLJTclLEfItzcfiDdgqpvMAMOzYAnLa+/fikos0/ZR+JpgMq0c9rXOPS+Mm652VJD8IH2rt262BIsEYtUrKehtIvwGn1Mj3UdMrwO4S5IadaDcukLe10IJMgHfzCRQsxSY1SgB0bqRkUvDr+GUzTQVLYD6EkDrfYTHj7JAD13JT19xQ2LGOnwuVBi+pe3Z4RRmyD0GdzC6oWMeXG6WnK7+Q==
- 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=c24JNM9CmKKyBmuocLYrIdMPXWfKN3aqMIKpf5afvV4=; b=O3Q8KxxGQ09UOX5wqaf9wU9ZDPSUPRU45xPadheJgEeLGt+L2CAj0Unn/Qno+GhwXjm5//8soPq55/cESQ3Cgkc3qP0zbu53P8/P3A96/kP92dic7dbtVM7l3Fqq8qMHImo5Ofj3Kudyr4jmMvtd8vw0sZokhN7LV46+f31fKdCv1DKJw48A3DTFuT3kQZjEtoF+/xpgTZ7uRnPEJ4PfJPBWcvMTCbeOjny8+WhID+KLxoWTH/92NUlq4QtkIo3QXWqVVfwznTxLO1Jr9UgJm7sVakBcx3Ff/t6G33wLkY2RpJTFh9B1jp/0hAQmTVw6Jq5+ivlNX+bUYeHECGjRoA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=TH4O/OSl/GXDZtPZeNzan7mPCNxgqKtSG4HrD1ekN+qX4jDIiKsVrf/i12L3PmdwRx+ZRgWeI8lkICacIdktvxJcQxoU5c64aM6m5Uam5MxOEmGKx8bTIXDcVbxJ6nnGHD8pW6GbU271NnKzZuipaqBqcuoW+yI6RU/a0Sol/nTSbiGNh4qGjuPcpJ7eVJD3mMfyqaQspFZBjjILZM4tRjRYz2c/ibP4yV6AAIwoPj3GDqXY+HydkJpMFTe6Vd1smRmqSaC9No6lDPzBJ0cw+eA/7o0HdCkTJ7tZ4F8VAg9VH14ukE6KzxWSk3TmUd0IAvSfI1kW8+c+LEaidou/aA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LiToRe2dz/7nR9uUzYEoDSc1syPLMSUmWrQLbM7hkt6PBxfFaJTz0QbTY2gl2XWWZ3ey6yLyA/m5L5v7+jKecOdV4lZebvvXfL/PJt/G0XMNd5ORlWJzfnVlo5/+j24kD0Qb8nnjiGzatq/0Lss5JHIe0SqiTs6dxuXeXemDcN6GhSu0zZhnqwHdkSFcS2yl53cEKyPsHCt0S8rCO1RMm7JEmxt9gRzoEix1ilpuf5mf24sd21z22lg0Cj/BGvd/XKbsVrRPi94r2HbIILmYNGGODg6wQHiJ6+werwA6I0raKnbTvFYasQAG/KeiNyjnDmlOyw3UVwSe/Ud+YQHRiw==
- 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: Fri, 02 Sep 2022 03:39:06 +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>
---
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 e593115ba2..e16a7c3764 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
|