lkml.org 
[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 4/7] cgroup: rstat: support cgroup1
    On Tue 02-02-21 13:47:43, Johannes Weiner wrote:
    > Rstat currently only supports the default hierarchy in cgroup2. In
    > order to replace memcg's private stats infrastructure - used in both
    > cgroup1 and cgroup2 - with rstat, the latter needs to support cgroup1.
    >
    > The initialization and destruction callbacks for regular cgroups are
    > already in place. Remove the cgroup_on_dfl() guards to handle cgroup1.
    >
    > The initialization of the root cgroup is currently hardcoded to only
    > handle cgrp_dfl_root.cgrp. Move those callbacks to cgroup_setup_root()
    > and cgroup_destroy_root() to handle the default root as well as the
    > various cgroup1 roots we may set up during mounting.
    >
    > The linking of css to cgroups happens in code shared between cgroup1
    > and cgroup2 as well. Simply remove the cgroup_on_dfl() guard.
    >
    > Linkage of the root css to the root cgroup is a bit trickier: per
    > default, the root css of a subsystem controller belongs to the default
    > hierarchy (i.e. the cgroup2 root). When a controller is mounted in its
    > cgroup1 version, the root css is stolen and moved to the cgroup1 root;
    > on unmount, the css moves back to the default hierarchy. Annotate
    > rebind_subsystems() to move the root css linkage along between roots.

    I am not familiar with rstat API and from this patch it is not really
    clear to me how does it deal with memcg v1 use_hierarchy oddness.
    --
    Michal Hocko
    SUSE Labs

    \
     
     \ /
      Last update: 2021-02-04 14:43    [W:8.358 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site