]> git.baikalelectronics.ru Git - kernel.git/commit
sched/deadline: Fix BUG_ON condition for deboosted tasks
authorJuri Lelli <juri.lelli@redhat.com>
Thu, 14 Jul 2022 15:19:08 +0000 (17:19 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 21 Jul 2022 08:35:28 +0000 (10:35 +0200)
commitbd548afb56c2bac1a98a1c4fcfff44fa222aab3b
tree5087a26c67346ad80e9822b94e56cf82a833c48d
parent4d12eb50455169445883967409f9de42c3d6d556
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: 0608dbe757fa ("sched/deadline: Don't replenish from a !SCHED_DEADLINE entity")
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20220714151908.533052-1-juri.lelli@redhat.com
kernel/sched/deadline.c