From: Heiko Carstens Date: Fri, 17 Feb 2006 21:52:48 +0000 (-0800) Subject: [PATCH] s390: smp initialization speed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54330456b2e3398743586254f6d7695061ea0d49;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] s390: smp initialization speed The last changes that introduced the additional_cpus command line parameter also introduced a regression regarding smp initialization speed. In smp_setup_cpu_possible_map() cpu_present_map is set to the same value as cpu_possible_map. Especially that means that bits in the present map will be set for cpus that are not present. This will cause a slow down in the initial cpu_up() loop in smp_init() since trying to take cpus online that aren't present takes a while. Fix this by setting only bits for present cpus in cpu_present_map and set cpu_present_map to cpu_possible_map in smp_cpus_done(). Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index d0a2745aec7f..7dbe00c76c6b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -677,17 +677,21 @@ static unsigned int __initdata possible_cpus; void __init smp_setup_cpu_possible_map(void) { - unsigned int pcpus, cpu; + unsigned int phy_cpus, pos_cpus, cpu; - pcpus = min(smp_count_cpus() + additional_cpus, (unsigned int) NR_CPUS); + phy_cpus = smp_count_cpus(); + pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS); if (possible_cpus) - pcpus = min(possible_cpus, (unsigned int) NR_CPUS); + pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS); - for (cpu = 0; cpu < pcpus; cpu++) + for (cpu = 0; cpu < pos_cpus; cpu++) cpu_set(cpu, cpu_possible_map); - cpu_present_map = cpu_possible_map; + phy_cpus = min(phy_cpus, pos_cpus); + + for (cpu = 0; cpu < phy_cpus; cpu++) + cpu_set(cpu, cpu_present_map); } #ifdef CONFIG_HOTPLUG_CPU @@ -843,6 +847,7 @@ void __devinit smp_prepare_boot_cpu(void) void smp_cpus_done(unsigned int max_cpus) { + cpu_present_map = cpu_possible_map; } /*