• Tejun Heo's avatar
    cgroup: allocate 2x cgrp_cset_links when setting up a new root · 04313591
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarZefan Li <lizefan@huawei.com>
    04313591
cgroup.c 166 KB