public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>,
	"open list:READ-COPY UPDATE..." <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/1] kernel/rcu/tree.c: correct a check for grace period in progress
Date: Tue, 10 Jun 2014 21:42:42 -0700	[thread overview]
Message-ID: <20140611044242.GY4581@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAJhHMCCgXBCe-deg7TtqA-azyc2ZvQRLKAiKVJ5OhL5GzLhH0w@mail.gmail.com>

On Wed, Jun 11, 2014 at 12:23:57AM -0400, Pranith Kumar wrote:
> Hi Paul,
> 
> On Wed, Jun 11, 2014 at 12:12 AM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> >>       if (rnp->gpnum != rnp->completed ||
> >> -         ACCESS_ONCE(rnp->gpnum) != ACCESS_ONCE(rnp->completed)) {
> >> +         ACCESS_ONCE(rnp_root->gpnum) != ACCESS_ONCE(rnp_root->completed)) {
> >
> > At this point in the code, we are checking the current rcu_node structure,
> > which might or might not be the root.  If it is not the root, we absolutely
> > cannot compare against the root because we don't yet hold the root's lock.
> >
> 
> I was a bit thrown by the double checking which is being done
> (rnp->gpnum != rnp->complete) in that if condition. Once without
> ACCESS_ONCE and one with. Is there any particular reason for this?
> 
> I now understand that we are comparing ->gpnum and ->completed of the
> root node which might change from under us if we don't hold the root's
> lock. I will keep looking :)

Hmmm...  Now that you mention it, that does look a bit strange.

							Thanx, Paul


  reply	other threads:[~2014-06-11  4:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  3:20 [RFC PATCH 1/1] kernel/rcu/tree.c: correct a check for grace period in progress Pranith Kumar
2014-06-11  4:12 ` Paul E. McKenney
2014-06-11  4:23   ` Pranith Kumar
2014-06-11  4:42     ` Paul E. McKenney [this message]
2014-06-11 18:18       ` Paul E. McKenney
2014-06-11 18:34         ` Pranith Kumar

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=20140611044242.GY4581@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=bobby.prani@gmail.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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