[PATCH] arm: allow single CPU configuration by adjusting NR_CPUS range and defaults
Suchit Karunakaran
suchitkarunakaran at gmail.com
Thu Jul 24 10:26:03 PDT 2025
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 at gmail.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
More information about the linux-arm-kernel
mailing list