lkml.org 
[lkml]   [2026]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sched/fair: Fix wakeup_preempt_fair for not waking up task
Date
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@linaro.org>
---

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

\
 
 \ /
  Last update: 2026-04-29 18:41    [W:0.065 / U:2.446 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog