From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755589AbbLACso (ORCPT ); Mon, 30 Nov 2015 21:48:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42998 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754804AbbLACsn (ORCPT ); Mon, 30 Nov 2015 21:48:43 -0500 Subject: Re: [PATCH] sched: remove false-positive warning from wake_up_process() To: Linus Torvalds , Sasha Levin References: <1448933660-23082-1-git-send-email-sasha.levin@oracle.com> Cc: Ingo Molnar , Peter Zijlstra , Linux Kernel Mailing List , Oleg Nesterov From: Rik van Riel Message-ID: <565D0A88.5060902@redhat.com> Date: Mon, 30 Nov 2015 21:48:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/30/2015 08:47 PM, Linus Torvalds wrote: > On Mon, Nov 30, 2015 at 5:34 PM, Sasha Levin 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