update_if_frozen(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… update_if_frozen(9) β€” a Kernel API Manual moment

okay so bestie, welcome to the update_if_frozen(9) page ✨ this is a little slice of the Kernel API Manual and honestly it's lowkey iconic once you get what it's doing. sit down, grab a boba, we're learning about cgroup freezing 🧊


🌸 NAME 🌸

update_if_frozen β€” update whether a cgroup finished freezing

like yes, that's literally the whole vibe: it updates the status of whether a cgroup is done freezing πŸ‘‘


✨ SYNOPSIS ✨

void update_if_frozen (struct cgroup_subsys_state *css );

that's it. that's the whole signature. short and slay 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • css β€” css of interest πŸ’– (yes that's the actual phrase in the docs, and honestly? iconic. it's the css you care about, the main character css, the one we're checking on)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• Once FREEZING is initiated, the transition to FROZEN is lazily updated by calling this function. lazy in the "it happens when you call me" way, not the "i'm not doing my homework" way, bestie πŸ’€

If the current state is FREEZING but not FROZEN, this function checks whether all tasks of this cgroup and the descendant cgroups finished freezing β€” and if they did, it sets FROZEN. slay, everyone's frozen, we can update the state 🧊✨

🚨 important caller responsibility moment 🚨 the caller is responsible for grabbing the RCU read lock and calling update_if_frozen on all descendants prior to invoking this function. not me forgetting the RCU read lock… couldn't be me πŸ™ˆ please do it. fr fr.

Task states and freezer state might disagree while tasks are being migrated into or out of css, so we can't verify task states against freezer state here β€” no cap, it's just not possible in this spot. See freezer_attach for details πŸ‘€ (yes, go read that one too, iykyk)


🌈 SEE ALSO 🌈

Kernel file ./kernel/cgroup/legacy_freezer.c πŸ—‚οΈ and the whole friend group:

go read them all, they're giving lore πŸ’œ


⭐ sign-off ⭐

this page lives in ./kernel/cgroup, dated October 2026, and it's update_if_frozen(9) β€” that's the whole footer, bestie, and honestly it ate πŸŽ€ bye, ily, go freeze some cgroups responsibly πŸ’…πŸ”₯

πŸ“¦ where this page comes from