[RFC PATCH 0/3] sched/core: Allow proxy execution to work with core scheduling

From: K Prateek Nayak

Date: Fri Jul 17 2026 - 07:24:49 EST


Proxy execution runs the lock owner in place of blocked donor returned
by pick_next_task() but the lock owner can have a different core-cookie
compared to the blocked donor and simply running the lock owner under
those circumstances breaks the guarantees of core scheduling.

Allow proxy execution to exist alognside core scheduling by forcing a
re-pick once the blocked_on chain is found to be stable in __schedule()
and then swapping the rq->core_pick with the lock owner allowing the
execution context to dictate the core-cookie.

Lightly tested with John's priority-inversion-demo [1] patched with
"coresched new -t pid --" and the plotted chart seems to suggest proxy
is working [2]. Your mileage may vary :-)

I'll update the thread if I find any nasty bugs over the weekend run.
Patches are prepared on top of:

https://github.com/johnstultz-work/linux-dev.git proxy-exec-v30-7.2-rc1

at commit abb09adc985b ("HACK: scx: Add scx_prio_inversion test
scheduler") with commit 93bd6418a6ea ("sched/core: Skip
put_prev_task/set_next_task re-entry for sched_ext donors") reverted on
top to make !EXT builds happy.

This is essentially a formal version of [3] broken down to be slightly
more readable. Comments and feedback are always appreciated!

References
==========

[1] https://github.com/johnstultz-work/priority-inversion-demo/
[2] https://imgur.com/NsgWqRx
[3] https://lore.kernel.org/lkml/9ceb2af0-33c6-40ca-b855-5167a9c5ae0f@xxxxxxx/

--
K Prateek Nayak (3):
sched/core: Track the core-wide pick leader
sched/core: Fix forceidle when lock owner has mismatchd cookie
sched/core: Swap to lock owner for core-wide pick on core-cookie
mismatch

kernel/sched/core.c | 129 ++++++++++++++++++++++++++++++++++++++-----
kernel/sched/sched.h | 4 ++
2 files changed, 119 insertions(+), 14 deletions(-)

--
2.43.0