Skip to contentSkip to conversation

sched/deadline: check start_dl_timer expiry with ktime_before()

PATCH Applied Liang Hao 3 participants 4 messages Aug 16 – Sep 2 Scheduler

lore
Share & tools
lore

Liang Hao

author
#0 lore raw

PATCH 1/1 sched/deadline: check start_dl_timer expiry with ktime_before()

Replace ktime_us_delta() < 0 with ktime_before() so the past-expiry test uses the same resolution as act/now.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index c3e38d4f3365..e6b69140ae1a 100644
@@ -1097,7 +1097,7 @@ static int start_dl_timer(struct sched_dl_entity *dl_se)
 	 * chosen as the deadline is too small, don't even try to
 	 * start the timer in the past!
 	 */
-	if (ktime_us_delta(act, now) < 0)
+	if (ktime_before(act, now))
 		return 0;
 
 	/*
Signature · 1 line
2.50.1 (Apple Git-155)
merge bot Applied
#2 lore raw
In reply to Liang Hao
The following commit has been merged into the sched/core branch of tip:

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     6c10af7c54434768127d80fac8a00b1c0f553344
Gitweb:        https://git.kernel.org/tip/6c10af7c54434768127d80fac8a00b1c0f553344
Author:        Liang Hao <[email protected]>
AuthorDate:    Sun, 16 Aug 2026 11:26:43 +08:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Wed, 02 Sep 2026 09:37:25 +02:00

sched/deadline: check start_dl_timer expiry with ktime_before()

Replace ktime_us_delta() < 0 with ktime_before() so the past-expiry test uses the same resolution as act/now.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index 0663c00..de6a361 100644
@@ -1097,7 +1097,7 @@ static int start_dl_timer(struct sched_dl_entity *dl_se)
 	 * chosen as the deadline is too small, don't even try to
 	 * start the timer in the past!
 	 */
-	if (ktime_us_delta(act, now) < 0)
+	if (ktime_before(act, now))
 		return 0;
 
 	/*
merge bot Applied
#3 lore raw
In reply to Liang Hao
The following commit has been merged into the sched/core branch of tip:

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     f549101187c875c2016072cadcb909d228532ae8
Gitweb:        https://git.kernel.org/tip/f549101187c875c2016072cadcb909d228532ae8
Author:        Liang Hao <[email protected]>
AuthorDate:    Sun, 16 Aug 2026 11:26:43 +08:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Wed, 02 Sep 2026 10:28:24 +02:00

sched/deadline: check start_dl_timer expiry with ktime_before()

Replace ktime_us_delta() < 0 with ktime_before() so the past-expiry test uses the same resolution as act/now.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index 0663c00..de6a361 100644
@@ -1097,7 +1097,7 @@ static int start_dl_timer(struct sched_dl_entity *dl_se)
 	 * chosen as the deadline is too small, don't even try to
 	 * start the timer in the past!
 	 */
-	if (ktime_us_delta(act, now) < 0)
+	if (ktime_before(act, now))
 		return 0;
 
 	/*