[RFC PATCH 07/16] sched/core: Avoid delaying blocked donors queued on sleeping owner

From: K Prateek Nayak

Date: Wed Aug 26 2026 - 02:39:46 EST


Subsequent patches will rely on the fact that tasks on a sleeping
owner's chain are all owner by one CPU (task_cpu() will all resolve to a
single CPU).

With delayed task, this assumption will not be true since the delayed
task is owned by the CPU where it was dequeued until the pick fully
blocks it.

Block the task queued on sleeping owner completely to avoid this
complication. Further optimizations can explore moving the delayed task
to the p->blocked_cpu and wait until it is dequeued there but for this
PoC, the simpler approach has been adopted.

Signed-off-by: K Prateek Nayak <kprateek.nayak@xxxxxxx>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e53967a126a9..d635f5452a1b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6916,7 +6916,7 @@ static void proxy_enqueue_on_owner(struct rq *rq, struct task_struct *owner,
* Owner is fully blocked. __activate_blocked_task_slowpath()
* will see us on the list during wakeup and DTRT.
*/
- block_task(rq, p, READ_ONCE(p->__state));
+ block_task(rq, p, READ_ONCE(p->__state) | TASK_WAKING);
}

/*
--
2.34.1