cc0ee5 cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow

23 files Authored by Chris Down 4 years ago, Committed by Packit Service 4 years ago,
    cgroup: Implement default propagation of MemoryLow with DefaultMemoryLow
    
    In cgroup v2 we have protection tunables -- currently MemoryLow and
    MemoryMin (there will be more in future for other resources, too). The
    design of these protection tunables requires not only intermediate
    cgroups to propagate protections, but also the units at the leaf of that
    resource's operation to accept it (by setting MemoryLow or MemoryMin).
    
    This makes sense from an low-level API design perspective, but it's a
    good idea to also have a higher-level abstraction that can, by default,
    propagate these resources to children recursively. In this patch, this
    happens by having descendants set memory.low to N if their ancestor has
    DefaultMemoryLow=N -- assuming they don't set a separate MemoryLow
    value.
    
    Any affected unit can opt out of this propagation by manually setting
    `MemoryLow` to some value in its unit configuration. A unit can also
    stop further propagation by setting `DefaultMemoryLow=` with no
    argument. This removes further propagation in the subtree, but has no
    effect on the unit itself (for that, use `MemoryLow=0`).
    
    Our use case in production is simplifying the configuration of machines
    which heavily rely on memory protection tunables, but currently require
    tweaking a huge number of unit files to make that a reality. This
    directive makes that significantly less fragile, and decreases the risk
    of misconfiguration.
    
    After this patch is merged, I will implement DefaultMemoryMin= using the
    same principles.
    
    (cherry picked from commit c52db42b78f6fbeb7792cc4eca27e2767a48b6ca)
    
    Related: #1763435
    
    patch_name: 0406-cgroup-Implement-default-propagation-of-MemoryLow-wi.patch
    present_in_specfile: true
    location_in_specfile: 406
    squash_commits: true
    
        
file modified
+1 -0
file modified
+50 -8
file modified
+6 -0
file modified
+7 -0
file modified
+10 -3
file modified
+1 -1
file modified
+1 -1
file modified
+3 -0
file modified
+6 -0
file added
+5
file modified
+10 -0