summaryrefslogtreecommitdiff
path: root/kernel/cgroup/cgroup.c
diff options
context:
space:
mode:
authorRoman Gushchin <guro@fb.com>2019-04-26 10:59:45 -0700
committerTejun Heo <tj@kernel.org>2019-05-06 08:39:11 -0700
commit96b9c592def5d7203bdad1337d9c92a2183de5cb (patch)
treee7e9f4f31aa3c2182de25d660aba59cf3325d4cd /kernel/cgroup/cgroup.c
parentcb2c4cd87874a7975b7b8615866b3a87bae10aab (diff)
cgroup: get rid of cgroup_freezer_frozen_exit()
A task should never enter the exit path with the task->frozen bit set. Any frozen task must enter the signal handling loop and the only way to escape is through cgroup_leave_frozen(true), which unconditionally drops the task->frozen bit. So it means that cgroyp_freezer_frozen_exit() has zero chances to be called and has to be removed. Let's put a WARN_ON_ONCE() instead of the cgroup_freezer_frozen_exit() call to catch any potential leak of the task's frozen bit. Suggested-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Roman Gushchin <guro@fb.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup/cgroup.c')
-rw-r--r--kernel/cgroup/cgroup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 4fe9f7f1a3fa..327f37c9fdfa 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5926,9 +5926,8 @@ void cgroup_exit(struct task_struct *tsk)
css_set_move_task(tsk, cset, NULL, false);
cset->nr_tasks--;
- if (unlikely(cgroup_task_frozen(tsk)))
- cgroup_freezer_frozen_exit(tsk);
- else if (unlikely(cgroup_task_freeze(tsk)))
+ WARN_ON_ONCE(cgroup_task_frozen(tsk));
+ if (unlikely(cgroup_task_freeze(tsk)))
cgroup_update_frozen(task_dfl_cgroup(tsk));
spin_unlock_irq(&css_set_lock);