css_is_dying(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ css_is_dying β€” a.k.a. the "is my cgroup literally dying rn" check ✨

okay so this is a page from the Kernel API Manual, bestie, and it's called css_is_dying. yes that's the real name. yes it's dramatic. no we're not changing it. πŸ’…


🌸 NAME 🌸

css_is_dying β€” test whether the specified css is dying

like, is it okay? is it thriving? is it on its way out? this function tells you.


✨ SYNOPSIS ✨

bool css_is_dying (struct cgroup_subsys_state *css );

one function, one bool, one vibe check. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • css β€” target css. that's the one you're asking about. the main character of this whole operation, honestly.

πŸ’– DESCRIPTION πŸ’–

okay so what this does is test whether css is in the process of offlining or already offline. that's it. that's the function. πŸ¦‹

in most cases, ->css_online and ->css_offline callbacks should be enough β€” like, normally those two have you covered and you don't need to come knocking here. however, the actual offline operations are RCU delayed, and this test returns true also when css is scheduled to be offlined. so it's not just "already gone" β€” it's also "on the list, please hold". ⏳

this is useful, for example, when the use case requires synchronous behavior with respect to cgroup removal. because here's the situation: cgroup removal schedules css offlining, but the css can seem alive while the operation is being delayed. 😭 it's giving "ghosted but technically still in the group chat". if the delay affects user visible semantics, this test can be used to resolve the situation. so like β€” when the vibes are ambiguous, this is how you get a straight answer. ✨

ngl, the whole point is that "seems alive" β‰  "is alive", and this function is the one who will tell you the truth. 🫢

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/linux/cgroup.h, plus the whole friend group:


and that's the whole page, bestie πŸ’œ this one lives in ./include/linux and it's dated October 2026 β€” so yeah, mark your calendar, screenshot it, send it to the group chat. mwah. πŸŽ€β­

πŸ“¦ where this page comes from