cmask_from_cpumask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cmask_from_cpumask β€” the Kernel API Manual page, bestie edition πŸŽ€

okay so this is cmask_from_cpumask(9) from the Kernel API Manual, and honestly? she's a tiny little translator and she slays at her one job. let's get into it ✨


🌸 NAME 🌸

cmask_from_cpumask β€” translate a kernel cpumask to a cid-space cmask, no cap πŸ¦‹


✨ SYNOPSIS ✨

void cmask_from_cpumask (struct scx_cmask __arena *m , const struct
cpumask *cpumask );

look at her. two args, no return, zero drama. iconic. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • m β€” the cmask to fill, bestie. it gets zeroed first, and then only bits within [m->base, m->base + m->nr_cids) get updated. so if a cpu maps to a cid outside that range? it's getting ignored, sorry not sorry πŸ’…
  • cpumask β€” the kernel cpumask to translate. that's it, that's the whole vibe 🫢

πŸ’– DESCRIPTION πŸ’–

so for each cpu in cpumask, it sets that cpu's cid in m. literally that's the whole thing. simple, clean, ate. πŸ”₯

⚠️ but the tea is: the caller must ensure cpumask stays stable across the call β€” like, for example, holding an RCU read lock for task->cpus_ptr. do not let that thing shift under you mid-call, i am begging 😭

🌈 SEE ALSO 🌈

go read them, they're the friend group, you can't just know one of them πŸ’œ


kay that's the page!! source is ./tools/sched_ext/include/scx and this was dated October 2026 β€” mwah, bye bestie, go translate some cpumasks πŸ’…πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from