rcu: move check from rcu_dereference_bh to rcu_read_lock_bh_held
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 5 Oct 2010 21:03:02 +0000 (14:03 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 5 Oct 2010 21:03:02 +0000 (14:03 -0700)
As suggested by Linus, push the irqs_disabled() down to the
rcu_read_lock_bh_held() level so that all callers get the benefit
of the correct check.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/rcupdate.h
kernel/rcupdate.c

index 83af1f8d8b746cde3b8369d7125f3cdfe07da6d3..9fbc54a2585d42cb9276adf2c2d168f53e883f63 100644 (file)
@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
  * Makes rcu_dereference_check() do the dirty work.
  */
 #define rcu_dereference_bh(p) \
-               rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled())
+               rcu_dereference_check(p, rcu_read_lock_bh_held())
 
 /**
  * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched
index 4d169835fb362dcd6eb52a916a0d8e85e48c8fb8..0af1dc70fece2f456cc37006b0c554581e89c74c 100644 (file)
@@ -86,7 +86,7 @@ int rcu_read_lock_bh_held(void)
 {
        if (!debug_lockdep_rcu_enabled())
                return 1;
-       return in_softirq();
+       return in_softirq() || irqs_disabled();
 }
 EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);