* [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
@ 2026-05-22 12:58 Gabriele Monaco
2026-05-22 20:58 ` Andrea Righi
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Gabriele Monaco @ 2026-05-22 12:58 UTC (permalink / raw)
To: Juri Lelli, Ingo Molnar, Peter Zijlstra, linux-kernel
Cc: jstultz, arighi, soolaugust, suzhidao, Gabriele Monaco
Commit 14a857056466 ("sched/deadline: Use revised wakeup rule for
dl_server") applies the revised wakeup rule to any server, as a result
servers that are not running (dl_defer_running == 0) and start with a
deadline overflow get enqueued and can boost tasks as if they were
running, invalidating the defer rule and the documented state model.
Apply the revised wakeup rule only for deferrable servers that are
marked as running.
Fixes: 14a857056466 ("sched/deadline: Use revised wakeup rule for dl_server")
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
---
Tested with ksched_football on a 16 CPUs machine: no regression (1s for
check in and game over in 10s).
Apparently the rt_stall sched_ext selftest does fail with tasks not
always getting above 4% (almost always above 3%). But that seems to be
the case also before this change on that machine.
---
kernel/sched/deadline.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index 7db4c87df83b..e5a7701a8af7 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1017,7 +1017,8 @@ static void update_dl_entity(struct sched_dl_entity *dl_se)
if (dl_time_before(dl_se->deadline, rq_clock(rq)) ||
dl_entity_overflow(dl_se, rq_clock(rq))) {
- if (unlikely((!dl_is_implicit(dl_se) || dl_se->dl_defer) &&
+ if (unlikely((!dl_is_implicit(dl_se) ||
+ (dl_se->dl_defer && dl_se->dl_defer_running)) &&
!dl_time_before(dl_se->deadline, rq_clock(rq)) &&
!is_dl_boosted(dl_se))) {
update_dl_revised_wakeup(dl_se, rq);
base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0
--
2.54.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-05-22 12:58 [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server Gabriele Monaco
@ 2026-05-22 20:58 ` Andrea Righi
2026-05-25 6:19 ` Juri Lelli
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Andrea Righi @ 2026-05-22 20:58 UTC (permalink / raw)
To: Gabriele Monaco
Cc: Juri Lelli, Ingo Molnar, Peter Zijlstra, linux-kernel, jstultz,
soolaugust, suzhidao
Hi Garbiele,
On Fri, May 22, 2026 at 02:58:33PM +0200, Gabriele Monaco wrote:
> Commit 14a857056466 ("sched/deadline: Use revised wakeup rule for
> dl_server") applies the revised wakeup rule to any server, as a result
> servers that are not running (dl_defer_running == 0) and start with a
> deadline overflow get enqueued and can boost tasks as if they were
> running, invalidating the defer rule and the documented state model.
>
> Apply the revised wakeup rule only for deferrable servers that are
> marked as running.
>
> Fixes: 14a857056466 ("sched/deadline: Use revised wakeup rule for dl_server")
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> ---
>
> Tested with ksched_football on a 16 CPUs machine: no regression (1s for
> check in and game over in 10s).
>
> Apparently the rt_stall sched_ext selftest does fail with tasks not
> always getting above 4% (almost always above 3%). But that seems to be
> the case also before this change on that machine.
Yeah the rt_stall selftest can be a bit flaky sometimes, as long as you get >3%
it's all good, maybe we should relax the min threshold a bit. In any case, I
tested this and it looks good om my side.
Tested-by: Andrea Righi <arighi@nvidia.com>
Thanks,
-Andrea
>
> ---
> kernel/sched/deadline.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 7db4c87df83b..e5a7701a8af7 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1017,7 +1017,8 @@ static void update_dl_entity(struct sched_dl_entity *dl_se)
> if (dl_time_before(dl_se->deadline, rq_clock(rq)) ||
> dl_entity_overflow(dl_se, rq_clock(rq))) {
>
> - if (unlikely((!dl_is_implicit(dl_se) || dl_se->dl_defer) &&
> + if (unlikely((!dl_is_implicit(dl_se) ||
> + (dl_se->dl_defer && dl_se->dl_defer_running)) &&
> !dl_time_before(dl_se->deadline, rq_clock(rq)) &&
> !is_dl_boosted(dl_se))) {
> update_dl_revised_wakeup(dl_se, rq);
>
> base-commit: 8bc67e4db64aa72732c474b44ea8622062c903f0
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-05-22 12:58 [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server Gabriele Monaco
2026-05-22 20:58 ` Andrea Righi
@ 2026-05-25 6:19 ` Juri Lelli
2026-07-29 13:27 ` Gabriele Monaco
2026-07-29 19:18 ` John Stultz
3 siblings, 0 replies; 8+ messages in thread
From: Juri Lelli @ 2026-05-25 6:19 UTC (permalink / raw)
To: Gabriele Monaco
Cc: Ingo Molnar, Peter Zijlstra, linux-kernel, jstultz, arighi,
soolaugust, suzhidao
Hi!
On 22/05/26 14:58, Gabriele Monaco wrote:
> Commit 14a857056466 ("sched/deadline: Use revised wakeup rule for
> dl_server") applies the revised wakeup rule to any server, as a result
> servers that are not running (dl_defer_running == 0) and start with a
> deadline overflow get enqueued and can boost tasks as if they were
> running, invalidating the defer rule and the documented state model.
>
> Apply the revised wakeup rule only for deferrable servers that are
> marked as running.
>
> Fixes: 14a857056466 ("sched/deadline: Use revised wakeup rule for dl_server")
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> ---
Makes sense to me.
Acked-by: Juri Lelli <juri.lelli@redhat.com>
Thanks,
Juri
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-05-22 12:58 [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server Gabriele Monaco
2026-05-22 20:58 ` Andrea Righi
2026-05-25 6:19 ` Juri Lelli
@ 2026-07-29 13:27 ` Gabriele Monaco
2026-07-29 13:29 ` Gabriele Monaco
2026-07-29 14:52 ` Peter Zijlstra
2026-07-29 19:18 ` John Stultz
3 siblings, 2 replies; 8+ messages in thread
From: Gabriele Monaco @ 2026-07-29 13:27 UTC (permalink / raw)
To: peterz
Cc: gmonaco, arighi, jstultz, juri.lelli, linux-kernel, mingo,
soolaugust, suzhidao
Peter,
could you take this patch?
Thanks,
Gabriele
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-07-29 13:27 ` Gabriele Monaco
@ 2026-07-29 13:29 ` Gabriele Monaco
2026-07-29 14:52 ` Peter Zijlstra
1 sibling, 0 replies; 8+ messages in thread
From: Gabriele Monaco @ 2026-07-29 13:29 UTC (permalink / raw)
To: peterz
Cc: arighi, jstultz, juri.lelli, linux-kernel, mingo, soolaugust,
suzhidao
On Wed, 2026-07-29 at 15:27 +0200, Gabriele Monaco wrote:
> Peter,
>
> could you take this patch?
>
> Thanks,
> Gabriele
I somehow expected the reply command in lkml to give a bit more context, of
course it does not. [1] is the link to the mentioned patch.
[1] - https://lore.kernel.org/lkml/20260522125833.264145-1-gmonaco@redhat.com/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-07-29 13:27 ` Gabriele Monaco
2026-07-29 13:29 ` Gabriele Monaco
@ 2026-07-29 14:52 ` Peter Zijlstra
2026-07-29 14:54 ` Gabriele Monaco
1 sibling, 1 reply; 8+ messages in thread
From: Peter Zijlstra @ 2026-07-29 14:52 UTC (permalink / raw)
To: Gabriele Monaco
Cc: arighi, jstultz, juri.lelli, linux-kernel, mingo, soolaugust,
suzhidao
On Wed, Jul 29, 2026 at 03:27:22PM +0200, Gabriele Monaco wrote:
> Peter,
>
> could you take this patch?
Yes, just back from holidays, so immense backlog. sched/urgent this?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-07-29 14:52 ` Peter Zijlstra
@ 2026-07-29 14:54 ` Gabriele Monaco
0 siblings, 0 replies; 8+ messages in thread
From: Gabriele Monaco @ 2026-07-29 14:54 UTC (permalink / raw)
To: Peter Zijlstra
Cc: arighi, jstultz, juri.lelli, linux-kernel, mingo, soolaugust,
suzhidao
On Wed, 2026-07-29 at 16:52 +0200, Peter Zijlstra wrote:
> On Wed, Jul 29, 2026 at 03:27:22PM +0200, Gabriele Monaco wrote:
> > Peter,
> >
> > could you take this patch?
>
> Yes, just back from holidays, so immense backlog. sched/urgent this?
I'd say so, thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server
2026-05-22 12:58 [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server Gabriele Monaco
` (2 preceding siblings ...)
2026-07-29 13:27 ` Gabriele Monaco
@ 2026-07-29 19:18 ` John Stultz
3 siblings, 0 replies; 8+ messages in thread
From: John Stultz @ 2026-07-29 19:18 UTC (permalink / raw)
To: Gabriele Monaco
Cc: Juri Lelli, Ingo Molnar, Peter Zijlstra, linux-kernel, arighi,
soolaugust, suzhidao
On Fri, May 22, 2026 at 5:59 AM Gabriele Monaco <gmonaco@redhat.com> wrote:
>
> Commit 14a857056466 ("sched/deadline: Use revised wakeup rule for
> dl_server") applies the revised wakeup rule to any server, as a result
> servers that are not running (dl_defer_running == 0) and start with a
> deadline overflow get enqueued and can boost tasks as if they were
> running, invalidating the defer rule and the documented state model.
>
> Apply the revised wakeup rule only for deferrable servers that are
> marked as running.
>
> Fixes: 14a857056466 ("sched/deadline: Use revised wakeup rule for dl_server")
> Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
> ---
>
> Tested with ksched_football on a 16 CPUs machine: no regression (1s for
> check in and game over in 10s).
>
Yeah, I double checked in my environment and I'm not seeing any
trouble with the ksched_football startup on my 64 vcpu guest I test
with.
[ 61.150605] ksched_football: Started referee, game_time: 10 secs !
[ 62.407743] ksched_football: All players checked in! Starting game.
Tested-by: John Stultz <jstultz@google.com>
thanks
-john
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-29 19:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 12:58 [PATCH] sched/deadline: Use revised wakeup rule only for running dl_server Gabriele Monaco
2026-05-22 20:58 ` Andrea Righi
2026-05-25 6:19 ` Juri Lelli
2026-07-29 13:27 ` Gabriele Monaco
2026-07-29 13:29 ` Gabriele Monaco
2026-07-29 14:52 ` Peter Zijlstra
2026-07-29 14:54 ` Gabriele Monaco
2026-07-29 19:18 ` John Stultz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox