Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754643AbbLADOG (ORCPT ); Mon, 30 Nov 2015 22:14:06 -0500 Received: from mail-ig0-f171.google.com ([209.85.213.171]:37596 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930AbbLADOD (ORCPT ); Mon, 30 Nov 2015 22:14:03 -0500 MIME-Version: 1.0 In-Reply-To: <565D0A88.5060902@redhat.com> References: <1448933660-23082-1-git-send-email-sasha.levin@oracle.com> <565D0A88.5060902@redhat.com> Date: Mon, 30 Nov 2015 19:14:02 -0800 X-Google-Sender-Auth: 9mvuINhXc3WxZaPkusmf5CWzDIQ Message-ID: Subject: Re: [PATCH] sched: remove false-positive warning from wake_up_process() From: Linus Torvalds To: Rik van Riel Cc: Sasha Levin , Ingo Molnar , Peter Zijlstra , Linux Kernel Mailing List , Oleg Nesterov Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1390 Lines: 33 On Mon, Nov 30, 2015 at 6:48 PM, Rik van Riel wrote: > > 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? It would. We already do the right thing (thanks to that commit 9067ac85d533), namely just ignore the spurious wakeup. Basically, all "normal" wait events have to be in a loop around the event condition because of spurious wakeups like this, and they already are (ie helpers like "wait_event()" etc do the right thing, and in general it's actually fairly hard to do the wrong thing). And special things like TASK_STOPPED now only get woken up by properly serialized things that are supposed to wake them up. So we're ok. It's just that the sanity check WARN_ON() was racily too eager to warn about mis-use. The warning was *meant* to trigger in case somebody depended on the old broken behavior of "wake_up_process() wakes up anything" that the code moved away from. But the warning also triggered for this race condition, that was actually fixed by the commit in question. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/