From: Paul E. McKenney Date: Thu, 27 Apr 2017 23:13:53 +0000 (-0700) Subject: rcu: Add preemptibility checks in rcu_sched_qs() and rcu_bh_qs() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f4687d2637a4016b2eedfdb777105c95e8d6fe52;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) */ void rcu_sched_qs(void) { + RCU_LOCKDEP_WARN(preemptible(), "rcu_sched_qs() invoked with preemption enabled!!!"); if (!__this_cpu_read(rcu_sched_data.cpu_no_qs.s)) return; trace_rcu_grace_period(TPS("rcu_sched"), @@ -265,6 +266,7 @@ void rcu_sched_qs(void) void rcu_bh_qs(void) { + RCU_LOCKDEP_WARN(preemptible(), "rcu_bh_qs() invoked with preemption enabled!!!"); if (__this_cpu_read(rcu_bh_data.cpu_no_qs.s)) { trace_rcu_grace_period(TPS("rcu_bh"), __this_cpu_read(rcu_bh_data.gpnum),