• Tejun Heo's avatar
    cgroup: call subsys->*attach() only for subsystems which are actually affected by migration · bfc2cf6f
    Tejun Heo authored
    Currently, subsys->*attach() callbacks are called for all subsystems
    which are attached to the hierarchy on which the migration is taking
    place.
    
    With cgroup_migrate_prepare_dst() filtering out identity migrations,
    v1 hierarchies can avoid spurious ->*attach() callback invocations
    where the source and destination csses are identical; however, this
    isn't enough on v2 as only a subset of the attached controllers can be
    affected on controller enable/disable.
    
    While spurious ->*attach() invocations aren't critically broken,
    they're unnecessary overhead and can lead to temporary overcharges on
    certain controllers.  Fix it by tracking which subsystems are affected
    by a migration and invoking ->*attach() callbacks only on those
    subsystems.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarZefan Li <lizefan@huawei.com>
    bfc2cf6f
cgroup-v1.c 35.5 KB