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

Joel Fernandes (Google) posted 15 patches 1 year, 11 months ago
[PATCH v2 12/15] sched/deadline: Reverse args to dl_time_before in replenish
Posted by Joel Fernandes (Google) 1 year, 11 months ago
From: Suleiman Souhlal <suleiman@google.com>

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@joelfernandes.org>
---
 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
Re: [PATCH v2 12/15] sched/deadline: Reverse args to dl_time_before in replenish
Posted by Daniel Bristot de Oliveira 1 year, 10 months ago
On 3/13/24 02:24, Joel Fernandes (Google) wrote:
> From: Suleiman Souhlal <suleiman@google.com>
> 
> 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@joelfernandes.org>

Makes sense, I am adding it to the defer patch in v6 as it is a fix for it...

-- Daniel