1. 05 10月, 2018 2 次提交
    • 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
    • P
      util: introduce cgroup v2 files · b4ddf5ae
      Pavel Hrdina 提交于
      Place cgroup v2 backend type before cgroup v1 to make it obvious
      that cgroup v2 is preferred implementation.
      
      Following patches will introduce support for hybrid configuration
      which will allow us to use both at the same time, but we should
      prefer cgroup v2 regardless.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      b4ddf5ae
  2. 25 9月, 2018 38 次提交