From: Tejun Heo <tj@kernel.org>
To: Andrea Righi <arighi@nvidia.com>
Cc: David Vernet <void@manifault.com>,
Changwoo Min <changwoo@igalia.com>,
Emil Tsalapatis <emil@etsalapatis.com>,
sched-ext@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 sched_ext/for-7.2-fixes] sched_ext: Preserve rq tracking across local DSQ dispatch
Date: Tue, 07 Jul 2026 12:36:34 -1000 [thread overview]
Message-ID: <455e701bca66bdecde530d225f4dba0a@kernel.org> (raw)
In-Reply-To: <20260707173851.153379-1-arighi@nvidia.com>
Hello, Andrea.
Instead of clearing and restoring the tracking at the function boundaries,
can you wrap the lock switch itself so scx_locked_rq() follows it? Something
like:
static void switch_rq_lock(struct rq *from, struct rq *to)
{
bool tracked = scx_locked_rq() == from;
if (tracked)
update_locked_rq(NULL);
raw_spin_rq_unlock(from);
raw_spin_rq_lock(to);
if (tracked)
update_locked_rq(to);
}
Then use it at the unlock/lock pairs in dispatch_to_local_dsq(),
move_remote_task_to_local_dsq(), and scx_dsq_move() (the in_balance ones;
the !in_balance fresh lock stays). That keeps scx_locked_rq() naming the
actually-held rq the whole time instead of going NULL across the dance, and
drops the tracked_rq bookkeeping, the WARN_ON_ONCE()s, and the
in_balance-vs-scx_locked_rq() coupling.
The == from guard makes it a no-op for the consume path (there it's this_rq,
not the rq being released), so that stays as-is for now - it's harmless
today because the deactivate runs under the migration guards. Would be nice
to bring consume under the same helper on for-7.3 so the tracking is
faithful everywhere.
Thanks.
--
tejun
next prev parent reply other threads:[~2026-07-07 22:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 17:38 [PATCH v2 sched_ext/for-7.2-fixes] sched_ext: Preserve rq tracking across local DSQ dispatch Andrea Righi
2026-07-07 22:36 ` Tejun Heo [this message]
2026-07-08 7:58 ` 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=455e701bca66bdecde530d225f4dba0a@kernel.org \
--to=tj@kernel.org \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=emil@etsalapatis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sched-ext@lists.linux.dev \
--cc=void@manifault.com \
/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.