]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86: improve UP kernel when CPU-hotplug and SMP is enabled
authorThomas Gleixner <tglx@linutronix.de>
Mon, 13 Oct 2008 17:15:23 +0000 (17:15 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 18 Oct 2008 17:49:13 +0000 (10:49 -0700)
commit 649c6653fa94ec8f3ea32b19c97b790ec4e8e4ac upstream

num_possible_cpus() can be > 1 when disabled CPUs have been accounted.

Disabled CPUs are not in the cpu_present_map, so we can use
num_present_cpus() as a safe indicator to switch to UP alternatives.

Reported-by: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/alternative.c

index 65a0c1b4869636122fc22dec84de26788662a2d4..f509cfc6bf634c729454cdd96359ba99c66c1f1c 100644 (file)
@@ -444,7 +444,7 @@ void __init alternative_instructions(void)
                                            _text, _etext);
 
                /* Only switch to UP mode if we don't immediately boot others */
-               if (num_possible_cpus() == 1 || setup_max_cpus <= 1)
+               if (num_present_cpus() == 1 || setup_max_cpus <= 1)
                        alternatives_smp_switch(0);
        }
 #endif