Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 773e3f9

Browse files
committed
rcu: move check from rcu_dereference_bh to rcu_read_lock_bh_held
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 <[email protected]>
1 parent b3a084b commit 773e3f9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/rcupdate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
454454
* Makes rcu_dereference_check() do the dirty work.
455455
*/
456456
#define rcu_dereference_bh(p) \
457-
rcu_dereference_check(p, rcu_read_lock_bh_held() || irqs_disabled())
457+
rcu_dereference_check(p, rcu_read_lock_bh_held())
458458

459459
/**
460460
* rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched

kernel/rcupdate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int rcu_read_lock_bh_held(void)
8686
{
8787
if (!debug_lockdep_rcu_enabled())
8888
return 1;
89-
return in_softirq();
89+
return in_softirq() || irqs_disabled();
9090
}
9191
EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
9292

0 commit comments

Comments
 (0)