]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cgroup: split cgroup destruction into two steps
authorTejun Heo <tj@kernel.org>
Fri, 14 Jun 2013 02:27:42 +0000 (19:27 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 14 Jun 2013 02:27:42 +0000 (19:27 -0700)
commitea15f8ccdb430af1e8bc9b4e19a230eb4c356777
treee75aa3f5ddac2a7092c0f16361d72f9b25232832
parent455050d23e1bfc47ca98e943ad5b2f3a9bbe45fb
cgroup: split cgroup destruction into two steps

Split cgroup_destroy_locked() into two steps and put the latter half
into cgroup_offline_fn() which is executed from a work item.  The
latter half is responsible for offlining the css's, removing the
cgroup from internal lists, and propagating release notification to
the parent.  The separation is to allow using percpu refcnt for css.

Note that this allows for other cgroup operations to happen between
the first and second halves of destruction, including creating a new
cgroup with the same name.  As the target cgroup is marked DEAD in the
first half and cgroup internals don't care about the names of cgroups,
this should be fine.  A comment explaining this will be added by the
next patch which implements the actual percpu refcnting.

As RCU freeing is guaranteed to happen after the second step of
destruction, we can use the same work item for both.  This patch
renames cgroup->free_work to ->destroy_work and uses it for both
purposes.  INIT_WORK() is now performed right before queueing the work
item.

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