Commit 9153f34e authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] CONFIG_NR_CPUS

By Robert Love, this patch sets the maximum number
of CPUs a kernel can support (From 2-32 on IA32)
The reasoning behind this is a space saving of
8KB per CPU.
parent 56aba639
......@@ -233,6 +233,7 @@ fi
if [ "$CONFIG_SMP" = "y" ]; then
define_bool CONFIG_HAVE_DEC_LOCK y
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
......
......@@ -34,6 +34,14 @@ CONFIG_HUGETLB_PAGE
Otherwise, say N.
CONFIG_NR_CPUS
This allows you to specify the maximum number of CPUs which this
kernel will support. The maximum supported value is 32 and the
minimum value which makes sense is 2.
This is purely to save memory - each supported CPU adds
approximately eight kilobytes to the kernel image.
CONFIG_PREEMPT
This option reduces the latency of the kernel when reacting to
real-time or interactive events by allowing a low priority process to
......
......@@ -168,6 +168,7 @@ if [ "$CONFIG_SMP" != "y" ]; then
define_bool CONFIG_X86_IO_APIC y
fi
else
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
bool 'Multi-node NUMA system support' CONFIG_X86_NUMA
if [ "$CONFIG_X86_NUMA" = "y" ]; then
#Platform Choices
......
......@@ -76,6 +76,7 @@ CONFIG_NOHIGHMEM=y
# CONFIG_MATH_EMULATION is not set
CONFIG_MTRR=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_NR_CPUS=32
#
# Power management options (ACPI, APM)
......
......@@ -118,6 +118,10 @@ bool 'Performance monitor support' CONFIG_PERFMON
tristate '/proc/pal support' CONFIG_IA64_PALINFO
tristate '/proc/efi/vars support' CONFIG_EFI_VARS
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
fi
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
......
......@@ -61,6 +61,7 @@ CONFIG_IA64_PALINFO=y
CONFIG_EFI_VARS=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_NR_CPUS=64
#
# ACPI Support
......
......@@ -491,6 +491,8 @@ fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
if [ "$CONFIG_SMP" != "y" ]; then
bool 'Run uncached' CONFIG_MIPS_UNCACHED
else
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
fi
endmenu
......
......@@ -245,6 +245,8 @@ bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
if [ "$CONFIG_SMP" != "y" ]; then
bool 'Run uncached' CONFIG_MIPS_UNCACHED
else
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
fi
endmenu
......
......@@ -32,6 +32,7 @@ CONFIG_L1_CACHE_SHIFT=7
# CONFIG_EISA is not set
# CONFIG_MCA is not set
# CONFIG_SBUS is not set
CONFIG_NR_CPUS=64
#
# CPU selection
......
......@@ -19,6 +19,10 @@ comment 'General options'
# bool 'Symmetric multi-processing support' CONFIG_SMP
define_bool CONFIG_SMP n
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
fi
bool 'Kernel Debugger support' CONFIG_KWDB
# define_bool CONFIG_KWDB n
......
......@@ -174,6 +174,7 @@ fi
bool 'Symmetric multi-processing support' CONFIG_SMP
if [ "$CONFIG_SMP" = "y" ]; then
bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
fi
if [ "$CONFIG_SMP" != "y" ]; then
bool 'Preemptible Kernel' CONFIG_PREEMPT
......
......@@ -21,6 +21,7 @@ define_bool CONFIG_PPC64 y
bool 'Symmetric multi-processing support' CONFIG_SMP
if [ "$CONFIG_SMP" = "y" ]; then
bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
if [ "$CONFIG_PPC_PSERIES" = "y" ]; then
bool ' Hardware multithreading' CONFIG_HMT
bool ' Discontiguous Memory Support' CONFIG_DISCONTIGMEM
......
......@@ -40,6 +40,7 @@ CONFIG_IRQ_ALL_CPUS=y
# CONFIG_DISCONTIGMEM is not set
# CONFIG_PREEMPT is not set
# CONFIG_RTAS_FLASH is not set
CONFIG_NR_CPUS=64
#
# General setup
......
......@@ -21,6 +21,9 @@ comment 'Base setup'
comment 'Processor type and features'
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'IEEE FPU emulation' CONFIG_MATHEMU
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
fi
comment 'I/O subsystem configuration'
bool 'Process warning machine checks' CONFIG_MACHCHK_WARNING
......
......@@ -39,6 +39,7 @@ CONFIG_KMOD=y
#
CONFIG_SMP=y
CONFIG_MATHEMU=y
CONFIG_NR_CPUS=64
#
# I/O subsystem configuration
......
......@@ -20,6 +20,9 @@ mainmenu_option next_comment
comment 'Base setup'
comment 'Processor type and features'
bool 'Symmetric multi-processing support' CONFIG_SMP
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
fi
bool 'Kernel support for 31 bit emulation' CONFIG_S390_SUPPORT
if [ "$CONFIG_S390_SUPPORT" = "y" ]; then
tristate 'Kernel support for 31 bit ELF binaries' CONFIG_BINFMT_ELF32
......
......@@ -40,6 +40,7 @@ CONFIG_KMOD=y
CONFIG_SMP=y
CONFIG_S390_SUPPORT=y
CONFIG_BINFMT_ELF32=y
CONFIG_NR_CPUS=64
#
# I/O subsystem configuration
......
......@@ -19,6 +19,10 @@ define_bool CONFIG_HW_CONSOLE y
bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_SMP
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
fi
# Identify this as a Sparc32 build
define_bool CONFIG_SPARC32 y
......
......@@ -20,6 +20,10 @@ bool 'SPARC64 Huge TLB Page Support' CONFIG_HUGETLB_PAGE
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'Preemptible Kernel' CONFIG_PREEMPT
if [ "$CONFIG_SMP" = "y" ]; then
int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
fi
# Identify this as a Sparc64 build
define_bool CONFIG_SPARC64 y
......
......@@ -59,6 +59,7 @@ CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=m
# CONFIG_SUNOS_EMUL is not set
CONFIG_SOLARIS_EMUL=m
CONFIG_NR_CPUS=64
#
# Parallel port support
......
......@@ -54,6 +54,7 @@ if [ "$CONFIG_SMP" = "n" ]; then
fi
if [ "$CONFIG_SMP" = "y" ]; then
define_bool CONFIG_HAVE_DEC_LOCK y
int 'Maximum number of CPUs (2-8)' CONFIG_NR_CPUS 8
fi
define_bool CONFIG_X86_MCE y
......
......@@ -51,6 +51,7 @@ CONFIG_SMP=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCE_NONFATAL is not set
CONFIG_NR_CPUS=8
#
# Power management options
......
......@@ -8,10 +8,16 @@
* /proc/sys/kernel/threads-max.
*/
/*
* Maximum supported processors that can run under SMP. This value is
* set via configure setting. The maximum is equal to the size of the
* bitmasks used on that platform, i.e. 32 or 64. Setting this smaller
* saves quite a bit of memory.
*/
#ifdef CONFIG_SMP
#define NR_CPUS 32 /* Max processors that can be running in SMP */
#define NR_CPUS CONFIG_NR_CPUS
#else
#define NR_CPUS 1
#define NR_CPUS 1
#endif
#define MIN_THREADS_LEFT_FOR_ROOT 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment