• P
    vircgroup: introduce virCgroupV2MakeGroup · 89f52abd
    Pavel Hrdina 提交于
    When creating cgroup hierarchy we need to enable controllers in the
    parent cgroup in order to be usable.  That means writing "+{controller}"
    into cgroup.subtree_control file.  We can enable only controllers that
    are enabled for parent cgroup, that means we need to do that for the
    whole cgroup tree.
    
    Cgroups for threads needs to be handled differently in cgroup v2.  There
    are two types of controllers:
    
        - domain controllers: these cannot be enabled for threads
        - threaded controllers: these can be enabled for threads
    
    In addition there are multiple types of cgroups:
    
        - domain: normal cgroup
        - domain threaded: a domain cgroup that serves as root for threaded
                           cgroups
        - domain invalid: invalid cgroup, can be changed into threaded, this
                          is the default state if you create subgroup inside
                          domain threaded group or threaded group
        - threaded: threaded cgroup which can have domain threaded or
                    threaded as parent group
    
    In order to create threaded cgroup it's sufficient to write "threaded"
    into cgroup.type file, it will automatically make parent cgroup
    "domain threaded" if it was only "domain".  In case the parent cgroup
    is already "domain threaded" or "threaded" it will modify only the type
    of current cgroup.  After that we can enable threaded controllers.
    Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
    89f52abd
vircgroupbackend.h 14.8 KB