Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp443474imw; Wed, 13 Jul 2022 01:05:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJpnShWa1hQ/2fJU79gELw5h1EnVguwGtNavlhE8lUckYSsflksSR2ad9GlhvLrt8BTXBe X-Received: by 2002:a65:49c8:0:b0:415:e89d:ea1a with SMTP id t8-20020a6549c8000000b00415e89dea1amr1980112pgs.266.1657699555769; Wed, 13 Jul 2022 01:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657699555; cv=none; d=google.com; s=arc-20160816; b=WM8XCrW+lntw/8loZ9np5KXoE5NX+oehGlOQjENNTE+ru4GmZDq65Y8M9UPenYZBH3 VoULmzevBBkZB4UJxpCCVYk8N1M2wmRm4J9+lxEwnPeWJ9QfnZEKsnv49Gc0Symc8WLi ro2MrMNFGzCwCp5/q/oXNjCMC20QwaL+vuDcDeI0xaqt9LcNIudQTT9XmKWqMi206rPR OxIxfwrEBRc2rZKKuZyPUV5pewfq+Vs5fcM8iSGH3WuDd2SBDOHcudW+AEb6lZRQiIVS oATPQo88ZHeqSwWRtf9jrbwNEFLigPnvRVnu6QssBnnybqBvh/wZcaVTy32dFtgcvj7a m1QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UUUAyRjzYTQJMt+N0hTGhBJ/lch625duUKNPGtSQaX4=; b=S77RMeZuWDoKun07RisG2tYPp1j7O3+7sSHHOd7Wr07HcQemtc/Re3zZ9f/Z9RPm+K tgHZn4qgfpWKrQlOuAJDvbyNl8Zxc5Zm1nFoTj0DqnuOShctWJKJV3Jf0dzqOfFgeZJ9 8nQ1qahum2gkAB0Qj2TID7pCbD7POtyaCVzCL/lrtjhFgdguxGorkSw106AY85nHepPj YyFsQ311I/F62qWq5lVEijeq1sRhoFoO9Mo1xJNsoMtN3VXbRSOj1BZ2DzkW5qgv4mJI S5Z6nvqRHNFv7TPjAnXXVCetB7sQgBU4Yi+bb/JrGDlukcD7MwpboXd71xi3zq6HiszO msow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RxKzGtlF; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o24-20020a63f158000000b00412b40ea629si15884152pgk.502.2022.07.13.01.05.40; Wed, 13 Jul 2022 01:05:55 -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=@redhat.com header.s=mimecast20190719 header.b=RxKzGtlF; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234541AbiGMHus (ORCPT + 99 others); Wed, 13 Jul 2022 03:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233765AbiGMHuq (ORCPT ); Wed, 13 Jul 2022 03:50:46 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D574B313A4 for ; Wed, 13 Jul 2022 00:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657698643; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UUUAyRjzYTQJMt+N0hTGhBJ/lch625duUKNPGtSQaX4=; b=RxKzGtlFqBQxL5g6hDySHpSI/8Cl1YWx4VuZMX2h6VXuHyroT2tJkecROBSq98L/uAhz+1 1/DaDd7udqJWA5pW8xTFutbqkt+50hA3wnwXpE4bmmMIYGA++dxrvZQn5g3ueEjG3UfNYk YLi5PFRVYn65vZ7zs5G53O+5nOwNWYA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-394-bTeqqciWMX23RezB32E6HA-1; Wed, 13 Jul 2022 03:50:39 -0400 X-MC-Unique: bTeqqciWMX23RezB32E6HA-1 Received: by mail-wm1-f70.google.com with SMTP id a6-20020a05600c348600b003a2d72b7a15so711421wmq.9 for ; Wed, 13 Jul 2022 00:50:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UUUAyRjzYTQJMt+N0hTGhBJ/lch625duUKNPGtSQaX4=; b=yi28+s1tmAsSZ97VJIiC6gmg9VZqHIf6YGrNugJtBUEzd13wlMzPueaMnXTqgGNIjV 1wEWMaA1asVhIzXMKOxhCDYhXH2kGDT58PuUpK00LLQEf62mQ8Ni1N3Z8FzYiut3CkQH ot7de1Ud8IH3MLLulesaJ1XSuZQAG+eiSJlw4qliADLKCa0BkpS2MwEZvXjflFxdhBn7 XqriN3KIwjzhx9H5vzgLWqLaaY+aNtjr9B+z/+1bWtmgFbOq00BeyV9YFIhb1poGHMFF mzzbbEO9sJP3+gyE2T/wmlwgRLTOFs5LJSmQn8k2BY+E/DJY6ugeevfbHpv9CtDEVAmS PNCA== X-Gm-Message-State: AJIora+frCwNeRs5wgD9AAY2Btf/PPY7MOIW0moLhRUgF7xwS6lmFWbd TdXyBwnuqI6xsrnSHuMfm1YJ43SfkXlelYkRCNZFJlVwp7yi0rXZKFA2BXB5m1yY2wf5X7G5K9Z Ohh9pR/TSHKp7uHY06d9N6PHNkCgwKKC+aEwrsGKvy92zVLTqgVUT0/8pw3B3LDAlgMWhsfeV3x iMPzQ= X-Received: by 2002:a05:6000:12c8:b0:21d:6913:89af with SMTP id l8-20020a05600012c800b0021d691389afmr1868516wrx.546.1657698638250; Wed, 13 Jul 2022 00:50:38 -0700 (PDT) X-Received: by 2002:a05:6000:12c8:b0:21d:6913:89af with SMTP id l8-20020a05600012c800b0021d691389afmr1868479wrx.546.1657698637897; Wed, 13 Jul 2022 00:50:37 -0700 (PDT) Received: from localhost.localdomain.com ([151.29.54.26]) by smtp.gmail.com with ESMTPSA id c10-20020adffb4a000000b0021db7b0162esm2220413wrs.105.2022.07.13.00.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 00:50:37 -0700 (PDT) From: Juri Lelli To: LKML , linux-rt-users Cc: Juri Lelli , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Subject: [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks Date: Wed, 13 Jul 2022 09:50:14 +0200 Message-Id: <20220713075014.411739-1-juri.lelli@redhat.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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)); return; } -- 2.36.1