Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199338
b: refs/heads/master
c: 5f2eb55
h: refs/heads/master
v: v3
  • Loading branch information
Jan Beulich authored and H. Peter Anvin committed May 24, 2010
1 parent 5925c1f commit a01df5e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b46fc5f235be04a7f77fb2af1d8cb809889c25c1
refs/heads/master: 5f2eb55026c91f8400ab4469aff88b2e201b5616
26 changes: 23 additions & 3 deletions trunk/arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,9 +1215,17 @@ __init void prefill_possible_map(void)
if (!num_processors)
num_processors = 1;

if (setup_possible_cpus == -1)
possible = num_processors + disabled_cpus;
else
i = setup_max_cpus ?: 1;
if (setup_possible_cpus == -1) {
possible = num_processors;
#ifdef CONFIG_HOTPLUG_CPU
if (setup_max_cpus)
possible += disabled_cpus;
#else
if (possible > i)
possible = i;
#endif
} else
possible = setup_possible_cpus;

total_cpus = max_t(int, possible, num_processors + disabled_cpus);
Expand All @@ -1230,11 +1238,23 @@ __init void prefill_possible_map(void)
possible = nr_cpu_ids;
}

#ifdef CONFIG_HOTPLUG_CPU
if (!setup_max_cpus)
#endif
if (possible > i) {
printk(KERN_WARNING
"%d Processors exceeds max_cpus limit of %u\n",
possible, setup_max_cpus);
possible = i;
}

printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
possible, max_t(int, possible - num_processors, 0));

for (i = 0; i < possible; i++)
set_cpu_possible(i, true);
for (; i < NR_CPUS; i++)
set_cpu_possible(i, false);

nr_cpu_ids = possible;
}
Expand Down

0 comments on commit a01df5e

Please sign in to comment.