cgroup: pids: kill pids_fork(), simplify pids_can_fork() and pids_cancel_fork()
authorOleg Nesterov <oleg@redhat.com>
Fri, 27 Nov 2015 18:57:22 +0000 (19:57 +0100)
committerTejun Heo <tj@kernel.org>
Mon, 30 Nov 2015 14:48:18 +0000 (09:48 -0500)
commitafbcb364bee9e7cf46c94257a82cb9760b6d254f
tree0258ae0534c2d1933da6bf445b840db067a50941
parentc9e75f0492b248aeaa7af8991a6fc9a21506bc96
cgroup: pids: kill pids_fork(), simplify pids_can_fork() and pids_cancel_fork()

Now that we know that the forking task can't migrate amd the child is always
moved to the same cgroup by cgroup_post_fork()->css_set_move_task() we can
change pids_can_fork() and pids_cancel_fork() to just use task_css(current).
And since we no longer need to pin this css, we can remove pid_fork().

Note: the patch uses task_css_check(true), perhaps it makes sense to add a
helper or change task_css_set_check() to take cgroup_threadgroup_rwsem into
account.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup_pids.c