Re: [PATCH sched_ext/for-7.4-fixes] sched_ext: Clarify ops.sub_caps_updated() context and intended use

From: Kuba Piecuch

Date: Mon Nov 30 2026 - 12:21:35 EST


Hi Tejun,

On Mon, 30 Nov 2026 15:26, Tejun Heo wrote:
> AFAICS, this doesn't hold when a delivery for the shard is already in
> flight. caps_updated_record() then only folds the change into the buffer
> and the kfunc returns without delivering it. The caller which is already
> delivering reports the change from its own context, possibly after the
> kfunc that made the change has returned. This can only happen when updates
> to the same shard race each other. Maybe we can figure out something
> better in the future but, for now, can you document the condition? The
> same goes for the struct scx_caps_updated comment and the two kfunc
> comments.

Good catch, thanks.

> Also, scx_bpf_sub_revoke() walks the whole subtree, so the caller can be
> any ancestor, not only the parent.

Agreed, thanks.

> Leaving the delivery to scx_sub_seed_caps() isn't specific to
> ops.sub_attach(). It happens for any grant or revoke made before the
> child's ops are ready.

Makes sense -- will address all of the above in v2.

Thanks,
Kuba