LKML Archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Mel Gorman <mgorman@techsingularity.net>,
	Peter Zijlstra <peterz@infradead.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: Fri, 5 Feb 2016 10:44:42 +0100	[thread overview]
Message-ID: <20160205094441.GB7551@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1602041845280.25254@nanos>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> 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.

So I too didn't understand that sentence at first, because the capitalization 
really throws off quick parsing of that comment, as 'MB' ususally denotes 
megabytes.

So please change it to "mb(); (A)" or so - and I think all of these comments 
should be changed to use a standard API name for the barrier they imply, as the 
head of futex.c does:

 *   waiters++; (a)
 *   mb(); (A) <-- paired with -.
 *                              |
 *   lock(hash_bucket(futex));  |
 *                              |
 *   uval = *futex;             |
 *                              |        *futex = newval;
 *                              |        sys_futex(WAKE, futex);
 *                              |          futex_wake(futex);
 *                              |
 *                              `------->  mb(); (B)

Btw., pedantic: shouldn't that be smp_mb()? Futexes don't operate on IO spaces, so 
on UP they only need compiler barriers.

Thanks,

	Ingo

  reply	other threads:[~2016-02-05  9:44 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
2016-02-05  9:44       ` Ingo Molnar [this message]
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=20160205094441.GB7551@gmail.com \
    --to=mingo@kernel.org \
    --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=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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).