From: sashiko-bot@kernel.org
To: "Andrea Righi" <arighi@nvidia.com>
Cc: sched-ext@lists.linux.dev
Subject: Re: [PATCH 4/9] sched_ext: Handle blocked donor migration with proxy execution
Date: Mon, 06 Jul 2026 07:21:55 +0000 [thread overview]
Message-ID: <20260706072155.7107F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260706070410.282826-5-arighi@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Plain data race on `rq->donor` in `task_current_donor()` during lockless evaluation triggers KCSAN warnings.
--
commit 6a880849b19162c80e0a10e017da8716e5ef3566
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. This commit allows
normal sched_ext migration of blocked donors unless the donor is active
on its rq.
> diff --git a/kernel/sched/ext/ext.c b/kernel/sched/ext/ext.c
> index 4c6cd694c86db..e7cf88b2be7f6 100644
> --- a/kernel/sched/ext/ext.c
> +++ b/kernel/sched/ext/ext.c
[ ... ]
> @@ -2156,6 +2156,18 @@ static bool task_can_run_on_remote_rq(struct scx_sched *sch,
> if (task_on_cpu(task_rq(p), p))
> return false;
>
> + /*
> + * A blocked donor may be moved normally to select a new callback rq.
> + * set_task_cpu() updates wake_cpu and makes the destination rq its new
> + * callback home, even if the donor was previously proxy-migrated.
> + *
> + * Don't move an active donor while the source rq still references it for
> + * scheduling and accounting. The migration can be retried after the donor
> + * is switched out.
> + */
> + if (task_is_blocked(p) && task_current_donor(task_rq(p), p))
[Severity: Medium]
Will this trigger KCSAN warnings due to a data race on rq->donor?
When consume_dispatch_q() calls task_can_run_on_remote_rq() with enforce=false
as an opportunistic lockless check, it only holds dsq->lock, not the runqueue
lock for task_rq(p).
This causes task_current_donor() to perform a plain read of rq->donor:
kernel/sched/sched.h:task_current_donor() {
return rq->donor == p;
}
Since rq->donor can be concurrently modified by the runqueue's owner CPU,
the plain read violates the memory model. Even if it is logically safe
because the condition is re-evaluated later with the lock held, should
this be annotated with READ_ONCE() or data_race() to avoid KCSAN warnings?
> + return false;
> +
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260706070410.282826-1-arighi@nvidia.com?part=4
next prev parent reply other threads:[~2026-07-06 7:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 6:50 [PATCHSET v3 sched_ext/for-7.3] sched: Make proxy execution compatible with sched_ext Andrea Righi
2026-07-06 6:50 ` [PATCH 1/9] sched/core: Drop mutex locks before proxy rescheduling Andrea Righi
2026-07-06 8:45 ` K Prateek Nayak
2026-07-06 6:50 ` [PATCH 2/9] sched_ext: Split curr|donor references properly Andrea Righi
2026-07-06 7:35 ` sashiko-bot
2026-07-06 6:50 ` [PATCH 3/9] sched_ext: Fix TOCTOU race in consume_remote_task() Andrea Righi
2026-07-06 7:24 ` sashiko-bot
2026-07-06 6:50 ` [PATCH 4/9] sched_ext: Handle blocked donor migration with proxy execution Andrea Righi
2026-07-06 7:21 ` sashiko-bot [this message]
2026-07-06 6:51 ` [PATCH 5/9] sched_ext: Fix ops.running/stopping() pairing for proxy-exec donors Andrea Righi
2026-07-06 6:51 ` [PATCH 6/9] sched_ext: Delegate proxy donor admission to BPF schedulers Andrea Righi
2026-07-06 7:36 ` sashiko-bot
2026-07-06 7:49 ` K Prateek Nayak
2026-07-06 6:51 ` [PATCH 7/9] sched_ext: Add selftest for blocked donor admission Andrea Righi
2026-07-06 6:51 ` [PATCH 8/9] sched_ext: scx_qmap: Add proxy execution support Andrea Righi
2026-07-06 6:51 ` [PATCH 9/9] sched: Allow enabling proxy exec with sched_ext Andrea Righi
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=20260706072155.7107F1F000E9@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox