Skip to content

Commit ddfc710

Browse files
jlelliPeter Zijlstra
authored andcommitted
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: 64be6f1 ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity") Signed-off-by: Juri Lelli <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent ff69927 commit ddfc710

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/sched/deadline.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,10 @@ static void enqueue_task_dl(struct rq *rq, struct task_struct *p, int flags)
17011701
* the throttle.
17021702
*/
17031703
p->dl.dl_throttled = 0;
1704-
BUG_ON(!is_dl_boosted(&p->dl) || flags != ENQUEUE_REPLENISH);
1704+
if (!(flags & ENQUEUE_REPLENISH))
1705+
printk_deferred_once("sched: DL de-boosted task PID %d: REPLENISH flag missing\n",
1706+
task_pid_nr(p));
1707+
17051708
return;
17061709
}
17071710

0 commit comments

Comments
 (0)