mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>, Davidlohr Bueso <dbueso@suse.de>,
	Hugh Dickins <hughd@google.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] futex: Remove unnecessary warning from get_futex_key
Date: Wed, 9 Aug 2017 16:31:52 +0100	[thread overview]
Message-ID: <20170809153152.eqbelk4mtot4cmzg@suse.de> (raw)
In-Reply-To: <20170809150834.ostlfg3kw2ecwlgf@hirez.programming.kicks-ass.net>

On Wed, Aug 09, 2017 at 05:08:34PM +0200, Peter Zijlstra wrote:
> On Wed, Aug 09, 2017 at 03:43:09PM +0100, Mel Gorman wrote:
> > On Wed, Aug 09, 2017 at 03:05:19PM +0100, Mark Rutland wrote:
> > > > diff --git a/kernel/futex.c b/kernel/futex.c
> > > > index 16dbe4c93895..f50b434756c1 100644
> > > > --- a/kernel/futex.c
> > > > +++ b/kernel/futex.c
> > > > @@ -670,13 +670,14 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
> > > >  		 * this reference was taken by ihold under the page lock
> > > >  		 * pinning the inode in place so i_lock was unnecessary. The
> > > >  		 * only way for this check to fail is if the inode was
> > > > -		 * truncated in parallel so warn for now if this happens.
> > > > +		 * truncated in parallel which is almost certainly an
> > > > +		 * application bug. In such a case, just retry.
> > > >  		 *
> > > >  		 * 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 still imply smp_mb(); (B).
> > > >  		 */
> > > > -		if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) {
> > > > +		if (!atomic_inc_not_zero(&inode->i_count)) {
> > > 
> > > I applied the same diff yesterday, and haven't seen anything go wrong
> > > with my test case and/or with Syzkaller running, so FWIW:
> > > 
> > > Tested-by: Mark Rutland <mark.rutland@arm.com>
> > > 
> > > Thanks for putting this together!
> > > 
> > 
> > No problem. FWIW, I had the test case running for 12 hours in a loop as
> > well and other than having to adjust the number of threads doing futex()
> > to trigger the warning without the patch, I observed no other problems.
> > If Thomas is happy, I hope this can be merged for 4.13 (or picked up
> > directly by Linus if he feels like it). Even if it's delayed, I'll resubmit
> > to -stable manually if the "Cc: stable" gets stripped along the way.
> 
> Probably best if Linus picks this up directly as Thomas is on holidays.
> 

Whoops, I had no idea. Primarily I wanted it go through Thomas under the
general heading of "if you screw up futex.c, Thomas will look for you and
he will find you". The patch in this case is trivial and enough people
have looked at it. Linus, can you pick it up directly please?

-- 
Mel Gorman
SUSE Labs

  reply	other threads:[~2017-08-09 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  7:27 Mel Gorman
2017-08-09 14:05 ` Mark Rutland
2017-08-09 14:43   ` Mel Gorman
2017-08-09 15:08     ` Peter Zijlstra
2017-08-09 15:31       ` Mel Gorman [this message]
2017-08-09 21:02         ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2017-08-09  6:21 Mel Gorman
2017-08-09  6:49 ` Davidlohr Bueso

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=20170809153152.eqbelk4mtot4cmzg@suse.de \
    --to=mgorman@suse.de \
    --cc=bigeasy@linutronix.de \
    --cc=dbueso@suse.de \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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

all inboxes | Powered by JetHome®