cpuset_for_each_child(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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