From: Kuba Piecuch <jpiecuch@google.com>
To: Tejun Heo <tj@kernel.org>, Kuba Piecuch <jpiecuch@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
David Vernet <void@manifault.com>,
Andrea Righi <arighi@nvidia.com>,
Changwoo Min <changwoo@igalia.com>, <sched-ext@lists.linux.dev>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH sched_ext/for-7.4 0/5] sched_ext: Make ops.cpu_acquire/release() reliable
Date: Tue, 20 Oct 2026 18:02:36 +0000 [thread overview]
Message-ID: <DM9V2QCIFVGI.3VSJXUCU94ICW@google.com> (raw)
In-Reply-To: <657547efeaea54276c50a0c106399366@kernel.org>
Hi Tejun,
On Tue Oct 20, 2026 at 12:31 AM UTC, Tejun Heo wrote:
> I don't really see a lot of utility in ops.cpu_acquire/release(). As it
> currently stands, it doesn't add anything that can't be covered by IMMED,
That's true if the only thing you do from ops.cpu_release() is
re-enqueue the local DSQ. It may not be true if you're trying to do
other things like e.g. kicking the sibling CPU in scx_pair.
Fixing ops.cpu_release() would let us get rid of the sched_switch hack
in scx_pair, which we know isn't perfect at detecting CPU preemption
by a higher sched_class.
> and given how asynchronous the events are, I'm not sure an edge-triggered
> view of CPU availability is particularly useful. IMMED works because it's
> something the kernel can check and enforce. If there are holes in it,
> let's plug them, but I don't think the holes justify keeping or updating
> ops.cpu_acquire/release().
ops.cpu_acquire() is synchronously invoked in the dispatch path, and
ops.cpu_release() would be invoked when the sched_class of rq->donor
goes above ext_sched_class, so either in __schedule() or when changing
the sched_class of a running task. It doesn't strike me as particularly
asynchronous.
Part of my motivation is Google's BPF schedulers, which are composed
of subschedulers, and we explicitly track which CPU is owned by which
subscheduler. Having a reliable CPU preemption callback would help with
porting them over to sched_ext.
> Can you please send the IMMED fixes separately?
Will do.
Thanks,
Kuba
next prev parent reply other threads:[~2026-10-20 18:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 12:14 [RFC PATCH sched_ext/for-7.4 0/5] sched_ext: Make ops.cpu_acquire/release() reliable Kuba Piecuch
2026-10-18 12:14 ` [RFC PATCH 1/5] sched_ext: Make legacy scx_bpf_reenqueue_local() target the locked rq Kuba Piecuch
2026-10-18 12:14 ` [RFC PATCH 2/5] sched_ext: Emit ops.cpu_acquire/release() on actual CPU transitions Kuba Piecuch
2026-10-18 12:32 ` sashiko-bot
2026-10-18 12:14 ` [RFC PATCH 3/5] sched_ext: Release the CPU when its running task leaves SCX Kuba Piecuch
2026-10-18 12:14 ` [RFC PATCH 4/5] sched_ext: Un-deprecate ops.cpu_acquire/release() Kuba Piecuch
2026-10-18 12:14 ` [RFC PATCH 5/5] selftests/sched_ext: Add cpu_avail tests Kuba Piecuch
2026-10-18 12:30 ` sashiko-bot
2026-10-19 14:48 ` [RFC PATCH sched_ext/for-7.4 0/5] sched_ext: Make ops.cpu_acquire/release() reliable Kuba Piecuch
2026-10-20 0:31 ` Tejun Heo
2026-10-20 18:02 ` Kuba Piecuch [this message]
2026-10-20 19:00 ` Tejun Heo
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=DM9V2QCIFVGI.3VSJXUCU94ICW@google.com \
--to=jpiecuch@google.com \
--cc=arighi@nvidia.com \
--cc=changwoo@igalia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox