aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-08-06 03:59:49 -0400
committerIngo Molnar <mingo@kernel.org>2012-08-23 04:45:13 -0400
commit816afe4ff98ee10b1d30fd66361be132a0a5cee6 (patch)
treeedb054530d87da95a9a9054d50467d92b62d8214 /kernel/cpu.c
parent23dcfa61bac244e1200ff9ad19c6e9144dcb6bb5 (diff)
x86/smp: Don't ever patch back to UP if we unplug cpus
We still patch SMP instructions to UP variants if we boot with a single CPU, but not at any other time. In particular, not if we unplug CPUs to return to a single cpu. Paul McKenney points out: mean offline overhead is 6251/48=130.2 milliseconds. If I remove the alternatives_smp_switch() from the offline path [...] the mean offline overhead is 550/42=13.1 milliseconds Basically, we're never going to get those 120ms back, and the code is pretty messy. We get rid of: 1) The "smp-alt-once" boot option. It's actually "smp-alt-boot", the documentation is wrong. It's now the default. 2) The skip_smp_alternatives flag used by suspend. 3) arch_disable_nonboot_cpus_begin() and arch_disable_nonboot_cpus_end() which were only used to set this one flag. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Paul McKenney <paul.mckenney@us.ibm.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/87vcgwwive.fsf@rustcorp.com.au Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 14d32588cccd..f6bfe3e03f6b 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -439,14 +439,6 @@ EXPORT_SYMBOL_GPL(cpu_up);
439#ifdef CONFIG_PM_SLEEP_SMP 439#ifdef CONFIG_PM_SLEEP_SMP
440static cpumask_var_t frozen_cpus; 440static cpumask_var_t frozen_cpus;
441 441
442void __weak arch_disable_nonboot_cpus_begin(void)
443{
444}
445
446void __weak arch_disable_nonboot_cpus_end(void)
447{
448}
449
450int disable_nonboot_cpus(void) 442int disable_nonboot_cpus(void)
451{ 443{
452 int cpu, first_cpu, error = 0; 444 int cpu, first_cpu, error = 0;
@@ -458,7 +450,6 @@ int disable_nonboot_cpus(void)
458 * with the userspace trying to use the CPU hotplug at the same time 450 * with the userspace trying to use the CPU hotplug at the same time
459 */ 451 */
460 cpumask_clear(frozen_cpus); 452 cpumask_clear(frozen_cpus);
461 arch_disable_nonboot_cpus_begin();
462 453
463 printk("Disabling non-boot CPUs ...\n"); 454 printk("Disabling non-boot CPUs ...\n");
464 for_each_online_cpu(cpu) { 455 for_each_online_cpu(cpu) {
@@ -474,8 +465,6 @@ int disable_nonboot_cpus(void)
474 } 465 }
475 } 466 }
476 467
477 arch_disable_nonboot_cpus_end();
478
479 if (!error) { 468 if (!error) {
480 BUG_ON(num_online_cpus() > 1); 469 BUG_ON(num_online_cpus() > 1);
481 /* Make sure the CPUs won't be enabled by someone else */ 470 /* Make sure the CPUs won't be enabled by someone else */