Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp637022imw; Wed, 13 Jul 2022 05:26:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uE5xgoeRjJdw8IxvgKQTS65I20y6MhMDEOoDw1pFdd+JDB+eX6ZNZQ3OaKBolnxXbVGoyg X-Received: by 2002:a17:90b:4d07:b0:1ef:521c:f051 with SMTP id mw7-20020a17090b4d0700b001ef521cf051mr9998423pjb.164.1657715216581; Wed, 13 Jul 2022 05:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657715216; cv=none; d=google.com; s=arc-20160816; b=LpuaqRmt82pR5/W6xtPFqXq9uo10JDex56FuCGPhDd080q176EVN5RZM+SOGoVoQp0 gqnRBFBPNrxCpsHP0NQjyp2+CrAu72Kn3JjaImrO2srGs4N72raGtbcriFix8vAkD6VD y0UrFwl+DH4Q9Obwbd1WhPrnhEl2akyd1rb3siAmCfW7Oxwk8W6g6UfijIfuotgzM+j2 ecphYd5+tEViL3pGZMA8qyMZzszJzd9rGg280Ocq9dvlEZKR2Ds1SyDBuhYoU1fmclFK Hb1xDMqF+dYEWgDFXZVw33xvBVAxBv5rdCEWuj7LK/GA2hTLZ3fo9IqdfPnuIpiB7E7z w0Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BYYELStWS2hN6y0lTADUOUo9y3x8GZgQvz5BQe8u10g=; b=b2403GtBkox5uFiHvFYd9iAEMAe4JufxUilUXms1woVD7SNeqtBvJ7K0QAZFj8xBuJ mDEk/DMNra10tHOCD1YzCmEdmNAP86bJ1QOCuWAbgeoFty1EaBL4terLV+j5pQ59OzUg BPtUJrle6Gw6+6fJeQdz/yObSLaEzvBcvCB1Q3GrcKEBQPHMy+B7ZnoiPtmGHERIYA2Q NLf/+uE5Q0RjiOpV20n8V+PefdXXJ/Hu1fdJwuYioYt+Beg+ZOGuInf8l+D7XD4VdBrs ehSaCU9E61gbixLfpNklMoEh92bRICnYznG4tzdWo3alOqsRiLz4fEWGmFbo1eJdZ4Rc 1OYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eGZTXGFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a63e556000000b004116ce26577si14885725pgj.798.2022.07.13.05.26.44; Wed, 13 Jul 2022 05:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eGZTXGFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236087AbiGMLqb (ORCPT + 99 others); Wed, 13 Jul 2022 07:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235725AbiGMLq2 (ORCPT ); Wed, 13 Jul 2022 07:46:28 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0BA010273C; Wed, 13 Jul 2022 04:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BYYELStWS2hN6y0lTADUOUo9y3x8GZgQvz5BQe8u10g=; b=eGZTXGFuiXmNipSFTnNbXYluEh 1LFJOQTJIEzwRokS/1RLy+u2v5hbNyVhM844nZB1XkIEiTuPnUMXDD87S0d5hy+ok/KuYzVcoqdRp h0VGOmgymZd2sM0LxJj0T168PXgRz4nSBzBAET+klvgQNwrMFDTdP4A/G9sIBH60eIaHJn0W1Jegt rV6/JRIPfwEEKhhKY98nQIagYlQHor+z7DzT9GFnIkJXf4NJg6a6//06ejEGiv8RaZszCP1Y3f3Dm 4UnOfFAM+uaJ5+fN4A4+m2Eqgbr0rB3DQx74NhCr7ZHtchzMuk9mnhp6Soao7V/fJoxD7iKMBlDbW LOR54l8w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBaoo-0088q2-9R; Wed, 13 Jul 2022 11:46:14 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 84AF3300110; Wed, 13 Jul 2022 13:46:11 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 45DBD20D74F04; Wed, 13 Jul 2022 13:46:11 +0200 (CEST) Date: Wed, 13 Jul 2022 13:46:11 +0200 From: Peter Zijlstra To: Juri Lelli Cc: LKML , linux-rt-users , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Subject: Re: [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks Message-ID: References: <20220713075014.411739-1-juri.lelli@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220713075014.411739-1-juri.lelli@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022 at 09:50:14AM +0200, Juri Lelli wrote: > Tasks the are being deboosted from SCHED_DEADLINE might enter > enqueue_task_dl() one last time and hit an erroneous BUG_ON condition: > since they are not boosted anymore, the if (is_dl_boosted()) branch is > not taken, but the else if (!dl_prio) is and inside this one we > BUG_ON(!is_dl_boosted), which is of course false (BUG_ON triggered) > otherwise we had entered the if branch above. Long story short, the > current condition doesn't make sense and always leads to triggering of a > BUG. > > Fix this by only checking enqueue flags, properly: ENQUEUE_REPLENISH has > to be present, but additional flags are not a problem. > > Fixes: 2279f540ea7d ("sched/deadline: Fix priority inheritance with multiple scheduling classes") > Signed-off-by: Juri Lelli > --- > kernel/sched/deadline.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index 5867e186c39a..0447d46f4718 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -1703,7 +1703,7 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags) > * the throttle. > */ > p->dl.dl_throttled = 0; > - BUG_ON(!is_dl_boosted(&p->dl) || flags != ENQUEUE_REPLENISH); > + BUG_ON(!(flags & ENQUEUE_REPLENISH)); While there, can we perhaps make it less fatal?