[tip: sched/core] sched/deadline: check start_dl_timer expiry with ktime_before()

From: tip-bot2 for Liang Hao

Date: Wed Sep 02 2026 - 04:45:51 EST


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 <haohlliang@xxxxxxxxx>
AuthorDate: Sun, 16 Aug 2026 11:26:43 +08:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
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.

Signed-off-by: Liang Hao <haohlliang@xxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
Link: https://patch.msgid.link/20260816032643.44969-1-haohlliang@xxxxxxxxx
---
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 0663c00..de6a361 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -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;

/*