stop_machine: Provide RCU quiescent state in multi_cpu_stop()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 10 Jul 2019 15:01:01 +0000 (08:01 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Sat, 5 Oct 2019 17:46:05 +0000 (10:46 -0700)
When multi_cpu_stop() loops waiting for other tasks, it can trigger an RCU
CPU stall warning.  This can be misleading because what is instead needed
is information on whatever task is blocking multi_cpu_stop().  This commit
therefore inserts an RCU quiescent state into the multi_cpu_stop()
function's waitloop.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/rcutree.h
kernel/rcu/tree.c
kernel/stop_machine.c

index 18b1ed9864b02c8909097fceab9317dc4e97650f..c5147de885ec47abb94e9756cea867711b9297f7 100644 (file)
@@ -37,6 +37,7 @@ void kfree_call_rcu(struct rcu_head *head, rcu_callback_t func);
 
 void rcu_barrier(void);
 bool rcu_eqs_special_set(int cpu);
+void rcu_momentary_dyntick_idle(void);
 unsigned long get_state_synchronize_rcu(void);
 void cond_synchronize_rcu(unsigned long oldstate);
 
index 238f93b4b0a4e9e700228f1845aff5e48ccf9dd2..a5c296d202aec4925a37d1c957d389b61ddb5d6d 100644 (file)
@@ -364,7 +364,7 @@ bool rcu_eqs_special_set(int cpu)
  *
  * The caller must have disabled interrupts and must not be idle.
  */
-static void __maybe_unused rcu_momentary_dyntick_idle(void)
+void rcu_momentary_dyntick_idle(void)
 {
        int special;
 
index c7031a22aa7bcb9dfd0f73da764108a321e99442..34c4f117d8c7828b96d5803f61b6c00fd77e48e3 100644 (file)
@@ -233,6 +233,7 @@ static int multi_cpu_stop(void *data)
                         */
                        touch_nmi_watchdog();
                }
+               rcu_momentary_dyntick_idle();
        } while (curstate != MULTI_STOP_EXIT);
 
        local_irq_restore(flags);