]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: allocate 2x cgrp_cset_links when setting up a new root
authorTejun Heo <tj@kernel.org>
Thu, 3 Mar 2016 14:58:01 +0000 (09:58 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 3 Mar 2016 14:58:01 +0000 (09:58 -0500)
commit0dce8506a9eec3f34c4ace528733eeb160fc4d02
treeeb0582020cd0369d8767c813149b9eec7dddde8e
parent0cc4671278b6aefe9490fead60866dff1358d89c
cgroup: allocate 2x cgrp_cset_links when setting up a new root

During prep, cgroup_setup_root() allocates cgrp_cset_links matching
the number of existing css_sets to later link the new root.  This is
fine for now as the only operation which can happen inbetween is
rebind_subsystems() and rebinding of empty subsystems doesn't create
new css_sets.

However, while not yet allowed, with the recent reimplementation,
rebind_subsystems() can rebind subsystems with descendant csses and
thus can create new css_sets.  This patch makes cgroup_setup_root()
allocate 2x of the existing css_sets so that later use of live
subsystem rebinding doesn't blow up.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
kernel/cgroup.c