Skip to content

Commit

Permalink
rcu: Flag lockless access to ->gp_flags with ACCESS_ONCE()
Browse files Browse the repository at this point in the history
This commit applies ACCESS_ONCE() to an outside-of-lock access to
->gp_flags.  Although it is hard to imagine any sane compiler messing
this particular case up, the documentation benefits are substantial.
Plus the definition of "sane compiler" grows ever looser.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Paul E. McKenney committed Sep 23, 2013
1 parent 88d6df6 commit 591c6d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
/* Handle grace-period start. */
for (;;) {
wait_event_interruptible(rsp->gp_wq,
rsp->gp_flags &
ACCESS_ONCE(rsp->gp_flags) &
RCU_GP_FLAG_INIT);
if (rcu_gp_init(rsp))
break;
Expand Down

0 comments on commit 591c6d1

Please sign in to comment.