aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/smp.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2006-02-17 16:52:48 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-17 16:59:27 -0500
commit54330456b2e3398743586254f6d7695061ea0d49 (patch)
tree1527f8c2a5ff6247e88b73f6529b2b6b7aa9d724 /arch/s390/kernel/smp.c
parent37a3302618a51520e2056494715ea6b4776dd8ab (diff)
[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 <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r--arch/s390/kernel/smp.c15
1 files changed, 10 insertions, 5 deletions
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;
677 677
678void __init smp_setup_cpu_possible_map(void) 678void __init smp_setup_cpu_possible_map(void)
679{ 679{
680 unsigned int pcpus, cpu; 680 unsigned int phy_cpus, pos_cpus, cpu;
681 681
682 pcpus = min(smp_count_cpus() + additional_cpus, (unsigned int) NR_CPUS); 682 phy_cpus = smp_count_cpus();
683 pos_cpus = min(phy_cpus + additional_cpus, (unsigned int) NR_CPUS);
683 684
684 if (possible_cpus) 685 if (possible_cpus)
685 pcpus = min(possible_cpus, (unsigned int) NR_CPUS); 686 pos_cpus = min(possible_cpus, (unsigned int) NR_CPUS);
686 687
687 for (cpu = 0; cpu < pcpus; cpu++) 688 for (cpu = 0; cpu < pos_cpus; cpu++)
688 cpu_set(cpu, cpu_possible_map); 689 cpu_set(cpu, cpu_possible_map);
689 690
690 cpu_present_map = cpu_possible_map; 691 phy_cpus = min(phy_cpus, pos_cpus);
692
693 for (cpu = 0; cpu < phy_cpus; cpu++)
694 cpu_set(cpu, cpu_present_map);
691} 695}
692 696
693#ifdef CONFIG_HOTPLUG_CPU 697#ifdef CONFIG_HOTPLUG_CPU
@@ -843,6 +847,7 @@ void __devinit smp_prepare_boot_cpu(void)
843 847
844void smp_cpus_done(unsigned int max_cpus) 848void smp_cpus_done(unsigned int max_cpus)
845{ 849{
850 cpu_present_map = cpu_possible_map;
846} 851}
847 852
848/* 853/*