scx_arena_to_kaddr(9)
π scx_arena_to_kaddr β from the Kernel API Manual (section 9, bestie)
okay so real talk, you're reading the scx_arena_to_kaddr(9) page, which lives in the Kernel API Manual, and it is genuinely one of the most useful little translators in the whole sched_ext situation. let me walk you through it π«Ά
β¨ NAME β¨
scx_arena_to_kaddr β the glow-up that turns a BPF-arena pointer into its actual kernel address π«
π SYNOPSIS π
void * scx_arena_to_kaddr (struct scx_sched *sch , const void *bpf_ptr );
πΈ ARGUMENTS πΈ
schβ the scheduler whose arena is hostingbpf_ptr. like, whose house is this pointer staying at πbpf_ptrβ the BPF-arena pointer itself. heads up: only the low 32 bits get used, bestie π
π DESCRIPTION π
so here's the tea β β the (u32) cast is the main character here. it normalizes any input you throw at it into the arena's 4 GiB kern_vm range. no cap.
and when you pair that with scratch-page fault recovery? the returned pointer is safe to dereference up to GUARD_SZ / 2 past the intended object. iconic behavior, honestly π
but listen β if you need to access anything larger than GUARD_SZ / 2, you must explicitly bounds-check it yourself. this is not optional. don't let the vibe check catch you slipping π
π¦ SEE ALSO π¦
Kernel file ./kernel/sched/ext/internal.h, plus the whole friend group:
scx_add_event(9)__scx_add_event(9)struct scx_enable_args(9)struct sched_ext_ops(9)struct sched_ext_ops_cid(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)
that's the whole page, bestie β you ate that π this gem came out of ./kernel/sched/ext in October 2026, so if anyone asks, that's the receipts π₯ mwah π
π¦ 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