[PATCH] sched/fair: Fix wakeup_preempt_fair for not waking up task
From: Vincent Guittot
Date: Wed Apr 29 2026 - 12:41:26 EST
The assumption that p is always enqueued and not delayed, is only true for
wakeup. If p was moved while sched_delayed, pick_next_entity will dequeue
it during the attach and the cfs might become empty.
Fixes: ac8e69e69363 ("sched/fair: Fix wakeup_preempt_fair() vs delayed dequeue")
Signed-off-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
---
I have triggered this while running my latency stress test on a new platform.
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 728965851842..99fb524c4922 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -9147,7 +9147,7 @@ static void wakeup_preempt_fair(struct rq *rq, struct task_struct *p, int wake_f
* Because p is enqueued, nse being null can only mean that we
* dequeued a delayed task.
*/
- if (!nse)
+ if (!nse && (wake_flags & WF_TTWU))
goto pick;
if (sched_feat(RUN_TO_PARITY))
--
2.43.0