[1/2,2.6.31-rc5,REPOST] init: set nr_cpu_ids before setup_per_cpu_areas()

Submitted by Tejun Heo on Aug. 6, 2009, 9:33 a.m.


Message ID 4A7AA368.8080606@kernel.org
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Tejun Heo Aug. 6, 2009, 9:33 a.m.
nr_cpu_ids is dependent only on cpu_possible_map and
setup_per_cpu_areas() already depends on cpu_possible_map and will use
nr_cpu_ids.  Initialize nr_cpu_ids before setting up percpu areas.

Signed-off-by: Tejun Heo <tj@kernel.org>
This is repost of the following two patches with sparclinux mailing
list cc'd because I couldn't get any response from David Miller.
Nothing has changed code-wise.


These two patches fix boot failure on sparc64 which happens if the
cpus don't have consecutive cpu numbers.


 init/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/init/main.c b/init/main.c
index 2c5ade7..2d9d6bd 100644
--- a/init/main.c
+++ b/init/main.c
@@ -584,8 +584,8 @@  asmlinkage void __init start_kernel(void)
 	mm_init_owner(&init_mm, &init_task);
-	setup_per_cpu_areas();
+	setup_per_cpu_areas();
 	smp_prepare_boot_cpu();	/* arch-specific boot-cpu hooks */