diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-07-02 18:54:40 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 13:16:24 +0200 |
commit | 329513a35d1a2b6b28d54f5c2c0dde4face8200b (patch) | |
tree | ef517f954c7dc6e86952e372608bde091b13f803 | |
parent | 5f4765f96eebee6a0adc4009758b597ba48a0a3a (diff) |
x86: move prefill_possible_map calling early
call it right after we are done with MADT/mptable handling, instead of
doing that in setup_per_cpu_areas() later on...
this way for_possible_cpu() can be used early.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/setup_percpu.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 8 | ||||
-rw-r--r-- | include/asm-x86/smp.h | 4 |
4 files changed, 13 insertions, 10 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index f52a6fb9023..cfcfbefee0b 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -818,6 +818,7 @@ void __init setup_arch(char **cmdline_p) get_smp_config(); #endif + prefill_possible_map(); #ifdef CONFIG_X86_64 init_cpu_to_node(); #endif diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 43aca2de624..5fc310f746f 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c @@ -162,16 +162,6 @@ void __init setup_per_cpu_areas(void) char *ptr; int cpu; - /* no processor from mptable or madt */ - if (!num_processors) - num_processors = 1; - -#ifdef CONFIG_HOTPLUG_CPU - prefill_possible_map(); -#else - nr_cpu_ids = num_processors; -#endif - /* Setup cpu_pda map */ setup_cpu_pda_map(); diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 3b19441d78b..e1200b202ed 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1278,12 +1278,20 @@ __init void prefill_possible_map(void) int i; int possible; + /* no processor from mptable or madt */ + if (!num_processors) + num_processors = 1; + +#ifdef CONFIG_HOTPLUG_CPU if (additional_cpus == -1) { if (disabled_cpus > 0) additional_cpus = disabled_cpus; else additional_cpus = 0; } +#else + additional_cpus = 0; +#endif possible = num_processors + additional_cpus; if (possible > NR_CPUS) possible = NR_CPUS; diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h index fad45f6a193..b324a0645a7 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h @@ -119,6 +119,10 @@ static inline int num_booting_cpus(void) { return cpus_weight(cpu_callout_map); } +#else +static inline void prefill_possible_map(void) +{ +} #endif /* CONFIG_SMP */ extern unsigned disabled_cpus __cpuinitdata; |