cpuset_for_each_child(9)
π cpuset_for_each_child β traverse online children of a cpuset
okay bestie, so you know how the kernel API manual has this whole cpuset_for_each_child(9) situation? yeah. we're getting into it. this is the one that walks you through the online children of a cpuset, and honestly it's giving very much "main character energy" for cgroup traversal. let's break it down so you actually get it, no cap.
β¨ SYNOPSIS β¨
cpuset_for_each_child (child_cs , pos_css , parent_cs );
literally the whole vibe in one line. periodt.
π ARGUMENTS π
child_csβ this is your loop cursor, and it's pointing at the current child. think of it as your little "where am I right now" bestie. it moves as you iterate, okay? don't lose track of it. π«Άpos_cssβ this one is used for iteration. yeah, that's it. it's the pos helper that keeps the walk going. iconic behavior, honestly. β¨parent_csβ the target cpuset whose children you're walking. this is the mom friend of the operation. you're traversing its online children. πΈ
π¦ DESCRIPTION π¦
so what does it actually do? it walks child_cs through the online children of parent_cs. that's the whole assignment. no cap.
but here's the thing, and I need you to hear me on this: π¨ Must be used with RCU read locked. π¨ like, actually. do not skip that. if you're not holding the RCU read lock, you're not doing it right, and the kernel is not gonna be nice about it. this is a hard requirement, not a suggestion. lock it up before you walk, bestie. π
π SEE ALSO π
- Kernel file
./kernel/cgroup/cpuset-internal.hβ go read it, iykyk. π cpuset_for_each_descendant_pre(9)β the descendant pre-order version, if you're feeling extra. π₯
lowkey reminder: RCU read lock. don't make me say it again. okay I will say it again: RCU read lock. π
and that's the whole page, bestie! you ate that. slay. π
this masterpiece came from ./kernel/cgroup, October 2026, and it's the cpuset_for_each_child(9) manual page β catch you on the next traversal. 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