task_css_set_check(9)
π task_css_set_check(9) β¨
okay so bestie, welcome to the kernel API manual β this one's a macro page, and honestly? she's kind of a vibe. buckle up π
πΈ NAME πΈ
task_css_set_check β literally just: obtain a task's css_set, but with extra access conditions baked in. that's the whole assignment π
β¨ SYNOPSIS β¨
task_css_set_check (task , __c );
yes, the spacing is real, no i'm not fixing it, that's how she's written π
π«Ά ARGUMENTS π«Ά
taskβ the task you wanna get the css_set for. the main character, if you will π__cβ an extra condition expression, and it gets passed straight torcu_dereference_check. so like, your little bonus vibe check π
π₯ DESCRIPTION π₯
so a task's css_set is RCU protected β meaning it's got that read-copy-update energy protecting it π and it gets initialized and exited while holding task_lock. also, it can only be modified while holding both cgroup_mutex and task_lock, and only while the task is still alive. not me being strict about the lock order π
what this macro does: it verifies that the caller is actually inside a proper critical section, then returns the task's css_set. that's it. that's the whole thing. it's giving bouncer-at-the-club checking your ID before letting you in π
and because life isn't one-size-fits-all, the caller can also pass additional allowed conditions via __c β like the locks used during the cgroup_subsys::attach methods. so basically you can tell her "hey, i also have this lock, that's fiiiine" β¨
π 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)css_for_each_descendant_post(9)cgroup_taskset_for_each(9)cgroup_taskset_for_each_leader(9)cgroup_css(9)css_is_dying(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)
ok and one genuine heads-up bestie: this is a check macro, so the "proper critical section" thing is not decorative β it's asserting your locking is correct. don't be out here calling it from nowhere and then acting surprised π
and that's the page!! sourced from ./include/linux, dated October 2026, filed under task_css_set_check(9) β slay, go read your locks, ily π¦ππ
π¦ 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