]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: remove cgroup_enable_task_cg_lists() optimization
authorTejun Heo <tj@kernel.org>
Thu, 24 Oct 2019 19:03:51 +0000 (12:03 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 25 Oct 2019 12:56:28 +0000 (05:56 -0700)
commit113294dd08165d3f79befd480ef53f63217949d8
tree485462f8daa9a37a6c5e6f8f70f2f4abcaa38099
parent395dfeeccd1ec5f4bb12e817c84d9b7c1f555c56
cgroup: remove cgroup_enable_task_cg_lists() optimization

cgroup_enable_task_cg_lists() is used to lazyily initialize task
cgroup associations on the first use to reduce fork / exit overheads
on systems which don't use cgroup.  Unfortunately, locking around it
has never been actually correct and its value is dubious given how the
vast majority of systems use cgroup right away from boot.

This patch removes the optimization.  For now, replace the cg_list
based branches with WARN_ON_ONCE()'s to be on the safe side.  We can
simplify the logic further in the future.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup.h
kernel/cgroup/cgroup.c
kernel/cgroup/cpuset.c