aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_freezer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup_freezer.c')
-rw-r--r--kernel/cgroup_freezer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 59e9ef6aab40..eb3f34d57419 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -47,17 +47,20 @@ static inline struct freezer *task_freezer(struct task_struct *task)
47 struct freezer, css); 47 struct freezer, css);
48} 48}
49 49
50int cgroup_frozen(struct task_struct *task) 50int cgroup_freezing_or_frozen(struct task_struct *task)
51{ 51{
52 struct freezer *freezer; 52 struct freezer *freezer;
53 enum freezer_state state; 53 enum freezer_state state;
54 54
55 task_lock(task); 55 task_lock(task);
56 freezer = task_freezer(task); 56 freezer = task_freezer(task);
57 state = freezer->state; 57 if (!freezer->css.cgroup->parent)
58 state = CGROUP_THAWED; /* root cgroup can't be frozen */
59 else
60 state = freezer->state;
58 task_unlock(task); 61 task_unlock(task);
59 62
60 return state == CGROUP_FROZEN; 63 return (state == CGROUP_FREEZING) || (state == CGROUP_FROZEN);
61} 64}
62 65
63/* 66/*