• T
    cgroup: reorder operations in cgroup_create() · 0d80255e
    Tejun Heo 提交于
    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: NTejun Heo <tj@kernel.org>
    Acked-by: NLi Zefan <lizefan@huawei.com>
    0d80255e
cgroup.c 146.8 KB