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 <[email protected]>
Cc: Aleksa Sarai <[email protected]>
This commit is contained in:
Tejun Heo 2015-10-15 16:41:53 -04:00
commit afcf6c8b75
4 changed files with 14 additions and 2 deletions

View file

@ -637,6 +637,10 @@ void exit(struct task_struct *task)
Called during task exit.
void free(struct task_struct *task)
Called when the task_struct is freed.
void bind(struct cgroup *root)
(cgroup_mutex held by caller)