mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before()
@ 2026-08-16  3:26 Liang Hao
  2026-08-18 11:55 ` Juri Lelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Liang Hao @ 2026-08-16  3:26 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra, Juri Lelli
  Cc: Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, K Prateek Nayak, linux-kernel,
	Liang Hao

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@gmail.com>
---
 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 c3e38d4f3365..e6b69140ae1a 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;
 
 	/*
-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before()
  2026-08-16  3:26 [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before() Liang Hao
@ 2026-08-18 11:55 ` Juri Lelli
  2026-09-02  7:54 ` [tip: sched/core] " tip-bot2 for Liang Hao
  2026-09-02  8:33 ` tip-bot2 for Liang Hao
  2 siblings, 0 replies; 4+ messages in thread
From: Juri Lelli @ 2026-08-18 11:55 UTC (permalink / raw)
  To: Liang Hao
  Cc: Ingo Molnar, Peter Zijlstra, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
	K Prateek Nayak, linux-kernel

Hello,

On 16/08/26 11:26, Liang Hao wrote:
> 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@gmail.com>

Looks good to me.

Acked-by: Juri Lelli <juri.lelli@redhat.com>

Thanks,
Juri


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: sched/core] sched/deadline: check start_dl_timer expiry with ktime_before()
  2026-08-16  3:26 [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before() Liang Hao
  2026-08-18 11:55 ` Juri Lelli
@ 2026-09-02  7:54 ` tip-bot2 for Liang Hao
  2026-09-02  8:33 ` tip-bot2 for Liang Hao
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Liang Hao @ 2026-09-02  7:54 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Liang Hao, Peter Zijlstra (Intel), Juri Lelli, x86, linux-kernel

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

Signed-off-by: Liang Hao <haohlliang@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20260816032643.44969-1-haohlliang@gmail.com
---
 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;
 
 	/*

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip: sched/core] sched/deadline: check start_dl_timer expiry with ktime_before()
  2026-08-16  3:26 [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before() Liang Hao
  2026-08-18 11:55 ` Juri Lelli
  2026-09-02  7:54 ` [tip: sched/core] " tip-bot2 for Liang Hao
@ 2026-09-02  8:33 ` tip-bot2 for Liang Hao
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot2 for Liang Hao @ 2026-09-02  8:33 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Liang Hao, Peter Zijlstra (Intel), Juri Lelli, x86, linux-kernel

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@gmail.com>
AuthorDate:    Sun, 16 Aug 2026 11:26:43 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
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@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Link: https://patch.msgid.link/20260816032643.44969-1-haohlliang@gmail.com
---
 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;
 
 	/*

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-02  8:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-16  3:26 [PATCH] sched/deadline: check start_dl_timer expiry with ktime_before() Liang Hao
2026-08-18 11:55 ` Juri Lelli
2026-09-02  7:54 ` [tip: sched/core] " tip-bot2 for Liang Hao
2026-09-02  8:33 ` tip-bot2 for Liang Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®