diff options
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 763d815e27a0..37462f1ddba5 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -1215,9 +1215,17 @@ __init void prefill_possible_map(void) | |||
| 1215 | if (!num_processors) | 1215 | if (!num_processors) |
| 1216 | num_processors = 1; | 1216 | num_processors = 1; |
| 1217 | 1217 | ||
| 1218 | if (setup_possible_cpus == -1) | 1218 | i = setup_max_cpus ?: 1; |
| 1219 | possible = num_processors + disabled_cpus; | 1219 | if (setup_possible_cpus == -1) { |
| 1220 | else | 1220 | possible = num_processors; |
| 1221 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 1222 | if (setup_max_cpus) | ||
| 1223 | possible += disabled_cpus; | ||
| 1224 | #else | ||
| 1225 | if (possible > i) | ||
| 1226 | possible = i; | ||
| 1227 | #endif | ||
| 1228 | } else | ||
| 1221 | possible = setup_possible_cpus; | 1229 | possible = setup_possible_cpus; |
| 1222 | 1230 | ||
| 1223 | total_cpus = max_t(int, possible, num_processors + disabled_cpus); | 1231 | total_cpus = max_t(int, possible, num_processors + disabled_cpus); |
| @@ -1230,11 +1238,23 @@ __init void prefill_possible_map(void) | |||
| 1230 | possible = nr_cpu_ids; | 1238 | possible = nr_cpu_ids; |
| 1231 | } | 1239 | } |
| 1232 | 1240 | ||
| 1241 | #ifdef CONFIG_HOTPLUG_CPU | ||
| 1242 | if (!setup_max_cpus) | ||
| 1243 | #endif | ||
| 1244 | if (possible > i) { | ||
| 1245 | printk(KERN_WARNING | ||
| 1246 | "%d Processors exceeds max_cpus limit of %u\n", | ||
| 1247 | possible, setup_max_cpus); | ||
| 1248 | possible = i; | ||
| 1249 | } | ||
| 1250 | |||
| 1233 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | 1251 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", |
| 1234 | possible, max_t(int, possible - num_processors, 0)); | 1252 | possible, max_t(int, possible - num_processors, 0)); |
| 1235 | 1253 | ||
| 1236 | for (i = 0; i < possible; i++) | 1254 | for (i = 0; i < possible; i++) |
| 1237 | set_cpu_possible(i, true); | 1255 | set_cpu_possible(i, true); |
| 1256 | for (; i < NR_CPUS; i++) | ||
| 1257 | set_cpu_possible(i, false); | ||
| 1238 | 1258 | ||
| 1239 | nr_cpu_ids = possible; | 1259 | nr_cpu_ids = possible; |
| 1240 | } | 1260 | } |
