Skip to content

Commit 5d272dd

Browse files
committed
cpumask: limit FORCE_NR_CPUS to just the UP case
Hardcoding the number of CPUs at compile time does improve code generation, but if you get it wrong the result will be confusion. We already limited this earlier to only "experts" (see commit fe5759d "cpumask: limit visibility of FORCE_NR_CPUS"), but with distro kernel configs often having EXPERT enabled, that turns out to not be much of a limit. To quote the philosophers at Disney: "Everyone can be an expert. And when everyone's an expert, no one will be". There's a runtime warning if you then set nr_cpus to anything but the forced number, but apparently that can be ignored too [1] and by then it's pretty much too late anyway. If we had some real way to limit this to "embedded only", maybe it would be worth it, but let's see if anybody even notices that the option is gone. We need to simplify kernel configuration anyway. Link: https://lore.kernel.org/all/[email protected]/ [1] Reported-by: Steven Rostedt <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Paul McKenney <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Yury Norov <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 46d1907 commit 5d272dd

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/Kconfig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,7 @@ config CPUMASK_OFFSTACK
539539
stack overflow.
540540

541541
config FORCE_NR_CPUS
542-
bool "Set number of CPUs at compile time"
543-
depends on SMP && EXPERT && !COMPILE_TEST
544-
help
545-
Say Yes if you have NR_CPUS set to an actual number of possible
546-
CPUs in your system, not to a default value. This forces the core
547-
code to rely on compile-time value and optimize kernel routines
548-
better.
542+
def_bool !SMP
549543

550544
config CPU_RMAP
551545
bool

0 commit comments

Comments
 (0)