[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250724172603.18701-1-suchitkarunakaran@gmail.com>
Date: Thu, 24 Jul 2025 22:56:03 +0530
From: Suchit Karunakaran <suchitkarunakaran@...il.com>
To: linux@...linux.org.uk,
rmk+kernel@...linux.org.uk,
ardb@...nel.org,
linus.walleij@...aro.org,
ebiggers@...gle.com,
nathan@...nel.org,
lumag@...nel.org,
dave@...ilevsky.ca,
ruanjinjie@...wei.com,
kees@...nel.org,
liuyuntao12@...wei.com,
linux-arm-kernel@...ts.infradead.org
Cc: skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Suchit Karunakaran <suchitkarunakaran@...il.com>
Subject: [PATCH] arm: allow single CPU configuration by adjusting NR_CPUS range and defaults
Previously, the NR_CPUS config for ARM required a minimum of 2 CPUs.
This patch changes the minimum NR_CPUS to 1 when SMP is not enabled,
sets range to exactly 1 if !SMP, allowing only a single CPU setting and
adds conditional defaults:
- default to 1 if SMP is disabled (uniprocessor)
- default to 4 if SMP is enabled (multiprocessor)
Signed-off-by: Suchit Karunakaran <suchitkarunakaran@...il.com>
---
arch/arm/Kconfig | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3072731fe09c..23acee38721e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1063,11 +1063,13 @@ config KASAN_SHADOW_OFFSET
default 0xffffffff
config NR_CPUS
- int "Maximum number of CPUs (2-32)"
+ int "Maximum number of CPUs (1-32)"
+ range 1 1 if !SMP
range 2 16 if DEBUG_KMAP_LOCAL
range 2 32 if !DEBUG_KMAP_LOCAL
depends on SMP
- default "4"
+ default "1" if !SMP
+ default "4" if SMP
help
The maximum number of CPUs that the kernel can support.
Up to 32 CPUs can be supported, or up to 16 if kmap_local()
--
2.50.1
Powered by blists - more mailing lists