runc/libcontainer/cgroups/fs
Kir Kolyshkin d57f5bb286 cgroupv1: don't ignore MemorySwap if Memory==-1
Commit 18ebc51b3cc3 "Reset Swap when memory is set to unlimited (-1)"
added handling of the case when a user updates the container limits
to set memory to unlimited (-1) but do not set any other limits.
Apparently, in this case, if swap limit was previously set, kernel fails
to set memory.limit_in_bytes to -1 if memory.memsw.limit_in_bytes is
not set to -1.

What the above commit fails to handle correctly is the request when
Memory is set to -1 and MemorySwap is set to some specific limit N
(where N > 0). In this case, the value of N is silently discarded
and MemorySwap is set to -1 instead.

This is wrong thing to do, as the limit set, even if incorrectly,
should not be ignored.

Fix this by only assigning MemorySwap == -1 in case it was not
explicitly set.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-05-20 17:23:40 -07:00
..
apply_raw.go Replace formatted errors when unneeded 2020-05-16 18:13:21 -07:00
apply_raw_test.go Fix skip message for cgroupv2 2020-02-03 14:27:12 +02:00
blkio.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
blkio_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
cpu.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
cpu_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
cpuacct.go Add reading of information from cpuacct.usage_all 2020-05-05 08:51:12 +02:00
cpuacct_test.go Add reading of information from cpuacct.usage_all 2020-05-05 08:51:12 +02:00
cpuset.go fix "libcontainer/cgroups/fs/cpuset.go:63:14: undefined: fmt" 2020-05-19 23:38:20 +09:00
cpuset_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
devices.go Replace formatted errors when unneeded 2020-05-16 18:13:21 -07:00
devices_test.go cgroupv1: devices: use minimal transition rules with devices.Emulator 2020-05-13 17:42:43 +10:00
freezer.go cgroups: add GetFreezerState() helper to Manager 2020-05-13 17:38:45 +10:00
freezer_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
fs_unsupported.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
hugetlb.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
hugetlb_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
kmem.go libcontainer: use errors.Is() and errors.As() 2020-04-02 20:34:01 -07:00
kmem_disabled.go cgroups: nokmem: error out on explicitly-set kmemcg limits 2018-12-01 14:31:35 +11:00
memory.go cgroupv1: don't ignore MemorySwap if Memory==-1 2020-05-20 17:23:40 -07:00
memory_test.go Exposing memory.numa_stats 2020-04-08 17:40:09 +02:00
name.go Move the process outside of the systemd cgroup 2016-02-19 11:26:46 -08:00
net_cls.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
net_cls_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
net_prio.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
net_prio_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
perf_event.go Rename parent and data 2015-11-05 19:12:53 +08:00
pids.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
pids_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00
stats_util_test.go Replace formatted errors when unneeded 2020-05-16 18:13:21 -07:00
util_test.go cgroup2: split fs2 from fs 2019-12-06 15:42:10 +09:00