All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuba Piecuch <jpiecuch@google.com>
To: Tejun Heo <tj@kernel.org>
Cc: 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 PATCHSET sched_ext/for-7.4-fixes] sched_ext: sub: Don't run ops.sub_caps_updated() in an SCX op context
Date: Mon, 30 Nov 2026 12:53:26 +0000	[thread overview]
Message-ID: <20261130125254.1864040-1-jpiecuch@google.com> (raw)
In-Reply-To: <8e4043f995e96c0d4642287bc5009000@kernel.org>

Hi Tejun,

On Fri, 27 Nov 2026 15:43, Tejun Heo wrote:
> The synchronous delivery is intentional. Once it's deferred, it becomes
> unclear what happens when there are competing updates.
>
> ops.sub_caps_updated() is there only so that a sub-sched can propagate
> grants and revokes to its own children. It isn't the place for any other
> operation. ops.sub_ecaps_updated() is the one that reports a change once
> it's in effect on the cpu and it runs with the rq locked, so anything
> that acts on the caps, e.g. setting cpuperf, belongs there.
>
> All the listed failure modes are self-inflicted, e.g. a sub-sched calling
> scx_bpf_cidperf_set() from ops.sub_caps_updated() or a parent granting
> from ops.dump*(), and none of them is critical. Isn't this more of a
> documentation problem than anything else?

That makes sense, thanks for clarifying the intent.

The doc comment on @sub_caps_updated in kernel/sched/ext/internal.h
currently says "Delivered asynchronously after the change is recorded",
which is easy to read as running in a separate unlocked context, and
doesn't mention that it may run synchronously in the parent's
grant/revoke context (inheriting whatever lock the parent holds) in
addition to running unlocked.

I'll drop this RFC and send a doc patch clarifying @sub_caps_updated
(may run synchronously in the caller's locking context as well as
unlocked, intended only for tracking caps and propagating
grants/revokes, with cap-acting operations like scx_bpf_cidperf_set()
belonging in ops.sub_ecaps_updated()). Let me know if you'd also want
scx_kfunc_context_filter() to reject rq-lock-sensitive kfuncs from
ops.sub_caps_updated() at load time, or if updating the doc comment is
enough.

Thanks,
Kuba

  reply	other threads:[~2026-11-30 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 15:34 [RFC PATCHSET sched_ext/for-7.4-fixes] sched_ext: sub: Don't run ops.sub_caps_updated() in an SCX op context Kuba Piecuch
2026-11-25 15:34 ` [RFC PATCH 1/2] sched_ext: sub: Defer ops.sub_caps_updated() out of SCX op contexts Kuba Piecuch
2026-11-25 15:34 ` [RFC PATCH 2/2] selftests/sched_ext: Test that ops.sub_caps_updated() runs unlocked Kuba Piecuch
2026-11-25 16:06   ` sashiko-bot
2026-11-27 15:43 ` [RFC PATCHSET sched_ext/for-7.4-fixes] sched_ext: sub: Don't run ops.sub_caps_updated() in an SCX op context Tejun Heo
2026-11-30 12:53   ` Kuba Piecuch [this message]
2026-11-30 14:39     ` Tejun Heo
2026-11-30 15:54       ` Kuba Piecuch

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=20261130125254.1864040-1-jpiecuch@google.com \
    --to=jpiecuch@google.com \
    --cc=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=linux-kernel@vger.kernel.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 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.