Re: [PATCHSET sched_ext/for-7.2] sched_ext: Topological CPU IDs and cid-form struct_ops

From: Cheng-Yang Chou

Date: Tue Apr 21 2026 - 21:24:23 EST


Hi Tejun,

On Tue, Apr 21, 2026 at 08:33:51AM -1000, Tejun Heo wrote:
> > 1. Regarding the ext_cid feature (same as ext_idle), is it feasible to
> > implement this within the BPF arena instead of the current approach?
>
> No - cid-form struct_ops translates cids <-> cpus at the ops boundary,
> so the kernel needs direct access to the mapping. Building it also
> pulls from cpu_to_node() / cacheinfo / sibling masks which aren't
> reachable from BPF.

I see. Thanks for the details. (I was wondering if there might be an
opportunity to contribute here, but it sounds non-trivial. I'll just
keep it in mind for now.)

>
> > 2. I noticed rust/kernel/cpumask.rs is already in tree. ... would it be
> > a good time to start adding Rust abstractions ...
>
> I'd wait for a concrete in-tree consumer before growing Rust
> wrappers speculatively.

Agreed, it's definitely too early for that.

Should we also update the doc? Perhaps adding a dedicated 'Topological
CPU IDs (cids)' section would be better than just a one-liner. Also,
is there a need for a standalone selftest? I noticed scx_qmap already
utilizes ext_cid, so I wasn't sure if a separate test is required.

Happy to help with either, thanks!

--
Cheers,
Cheng-Yang