Re: [PATCHSET v2 sched_ext/for-7.2] sched_ext: cid/cmask interface prep
From: Andrea Righi
Date: Thu Jun 04 2026 - 02:19:04 EST
Hi Tejun,
On Wed, Jun 03, 2026 at 04:00:28PM -1000, Tejun Heo wrote:
> Hello,
>
> v2:
> - New patch 2 reorders the BPF-side cmask helpers (cid.bpf.h) and their
> callers to (cid, mask) so the kernel and BPF interfaces match.
> - Bound scx_cmask_for_each_cid() to the active range so a stale word past
> it can't yield a phantom cid (sashiko AI).
> - scx_bpf_kick_cid() returns scx_cid_to_cpu()'s errno instead of -EINVAL
> (Andrea).
>
> v1: https://lore.kernel.org/r/20260603172153.3081861-1-tj@xxxxxxxxxx
>
> Preparatory changes to the cid/cmask interface that landed in for-7.2 this
> cycle - a single-cid helper-argument reorder on the kernel and BPF sides,
> two new helpers, and a kfunc return-type change. Posting ahead of the merge
> window, in particular the scx_bpf_kick_cid() return-type change in patch 4 -
> it changes a kfunc's signature and is cleaner to settle before 7.2 ships.
>
> - Patch 1 reorders the single-cid cmask helpers to (cid, mask), matching the
> kernel's index-first bit and cpumask predicates.
> - Patch 2 reorders the BPF-side counterparts in cid.bpf.h the same way.
> - Patch 3 adds scx_cmask_test() and scx_cmask_for_each_cid().
> - Patch 4 switches scx_bpf_kick_cid() from void to s32 so future cap
> enforcement can surface failures. The cid interface has no external users
> yet, so the ABI change is safe now.
>
> These are extracted from the in-development sub-scheduler series. Nothing
> here depends on the rest of that work.
Looks good to me.
Reviewed-by: Andrea Righi <arighi@xxxxxxxxxx>
Thanks,
-Andrea