mirror of
https://github.com/adulau/aha.git
synced 2025-01-02 14:13:18 +00:00
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>
This commit is contained in:
parent
5f4765f96e
commit
329513a35d
4 changed files with 13 additions and 10 deletions
|
@ -818,6 +818,7 @@ void __init setup_arch(char **cmdline_p)
|
||||||
get_smp_config();
|
get_smp_config();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
prefill_possible_map();
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
init_cpu_to_node();
|
init_cpu_to_node();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -162,16 +162,6 @@ void __init setup_per_cpu_areas(void)
|
||||||
char *ptr;
|
char *ptr;
|
||||||
int cpu;
|
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 */
|
||||||
setup_cpu_pda_map();
|
setup_cpu_pda_map();
|
||||||
|
|
||||||
|
|
|
@ -1278,12 +1278,20 @@ __init void prefill_possible_map(void)
|
||||||
int i;
|
int i;
|
||||||
int possible;
|
int possible;
|
||||||
|
|
||||||
|
/* no processor from mptable or madt */
|
||||||
|
if (!num_processors)
|
||||||
|
num_processors = 1;
|
||||||
|
|
||||||
|
#ifdef CONFIG_HOTPLUG_CPU
|
||||||
if (additional_cpus == -1) {
|
if (additional_cpus == -1) {
|
||||||
if (disabled_cpus > 0)
|
if (disabled_cpus > 0)
|
||||||
additional_cpus = disabled_cpus;
|
additional_cpus = disabled_cpus;
|
||||||
else
|
else
|
||||||
additional_cpus = 0;
|
additional_cpus = 0;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
additional_cpus = 0;
|
||||||
|
#endif
|
||||||
possible = num_processors + additional_cpus;
|
possible = num_processors + additional_cpus;
|
||||||
if (possible > NR_CPUS)
|
if (possible > NR_CPUS)
|
||||||
possible = NR_CPUS;
|
possible = NR_CPUS;
|
||||||
|
|
|
@ -119,6 +119,10 @@ static inline int num_booting_cpus(void)
|
||||||
{
|
{
|
||||||
return cpus_weight(cpu_callout_map);
|
return cpus_weight(cpu_callout_map);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static inline void prefill_possible_map(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
extern unsigned disabled_cpus __cpuinitdata;
|
extern unsigned disabled_cpus __cpuinitdata;
|
||||||
|
|
Loading…
Reference in a new issue