linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86: Document the hotplug code is incompatible with x86 irq handling
@ 2007-05-31 13:32 Eric W. Biederman
  2007-06-07 14:01 ` Pavel Machek
  0 siblings, 1 reply; 17+ messages in thread
From: Eric W. Biederman @ 2007-05-31 13:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Andi Kleen, linux-kernel, Neil Brown, Rafael J. Wysocki,
	Ingo Molnar, Zwane Mwaikambo


I just realized that except for doing the code review and noticing
that the current cpu hotplug code is fundamentally incompatible
with x86 I haven't done anything about it.  So here is my patch
to document what is wrong.

The current cpu hotplug code requires irqs to be migrated from a cpu
outside of irq context.  On x86 ioapics simply do not support this,
making the code unfixable without major redesign of the generic cpu
hotplug code.

So this patch makes CPU_HOTPLUG on x86 depend on CONFIG_BROKEN
and adds a WARN_ON so people that do enable it are not in doubt about
which part of the code is broken, even if it does work for them.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/i386/Kconfig        |    2 +-
 arch/i386/kernel/irq.c   |   13 +++++++++++++
 arch/x86_64/Kconfig      |    2 +-
 arch/x86_64/kernel/irq.c |   13 +++++++++++++
 4 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 8770a5d..74444c1 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -892,7 +892,7 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
+	depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER && BROKEN
 	---help---
 	  Say Y here to experiment with turning CPUs off and on, and to
 	  enable suspend on SMP systems. CPUs can be controlled through
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c
index d2daf67..42aeccb 100644
--- a/arch/i386/kernel/irq.c
+++ b/arch/i386/kernel/irq.c
@@ -312,6 +312,19 @@ void fixup_irqs(cpumask_t map)
 	unsigned int irq;
 	static int warned;
 
+	/* 
+	 * Function is so wrong at so many levels.
+	 * - We migrate irqs that are directed at the cpu we are
+	 *   removing.
+	 * - We cannot safely migrate ioapic irqs on x86 except in
+	 *   side of irq context.
+	 * - We are enabling irqs when the interface requires irqs to
+	 *   be disabled.
+	 * Since someone probably finds this useful just warn very
+	 * loudly until cpu hotplug is redesigned.
+	 */
+	WARN_ON(1);
+
 	for (irq = 0; irq < NR_IRQS; irq++) {
 		cpumask_t mask;
 		if (irq == 2)
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 5ce9443..a61c4f2 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -429,7 +429,7 @@ config NR_CPUS
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && EXPERIMENTAL && BROKEN
 	help
 		Say Y here to experiment with turning CPUs off and on.  CPUs
 		can be controlled through /sys/devices/system/cpu/cpu#.
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 3eaceac..da6f282 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -142,6 +142,19 @@ void fixup_irqs(cpumask_t map)
 	unsigned int irq;
 	static int warned;
 
+	/* 
+	 * Function is so wrong at so many levels.
+	 * - We migrate irqs that are directed at the cpu we are
+	 *   removing.
+	 * - We cannot safely migrate ioapic irqs on x86 except in
+	 *   side of irq context.
+	 * - We are enabling irqs when the interface requires irqs to
+	 *   be disabled.
+	 * Since someone probably finds this useful just warn very
+	 * loudly until cpu hotplug is redesigned.
+	 */
+	WARN_ON(1);
+
 	for (irq = 0; irq < NR_IRQS; irq++) {
 		cpumask_t mask;
 		if (irq == 2)
-- 
1.5.1.1.181.g2de0


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

end of thread, other threads:[~2007-06-22 17:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fa.tUMR7tAB+jMgtfyl/LJ7U9QMgBs@ifi.uio.no>
2007-05-31 14:34 ` [PATCH] x86: Document the hotplug code is incompatible with x86 irq handling Robert Hancock
2007-05-31 15:47   ` Eric W. Biederman
2007-05-31 20:12     ` Rafael J. Wysocki
2007-06-01 19:48       ` Eric W. Biederman
2007-06-01 20:06         ` Rafael J. Wysocki
2007-06-01 20:29           ` Eric W. Biederman
2007-06-01 20:44             ` Rafael J. Wysocki
2007-06-01 20:34         ` Rafael J. Wysocki
2007-05-31 13:32 Eric W. Biederman
2007-06-07 14:01 ` Pavel Machek
2007-06-12 18:19   ` Eric W. Biederman
2007-06-12 20:52     ` Rafael J. Wysocki
2007-06-12 21:56       ` Siddha, Suresh B
2007-06-12 22:16         ` Rafael J. Wysocki
2007-06-12 22:24           ` Siddha, Suresh B
2007-06-12 22:58             ` Rafael J. Wysocki
2007-06-22 17:27               ` Eric W. Biederman

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).