Skip to content

Commit

Permalink
rcu: using ACCESS_ONCE() to observe the jiffies_stall/rnp->qsmask value
Browse files Browse the repository at this point in the history
Using ACCESS_ONCE() to observe the jiffies_stall/rnp->qsmask value
due to the caller didn't hold the root_rcu/rnp node's lock.  Although
use without ACCESS_ONCE() is safe due to the value loaded being used
but once, the ACCESS_ONCE() is a good documentation aid -- the variables
are being loaded without the services of a lock.

Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
CC: Dipankar Sarma <dipankar@in.ibm.com>
CC: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  • Loading branch information
Dongdong Deng authored and Paul E. McKenney committed Oct 7, 2010
1 parent b0a0f66 commit 4ee0a60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/rcutree.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,9 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)

if (rcu_cpu_stall_suppress)
return;
delta = jiffies - rsp->jiffies_stall;
delta = jiffies - ACCESS_ONCE(rsp->jiffies_stall);
rnp = rdp->mynode;
if ((rnp->qsmask & rdp->grpmask) && delta >= 0) {
if ((ACCESS_ONCE(rnp->qsmask) & rdp->grpmask) && delta >= 0) {

/* We haven't checked in, so go dump stack. */
print_cpu_stall(rsp);
Expand Down

0 comments on commit 4ee0a60

Please sign in to comment.