Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7867977ybl; Thu, 16 Jan 2020 06:57:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwCi2chfiVANIPMYQfNukZIGzHfpe8XBtJqCpe+BEcL5UQxBPu2SU981aN3FYERS3iBi85X X-Received: by 2002:aca:b183:: with SMTP id a125mr4353265oif.83.1579186644565; Thu, 16 Jan 2020 06:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579186644; cv=none; d=google.com; s=arc-20160816; b=USAfIQUpIA80XKEUjRSEH+zr2DkRxQg3pzxutCIQEbs9KkYJ1JsBsmNjuH97Cih86h 9C+HprQgSPqJah6FBYdamYvJ+Hkhiuu2mq54qEkddhksak4r7SAv6zMR57XDH82fHwdr k2bPOnZsWnZa4w/WgE2NP1WnxjnAGAt0TuIaLHIFcnJHyMeD9JHTXlNfwx3sUSiAGtAd wSxjjmZN1CS47xLyDwV6NRXz4YJaUbBN6qbaZNTwluVTIm+tSh+RanyboPTLkXUZ/bsd D0am7YqjT93khX7kV0Is6gcmWea08t9rS0rM6833o0WXlB1VB78C85+117VzdOFbnIQU RXAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=DYRBWrdo5W53j583yN9S7Ecmo+0UR6LgNI9w+wJ2RIE=; b=qggEdatJ7g9aEoSaydRRhJorNe/Jhe9HOHDFec64anHPVZGd0y7PDOVj756yAnH0/t lLjWwzrpPpUzj9Mpyucaj3Nm7Xg0PLOk+/lteRNG4ecvQ0oXMJuRjH67CRPTlI7DfAi1 VHScY1Wi8AvRqfkIyvXql291zj/6U3ZMpr/IJS0ByEvmXfPVBWSowoQi1vmIEuZJcULd VdveWhldwruEFNCMpyJwwG2RPb4OD2KGv6BPxpKueTw8Jl2rgm9vXA6mkdGb5Yhb+dvg hnP2I9khwkTDuFglmGYa/tB3kc3jwT0A2oKmX8P3EvlQW7D6wfhE0+b3G1oGkkogPV1r cU0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si12979347otn.110.2020.01.16.06.57.11; Thu, 16 Jan 2020 06:57:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbgAPOzK (ORCPT + 99 others); Thu, 16 Jan 2020 09:55:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:42088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbgAPOzK (ORCPT ); Thu, 16 Jan 2020 09:55:10 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5B73820748; Thu, 16 Jan 2020 14:55:08 +0000 (UTC) Date: Thu, 16 Jan 2020 09:55:07 -0500 From: Steven Rostedt To: Alexander Popov Cc: Linus Torvalds , John Stultz , Thomas Gleixner , Stephen Boyd , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org, notify@kernel.org Subject: Re: [PATCH 1/1] timer: Warn about schedule_timeout() called for tasks in TASK_RUNNING state Message-ID: <20200116095507.6f164a0a@gandalf.local.home> In-Reply-To: <20200116095220.7368a604@gandalf.local.home> References: <20200116140218.1328022-1-alex.popov@linux.com> <20200116095220.7368a604@gandalf.local.home> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 16 Jan 2020 09:52:20 -0500 Steven Rostedt wrote: > > --- a/kernel/time/timer.c > > +++ b/kernel/time/timer.c > > @@ -1887,6 +1887,11 @@ signed long __sched schedule_timeout(signed long timeout) > > } > > } > > > > +#ifdef CONFIG_SCHED_DEBUG > > + WARN_ONCE(current->state == TASK_RUNNING, > > + "schedule_timeout for TASK_RUNNING\n"); > > +#endif > > + > > But this can trigger false warnings. For example, if we are waiting on > an event with a timeout: Also, there are helpers here that you can use: schedule_timeout_interruptible(signed long timeout); schedule_timeout_uninterruptible(signed long timeout) -- Steve