aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-08-08 22:26:23 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:12 +0200
commit77c4cfba6f86a201a0196fa526966c6602f2fd9e (patch)
tree2a38913528f4c5e23712f90c3ca7ce2852228189
parentdbba0573bd99e25e8e9894cad932e3525abcca1d (diff)
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: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Git-commit: 591c6d1710cd73824057d08eda302cf2a7cfd18a [kishank@codeaurora.org resolve trivial conflicts] Signed-off-by: Kishan Kumar <kishank@codeaurora.org>
-rw-r--r--kernel/rcutree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 64eeb75fa..6e8e6eced 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1530,7 +1530,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 ((rsp->gp_flags & RCU_GP_FLAG_INIT) &&
rcu_gp_init(rsp))