Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgroupv2: fix setting MemorySwap #2288

Merged
merged 1 commit into from
Apr 8, 2020

Commits on Apr 8, 2020

  1. cgroupv2: fix setting MemorySwap

    The resources.MemorySwap field from OCI is memory+swap, while cgroupv2
    has a separate swap limit, so subtract memory from the limit (and make
    sure values are set and sane).
    
    Make sure to set MemorySwapMax for systemd, too. Since systemd does not
    have MemorySwapMax for cgroupv1, it is only needed for v2 driver.
    
    [v2: return -1 on any negative value, add unit test]
    [v3: treat any negative value other than -1 as error]
    
    Signed-off-by: Kir Kolyshkin <[email protected]>
    kolyshkin committed Apr 8, 2020
    Configuration menu
    Copy the full SHA
    c86be8a View commit details
    Browse the repository at this point in the history