public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks
@ 2022-07-13  7:50 Juri Lelli
  2022-07-13 11:46 ` Peter Zijlstra
  2022-07-13 21:31 ` Srivatsa S. Bhat
  0 siblings, 2 replies; 11+ messages in thread
From: Juri Lelli @ 2022-07-13  7:50 UTC (permalink / raw)
  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

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 <juri.lelli@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-07-19  7:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13  7:50 [PATCH] sched/deadline: Fix BUG_ON condition for deboosted tasks Juri Lelli
2022-07-13 11:46 ` Peter Zijlstra
2022-07-13 12:58   ` Juri Lelli
2022-07-13 21:31 ` Srivatsa S. Bhat
2022-07-14  7:28   ` Juri Lelli
2022-07-15  4:49     ` Ankit Jain
2022-07-15  7:47       ` Juri Lelli
2022-07-18  7:46         ` Ankit Jain
2022-07-18 13:01           ` Juri Lelli
2022-07-19  5:30             ` Ankit Jain
2022-07-19  7:19               ` Juri Lelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox