scx_next_descendant_pre(9)
π scx_next_descendant_pre β find the next descendant for pre-order walk π
okay so bestie, welcome to the Kernel API Manual, section 9 (that's the kernel-API girlies section, iykyk). today we're talking about scx_next_descendant_pre(9) and honestly? she's a helper. a little iterator gremlin. and she ate. β¨
πΈ SYNOPSIS πΈ
struct scx_sched * scx_next_descendant_pre (struct scx_sched *pos ,
struct scx_sched *root );
literally just two args, both struct scx_sched *, and she hands you back a struct scx_sched *. no cap. π«Ά
π ARGUMENTS π
posβ the current position, bestie. and listen β you passNULLto initiate the traversal. that's your "start the walk" button. πrootβ the sched whose descendants we're walking. the main character, basically. she owns the whole subtree we're poking around in.
π¦ DESCRIPTION π¦
okay so this one is explicitly "to be used by scx_for_each_descendant_pre" β she's not really a solo act, she's the supporting cast for that macro. the way that she works is: you give her your current position and the root, and she finds the next descendant to visit for a pre-order traversal of root's descendants. π
and here's the important deet, do NOT miss this: root is included in the iteration, and root is the first node to be visited. so like... she's in the group chat too. she's not just the admin who spawned everyone. periodt. π
pre-order = visit the node, then her descendants. root first, always. don't come for her. π
π§ SEE ALSO π§
okay so the source of truth is the kernel file ./kernel/sched/ext/sub.c, and then there is a whole squad of related functions β not me listing all of them, but also yes me listing all of them, because they're iconic and you should know them π:
scx_skip_subtree_pre(9)scx_rescue_charge(9)scx_rescue_end(9)scx_rescue_keep(9)scx_rescue_accrue(9)scx_rescue_admit(9)scx_rescue_try_admit(9)scx_rescue_check_overload(9)scx_rescue_timerfn(9)scx_resolve_local_dsq(9)queue_sync_ecaps(9)scx_process_sync_ecaps(9)scx_unbypass_replay_ecaps(9)scx_discard_stale_ecaps_syncs(9)scx_rehome_task(9)scx_punt_task(9)scx_cgroup_claim_subtree(9)scx_cgroup_return_subtree(9)scx_cgroup_task_migrating(9)scx_cgroup_task_migrated(9)scx_cgroup_task_migrate_canceled(9)scx_bpf_sub_dispatch(9)scx_bpf_sub_grant(9)scx_bpf_sub_revoke(9)scx_bpf_sub_caps(9)scx_bpf_sub_kill_bstr(9)
like, that's a roster. the whole scx_bpf_sub_* family showing up together? it's giving family reunion. π₯
β sign-off β
this page lives in ./kernel/sched/ext, dated October 2026, and yes, the girl herself is scx_next_descendant_pre(9) β she said it, we read it, we stan. bye bestie, go walk that tree in pre-order π
ππ
π¦ 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