Commit 591c6d17 authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Flag lockless access to ->gp_flags with ACCESS_ONCE()

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: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 88d6df61
...@@ -1481,7 +1481,7 @@ static int __noreturn rcu_gp_kthread(void *arg) ...@@ -1481,7 +1481,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
/* Handle grace-period start. */ /* Handle grace-period start. */
for (;;) { for (;;) {
wait_event_interruptible(rsp->gp_wq, wait_event_interruptible(rsp->gp_wq,
rsp->gp_flags & ACCESS_ONCE(rsp->gp_flags) &
RCU_GP_FLAG_INIT); RCU_GP_FLAG_INIT);
if (rcu_gp_init(rsp)) if (rcu_gp_init(rsp))
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment