LKML Archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Mel Gorman <mgorman@techsingularity.net>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Chris Mason <clm@fb.com>, Darren Hart <dvhart@linux.intel.com>,
	Hugh Dickins <hughd@google.com>,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>,
	Mel Gorman <mgorman@suse.de>
Subject: Re: [PATCH v5] futex: Remove requirement for lock_page in get_futex_key
Date: Thu, 4 Feb 2016 18:50:07 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1602041845280.25254@nanos> (raw)
In-Reply-To: <20160204174343.GA12375@linux-uzut.site>

On Thu, 4 Feb 2016, Davidlohr Bueso wrote:

> On Thu, 04 Feb 2016, Thomas Gleixner wrote:
> 
> > On Wed, 3 Feb 2016, Davidlohr Bueso wrote:
> > > +		 * We are not calling into get_futex_key_refs() in file-backed
> > > +		 * cases, therefore a successful atomic_inc return below will
> > > +		 * guarantee that get_futex_key() will continue to imply MB
> > > (B).
> > 
> > Can you please make that "MB (B)" part a bit more outstanding. I really had
> > to
> > search for it.
> 
> Hmm as you know this is mostly explained at the begining of the file, and we
> sprinkle MB (B) around the code based on that description. So I'm a bit
> confused
> as to why you don't like like that comment.

The other "MB (B)" places are more outstanding. It did not spring in my eye
immideately. So it's a pure cosmetic issue.

> > > +		 */
> > > +		if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) {
> > > +			rcu_read_unlock();
> > > +			put_page(page);
> > > +
> > > +			goto again;
> > > +		}
> > 
> > Don't we need
> > 
> > 		smp_mb__after_atomic();
> > 
> > here to make it a full barrier on all architectures?
> 
> I had this initially but, as Peter mentioned, we get that barrier with the
> successful atomic_inc_not_zero call anyway. Or is it something else you had
> in mind?

Oh. I missed that comment from Peter. And yes, I missed that
atomic_inc_not_zero() already has the barrier in the success case. :(

Thanks,

	tglx

  reply	other threads:[~2016-02-04 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04  6:28 [PATCH v5] futex: Remove requirement for lock_page in get_futex_key Davidlohr Bueso
2016-02-04  9:06 ` Thomas Gleixner
2016-02-04 17:43   ` Davidlohr Bueso
2016-02-04 17:50     ` Thomas Gleixner [this message]
2016-02-05  9:44       ` Ingo Molnar
2016-02-05 18:02         ` Davidlohr Bueso
2016-02-06  8:22           ` Ingo Molnar

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=alpine.DEB.2.11.1602041845280.25254@nanos \
    --to=tglx@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=clm@fb.com \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=dvhart@linux.intel.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).