[PATCH v2 12/15] sched/deadline: Reverse args to dl_time_before in replenish

From: Joel Fernandes (Google)
Date: Tue Mar 12 2024 - 21:28:00 EST


From: Suleiman Souhlal <suleiman@xxxxxxxxxx>

dl_time_before() seems to be incorrectly used, we need to check that the
0-laxity time is ahead of the rq_clock. Fix it.

Signed-off-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx>
---
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 1d54231fbaa6..dbba95d364e2 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -914,7 +914,7 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se)
* is in the future, throttle the server and arm the zero laxity timer.
*/
if (dl_se->dl_defer &&
- dl_time_before(dl_se->deadline - dl_se->runtime, rq_clock(rq))) {
+ dl_time_before(rq_clock(rq), dl_se->deadline - dl_se->runtime)) {
if (!is_dl_boosted(dl_se)) {
dl_se->dl_defer_armed = 1;
dl_se->dl_throttled = 1;
--
2.34.1