Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp339850imi; Thu, 21 Jul 2022 01:48:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tdMJTvYmSCJ/TTyVV2KfS8KVGDu2TQs6IzJfDQZ4J/A/fMaOLfyCg1r+84bIZjUBMjP5Hv X-Received: by 2002:a17:907:9810:b0:72f:36e5:266c with SMTP id ji16-20020a170907981000b0072f36e5266cmr17482921ejc.105.1658393314737; Thu, 21 Jul 2022 01:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658393314; cv=none; d=google.com; s=arc-20160816; b=aFnBmXQ4gKWB8086bD6ayFWa3MXjjU5n9TTZF8bEHG4ZHefleW8kSclpBShxfQ1ujZ 3OczU2xxptV2wNWgVVT8hSOWef4D0zXslG4E3nwUcR+sc7aTx6NUFr3CfvCxavVBmXbc 7SyoHUE0bdUs9bns43QTedZOuBAVV66TxFdJ7jwajaFbMQAi8NIX/+oGD7UJ+u09ZfbQ 6dm004pMsF+oGCN1EitWT4NQQGFLQrOt20t39a72iWfImiFzjQz0K6nQ933kj9JnuC6d slBSsMzA+p7SGGl9bDCcSgrfGgaSlkoJAsA7ClYWR1+MolbR6ws1B1hWTVGhr6UQzC/X kBFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=+Tqoe9ErZGuiOGQOEuxZHvru68/1En7mH71iUA7ma28=; b=fZKvI/y/jO7pO+rrYrBSJvsbGXNc4tLFNe3P85cNGtXHqVTd9x9URZg1uBMWEQTRWv IkuU0ERY6YFiVpesj0m/Wd7NyWn0oFqm1pdOxYC28uo2slQ0AAVI1HiIJvQHLIsTY1m3 oN12Rz3GGabW8eY+WolUzPljoduAuRpiNpQvukjD80zeLK6zEjgO8QvPl8WlAqPLrw1M jIzZM9IJRCju5kRBEKpoWtZTX8idtRTCgT55eE/iWkaheY6FaIpdUCAcZ5eU0Ukp+Egl jM3a6NRXHCwdXiVEV+EtqRdJPnCnJJIYsw3sBkUdBUquUUu8ef0Cgggjk51L8TDstcSM 3agg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QRt18Ufw; dkim=neutral (no key) header.i=@linutronix.de header.b=xUMbUfaY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id er14-20020a056402448e00b0043bb71edd37si1317035edb.135.2022.07.21.01.48.09; Thu, 21 Jul 2022 01:48:34 -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=@linutronix.de header.s=2020 header.b=QRt18Ufw; dkim=neutral (no key) header.i=@linutronix.de header.b=xUMbUfaY; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230170AbiGUIpL (ORCPT + 99 others); Thu, 21 Jul 2022 04:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232576AbiGUIo7 (ORCPT ); Thu, 21 Jul 2022 04:44:59 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BADD97FE65; Thu, 21 Jul 2022 01:44:53 -0700 (PDT) Date: Thu, 21 Jul 2022 08:44:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658393092; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Tqoe9ErZGuiOGQOEuxZHvru68/1En7mH71iUA7ma28=; b=QRt18Ufw/Qttk5f8bvFnRsELPpe3479JGU1AYFbDVFvjE8PFLgWq319lw4BX+3RToAo7sn n+iV5pcBIUWuEHVF+rLz6iF/d8Ao7Mt4lfuGFQ2woh8n6dMBIqi4oUuLx/0a6pP/g91aBP VlO6eoIOp/jqTXOHPdvitca3oOg5l4tSCE25Y27/F7hhdfzZsi4eAvqEuR6tqm2TccYAe7 PBKnoauWRX1i1f4QfwWjOA9V2b16i4cKseRGeeRZ44HrDgZVlrw00LR5cdQctJo5WZ9V6W 2+8YRWj3x/H1dAmj+J5wW+opB1Mf5F6eFYPjrygxIC1nRSDTkxXWmkdyMAbzGg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658393092; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Tqoe9ErZGuiOGQOEuxZHvru68/1En7mH71iUA7ma28=; b=xUMbUfaY4vlLgOxG08vILuuaE9BM8TRoCgsqiFMloRWVAX/JbulvcL9/WcGninuVydI/Cb ptGavNu6G5wRr3AQ== From: "tip-bot2 for Juri Lelli" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/urgent] sched/deadline: Fix BUG_ON condition for deboosted tasks Cc: Juri Lelli , "Peter Zijlstra (Intel)" , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220714151908.533052-1-juri.lelli@redhat.com> References: <20220714151908.533052-1-juri.lelli@redhat.com> MIME-Version: 1.0 Message-ID: <165839309101.15455.13532699965942868865.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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_PASS 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 The following commit has been merged into the sched/urgent branch of tip: Commit-ID: ddfc710395cccc61247348df9eb18ea50321cbed Gitweb: https://git.kernel.org/tip/ddfc710395cccc61247348df9eb18ea50321cbed Author: Juri Lelli AuthorDate: Thu, 14 Jul 2022 17:19:08 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 21 Jul 2022 10:35:28 +02:00 sched/deadline: Fix BUG_ON condition for deboosted tasks 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: 64be6f1f5f71 ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity") Signed-off-by: Juri Lelli Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220714151908.533052-1-juri.lelli@redhat.com --- kernel/sched/deadline.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index b515296..7bf5612 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1701,7 +1701,10 @@ 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); + if (!(flags & ENQUEUE_REPLENISH)) + printk_deferred_once("sched: DL de-boosted task PID %d: REPLENISH flag missing\n", + task_pid_nr(p)); + return; }