All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Turner <pjt@google.com>, NeilBrown <nfbrown@novell.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Mike Galbraith <efault@gmx.de>, Ingo Molnar <mingo@kernel.org>,
	Peter Anvin <hpa@zytor.com>,
	vladimir murzin <vladimir.murzin@arm.com>,
	linux-tip-commits@vger.kernel.org,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [tip:locking/core] sched/wait: Fix signal handling in bit wait helpers
Date: Fri, 11 Dec 2015 08:08:36 -0500 (EST)	[thread overview]
Message-ID: <285059043.27110857.1449839316960.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20151211113959.GI6356@twins.programming.kicks-ass.net>





----- Original Message -----
> From: "Peter Zijlstra" <peterz@infradead.org>
> To: "Paul Turner" <pjt@google.com>
> Cc: "NeilBrown" <nfbrown@novell.com>, "Linus Torvalds" <torvalds@linux-foundation.org>, "Thomas Gleixner"
> <tglx@linutronix.de>, "LKML" <linux-kernel@vger.kernel.org>, "Mike Galbraith" <efault@gmx.de>, "Ingo Molnar"
> <mingo@kernel.org>, "Peter Anvin" <hpa@zytor.com>, "vladimir murzin" <vladimir.murzin@arm.com>,
> linux-tip-commits@vger.kernel.org, jstancek@redhat.com, "Oleg Nesterov" <oleg@redhat.com>
> Sent: Friday, 11 December, 2015 12:39:59 PM
> Subject: Re: [tip:locking/core] sched/wait: Fix signal handling in bit wait helpers
> 
> On Fri, Dec 11, 2015 at 03:30:33AM -0800, Paul Turner wrote:
> 
> > > Blergh, all I've managed to far is to confuse myself further. Even
> > > something like the original (+- the EINTR) should work when we consider
> > > the looping, even when mixed with an occasional spurious wakeup.
> > >
> > >
> > > int bit_wait()
> > > {
> > >         if (signal_pending_state(current->state, current))
> > >                 return -EINTR;
> > >         schedule();
> > > }
> 
> So I asked Vladimir to test that (simply changing the return from 1 to
> -EINTR) and it made his fail much less likely but it still failed in the
> same way.
> 
> So I'm fairly sure I'm still missing something :/
> 
> > Hugh asked me about this after seeing a crash, here's another exciting
> > way in which the current code breaks -- this one actually quite
> > serious:
> 
> Yep, this got reported by Jan and I did kick myself for that.
> 
> > Peter's proposed follow-up above looks strictly more correct.  We need
> > to evaluate the potential existence of a signal, *after* we return
> > from schedule, but in the context of the state which we previously
> > _entered_ schedule() on.
> > 
> > Reviewed-by: Paul Turner <pjt@google.com>
> 
> Right, its maybe a bit overkill, but at this point I'm a tad
> conservative/paranoid.
> 
> Vladimir, Jan could you both please that patch?
> 
>  lkml.kernel.org/r/20151208104712.GJ6356@twins.programming.kicks-ass.net

This appears to exactly match patch I tested against v4.4-rc4 here:
  http://marc.info/?l=linux-mm&m=144950957622869&w=2

Anyway, I repeated the test with v4.4-rc4-113-g0bd0f1e as base.
Results look good. With patch applied, I can't trigger
"kernel BUG at mm/filemap.c:238!" anymore.

Regards,
Jan

> 
> 
> Thanks!
> 
> 
> 

  parent reply	other threads:[~2015-12-11 13:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 15:35 [BISECTED] rcu_sched self-detected stall since 3.17 Vladimir Murzin
2015-11-20 15:35 ` Vladimir Murzin
2015-11-20 15:35 ` Vladimir Murzin
2015-12-01 11:50 ` Vladimir Murzin
2015-12-01 11:50   ` Vladimir Murzin
2015-12-01 11:50   ` Vladimir Murzin
2015-12-01 13:04 ` Peter Zijlstra
2015-12-01 13:04   ` Peter Zijlstra
2015-12-01 13:04   ` Peter Zijlstra
2015-12-02  9:04   ` Vladimir Murzin
2015-12-02  9:04     ` Vladimir Murzin
2015-12-02  9:04     ` Vladimir Murzin
2015-12-04 11:52   ` [tip:locking/core] sched/wait: Fix signal handling in bit wait helpers tip-bot for Peter Zijlstra
2015-12-08 10:47     ` Peter Zijlstra
2015-12-09  1:06       ` NeilBrown
2015-12-09  7:40         ` Peter Zijlstra
2015-12-09 21:30           ` NeilBrown
2015-12-10 13:09             ` Peter Zijlstra
2015-12-11 11:30               ` Paul Turner
2015-12-11 11:39                 ` Peter Zijlstra
2015-12-11 11:53                   ` Vladimir Murzin
2015-12-11 13:08                   ` Jan Stancek [this message]
2015-12-11 13:22                     ` Peter Zijlstra
2015-12-11 17:57                   ` Vladimir Murzin
2015-12-15 18:16                   ` Oleg Nesterov
2015-12-15 19:01                 ` Oleg Nesterov
2015-12-15 16:56   ` [BISECTED] rcu_sched self-detected stall since 3.17 Oleg Nesterov
2015-12-15 16:56     ` Oleg Nesterov
2015-12-15 16:56     ` Oleg Nesterov

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=285059043.27110857.1449839316960.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nfbrown@novell.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vladimir.murzin@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.