[PATCH RFC v2] sched/proxy: Defer donor commit until proxy resolution
From: Xukai Wang
Date: Mon Jul 13 2026 - 02:23:03 EST
Hi,
This RFC tries to decouple proxy candidate selection from donor commit in the
scheduler core.
Currently pick_next_task() does not only select a task. It also commits the
selected task into the scheduling class state through put_prev_set_next_task().
With proxy execution enabled, the selected task may be a blocked donor,
and __schedule() then calls find_proxy_task() to resolve the proxy chain and
find the task that should actually run.
If find_proxy_task() returns NULL, __schedule() goes back to pick_again.
However, the picked donor has already been committed into the class current state.
This means the scheduler may first set_next() a blocked donor and then immediately
abandon that choice when proxy resolution fails.
This patch changes the model so that pick_next_task() only returns a candidate.
The actual class commit is moved to __schedule(), after proxy resolution.
I am keeping this as RFC and including John, as discussed in the v1 thread,
to check whether find_proxy_task() or the wider proxy series relies on rq->donor
being updated to the picked donor before proxy-chain resolution.
Signed-off-by: Xukai Wang <kingxukai@xxxxxxxxxxxx>
---
Changes in v2:
- Move the final put_prev_set_next_task()/rq_set_donor() after the
proxy/non-proxy branches.
- Move zap_balance_callbacks() from the NULL/idle proxy-resolution
paths into proxy_resched_idle(), next to the idle commit.
- Link to v1: https://patch.msgid.link/20260707-sched-proxy-v1-0-5928bf6dedf0@xxxxxxxxxxxx
---
Xukai Wang (1):
sched/proxy: Defer donor commit until after proxy resolution
kernel/sched/core.c | 90 +++++++++++++++++++++++++++++------------------------
1 file changed, 49 insertions(+), 41 deletions(-)
---
base-commit: 19b7bdc3a1550ab2550427c33395bec7caeaf72d
change-id: 20260707-sched-proxy-4404b6e97ad9
Best regards,
--
Xukai Wang <kingxukai@xxxxxxxxxxxx>