Skip to content

Commit

Permalink
notifier: Substitute rcu_access_pointer() for rcu_dereference_raw()
Browse files Browse the repository at this point in the history
(Trivial patch.)

If the code is looking at the RCU-protected pointer itself, but not
dereferencing it, the rcu_dereference() functions can be downgraded
to rcu_access_pointer().  This commit makes this downgrade in
__blocking_notifier_call_chain() which simply compares the RCU-protected
pointer against NULL with no dereferencing.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Linus Torvalds <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
  • Loading branch information
paulmck committed Feb 26, 2014
1 parent add1f09 commit 8857563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ int __blocking_notifier_call_chain(struct blocking_notifier_head *nh,
* racy then it does not matter what the result of the test
* is, we re-check the list after having taken the lock anyway:
*/
if (rcu_dereference_raw(nh->head)) {
if (rcu_access_pointer(nh->head)) {
down_read(&nh->rwsem);
ret = notifier_call_chain(&nh->head, val, v, nr_to_call,
nr_calls);
Expand Down

0 comments on commit 8857563

Please sign in to comment.