All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: 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 09:00:20 -1000	[thread overview]
Message-ID: <ba9d879aa8b0474d09577b82a1d68940@kernel.org> (raw)
In-Reply-To: <DM9V2QCIFVGI.3VSJXUCU94ICW@google.com>

Hello, Kuba.

On Tue, Oct 20, 2026 at 06:02:36PM +0000, Kuba Piecuch wrote:
> 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.

What I don't like about ops.cpu_acquire/release() is that they track
whether the CPU is occupied by a sched_class higher than SCX, which seems
a bit out of scope for a sched_class. Wanting to know that is fine, but
it's global system state and would be better tracked by hooking into
system events than built into sched_ext. I don't think the
acquire/release semantics are a good fit for it either.

> 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.

If sched_switch isn't enough, how about adding a tracepoint which tracks
the sched_class currently in effect on each CPU? That should cover both
scx_pair and your use case, and would be useful outside sched_ext too.

Thanks.

--
tejun

      reply	other threads:[~2026-10-20 19:00 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
2026-10-20 19:00       ` Tejun Heo [this message]

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=ba9d879aa8b0474d09577b82a1d68940@kernel.org \
    --to=tj@kernel.org \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=jpiecuch@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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.