From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756481AbcIVIgp (ORCPT ); Thu, 22 Sep 2016 04:36:45 -0400 Received: from mx2.suse.de ([195.135.220.15]:58130 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755990AbcIVIgm (ORCPT ); Thu, 22 Sep 2016 04:36:42 -0400 Date: Thu, 22 Sep 2016 10:36:37 +0200 From: Jan Kara To: Peter Zijlstra Cc: Petr Mladek , Matt Fleming , Ingo Molnar , Byungchul Park , Frederic Weisbecker , Luca Abeni , Rik van Riel , Thomas Gleixner , Wanpeng Li , Yuyang Du , Jan Kara , Sergey Senozhatsky , linux-kernel@vger.kernel.org, Mel Gorman , Mike Galbraith Subject: Re: [PATCH v2 7/7] sched/core: Add debug code to catch missing update_rq_clock() Message-ID: <20160922083637.GE2834@quack2.suse.cz> References: <20160921133813.31976-1-matt@codeblueprint.co.uk> <20160921133813.31976-8-matt@codeblueprint.co.uk> <20160921155826.GB8408@pathway.suse.cz> <20160922080436.GX5008@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160922080436.GX5008@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 22-09-16 10:04:36, Peter Zijlstra wrote: > On Wed, Sep 21, 2016 at 05:58:27PM +0200, Petr Mladek wrote: > > > +static inline void assert_clock_updated(struct rq *rq) > > > +{ > > > +#ifdef CONFIG_SCHED_DEBUG > > > + /* > > > + * The only reason for not seeing a clock update since the > > > + * last rq_pin_lock() is if we're currently skipping updates. > > > + */ > > > + WARN_ON_ONCE(rq->clock_update_flags < RQCF_ACT_SKIP); > > > +#endif > > > +} > > > > I am afraid that it might eventually create a deadlock. > > For example, there is the following call chain: > > > > Yeah, meh. There's already plenty WARNs in the sched code. The idea of > course being that they should not trigger. If they do, something > buggered already, so who bloody cares about a deadlock later ;-) Yeah, the trouble is that you usually won't see the WARN message before deadlocking. So WARN_ON in scheduler is usually equivalent to if (condition) while (1); ;) Not really helping debugging much... Honza -- Jan Kara SUSE Labs, CR