Subject: sched/eevdf: Fix RUN_TO_PARITY vs PREEMPT_SHORT From: Peter Zijlstra Date: Fri Apr 4 10:25:03 CEST 2025 Vincent noted that RUN_TO_PARITY can prevent preemption by a shorter slice under some conditions. Reported-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -918,7 +918,7 @@ static inline bool __pick_eevdf_curr(str if (sched_feat(RUN_TO_PARITY) && protect_slice(curr) && entity_eligible(cfs_rq, curr)) - return true; + return !sched_feat(PREEMPT_SHORT) || curr->slice < best->slice; return entity_before(curr, best); } @@ -1195,7 +1195,7 @@ static inline bool did_preempt_short(str if (!sched_feat(PREEMPT_SHORT)) return false; - if (curr->vlag == curr->deadline) + if (protect_slice(curr)) return false; return !entity_eligible(cfs_rq, curr);