css_for_each...cendant_post(9)
π css_for_each_descendant_post β NAME β¨
ok so bestie, css_for_each_descendant_post is literally the post-order walk of a css's descendants π¦ like that's the whole vibe, that's the function.
(this whole page lives in the Kernel API Manual, and honestly? iconic of it.)
πΈ SYNOPSIS πΈ
css_for_each_descendant_post (pos , css );
two args, no drama, we move π
π ARGUMENTS π
posβ thecss *that you use as the loop cursor. it's the little pointer that goes scoot-scoot-scooting along your walk, tracking where you are πcssβ the css whose descendants you wanna walk. this is your main character, your starting point, your root π«Ά
π₯ DESCRIPTION π₯
okay so it's basically the sibling of css_for_each_descendant_pre β same energy β except this one does a post-order traversal instead of pre-order. so instead of hitting the parent first and then the kids, you go down and then come back up, and the root is included in the iterationβ¦ and it's the last node to be visited, not the first. it's giving "save the best for last" ngl π
now for the part that actually matters, the visibility lore:
- if a subsystem synchronizes
->css_onlineand the start of iteration, then a css which finished->css_onlineis guaranteed to be visible in the future iterations β and it'll stay visible until the last reference is put. no cap, it's locked in π - a css which hasn't finished
->css_online, or one that already finished->css_offline, may show up during traversal. like it might justβ¦ appear π rude but real. - and it's each subsystem's responsibility to synchronize against on/offlining. that's on you bestie, the walker is not gonna do it for you π
β οΈ also pls note: the walk visibility guarantee example described in the pre-order walk does not apply the same to post-order walks. so don't go assuming pre-order rules transfer over β they do not, and that's the tea π
π SEE ALSO π
Kernel file ./include/linux/cgroup.h, plus the whole friend group:
cgroup_subsys_enabled(9)cgroup_subsys_on_dfl(9)css_for_each_child(9)css_for_each_descendant_pre(9)cgroup_taskset_for_each(9)cgroup_taskset_for_each_leader(9)cgroup_css(9)css_is_dying(9)task_css_set_check(9)task_css_check(9)task_css_set(9)task_css(9)task_get_css(9)task_css_is_root(9)cgroup_is_descendant(9)cgroup_ancestor(9)cgroup_common_ancestor(9)task_under_cgroup_hierarchy(9)
and that's the page bestie, go forth and traverse π
sign-off era: this one's from ./include/linux, dated October 2026, and it's filed under css_for_each...cendant_post(9) β mwah, slay, 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