Re: [RFC PATCHSET sched_ext/for-7.4-fixes] sched_ext: sub: Don't run ops.sub_caps_updated() in an SCX op context
From: Tejun Heo
Date: Fri Nov 27 2026 - 10:43:15 EST
Hello, Kuba.
On Wed, Nov 25, 2026 at 03:34:19PM +0000, Kuba Piecuch wrote:
> scx_bpf_sub_grant() and scx_bpf_sub_revoke() are in scx_kfunc_ids_any, so
> a parent scheduler can call them from any op. Before returning, they
> deliver ops.sub_caps_updated() to the affected children synchronously:
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?
Thanks.
--
tejun