diff options
author | Mike Travis <travis@sgi.com> | 2008-12-17 18:21:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-18 06:08:05 -0500 |
commit | 3b11ce7f542e415c90267b4482d4611410b468e6 (patch) | |
tree | 26366b9f25af830b71c78504bbadd94896a8b82a /arch/x86/kernel/smpboot.c | |
parent | a775a38b1353161a6d7af86b667d6523c12c1a37 (diff) |
x86: use possible_cpus=NUM to extend the possible cpus allowed
Impact: add new boot parameter
Use possible_cpus=NUM kernel parameter to extend the number of possible
cpus.
The ability to HOTPLUG ON cpus that are "possible" but not "present" is
dealt with in a later patch.
Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index be9466788043..1a9941b11150 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1252,6 +1252,15 @@ void __init native_smp_cpus_done(unsigned int max_cpus) | |||
1252 | check_nmi_watchdog(); | 1252 | check_nmi_watchdog(); |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | static int __initdata setup_possible_cpus = -1; | ||
1256 | static int __init _setup_possible_cpus(char *str) | ||
1257 | { | ||
1258 | get_option(&str, &setup_possible_cpus); | ||
1259 | return 0; | ||
1260 | } | ||
1261 | early_param("possible_cpus", _setup_possible_cpus); | ||
1262 | |||
1263 | |||
1255 | /* | 1264 | /* |
1256 | * cpu_possible_map should be static, it cannot change as cpu's | 1265 | * cpu_possible_map should be static, it cannot change as cpu's |
1257 | * are onlined, or offlined. The reason is per-cpu data-structures | 1266 | * are onlined, or offlined. The reason is per-cpu data-structures |
@@ -1264,7 +1273,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus) | |||
1264 | * | 1273 | * |
1265 | * Three ways to find out the number of additional hotplug CPUs: | 1274 | * Three ways to find out the number of additional hotplug CPUs: |
1266 | * - If the BIOS specified disabled CPUs in ACPI/mptables use that. | 1275 | * - If the BIOS specified disabled CPUs in ACPI/mptables use that. |
1267 | * - The user can overwrite it with additional_cpus=NUM | 1276 | * - The user can overwrite it with possible_cpus=NUM |
1268 | * - Otherwise don't reserve additional CPUs. | 1277 | * - Otherwise don't reserve additional CPUs. |
1269 | * We do this because additional CPUs waste a lot of memory. | 1278 | * We do this because additional CPUs waste a lot of memory. |
1270 | * -AK | 1279 | * -AK |
@@ -1277,9 +1286,17 @@ __init void prefill_possible_map(void) | |||
1277 | if (!num_processors) | 1286 | if (!num_processors) |
1278 | num_processors = 1; | 1287 | num_processors = 1; |
1279 | 1288 | ||
1280 | possible = num_processors + disabled_cpus; | 1289 | if (setup_possible_cpus == -1) |
1281 | if (possible > NR_CPUS) | 1290 | possible = num_processors + disabled_cpus; |
1282 | possible = NR_CPUS; | 1291 | else |
1292 | possible = setup_possible_cpus; | ||
1293 | |||
1294 | if (possible > CONFIG_NR_CPUS) { | ||
1295 | printk(KERN_WARNING | ||
1296 | "%d Processors exceeds NR_CPUS limit of %d\n", | ||
1297 | possible, CONFIG_NR_CPUS); | ||
1298 | possible = CONFIG_NR_CPUS; | ||
1299 | } | ||
1283 | 1300 | ||
1284 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | 1301 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", |
1285 | possible, max_t(int, possible - num_processors, 0)); | 1302 | possible, max_t(int, possible - num_processors, 0)); |