cgroup: use RCU free in create_css() failure path
authorTejun Heo <tj@kernel.org>
Sun, 4 May 2014 19:09:14 +0000 (15:09 -0400)
committerTejun Heo <tj@kernel.org>
Sun, 4 May 2014 19:09:14 +0000 (15:09 -0400)
commita2bed8209a3afc3b2cf1c28383fb48155c1fea46
treeb0b7b2dbbd0bfa934353335cb73e5adbcf207986
parent6fa4918d03c39351aef3573ac3e7958d6a5ad9b6
cgroup: use RCU free in create_css() failure path

Currently, when create_css() fails in the middle, the half-initialized
css is freed by invoking cgroup_subsys->css_free() directly.  This
patch updates the function so that it invokes RCU free path instead.
As the RCU free path puts the parent css and owning cgroup, their
references are now acquired right after a new css is successfully
allocated.

This doesn't make any visible difference now but is to enable
implementing css->id and RCU protected lookup by such IDs.

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