summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup_pids.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-10-15 16:41:53 -0400
committerTejun Heo <tj@kernel.org>2015-10-15 16:41:53 -0400
commitafcf6c8b75444382e0f9996157207ebae34a8848 (patch)
tree6b8b8ccc4a99cfc7e156765c58ab285034980995 /kernel/cgroup_pids.c
parent2e91fa7f6d451e3ea9fec999065d2fd199691f9d (diff)
downloadlinux-afcf6c8b75444382e0f9996157207ebae34a8848.tar.gz
linux-afcf6c8b75444382e0f9996157207ebae34a8848.tar.bz2
linux-afcf6c8b75444382e0f9996157207ebae34a8848.zip
cgroup: add cgroup_subsys->free() method and use it to fix pids controller
pids controller is completely broken in that it uncharges when a task exits allowing zombies to escape resource control. With the recent updates, cgroup core now maintains cgroup association till task free and pids controller can be fixed by uncharging on free instead of exit. This patch adds cgroup_subsys->free() method and update pids controller to use it instead of ->exit() for uncharging. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Aleksa Sarai <cyphar@cyphar.com>
Diffstat (limited to 'kernel/cgroup_pids.c')
-rw-r--r--kernel/cgroup_pids.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cgroup_pids.c b/kernel/cgroup_pids.c
index 45f0856a61fe..cdd8df4e991c 100644
--- a/kernel/cgroup_pids.c
+++ b/kernel/cgroup_pids.c
@@ -266,7 +266,7 @@ static void pids_fork(struct task_struct *task, void *priv)
css_put(old_css);
}
-static void pids_exit(struct task_struct *task)
+static void pids_free(struct task_struct *task)
{
struct pids_cgroup *pids = css_pids(task_css(task, pids_cgrp_id));
@@ -347,7 +347,7 @@ struct cgroup_subsys pids_cgrp_subsys = {
.can_fork = pids_can_fork,
.cancel_fork = pids_cancel_fork,
.fork = pids_fork,
- .exit = pids_exit,
+ .free = pids_free,
.legacy_cftypes = pids_files,
.dfl_cftypes = pids_files,
};