runc/libcontainer/cgroups/systemd
Kir Kolyshkin c86be8a2c1 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 <kolyshkin@gmail.com>
2020-04-07 20:45:53 -07:00
..
apply_nosystemd.go systemd: Export IsSystemdRunning() function 2020-03-30 15:24:06 -07:00
apply_systemd.go Remove unused consts testScopeWait and testSliceWait 2020-04-03 21:09:43 +02:00
unified_hierarchy.go cgroupv2: fix setting MemorySwap 2020-04-07 20:45:53 -07:00