[tip: sched/urgent] sched/deadline: Use revised wakeup rule for dl_server

From: tip-bot2 for Peter Zijlstra

Date: Wed Apr 08 2026 - 07:22:36 EST


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

Commit-ID: 14a857056466be9d3d907a94e92a704ac1be149b
Gitweb: https://git.kernel.org/tip/14a857056466be9d3d907a94e92a704ac1be149b
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
AuthorDate: Sat, 04 Apr 2026 12:22:44 +02:00
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Wed, 08 Apr 2026 13:11:43 +02:00

sched/deadline: Use revised wakeup rule for dl_server

John noted that commit 115135422562 ("sched/deadline: Fix 'stuck' dl_server")
unfixed the issue from commit a3a70caf7906 ("sched/deadline: Fix dl_server
behaviour").

The issue in commit 115135422562 was for wakeups of the server after the
deadline; in which case you *have* to start a new period. The case for
a3a70caf7906 is wakeups before the deadline.

Now, because the server is effectively running a least-laxity policy, it means
that any wakeup during the runnable phase means dl_entity_overflow() will be
true. This means we need to adjust the runtime to allow it to still run until
the existing deadline expires.

Use the revised wakeup rule for dl_defer entities.

Fixes: 115135422562 ("sched/deadline: Fix 'stuck' dl_server")
Reported-by: John Stultz <jstultz@xxxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
Tested-by: John Stultz <jstultz@xxxxxxxxxx>
Link: https://patch.msgid.link/20260404102244.GB22575@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
---
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 d08b004..674de6a 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1027,7 +1027,7 @@ 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) &&
+ if (unlikely((!dl_is_implicit(dl_se) || dl_se->dl_defer) &&
!dl_time_before(dl_se->deadline, rq_clock(rq)) &&
!is_dl_boosted(dl_se))) {
update_dl_revised_wakeup(dl_se, rq);