aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-03-19 13:25:26 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:01 -0400
commite1a14d0c1391627d869c0f97bb5e2382bf36d8dc (patch)
tree09e570282f5b8c9f433c9c98334469d194e98b91
parent1161705bd66df0c80fa45e87190e456c02e6f145 (diff)
x86: get rid of cpucount
weighting a map will do. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/smpboot_32.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
index 2fea910eff43..5c4e85cceb16 100644
--- a/arch/x86/kernel/smpboot_32.c
+++ b/arch/x86/kernel/smpboot_32.c
@@ -166,8 +166,6 @@ static void __cpuinit smp_callin(void)
166 cpu_set(cpuid, cpu_callin_map); 166 cpu_set(cpuid, cpu_callin_map);
167} 167}
168 168
169static int cpucount;
170
171/* 169/*
172 * Activate a secondary processor. 170 * Activate a secondary processor.
173 */ 171 */
@@ -585,7 +583,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
585 /* start_eip had better be page-aligned! */ 583 /* start_eip had better be page-aligned! */
586 start_eip = setup_trampoline(); 584 start_eip = setup_trampoline();
587 585
588 ++cpucount;
589 alternatives_smp_switch(1); 586 alternatives_smp_switch(1);
590 587
591 /* So we see what's up */ 588 /* So we see what's up */
@@ -656,7 +653,6 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
656 cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */ 653 cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */
657 cpu_clear(cpu, cpu_possible_map); 654 cpu_clear(cpu, cpu_possible_map);
658 per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID; 655 per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID;
659 cpucount--;
660 } 656 }
661 657
662 /* mark "stuck" area as not stuck */ 658 /* mark "stuck" area as not stuck */
@@ -672,7 +668,6 @@ void cpu_exit_clear(void)
672 668
673 idle_task_exit(); 669 idle_task_exit();
674 670
675 cpucount --;
676 cpu_uninit(); 671 cpu_uninit();
677 irq_ctx_exit(cpu); 672 irq_ctx_exit(cpu);
678 673
@@ -795,7 +790,6 @@ static int __init smp_sanity_check(unsigned max_cpus)
795 return 0; 790 return 0;
796} 791}
797 792
798
799/* 793/*
800 * Cycle through the processors sending APIC IPIs to boot each. 794 * Cycle through the processors sending APIC IPIs to boot each.
801 */ 795 */
@@ -851,7 +845,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
851 845
852 if (!check_apicid_present(bit)) 846 if (!check_apicid_present(bit))
853 continue; 847 continue;
854 if (max_cpus <= cpucount+1) 848 if (max_cpus <= cpus_weight(cpu_present_map))
855 continue; 849 continue;
856 /* Utterly temporary */ 850 /* Utterly temporary */
857 for (cpu = 0; cpu < NR_CPUS; cpu++) 851 for (cpu = 0; cpu < NR_CPUS; cpu++)
@@ -878,7 +872,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
878 bogosum += cpu_data(cpu).loops_per_jiffy; 872 bogosum += cpu_data(cpu).loops_per_jiffy;
879 printk(KERN_INFO 873 printk(KERN_INFO
880 "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", 874 "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
881 cpucount+1, 875 cpus_weight(cpu_present_map),
882 bogosum/(500000/HZ), 876 bogosum/(500000/HZ),
883 (bogosum/(5000/HZ))%100); 877 (bogosum/(5000/HZ))%100);
884 878
@@ -892,7 +886,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
892 * approved Athlon 886 * approved Athlon
893 */ 887 */
894 if (tainted & TAINT_UNSAFE_SMP) { 888 if (tainted & TAINT_UNSAFE_SMP) {
895 if (cpucount) 889 if (cpus_weight(cpu_present_map))
896 printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); 890 printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n");
897 else 891 else
898 tainted &= ~TAINT_UNSAFE_SMP; 892 tainted &= ~TAINT_UNSAFE_SMP;