summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/setup-common.c
diff options
context:
space:
mode:
authorRyan Grimm <grimm@us.ibm.com>2011-03-31 19:33:02 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-05 16:22:11 +1000
commitc1854e00727f50f7ac99e98d26ece04c087ef785 (patch)
tree836a9b3cbf097ffcc650e91db2a83c9f83d0d3d5 /arch/powerpc/kernel/setup-common.c
parentf86d6b9b36a5d0923fa2abaacd425e328668fe16 (diff)
powerpc: Set nr_cpu_ids early and use it to free PACAs
Without this, "holes" in the CPU numbering can cause us to free too many PACAs Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r--arch/powerpc/kernel/setup-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 9d4882a4664..21f30cb6807 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -509,6 +509,9 @@ void __init smp_setup_cpu_maps(void)
*/
cpu_init_thread_core_maps(nthreads);
+ /* Now that possible cpus are set, set nr_cpu_ids for later use */
+ nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
+
free_unused_pacas();
}
#endif /* CONFIG_SMP */