aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-04-27 19:13:53 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-06-08 11:25:34 -0400
commitf4687d2637a4016b2eedfdb777105c95e8d6fe52 (patch)
tree1a6f94344dc126fd0e48287990f6486581734454 /kernel/rcu/tree.c
parentc75e9caaf85f1fc4ed32e510b259d67ec3c4c603 (diff)
rcu: Add preemptibility checks in rcu_sched_qs() and rcu_bh_qs()
This commit adds WARN_ON_ONCE() calls that trigger if either rcu_sched_qs() or rcu_bh_qs() are invoked with preemption enabled. In the immortal words of Peter Zijlstra: "these are much harder to ignore than comments". Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 3bee58fc23b1..b01a02e7a0b7 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -250,6 +250,7 @@ static int rcu_gp_in_progress(struct rcu_state *rsp)
250 */ 250 */
251void rcu_sched_qs(void) 251void rcu_sched_qs(void)
252{ 252{
253 RCU_LOCKDEP_WARN(preemptible(), "rcu_sched_qs() invoked with preemption enabled!!!");
253 if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s)) 254 if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s))
254 return; 255 return;
255 trace_rcu_grace_period(TPS("rcu_sched"), 256 trace_rcu_grace_period(TPS("rcu_sched"),
@@ -265,6 +266,7 @@ void rcu_sched_qs(void)
265 266
266void rcu_bh_qs(void) 267void rcu_bh_qs(void)
267{ 268{
269 RCU_LOCKDEP_WARN(preemptible(), "rcu_bh_qs() invoked with preemption enabled!!!");
268 if (__this_cpu_read(rcu_bh_data.cpu_no_qs.s)) { 270 if (__this_cpu_read(rcu_bh_data.cpu_no_qs.s)) {
269 trace_rcu_grace_period(TPS("rcu_bh"), 271 trace_rcu_grace_period(TPS("rcu_bh"),
270 __this_cpu_read(rcu_bh_data.gpnum), 272 __this_cpu_read(rcu_bh_data.gpnum),