task_css_set_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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


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