]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
cgroup: reorder operations in cgroup_create()
authorTejun Heo <tj@kernel.org>
Fri, 6 Dec 2013 20:11:56 +0000 (15:11 -0500)
committerTejun Heo <tj@kernel.org>
Fri, 6 Dec 2013 20:11:56 +0000 (15:11 -0500)
commit0d80255e42b54419cfc6b10a3ec74b60fe04b8d7
tree05ca0985fc0797e2d8c607417a658f05d39cd7d9
parent780cd8b347b52584704438e599274f25c0a0fd13
cgroup: reorder operations in cgroup_create()

cgroup_create() currently does the followings.

1. alloc cgroup
2. alloc css's
3. create the directory and commit to cgroup creation
4. online css's
5. create cgroup and css files

The sequence performs allocations before other operations but it
doesn't buy anything because each of the above steps may fail and
should be unrollable.  Reorganize the sequence such that cgroup
operations are done before css operations.

1. alloc cgroup
2. create the directory and files and commit to cgroup creation
3. alloc css's
4. create files for and online css's

This simplifies the code a bit and enables further simplification and
separating out css creation from cgroup creation which is necessary
for the planned unified hierarchy where css's will be created and
destroyed dynamically across the lifetime of a cgroup.

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