1 Configure the max number of cpus at compile time (default was 32).
2 Saves memory footprint for kernel (around 240Kb in 32->2).
3 Author: Andrew Morton <akpm@zip.com.au>, Robert Love <rml@tech9.net>
5 --- linux/Documentation/Configure.help.orig 2002-06-06 15:48:03.000000000 +0200
6 +++ linux/Documentation/Configure.help 2002-06-06 15:47:15.000000000 +0200
9 If you don't know what to do here, say N.
11 +Maximum number of CPUs
13 + This allows you to specify the maximum number of CPUs which this
14 + kernel will support. The maximum supported value is 32 and the
15 + mimimum value which makes sense is 2.
17 + This is purely to save memory - each supported CPU adds
18 + approximately eight kilobytes to the kernel image.
20 Intel or compatible 80x86 processor
22 This is Linux's home port. Linux was originally native to the Intel
23 --- linux/include/linux/threads.h.orig 2002-06-06 15:44:27.000000000 +0200
24 +++ linux/include/linux/threads.h 2002-06-06 15:45:40.000000000 +0200
29 -#define NR_CPUS 32 /* Max processors that can be running in SMP */
30 +#define NR_CPUS CONFIG_NR_CPUS
36 #define MIN_THREADS_LEFT_FOR_ROOT 4
37 --- linux/arch/i386/kernel/smpboot.c.orig 2002-06-06 15:48:19.000000000 +0200
38 +++ linux/arch/i386/kernel/smpboot.c 2002-06-06 15:49:14.000000000 +0200
40 static int smp_b_stepping;
42 /* Setup configured maximum number of CPUs to activate */
43 -static int max_cpus = -1;
44 +static int max_cpus = NR_CPUS;
46 /* Total count of live CPUs */
50 if (!(phys_cpu_present_map & (1 << bit)))
52 - if ((max_cpus >= 0) && (max_cpus <= cpucount+1))
53 + if (max_cpus <= cpucount+1)
57 --- linux/arch/i386/config.in.orig 2002-06-06 15:43:12.000000000 +0200
58 +++ linux/arch/i386/config.in 2002-06-06 15:43:37.000000000 +0200
60 define_bool CONFIG_X86_IO_APIC y
63 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
64 bool 'Multiquad NUMA system' CONFIG_MULTIQUAD
67 --- linux/arch/i386/defconfig Wed Jun 19 17:32:33 2002
68 +++ linux/arch/i386/defconfig Wed Jun 19 17:26:35 2002
71 # CONFIG_MULTIQUAD is not set
72 CONFIG_HAVE_DEC_LOCK=y
77 --- linux/arch/alpha/config.in Wed Jun 19 17:31:21 2002
78 +++ linux/arch/alpha/config.in Wed Jun 19 17:26:35 2002
81 if [ "$CONFIG_SMP" = "y" ]; then
82 define_bool CONFIG_HAVE_DEC_LOCK y
83 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
86 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
87 --- linux/arch/ia64/config.in Wed Jun 19 17:32:34 2002
88 +++ linux/arch/ia64/config.in Wed Jun 19 17:26:35 2002
90 define_bool CONFIG_KCORE_ELF y # On IA-64, we always want an ELF /proc/kcore.
92 bool 'SMP support' CONFIG_SMP
93 +if [ "$CONFIG_SMP" = "y" ]; then
94 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
97 tristate 'Support running of Linux/x86 binaries' CONFIG_IA32_SUPPORT
98 bool 'Performance monitor support' CONFIG_PERFMON
99 tristate '/proc/pal support' CONFIG_IA64_PALINFO
100 --- linux/arch/ia64/defconfig Wed Jun 19 17:31:23 2002
101 +++ linux/arch/ia64/defconfig Wed Jun 19 17:26:35 2002
107 CONFIG_IA32_SUPPORT=y
109 CONFIG_IA64_PALINFO=y
110 --- linux/arch/mips/config-shared.in Wed Jun 19 17:32:34 2002
111 +++ linux/arch/mips/config-shared.in Wed Jun 19 17:26:35 2002
113 bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
114 if [ "$CONFIG_SMP" != "y" ]; then
115 bool 'Run uncached' CONFIG_MIPS_UNCACHED
117 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
121 --- linux/arch/mips64/defconfig Wed Jun 19 17:31:25 2002
122 +++ linux/arch/mips64/defconfig Wed Jun 19 17:26:35 2002
124 # CONFIG_REPLICATE_KTEXT is not set
125 # CONFIG_REPLICATE_EXHANDLERS is not set
128 # CONFIG_SGI_IP32 is not set
129 # CONFIG_SIBYTE_SB1xxx_SOC is not set
130 # CONFIG_SNI_RM200_PCI is not set
131 --- linux/arch/parisc/config.in Wed Jun 19 17:32:34 2002
132 +++ linux/arch/parisc/config.in Wed Jun 19 17:26:35 2002
134 comment 'General options'
136 bool 'Symmetric multi-processing support' CONFIG_SMP
137 +if [ "$CONFIG_SMP" = "y" ]; then
138 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
141 bool 'Chassis LCD and LED support' CONFIG_CHASSIS_LCD_LED
143 bool 'Kernel Debugger support' CONFIG_KWDB
144 --- linux/arch/ppc/config.in Wed Jun 19 17:31:16 2002
145 +++ linux/arch/ppc/config.in Wed Jun 19 17:26:35 2002
147 bool 'Symmetric multi-processing support' CONFIG_SMP
148 if [ "$CONFIG_SMP" = "y" ]; then
149 bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS
150 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
153 if [ "$CONFIG_6xx" = "y" -a "$CONFIG_8260" = "n" ];then
154 --- linux/arch/ppc64/config.in Wed Jun 19 17:31:23 2002
155 +++ linux/arch/ppc64/config.in Wed Jun 19 17:26:35 2002
157 bool 'Symmetric multi-processing support' CONFIG_SMP
158 if [ "$CONFIG_SMP" = "y" ]; then
159 bool ' Distribute interrupts on all CPUs by default' CONFIG_IRQ_ALL_CPUS
160 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
161 if [ "$CONFIG_PPC_PSERIES" = "y" ]; then
162 bool ' Hardware multithreading' CONFIG_HMT
164 --- linux/arch/ppc64/defconfig Wed Jun 19 17:31:23 2002
165 +++ linux/arch/ppc64/defconfig Wed Jun 19 17:26:35 2002
168 # CONFIG_PPC_ISERIES is not set
171 CONFIG_IRQ_ALL_CPUS=y
172 # CONFIG_HMT is not set
173 # CONFIG_MSCHUNKS is not set
174 --- linux/arch/s390/config.in Wed Jun 19 17:31:26 2002
175 +++ linux/arch/s390/config.in Wed Jun 19 17:26:35 2002
177 comment 'Processor type and features'
178 bool 'Symmetric multi-processing support' CONFIG_SMP
179 bool 'IEEE FPU emulation' CONFIG_MATHEMU
180 +if [ "$CONFIG_SMP" = "y" ]; then
181 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
185 mainmenu_option next_comment
186 --- linux/arch/s390/defconfig Wed Jun 19 17:31:26 2002
187 +++ linux/arch/s390/defconfig Wed Jun 19 17:26:35 2002
196 --- linux/arch/s390x/config.in Wed Jun 19 17:31:25 2002
197 +++ linux/arch/s390x/config.in Wed Jun 19 17:26:35 2002
199 mainmenu_option next_comment
200 comment 'Processor type and features'
201 bool 'Symmetric multi-processing support' CONFIG_SMP
202 +if [ "$CONFIG_SMP" = "y" ]; then
203 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
205 bool 'Kernel support for 31 bit emulation' CONFIG_S390_SUPPORT
206 if [ "$CONFIG_S390_SUPPORT" = "y" ]; then
207 tristate 'Kernel support for 31 bit ELF binaries' CONFIG_BINFMT_ELF32
208 --- linux/arch/s390x/defconfig Wed Jun 19 17:31:25 2002
209 +++ linux/arch/s390x/defconfig Wed Jun 19 17:26:35 2002
212 CONFIG_S390_SUPPORT=y
213 CONFIG_BINFMT_ELF32=y
217 # Loadable module support
218 --- linux/arch/sparc/config.in Wed Jun 19 17:31:21 2002
219 +++ linux/arch/sparc/config.in Wed Jun 19 17:26:35 2002
222 bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_SMP
224 +if [ "$CONFIG_SMP" = "y" ]; then
225 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
228 # Identify this as a Sparc32 build
229 define_bool CONFIG_SPARC32 y
231 --- linux/arch/sparc64/config.in Wed Jun 19 17:32:35 2002
232 +++ linux/arch/sparc64/config.in Wed Jun 19 17:26:35 2002
235 bool 'Symmetric multi-processing support' CONFIG_SMP
237 +if [ "$CONFIG_SMP" = "y" ]; then
238 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
241 # Identify this as a Sparc64 build
242 define_bool CONFIG_SPARC64 y
244 --- linux/arch/sparc64/defconfig Wed Jun 19 17:32:35 2002
245 +++ linux/arch/sparc64/defconfig Wed Jun 19 17:26:35 2002
248 # CONFIG_SUNOS_EMUL is not set
249 CONFIG_SOLARIS_EMUL=m
253 # Parallel port support
254 --- linux/arch/x86_64/config.in Wed Jun 19 17:31:25 2002
255 +++ linux/arch/x86_64/config.in Wed Jun 19 17:29:25 2002
257 define_bool CONFIG_X86_UP_IOAPIC y
259 define_bool CONFIG_HAVE_DEC_LOCK y
260 + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64
263 bool 'Machine check support' CONFIG_MCE
264 --- linux/arch/x86_64/defconfig Wed Jun 19 17:31:25 2002
265 +++ linux/arch/x86_64/defconfig Wed Jun 19 17:26:35 2002
267 CONFIG_X86_LOCAL_APIC=y
269 # CONFIG_SMP is not set
272 # CONFIG_GART_IOMMU is not set
274 --- linux-2.4.20/arch/um/config.in Sun Mar 16 01:41:53 2003
275 +++ linux-2.4.20-nr_cpus/arch/um/config.in Sun Mar 16 02:35:52 2003
277 bool '2G/2G host address space split' CONFIG_HOST_2G_2G
278 bool 'Symmetric multi-processing support' CONFIG_UML_SMP
279 define_bool CONFIG_SMP $CONFIG_UML_SMP
280 +if [ "$CONFIG_SMP" = "y" ]; then
281 + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32
283 int 'Nesting level' CONFIG_NEST_LEVEL 0
284 int 'Kernel address space size (in .5G units)' CONFIG_KERNEL_HALF_GIGS 1
285 bool 'Highmem support' CONFIG_HIGHMEM
286 --- linux-2.4.20/arch/um/defconfig Sun Mar 16 01:41:53 2003
287 +++ linux-2.4.20-nr_cpus/arch/um/defconfig Sun Mar 16 02:36:38 2003
289 # CONFIG_HOST_2G_2G is not set
290 # CONFIG_UML_SMP is not set
291 # CONFIG_SMP is not set
294 CONFIG_KERNEL_HALF_GIGS=1
295 # CONFIG_HIGHMEM is not set