cgroup_e_css_by_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cgroup_e_css_by_mask(9)

okay bestie, welcome to the Kernel API Manual β€” this one's called cgroup_e_css_by_mask and it's literally the glow-up version of cgroup_css. we're getting the effective css for a ss, and yes that sentence will make sense in like two seconds, keep reading 🫢


✨ SYNOPSIS ✨

struct cgroup_subsys_state * cgroup_e_css_by_mask (struct cgroup *cgrp ,
struct cgroup_subsys *ss );

like, it hands you back a struct cgroup_subsys_state * pointer, no cap πŸŽ€


🌸 ARGUMENTS 🌸

  • cgrp β€” the cgroup you're curious about, the one we're snooping on πŸ’–
  • ss β€” the subsystem you care about. tiny detail, huge vibe: if you pass NULL, it just returns cgrp->self πŸͺž

πŸ¦‹ DESCRIPTION πŸ¦‹

so it's similar to cgroup_css, right? but instead of the plain thing, it returns the effective css. and what even is that β€” it's defined as the matching css of the nearest ancestor including self that has ss enabled. closest one up the family tree (or you yourself, main character energy) that actually has the subsystem turned on πŸ‘‘

and here's the guarantee that makes it iconic: if ss is associated with the hierarchy cgrp is on, this function is guaranteed to return non-NULL css. so no NULL-checking panic spiral in that case, you're safe bestie ✨


πŸ”₯ SEE ALSO πŸ”₯

it's giving extended universe, and we're listing the whole cast. all of these live in the Kernel file ./kernel/cgroup/cgroup.c:


🫢 tiny reminder bestie: that non-NULL promise only kicks in when ss is associated with the hierarchy cgrp is on. don't go quoting me out of context πŸ’…

and that's the whole page, periodt 🌈 this gem comes from ./kernel/cgroup and it's dated October 2026 β€” go forth and get those effective csses, iykyk πŸ’œπŸ§š

πŸ“¦ where this page comes from