public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
* [PATCH] arm: allow single CPU configuration by adjusting NR_CPUS range and defaults
@ 2025-07-24 17:26 Suchit Karunakaran
  2025-07-24 17:45 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Suchit Karunakaran @ 2025-07-24 17:26 UTC (permalink / raw)
  To: linux, rmk+kernel, ardb, linus.walleij, ebiggers, nathan, lumag,
	dave, ruanjinjie, kees, liuyuntao12, linux-arm-kernel
  Cc: skhan, linux-kernel-mentees, linux-kernel, Suchit Karunakaran

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@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-24 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 17:26 [PATCH] arm: allow single CPU configuration by adjusting NR_CPUS range and defaults Suchit Karunakaran
2025-07-24 17:45 ` Russell King (Oracle)
2025-07-24 17:57   ` Suchit K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox