]>
Commit | Line | Data |
---|---|---|
e6d11017 JR |
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> | |
4 | ||
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 | |
7 | @@ -137,6 +137,15 @@ | |
8 | ||
9 | If you don't know what to do here, say N. | |
10 | ||
11 | +Maximum number of CPUs | |
12 | +CONFIG_NR_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. | |
16 | + | |
17 | + This is purely to save memory - each supported CPU adds | |
18 | + approximately eight kilobytes to the kernel image. | |
19 | + | |
20 | Intel or compatible 80x86 processor | |
21 | CONFIG_X86 | |
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 | |
25 | @@ -9,9 +9,9 @@ | |
26 | */ | |
27 | ||
28 | #ifdef CONFIG_SMP | |
29 | -#define NR_CPUS 32 /* Max processors that can be running in SMP */ | |
30 | +#define NR_CPUS CONFIG_NR_CPUS | |
31 | #else | |
32 | -#define NR_CPUS 1 | |
33 | +#define NR_CPUS 1 | |
34 | #endif | |
35 | ||
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 | |
39 | @@ -51,7 +51,7 @@ | |
40 | static int smp_b_stepping; | |
41 | ||
42 | /* Setup configured maximum number of CPUs to activate */ | |
43 | -static int max_cpus = -1; | |
44 | +static int max_cpus = NR_CPUS; | |
45 | ||
46 | /* Total count of live CPUs */ | |
47 | int smp_num_cpus = 1; | |
48 | @@ -1116,7 +1116,7 @@ | |
49 | ||
50 | if (!(phys_cpu_present_map & (1 << bit))) | |
51 | continue; | |
52 | - if ((max_cpus >= 0) && (max_cpus <= cpucount+1)) | |
53 | + if (max_cpus <= cpucount+1) | |
54 | continue; | |
55 | ||
56 | do_boot_cpu(apicid); | |
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 | |
59 | @@ -230,6 +230,7 @@ | |
60 | define_bool CONFIG_X86_IO_APIC y | |
61 | fi | |
62 | else | |
63 | + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32 | |
64 | bool 'Multiquad NUMA system' CONFIG_MULTIQUAD | |
65 | fi | |
66 | ||
67 | --- linux/arch/i386/defconfig Wed Jun 19 17:32:33 2002 | |
68 | +++ linux/arch/i386/defconfig Wed Jun 19 17:26:35 2002 | |
69 | @@ -65,6 +65,7 @@ | |
70 | CONFIG_SMP=y | |
71 | # CONFIG_MULTIQUAD is not set | |
72 | CONFIG_HAVE_DEC_LOCK=y | |
73 | +CONFIG_NR_CPUS=32 | |
74 | ||
75 | # | |
76 | # General setup | |
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 | |
79 | @@ -245,6 +245,7 @@ | |
80 | ||
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 | |
84 | fi | |
85 | ||
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 | |
89 | @@ -91,6 +91,10 @@ | |
90 | define_bool CONFIG_KCORE_ELF y # On IA-64, we always want an ELF /proc/kcore. | |
91 | ||
92 | bool 'SMP support' CONFIG_SMP | |
93 | +if [ "$CONFIG_SMP" = "y" ]; then | |
94 | + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64 | |
95 | +fi | |
96 | + | |
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 | |
102 | @@ -43,6 +43,7 @@ | |
103 | CONFIG_PM=y | |
104 | CONFIG_KCORE_ELF=y | |
105 | CONFIG_SMP=y | |
106 | +CONFIG_NR_CPUS=64 | |
107 | CONFIG_IA32_SUPPORT=y | |
108 | CONFIG_PERFMON=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 | |
112 | @@ -796,6 +796,8 @@ | |
113 | bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ | |
114 | if [ "$CONFIG_SMP" != "y" ]; then | |
115 | bool 'Run uncached' CONFIG_MIPS_UNCACHED | |
116 | +else | |
117 | + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32 | |
118 | fi | |
119 | endmenu | |
120 | ||
121 | --- linux/arch/mips64/defconfig Wed Jun 19 17:31:25 2002 | |
122 | +++ linux/arch/mips64/defconfig Wed Jun 19 17:26:35 2002 | |
123 | @@ -53,6 +53,7 @@ | |
124 | # CONFIG_REPLICATE_KTEXT is not set | |
125 | # CONFIG_REPLICATE_EXHANDLERS is not set | |
126 | CONFIG_SMP=y | |
127 | +CONFIG_NR_CPUS=64 | |
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 | |
133 | @@ -43,6 +43,10 @@ | |
134 | comment 'General options' | |
135 | ||
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 | |
139 | +fi | |
140 | + | |
141 | bool 'Chassis LCD and LED support' CONFIG_CHASSIS_LCD_LED | |
142 | ||
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 | |
146 | @@ -108,6 +108,7 @@ | |
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 | |
151 | fi | |
152 | ||
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 | |
156 | @@ -27,6 +27,7 @@ | |
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 | |
163 | fi | |
164 | --- linux/arch/ppc64/defconfig Wed Jun 19 17:31:23 2002 | |
165 | +++ linux/arch/ppc64/defconfig Wed Jun 19 17:26:35 2002 | |
166 | @@ -22,6 +22,7 @@ | |
167 | CONFIG_PPC_PSERIES=y | |
168 | # CONFIG_PPC_ISERIES is not set | |
169 | CONFIG_SMP=y | |
170 | +CONFIG_NR_CPUS=64 | |
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 | |
176 | @@ -30,6 +30,9 @@ | |
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 | |
182 | +fi | |
183 | endmenu | |
184 | ||
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 | |
188 | @@ -27,6 +27,7 @@ | |
189 | # | |
190 | CONFIG_SMP=y | |
191 | CONFIG_MATHEMU=y | |
192 | +CONFIG_NR_CPUS=64 | |
193 | ||
194 | # | |
195 | # General setup | |
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 | |
198 | @@ -20,6 +20,9 @@ | |
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 | |
204 | +fi | |
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 | |
210 | @@ -21,6 +21,7 @@ | |
211 | CONFIG_SMP=y | |
212 | CONFIG_S390_SUPPORT=y | |
213 | CONFIG_BINFMT_ELF32=y | |
214 | +CONFIG_NR_CPUS=64 | |
215 | ||
216 | # | |
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 | |
220 | @@ -29,6 +29,10 @@ | |
221 | ||
222 | bool 'Symmetric multi-processing support (does not work on sun4/sun4c)' CONFIG_SMP | |
223 | ||
224 | +if [ "$CONFIG_SMP" = "y" ]; then | |
225 | + int 'Maximum number of CPUs (2-32)' CONFIG_NR_CPUS 32 | |
226 | +fi | |
227 | + | |
228 | # Identify this as a Sparc32 build | |
229 | define_bool CONFIG_SPARC32 y | |
230 | ||
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 | |
233 | @@ -28,6 +28,10 @@ | |
234 | ||
235 | bool 'Symmetric multi-processing support' CONFIG_SMP | |
236 | ||
237 | +if [ "$CONFIG_SMP" = "y" ]; then | |
238 | + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64 | |
239 | +fi | |
240 | + | |
241 | # Identify this as a Sparc64 build | |
242 | define_bool CONFIG_SPARC64 y | |
243 | ||
244 | --- linux/arch/sparc64/defconfig Wed Jun 19 17:32:35 2002 | |
245 | +++ linux/arch/sparc64/defconfig Wed Jun 19 17:26:35 2002 | |
246 | @@ -58,6 +58,7 @@ | |
247 | CONFIG_BINFMT_MISC=m | |
248 | # CONFIG_SUNOS_EMUL is not set | |
249 | CONFIG_SOLARIS_EMUL=m | |
250 | +CONFIG_NR_CPUS=64 | |
251 | ||
252 | # | |
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 | |
256 | @@ -64,6 +64,7 @@ | |
257 | define_bool CONFIG_X86_UP_IOAPIC y | |
258 | else | |
259 | define_bool CONFIG_HAVE_DEC_LOCK y | |
260 | + int 'Maximum number of CPUs (2-64)' CONFIG_NR_CPUS 64 | |
261 | fi | |
262 | ||
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 | |
266 | @@ -41,6 +41,7 @@ | |
267 | CONFIG_X86_LOCAL_APIC=y | |
268 | CONFIG_MTRR=y | |
269 | # CONFIG_SMP is not set | |
270 | +CONFIG_NR_CPUS=64 | |
271 | CONFIG_HPET_TIMER=y | |
272 | # CONFIG_GART_IOMMU is not set | |
273 | CONFIG_DUMMY_IOMMU=y | |
a431f366 JR |
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 | |
276 | @@ -44,6 +44,9 @@ | |
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 | |
282 | +fi | |
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 | |
288 | @@ -32,6 +32,7 @@ | |
289 | # CONFIG_HOST_2G_2G is not set | |
290 | # CONFIG_UML_SMP is not set | |
291 | # CONFIG_SMP is not set | |
292 | +CONFIG_NR_CPUS=32 | |
293 | CONFIG_NEST_LEVEL=0 | |
294 | CONFIG_KERNEL_HALF_GIGS=1 | |
295 | # CONFIG_HIGHMEM is not set |