]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rcu: Add lockdep checks to synchronous expedited primitives
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 9 Jan 2017 23:25:55 +0000 (15:25 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 23 Jan 2017 19:37:14 +0000 (11:37 -0800)
The non-expedited synchronize_*rcu() primitives have lockdep checks, but
their expedited counterparts lack these checks.  This commit therefore
adds these checks to the expedited synchronize_*rcu() primitives.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcu/tree_exp.h

index 303df97bbfc5e5f196295fdcfdd6e715118e27d9..f3e214898e3abb4b8d24d14028c29cf9decd142e 100644 (file)
@@ -639,6 +639,11 @@ void synchronize_sched_expedited(void)
 {
        struct rcu_state *rsp = &rcu_sched_state;
 
+       RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
+                        lock_is_held(&rcu_lock_map) ||
+                        lock_is_held(&rcu_sched_lock_map),
+                        "Illegal synchronize_sched_expedited() in RCU read-side critical section");
+
        /* If only one CPU, this is automatically a grace period. */
        if (rcu_blocking_is_gp())
                return;
@@ -708,6 +713,11 @@ void synchronize_rcu_expedited(void)
 {
        struct rcu_state *rsp = rcu_state_p;
 
+       RCU_LOCKDEP_WARN(lock_is_held(&rcu_bh_lock_map) ||
+                        lock_is_held(&rcu_lock_map) ||
+                        lock_is_held(&rcu_sched_lock_map),
+                        "Illegal synchronize_rcu_expedited() in RCU read-side critical section");
+
        if (rcu_scheduler_active == RCU_SCHEDULER_INACTIVE)
                return;
        _synchronize_rcu_expedited(rsp, sync_rcu_exp_handler);