• Tejun Heo's avatar
    cgroup: implement cgroup_subsys->depends_on · af0ba678
    Tejun Heo authored
    Currently, the blkio subsystem attributes all of writeback IOs to the
    root.  One of the issues is that there's no way to tell who originated
    a writeback IO from block layer.  Those IOs are usually issued
    asynchronously from a task which didn't have anything to do with
    actually generating the dirty pages.  The memory subsystem, when
    enabled, already keeps track of the ownership of each dirty page and
    it's desirable for blkio to piggyback instead of adding its own
    per-page tag.
    
    blkio piggybacking on memory is an implementation detail which
    preferably should be handled automatically without requiring explicit
    userland action.  To achieve that, this patch implements
    cgroup_subsys->depends_on which contains the mask of subsystems which
    should be enabled together when the subsystem is enabled.
    
    The previous patches already implemented the support for enabled but
    invisible subsystems and cgroup_subsys->depends_on can be easily
    implemented by updating cgroup_refresh_child_subsys_mask() so that it
    calculates cgroup->child_subsys_mask considering
    cgroup_subsys->depends_on of the explicitly enabled subsystems.
    
    Documentation/cgroups/unified-hierarchy.txt is updated to explain that
    subsystems may not become immediately available after being unused
    from userland and that dependency could be a factor in it.  As
    subsystems may already keep residual references, this doesn't
    significantly change how subsystem rebinding can be used.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarLi Zefan <lizefan@huawei.com>
    Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    af0ba678
unified-hierarchy.txt 15.7 KB