From: sashiko-bot@kernel.org
To: "Andrea Righi" <arighi@nvidia.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 08/12] sched_ext: Handle blocked donor migration with proxy execution
Date: Tue, 21 Jul 2026 08:42:08 +0000 [thread overview]
Message-ID: <20260721084208.C1B751F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260721063242.552774-9-arighi@nvidia.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The newly added proxy-execution handling for blocked donors in put_prev_task_scx() is unreachable for sched_ext tasks, completely breaking proxy execution for this class.
- [Medium] Blocked proxy donors are enqueued to the tail of the local DSQ instead of the head, causing priority inversion when other tasks are batched.
--
--- Patch [8]: [PATCH 08/12] sched_ext: Handle blocked donor migration with proxy execution ---
commit 6380b59c7e35fb635b7bc11e5fa121a8296ed2b7
Author: John Stultz <jstultz@google.com>
sched_ext: Handle blocked donor migration with proxy execution
With proxy execution enabled, mutex-blocked donors stay runnable so
their scheduling context can execute the lock owner.
> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index a466adf8e1548..bf53f2be77f05 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
[ ... ]
> @@ -3122,6 +3126,25 @@ static void put_prev_task_scx(struct rq *rq, struct task_struct *p,
> if (p->scx.flags & SCX_TASK_QUEUED) {
> set_task_runnable(rq, p);
>
> + /*
> + * Mutex-blocked donors stay queued on the runqueue under proxy
> + * execution, but the donor never runs as itself, proxy-exec
> + * walks the blocked_on chain on the next __schedule() and runs
> + * the lock owner in its place.
> + *
> + * Put the donor on the local DSQ directly so pick_next_task()
> + * can still see it. find_proxy_task() will either run the chain
> + * owner or deactivate the donor so the wakeup path can return it
> + * and let BPF make a new dispatch decision once it is unblocked.
> + *
> + * This is preparatory code: a later patch will delegate blocked-donor
> + * admission to the BPF scheduler.
> + */
> + if (p->is_blocked) {
> + scx_dispatch_enqueue(sch, rq, &rq->scx.local_dsq, p, 0);
[Severity: High]
Is this newly added proxy execution handling for blocked donors reachable for
sched_ext tasks?
When a sched_ext task blocks on a mutex, try_to_block_task() checks
!task_is_blocked(prev) || !scx_allow_proxy_exec(prev) to decide if it
should be fully dequeued. scx_allow_proxy_exec() unconditionally returns
false for ext_sched_class:
kernel/sched/ext/ext.c:scx_allow_proxy_exec() {
return p->sched_class != &ext_sched_class;
}
Since should_block evaluates to true, the task is passed to block_task(),
which unconditionally dequeues it via dequeue_task_scx(). Dequeuing clears
SCX_TASK_QUEUED.
When put_prev_task_scx() is then called by __schedule() during the task
switch, the task is no longer queued (p->scx.flags & SCX_TASK_QUEUED is
false), meaning this entire block of newly added proxy donor retention
logic seems to be bypassed as dead code.
[Severity: Medium]
Will enqueuing the blocked proxy donor to the tail of the local DSQ cause a
priority inversion?
If the BPF scheduler has previously dispatched a batch of tasks to the local
DSQ, using 0 (tail enqueue) places the blocked donor behind them.
pick_next_task() will pop and execute the batched tasks before the donor,
delaying the execution of the lock owner.
Should this use SCX_ENQ_HEAD instead, similar to slice-preempted tasks, so
the lock owner can execute immediately to release the contended mutex?
> + goto switch_class;
> + }
> +
> /*
> * If @p has slice left and is being put, @p is getting
> * preempted by a higher priority scheduler class or core-sched
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260721063242.552774-1-arighi@nvidia.com?part=8
next prev parent reply other threads:[~2026-07-21 8:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 6:31 [PATCHSET v8 sched_ext/for-7.3] sched: Make proxy execution compatible with sched_ext Andrea Righi
2026-07-21 6:31 ` [PATCH 01/12] sched/core: Avoid false migration warning for proxy donors Andrea Righi
2026-07-21 6:50 ` sashiko-bot
2026-07-21 7:00 ` John Stultz
2026-07-21 7:34 ` Andrea Righi
2026-07-21 6:31 ` [PATCH 02/12] sched: Make NOHZ CFS bandwidth checks follow proxy donor Andrea Righi
2026-07-21 7:13 ` sashiko-bot
2026-07-21 6:31 ` [PATCH 03/12] sched: Add helper to block retained proxy donors Andrea Righi
2026-07-21 7:02 ` John Stultz
2026-07-21 6:31 ` [PATCH 04/12] sched_ext: Block proxy donors across scheduler transitions Andrea Righi
2026-07-21 6:31 ` [PATCH 05/12] sched_ext: Fix ops.running/stopping() pairing for proxy-exec donors Andrea Righi
2026-07-21 6:31 ` [PATCH 06/12] sched_ext: Fix proxy-exec race in consume_remote_task() Andrea Righi
2026-07-21 7:09 ` John Stultz
2026-07-21 7:51 ` sashiko-bot
2026-07-21 6:31 ` [PATCH 07/12] sched_ext: Split curr|donor references properly Andrea Righi
2026-07-21 8:13 ` sashiko-bot
2026-07-21 6:31 ` [PATCH 08/12] sched_ext: Handle blocked donor migration with proxy execution Andrea Righi
2026-07-21 8:42 ` sashiko-bot [this message]
2026-07-21 6:31 ` [PATCH 09/12] sched_ext: Delegate proxy donor admission to BPF schedulers Andrea Righi
2026-07-21 6:31 ` [PATCH 10/12] sched_ext: Add selftest for blocked donor admission Andrea Righi
2026-07-21 6:31 ` [PATCH 11/12] sched_ext: scx_qmap: Add proxy execution support Andrea Righi
2026-07-21 6:31 ` [PATCH 12/12] sched: Allow enabling proxy exec with sched_ext Andrea Righi
2026-07-21 7:05 ` John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260721084208.C1B751F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=arighi@nvidia.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sched-ext@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.