diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-03-10 14:42:08 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-03-10 15:21:59 -0500 |
commit | 2a58c527bb566b7abad96289fa5b973040c33c82 (patch) | |
tree | 5f22c738d4a79fb4ed816e3453445f55d0e6626e /kernel | |
parent | 5d8eb84253333f8f63ec704276e3f0a8ec8f3189 (diff) |
cpu/hotplug: Fix smpboot thread ordering
Commit 931ef163309e moved the smpboot thread park/unpark invocation to the
state machine. The move of the unpark invocation was premature as it depends
on work in progress patches.
As a result cpu down can fail, because rcu synchronization in takedown_cpu()
eventually requires a functional softirq thread. I never encountered the
problem in testing, but 0day testing managed to provide a reliable reproducer.
Remove the smpboot_threads_park() call from the state machine for now and put
it back into the original place after the rcu synchronization.
I'm embarrassed as I knew about the dependency and still managed to get it
wrong. Hotplug induced brain melt seems to be the only sensible explanation
for that.
Fixes: 931ef163309e "cpu/hotplug: Unpark smpboot threads from the state machine"
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/cpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 373e831e0faa..bcee286b7c73 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -706,8 +706,9 @@ static int takedown_cpu(unsigned int cpu) | |||
706 | else | 706 | else |
707 | synchronize_rcu(); | 707 | synchronize_rcu(); |
708 | 708 | ||
709 | /* Park the hotplug thread */ | 709 | /* Park the smpboot threads */ |
710 | kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread); | 710 | kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread); |
711 | smpboot_park_threads(cpu); | ||
711 | 712 | ||
712 | /* | 713 | /* |
713 | * Prevent irq alloc/free while the dying cpu reorganizes the | 714 | * Prevent irq alloc/free while the dying cpu reorganizes the |
@@ -1206,7 +1207,7 @@ static struct cpuhp_step cpuhp_ap_states[] = { | |||
1206 | [CPUHP_AP_SMPBOOT_THREADS] = { | 1207 | [CPUHP_AP_SMPBOOT_THREADS] = { |
1207 | .name = "smpboot:threads", | 1208 | .name = "smpboot:threads", |
1208 | .startup = smpboot_unpark_threads, | 1209 | .startup = smpboot_unpark_threads, |
1209 | .teardown = smpboot_park_threads, | 1210 | .teardown = NULL, |
1210 | }, | 1211 | }, |
1211 | [CPUHP_AP_NOTIFY_ONLINE] = { | 1212 | [CPUHP_AP_NOTIFY_ONLINE] = { |
1212 | .name = "notify:online", | 1213 | .name = "notify:online", |