Skip to content

Commit a0d0bb4

Browse files
rddunlapIngo Molnar
authored andcommitted
x86/Kconfig: Simplify NR_CPUS config
Clean up and simplify the X86 NR_CPUS Kconfig symbol/option by introducing RANGE_BEGIN_CPUS, RANGE_END_CPUS, and DEF_CONFIG_CPUS. Then combine some default values when their conditionals can be reduced. Also move the X86_BIGSMP kconfig option inside an "if X86_32"/"endif" config block and drop its explicit "depends on X86_32". Combine the max. 8192 cases of RANGE_END_CPUS (X86_64 only). Split RANGE_END_CPUS and DEF_CONFIG_CPUS into separate cases for X86_32 and X86_64. Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Acked-by: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Link: lkml.kernel.org/r/CA+55aFzOd3j6ZUSkEwTdk85qtt1JywOtm3ZAb-qAvt8_hJ6D4A@mail.gmail.com Signed-off-by: Ingo Molnar <[email protected]>
1 parent c80c5ec commit a0d0bb4

File tree

1 file changed

+42
-15
lines changed

1 file changed

+42
-15
lines changed

arch/x86/Kconfig

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,6 @@ config X86_MPPARSE
423423
For old smp systems that do not have proper acpi support. Newer systems
424424
(esp with 64bit cpus) with acpi support, MADT and DSDT will override it
425425

426-
config X86_BIGSMP
427-
bool "Support for big SMP systems with more than 8 CPUs"
428-
depends on X86_32 && SMP
429-
---help---
430-
This option is needed for the systems that have more than 8 CPUs
431-
432426
config GOLDFISH
433427
def_bool y
434428
depends on X86_GOLDFISH
@@ -460,6 +454,12 @@ config INTEL_RDT
460454
Say N if unsure.
461455

462456
if X86_32
457+
config X86_BIGSMP
458+
bool "Support for big SMP systems with more than 8 CPUs"
459+
depends on SMP
460+
---help---
461+
This option is needed for the systems that have more than 8 CPUs
462+
463463
config X86_EXTENDED_PLATFORM
464464
bool "Support for extended (non-PC) x86 platforms"
465465
default y
@@ -949,17 +949,44 @@ config MAXSMP
949949
Enable maximum number of CPUS and NUMA Nodes for this architecture.
950950
If unsure, say N.
951951

952+
config RANGE_END_CPUS
953+
int
954+
depends on X86_32
955+
default 8 if SMP && !X86_BIGSMP
956+
default 64 if SMP && X86_BIGSMP
957+
default 1 if !SMP
958+
959+
config RANGE_END_CPUS
960+
int
961+
depends on X86_64
962+
default 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK
963+
default 8192 if SMP && (MAXSMP || CPUMASK_OFFSTACK)
964+
default 1 if !SMP
965+
966+
config RANGE_BEGIN_CPUS
967+
int
968+
default 1 if !SMP
969+
default RANGE_END_CPUS if MAXSMP
970+
default 2
971+
972+
config DEF_CONFIG_CPUS
973+
int
974+
depends on X86_32
975+
default 1 if !SMP
976+
default 32 if X86_BIGSMP
977+
default 8 if SMP
978+
979+
config DEF_CONFIG_CPUS
980+
int
981+
depends on X86_64
982+
default 1 if !SMP
983+
default 8192 if MAXSMP
984+
default 64 if SMP
985+
952986
config NR_CPUS
953987
int "Maximum number of CPUs" if SMP && !MAXSMP
954-
range 2 8 if SMP && X86_32 && !X86_BIGSMP
955-
range 2 64 if SMP && X86_32 && X86_BIGSMP
956-
range 2 512 if SMP && !MAXSMP && !CPUMASK_OFFSTACK && X86_64
957-
range 2 8192 if SMP && !MAXSMP && CPUMASK_OFFSTACK && X86_64
958-
default "1" if !SMP
959-
default "8192" if MAXSMP
960-
default "32" if SMP && X86_BIGSMP
961-
default "8" if SMP && X86_32
962-
default "64" if SMP
988+
range RANGE_BEGIN_CPUS RANGE_END_CPUS
989+
default DEF_CONFIG_CPUS
963990
---help---
964991
This allows you to specify the maximum number of CPUs which this
965992
kernel will support. If CPUMASK_OFFSTACK is enabled, the maximum

0 commit comments

Comments
 (0)