From: Thomas Gleixner Date: Sun, 5 Oct 2008 14:52:24 +0000 (+0200) Subject: x86: improve UP kernel when CPU-hotplug and SMP is enabled X-Git-Tag: v2.6.28-rc1~611^2~6 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=649c6653fa94ec8f3ea32b19c97b790ec4e8e4ac;p=linux-2.6-omap-h63xx.git x86: improve UP kernel when CPU-hotplug and SMP is enabled 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 Signed-off-by: Thomas Gleixner Cc: Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index fb04e49776b..a84ac7b570e 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -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