scx_cmask_ref_or(9)
π scx_cmask_ref_or β a.k.a. the "OR it in, bestie" moment π
okay so real talk, this page is from the Kernel API Manual (section 9, the fancy kernel-internals section, iykyk) and it's all about scx_cmask_ref_or, which is a whole vibe. buckle up π
β¨ NAME β¨
scx_cmask_ref_or β OR @src into the arena cmask referenced by @ref. that's it, that's the tweet. slay π
π¦ SYNOPSIS π¦
void scx_cmask_ref_or (const struct scx_cmask_ref *ref , const struct
scx_cmask *src );
literally just one function, no return value, void energy, it's giving "I do the thing and I don't owe you a return code" π
πΈ ARGUMENTS πΈ
refβ a validated ref. it's already been vibe-checked, so you can trust it π«Άsrcβ a stable kernel cmask. stable as in "not going anywhere", not as in "horse". π
π₯ DESCRIPTION π₯
okay so here's the tea β β the bits that live inside the intersection of ref's snapshotted range and src's range get OR'd into ref->src. and the bits outside that intersection? untouched. left completely unchanged. not me ignoring my responsibilities π
and the stores on ref->src use WRITE_ONCE, because BPF may read/write concurrently β like, at the same time, no cap. so we're being polite about it. WRITE_ONCE is the main character here and it's carrying the whole function, honestly π
ngl, if you're out here ignoring the concurrent read/write situation you're gonna have a bad time β the manpage is very clear that WRITE_ONCE is there because BPF can read and write concurrently. that's the whole reason. don't skip it. π
π SEE ALSO π
the whole friend group π the kernel file is ./kernel/sched/ext/cid.c and it's surrounded by icons:
scx_cid_publish_tables(9)scx_cid_retire_tables(9)scx_cid_init(9)scx_cmask_clear(9)scx_cmask_fill(9)scx_bpf_cid_override(9)scx_bpf_cid_to_cpu(9)scx_bpf_cpu_to_cid(9)scx_cmask_subset(9)scx_cmask_empty(9)scx_bpf_cid_topo(9)scx_cmask_ref_init(9)scx_cmask_ref_init_kern(9)scx_cmask_ref_shard(9)scx_cmask_ref_copy(9)scx_cmask_ref_from_cpumask(9)
all 9's, all iconic, all in the group chat. go read them too, bestie, they ate π₯
π the cute sign-off π
this page lives in ./kernel/sched/ext (the source, the home base, the main character address) and it's dated October 2026 β yes, the future, because we're ahead of the game β and the whole thing is filed as scx_cmask_ref_or(9), which is also its version tag situation, and honestly? it's giving iconic. periodt. π
β¨π¦πΈπ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms