STRUCT SCX_ENABLE_ARGS(9)
β¨ struct scx_enable_args(9) β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is struct scx_enable_args β literally the argument container for cid-form ops.enable(). no cap, that's the whole vibe. π
πΈ SYNOPSIS πΈ
struct scx_enable_args {
u64 cmask_arena_addr;
};
that's it. one member. she's minimal, she's iconic, she's booked and busy. π
π¦ Members π¦
cmask_arena_addrβ the BPF arena address of the cmask of the cids the task may run on. yes, that's a lot of words, but it's the map to where the mask lives, iykyk. π
π₯ Description π₯
so cmask_arena_addr is the task's affinity as it enters the scheduler. periodt. set_cmask delivers that exact same mask right after enable β before set_weight and before the first enqueue β and then again on every affinity change after that. and listen: set_cmask is never called before enable. so a scheduler can lowkey just track affinity in set_cmask alone. one callback, that's the whole job. slay. β¨
the kernel builds the mask in the scheduler arena from its own geometry, so the header is valid no matter what the scheduler last wrote in there. like, the kernel does not care about your messy leftovers, bestie π.
β οΈ okay this part is important, don't skip it: the memory is per-cpu scratch that gets reused once the callback returns. so copy the bits out β do not keep the address. the set_cmask argument follows the exact same rules. same rules, same energy, no exceptions π«Ά
the address is a plain value instead of a typed pointer because BTF can't mark a struct member as an arena pointer yet β and a pointer member would reach the program typed as a kernel pointer, which is giving chaos energy. so cast it to struct scx_cmask __arena * before use, mwah π. and once arena members can be typed, a typed alias will join this field in an anonymous union at the same offset. future glow-up incoming π.
π SEE ALSO π
Kernel file ./kernel/sched/ext/internal.h and also, gather round, the whole squad:
scx_add_event(9)__scx_add_event(9)struct sched_ext_ops(9)struct sched_ext_ops_cid(9)scx_arena_to_kaddr(9)scx_kaddr_to_arena(9)DEFINE_SCX_COMPAT_MARKER(9)scx_root_protected_live(9)scx_root_protected(9)scx_bypass_dsp_enabled(9)scx_ops_sanitize_err(9)scx_has_subs(9)scx_task_sched(9)scx_task_sched_rcu(9)scx_task_on_sched(9)scx_prog_sched(9)scx_parent(9)
and that's the page, bestie π β brought to you by ./kernel/sched/ext, dated October 2026, and yeah we're still on struct scx_enable_args(9) at the bottom because the footer said so and we respect the footer ππ§
π¦ 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