From: Andrew Morton Cc: Christoph Lameter Signed-off-by: Andrew Morton --- kernel/sched.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff -puN kernel/sched.c~safer-nr_node_ids-and-nr_node_ids-determination-and-initial-up-fix kernel/sched.c --- a/kernel/sched.c~safer-nr_node_ids-and-nr_node_ids-determination-and-initial-up-fix +++ a/kernel/sched.c @@ -5279,6 +5279,11 @@ int __init migration_init(void) #endif #ifdef CONFIG_SMP + +/* Number of possible processor ids */ +int nr_cpu_ids = NR_CPUS; +EXPORT_SYMBOL(nr_cpu_ids); + #undef SCHED_DOMAIN_DEBUG #ifdef SCHED_DOMAIN_DEBUG static void sched_domain_debug(struct sched_domain *sd, int cpu) @@ -6758,10 +6763,6 @@ int in_sched_functions(unsigned long add && addr < (unsigned long)__sched_text_end); } -/* Number of possible processor ids */ -int nr_cpu_ids = NR_CPUS; -EXPORT_SYMBOL(nr_cpu_ids); - void __init sched_init(void) { int i, j, k; @@ -6802,11 +6803,11 @@ void __init sched_init(void) } highest_cpu = i; } - nr_cpu_ids = highest_cpu + 1; set_load_weight(&init_task); #ifdef CONFIG_SMP + nr_cpu_ids = highest_cpu + 1; open_softirq(SCHED_SOFTIRQ, run_rebalance_domains, NULL); #endif _