[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <566B0E76.9020704@arm.com>
Date: Fri, 11 Dec 2015 17:57:10 +0000
From: Vladimir Murzin <vladimir.murzin@....com>
To: Peter Zijlstra <peterz@...radead.org>, Paul Turner <pjt@...gle.com>
CC: NeilBrown <nfbrown@...ell.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
Mike Galbraith <efault@....de>, Ingo Molnar <mingo@...nel.org>,
Peter Anvin <hpa@...or.com>, linux-tip-commits@...r.kernel.org,
jstancek@...hat.com, Oleg Nesterov <oleg@...hat.com>
Subject: Re: [tip:locking/core] sched/wait: Fix signal handling in bit wait
helpers
On 11/12/15 11:39, Peter Zijlstra wrote:
> 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@...gle.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@...ns.programming.kicks-ass.net
>
By this time my test has been run ~500 times without any stalls. I'll
keep running overnight (just in case), but I think that patch can be
marked as tested.
Cheers
Vladimir
>
> Thanks!
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists