| From dd6ea834ec1405baa50e0f465c9f570a4686147e Mon Sep 17 00:00:00 2001 |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Tue, 20 Jul 2010 14:34:50 +0200 |
| Subject: [PATCH] cpu-hotplug: Prevent softirq wakeup on wrong CPU |
| |
| commit 96c5397b25bfa8910d4f89ec99190edafc251525 in tip. |
| |
| 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> |
| |
| diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c |
| index 9b44011..0c6ffea 100644 |
| --- a/arch/x86/kernel/smpboot.c |
| +++ b/arch/x86/kernel/smpboot.c |
| @@ -322,6 +322,9 @@ notrace static void __cpuinit start_secondary(void *unused) |
| per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; |
| x86_platform.nmi_init(); |
| |
| + while (!cpumask_test_cpu(smp_processor_id(), cpu_active_mask)) |
| + cpu_relax(); |
| + |
| /* enable local interrupts */ |
| local_irq_enable(); |
| |
| -- |
| 1.7.1.1 |
| |