summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-07-20 14:34:50 +0200
committerThomas Gleixner <tglx@linutronix.de>2010-07-20 19:11:56 +0200
commit96c5397b25bfa8910d4f89ec99190edafc251525 (patch)
tree665dea3f4b30c0e82faffc44091dbc92d68dfde3
parent8e7dbdf187d6a6896873a32537fed62111a5910e (diff)
downloadlwn-96c5397b25bfa8910d4f89ec99190edafc251525.tar.gz
lwn-96c5397b25bfa8910d4f89ec99190edafc251525.zip
cpu-hotplug: Prevent softirq wakeup on wrong CPU
When the plugged CPU sets the online flag it enables interrupts and goes idle. When an interrupt happens and tried to wakeup a softirq thread before the other cpu sets the active flag, then the softirq thread is put on one of the active cpus. Prevent this by waiting for the cpu_active bit. Temporary workaround. Needs more thought. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/smpboot.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index b4e870cbdc60..4b2c0fe634a4 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -321,6 +321,9 @@ notrace static void __cpuinit start_secondary(void *unused)
ipi_call_unlock();
per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
+ while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask))
+ cpu_relax();
+
/* enable local interrupts */
local_irq_enable();