mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dongdong Deng <dongdong.deng@windriver.com>
To: paulmck@linux.vnet.ibm.com, dipankar@in.ibm.com
Cc: linux-kernel@vger.kernel.org, dongdong.deng@windriver.com
Subject: [RFC PATCH] rcu: using ACCESS_ONCE() to observe the jiffies_stall/rnp->qsmask value
Date: Tue, 28 Sep 2010 16:32:43 +0800	[thread overview]
Message-ID: <1285662763-16748-1-git-send-email-dongdong.deng@windriver.com> (raw)

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.

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>
---
 kernel/rcutree.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index d5bc439..07a7063 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -532,9 +532,9 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
 
 	if (rcu_cpu_stall_panicking)
 		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);
-- 
1.6.0.4


             reply	other threads:[~2010-09-28  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  8:32 Dongdong Deng [this message]
2010-09-28 23:28 ` Paul E. McKenney
2010-09-29  6:46   ` DDD
2010-10-07  0:43     ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285662763-16748-1-git-send-email-dongdong.deng@windriver.com \
    --to=dongdong.deng@windriver.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®