[PATCH 5/6 v2] sched/eevdf: Always update slice protection

From: Vincent Guittot

Date: Mon Jun 15 2026 - 12:30:59 EST


Even if p will not preempt current, it modifies the avg_vruntime and
possibly the min slice. Make sure to update the slice protection with the
updated figures. As an example, Batch and Sched Idle tasks can otherwise
get a larger lag than their slice and finaly delay the scheduling of a
normal task, which deadline will be a later.

Signed-off-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
---
kernel/sched/fair.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4923bb28dde3..601c67cff185 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9826,13 +9826,13 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f
goto preempt;

if (cse_is_idle != pse_is_idle)
- return;
+ goto update;

/*
* BATCH and IDLE tasks do not preempt others.
*/
if (unlikely(!normal_policy(p->policy)))
- return;
+ goto update;

cfs_rq = cfs_rq_of(se);
update_curr(cfs_rq);
@@ -9852,7 +9852,7 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f
* EEVDF to forcibly queue an ineligible task.
*/
if ((wake_flags & WF_FORK) || pse->sched_delayed)
- return;
+ goto update;

/* Prefer picking wakee soon if appropriate. */
if (sched_feat(NEXT_BUDDY) &&
@@ -9898,7 +9898,7 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f
*/
if (preempt_action == PREEMPT_WAKEUP_SHORT && entity_eligible(cfs_rq, pse))
goto preempt;
-
+update:
if (sched_feat(RUN_TO_PARITY))
update_protect_slice(cfs_rq, se);

--
2.43.0