Describe the bug
When setting memory.max/memory.swap.max in cgroup v2, Linux uses "max" instead of "-1" to indicate no restriction on memory usage. The set_limit and set_memswap_limit functions of the memory controller accept i64 as a parameter. In cgroupv2, if the parameter is -1, "max" should be written into the cgroup file.
Expected behavior
Setting "-1" to memory.max/memory.swap.max using memory_container.set_limit(-1) and memory_controller.set_memswap_limit(-1) should success in cgroup v2 instead of return an "invalid argument" error.
Describe the bug When setting memory.max/memory.swap.max in cgroup v2, Linux uses "max" instead of "-1" to indicate no restriction on memory usage. The set_limit and set_memswap_limit functions of the memory controller accept i64 as a parameter. In cgroupv2, if the parameter is -1, "max" should be written into the cgroup file.
Expected behavior Setting "-1" to memory.max/memory.swap.max using memory_container.set_limit(-1) and memory_controller.set_memswap_limit(-1) should success in cgroup v2 instead of return an "invalid argument" error.
Additional context https://facebookmicrosites.github.io/cgroup2/docs/memory-controller.html