/*
* caller must hold freezer->lock
*/
-static void check_if_frozen(struct cgroup *cgroup,
- struct freezer *freezer)
+static void update_freezer_state(struct cgroup *cgroup,
+ struct freezer *freezer)
{
struct cgroup_iter it;
struct task_struct *task;
*/
if (nfrozen == ntotal)
freezer->state = CGROUP_FROZEN;
+ else if (nfrozen > 0)
+ freezer->state = CGROUP_FREEZING;
+ else
+ freezer->state = CGROUP_THAWED;
cgroup_iter_end(cgroup, &it);
}
if (state == CGROUP_FREEZING) {
/* We change from FREEZING to FROZEN lazily if the cgroup was
* only partially frozen when we exitted write. */
- check_if_frozen(cgroup, freezer);
+ update_freezer_state(cgroup, freezer);
state = freezer->state;
}
spin_unlock_irq(&freezer->lock);
freezer = cgroup_freezer(cgroup);
spin_lock_irq(&freezer->lock);
- check_if_frozen(cgroup, freezer); /* may update freezer->state */
+ update_freezer_state(cgroup, freezer);
if (goal_state == freezer->state)
goto out;
switch (freezer->state) {