aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-03-03 04:52:10 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-03-03 04:52:10 -0500
commit71f87b2fc64c2e9b6d53cb817f28711b959d3dfe (patch)
tree1be0de7afced46cfca629dcbfc1807280c50bb13
parent27d50c7eeb0f03c3d3ca72aac4d2dd487ca1f3f0 (diff)
cpu/hotplug: Plug death reporting race
Paul noticed that the conversion of the death reporting introduced a race where the outgoing cpu might be delayed after waking the controll processor, so it might not be able to call rcu_report_dead() before being physically removed, leading to RCU stalls. We cant call complete after rcu_report_dead(), so instead of going back to busy polling, simply issue a function call to do the completion. Fixes: 27d50c7eeb0f "rcu: Make CPU_DYING_IDLE an explicit call" Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/20160302201127.GA23440@linux.vnet.ibm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra <peterz@infradead.org>
-rw-r--r--kernel/cpu.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index ff8059b76a85..93e9d89bb0ab 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -755,14 +755,26 @@ static int notify_dead(unsigned int cpu)
755 return 0; 755 return 0;
756} 756}
757 757
758static void cpuhp_complete_idle_dead(void *arg)
759{
760 struct cpuhp_cpu_state *st = arg;
761
762 complete(&st->done);
763}
764
758void cpuhp_report_idle_dead(void) 765void cpuhp_report_idle_dead(void)
759{ 766{
760 struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state); 767 struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
761 768
762 BUG_ON(st->state != CPUHP_AP_OFFLINE); 769 BUG_ON(st->state != CPUHP_AP_OFFLINE);
763 st->state = CPUHP_AP_IDLE_DEAD;
764 complete(&st->done);
765 rcu_report_dead(smp_processor_id()); 770 rcu_report_dead(smp_processor_id());
771 st->state = CPUHP_AP_IDLE_DEAD;
772 /*
773 * We cannot call complete after rcu_report_dead() so we delegate it
774 * to an online cpu.
775 */
776 smp_call_function_single(cpumask_first(cpu_online_mask),
777 cpuhp_complete_idle_dead, st, 0);
766} 778}
767 779
768#else 780#else