lkml.org 
[lkml]   [2015]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sched: remove false-positive warning from wake_up_process()
From
Date
On 11/30/2015 08:47 PM, Linus Torvalds wrote:
> On Mon, Nov 30, 2015 at 5:34 PM, Sasha Levin <sasha.levin@oracle.com> wrote:
>> Futex can have a spurious wake up before we actually wake it up on our own,
>> which will trigger this warning if the task is still stopped.
>
> Actually, I think it would presumably be the other way around: a
> spurious stale futex wakeup happens *after* the process has been woken
> up for some other reason and moved to stopped state.
>
> (The "wake up and move to stopped state" could be for the same reason:
> a SIGSTOP signal).
>
> So the setup is presumably something like this:
>
> - on cpu1: futex code is about to go to sleep, adds itself to the
> futex hash chains, but then gets interrupted by a SIGSTOP
>
> - in the meantime, on cpu2, the futex is changed, and the wakup code
> sees the process from cpu1 on the futex hash chains
>
> - on cpu1, the process has now removed itself from the hash chains,
> and goes through the signal code that sets the state to STOPPED
>
> - in the meantime, on cpu2, the futex code now gets around to waking
> things up, and sees that stopped state
>
> Roughly.

What would the correct behaviour in that case be?

Does waking up the task while it is being traced, and ptrace
(or gdb) is not expecting a wakeup, break the tracing?

--
All rights reversed


\
 
 \ /
  Last update: 2015-12-01 04:01    [W:0.096 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site