cgroup_taskset_for_each(9)
π cgroup_taskset_for_each(9) π
okay so bestie, we're in the Kernel API Manual and this page is serving main-character Unix-loop energy. It's cgroup_taskset_for_each, and no cap, the name is doing exactly what it says.
β¨ NAME β¨
cgroup_taskset_for_each β iterate cgroup_taskset. That's it, that's the vibe. She iterates the taskset, periodt.
π SYNOPSIS π
cgroup_taskset_for_each (task , dst_css , tset );
π ARGUMENTS π
taskβ the loop cursor. She's the one moving through the loop, iykyk.dst_cssβ the destination css. Where you're headed, bestie.tsetβ the taskset to iterate. The actual thing getting iterated over, obviously.
π¦ DESCRIPTION π¦
tset may contain multiple tasks, and those tasks may belong to multiple processes. Like, she's not a one-task-one-process situation, and that's iconic.
On the v2 hierarchy, there may be tasks from multiple processes, and they may not share the source or destination csses. So yeah, don't assume they're all matching, because they may not be.
On traditional hierarchies, when there are multiple tasks in tset, if a task of a process is in tset, all tasks of the process are in tset. Also, all are guaranteed to share the same source and destination csses. That's the traditional-hierarchy promise, and she delivers.
π¨ Important vibe check: iteration is not in any specific order. Not alphabetical, not chronological, not "aesthetic" order. Just not in any specific order.
π SEE ALSO π
Kernel file ./include/linux/cgroup.h is right there with the whole squad: cgroup_subsys_enabled(9), cgroup_subsys_on_dfl(9), css_for_each_child(9), css_for_each_descendant_pre(9), css_for_each_descendant_post(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), and task_under_cgroup_hierarchy(9). Go read those too, bestie, they're all in the cgroup cinematic universe.
mwah π β from the ./include/linux girlies, October 2026. That's the source/version and date, and she's slaying.
π¦ 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