linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Do not force shutdown/reboot to boot cpu.
@ 2013-04-03 19:37 Robin Holt
  2013-04-08 15:57 ` Ingo Molnar
  0 siblings, 1 reply; 45+ messages in thread
From: Robin Holt @ 2013-04-03 19:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Russ Anderson, Shawn Guo, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86

We noticed that recently, reboot of a 1024 cpu machine takes approx 16
minutes of just stopping the cpus.  The slowdown was tracked to commit
f96972f which went into v3.7 and then to the stable trees.

x86 does not need to be running the boot cpu to pull reset and I don't
think it is really needed for shutdown either.

I decided to go the "simple" way and make this a config option that is
selected by the x86 arch.  I don't know which other arch's would also
benefit, if any.

Signed-off-by: Robin Holt <holt@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: <stable@vger.kernel.org>

---
 arch/x86/Kconfig        | 3 +++
 kernel/Kconfig.shutdown | 3 +++
 kernel/sys.c            | 4 ++++
 3 files changed, 10 insertions(+)
 create mode 100644 kernel/Kconfig.shutdown

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 70c0f3d..9611942 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -120,6 +120,7 @@ config X86
 	select OLD_SIGSUSPEND3 if X86_32 || IA32_EMULATION
 	select OLD_SIGACTION if X86_32
 	select COMPAT_OLD_SIGACTION if IA32_EMULATION
+	select ARCH_SHUTDOWN_TO_ANY_CPU
 
 config INSTRUCTION_DECODER
 	def_bool y
@@ -839,6 +840,8 @@ config SCHED_MC
 	  making when dealing with multi-core CPU chips at a cost of slightly
 	  increased overhead in some places. If unsure say N here.
 
+source "kernel/Kconfig.shutdown"
+
 source "kernel/Kconfig.preempt"
 
 config X86_UP_APIC
diff --git a/kernel/Kconfig.shutdown b/kernel/Kconfig.shutdown
new file mode 100644
index 0000000..d79fc04
--- /dev/null
+++ b/kernel/Kconfig.shutdown
@@ -0,0 +1,3 @@
+
+config ARCH_SHUTDOWN_TO_ANY_CPU
+	bool
diff --git a/kernel/sys.c b/kernel/sys.c
index 39c9c4a..c0b8880 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -369,7 +369,9 @@ EXPORT_SYMBOL(unregister_reboot_notifier);
 void kernel_restart(char *cmd)
 {
 	kernel_restart_prepare(cmd);
+#ifndef CONFIG_ARCH_SHUTDOWN_TO_ANY_CPU
 	disable_nonboot_cpus();
+#endif
 	if (!cmd)
 		printk(KERN_EMERG "Restarting system.\n");
 	else
@@ -413,7 +415,9 @@ void kernel_power_off(void)
 	kernel_shutdown_prepare(SYSTEM_POWER_OFF);
 	if (pm_power_off_prepare)
 		pm_power_off_prepare();
+#ifndef CONFIG_ARCH_SHUTDOWN_TO_ANY_CPU
 	disable_nonboot_cpus();
+#endif
 	syscore_shutdown();
 	printk(KERN_EMERG "Power down.\n");
 	kmsg_dump(KMSG_DUMP_POWEROFF);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2013-04-16  9:40 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03 19:37 [PATCH] Do not force shutdown/reboot to boot cpu Robin Holt
2013-04-08 15:57 ` Ingo Molnar
2013-04-08 16:11   ` H. Peter Anvin
2013-04-08 16:59     ` Robin Holt
2013-04-10 11:16       ` Ingo Molnar
2013-04-10 14:01         ` Robin Holt
2013-04-10 15:10         ` Linus Torvalds
2013-04-10 15:29           ` Russ Anderson
2013-04-10 16:59             ` Ingo Molnar
2013-04-10 17:14               ` Robin Holt
2013-04-10 17:22                 ` Ingo Molnar
2013-04-10 17:55                   ` Robin Holt
2013-04-10 19:00                     ` Robin Holt
2013-04-11  8:57                       ` Ingo Molnar
2013-04-11 11:34                         ` Robin Holt
2013-04-11 12:00                           ` Ingo Molnar
2013-04-11 12:03                             ` Robin Holt
2013-04-11 12:08                               ` Robin Holt
2013-04-11 12:14                                 ` Ingo Molnar
2013-04-10 17:58               ` H. Peter Anvin
2013-04-10 23:02               ` Russ Anderson
2013-04-10 22:29             ` Russ Anderson
2013-04-11  5:31           ` Paul Mackerras
2013-04-11 12:45             ` Bulk CPU Hotplug (Was Re: [PATCH] Do not force shutdown/reboot to boot cpu.) Srivatsa S. Bhat
2013-04-11 13:48               ` Robin Holt
2013-04-12  5:37                 ` Ingo Molnar
2013-04-12  6:09                   ` Srivatsa S. Bhat
2013-04-12  9:31                     ` Robin Holt
2013-04-12 10:01                       ` Robin Holt
2013-04-13 16:30                       ` Oleg Nesterov
2013-04-15 16:04                         ` Robin Holt
2013-04-15 16:09                           ` Oleg Nesterov
2013-04-15 16:10                           ` Robin Holt
2013-04-13 17:01                       ` Srivatsa S. Bhat
2013-04-15 10:16                       ` Ingo Molnar
2013-04-15 12:02                         ` Robin Holt
2013-04-15 15:59                           ` Robin Holt
2013-04-16  9:40                             ` Ingo Molnar
2013-04-11 14:23               ` Russ Anderson
2013-04-11 14:45                 ` Srivatsa S. Bhat
2013-04-11 20:08                   ` Russ Anderson
2013-04-11 20:17                     ` Srivatsa S. Bhat
2013-04-11 21:08                     ` Robin Holt
2013-04-08 16:54   ` [PATCH] Do not force shutdown/reboot to boot cpu Robin Holt
2013-04-08 17:07   ` Russ Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).