Details
Description
This is related to MESOS-2128. Looks like the redhat doc linked in that ticket is not accurate. `memory.limit_in_bytes` has to be less than or equal to `memory.memsw.limit_in_bytes`. Otherwise, the kernel is gonna throw EINVAL. Here is the validation with a box that has swap disabled:
[root@ip-10-10-0-120 test]# pwd /sys/fs/cgroup/memory/test [root@ip-10-10-0-120 test]# sleep 1000000 & [1] 23121 [root@ip-10-10-0-120 test]# echo 23121 > tasks [root@ip-10-10-0-120 test]# cat tasks 23121 [root@ip-10-10-0-120 test]# cat memory.limit_in_bytes 9223372036854771712 [root@ip-10-10-0-120 test]# cat memory.memsw.limit_in_bytes 9223372036854771712 [root@ip-10-10-0-120 test]# echo 3000000 > memory.limit_in_bytes [root@ip-10-10-0-120 test]# echo 3000000 > memory.memsw.limit_in_bytes [root@ip-10-10-0-120 test]# echo 100000000 > memory.limit_in_bytes bash: echo: write error: Invalid argument [root@ip-10-10-0-120 test]# cat /proc/swaps Filename Type Size Used Priority
[root@ip-10-10-0-120 test]# sleep 100000 & [1] 31363 [root@ip-10-10-0-120 test]# echo 31363 > tasks [root@ip-10-10-0-120 test]# echo 3000000 > memory.memsw.limit_in_bytes bash: echo: write error: Invalid argument [root@ip-10-10-0-120 test]# echo 3000000 > memory.limit_in_bytes [root@ip-10-10-0-120 test]# echo 3000000 > memory.memsw.limit_in_bytes [root@ip-10-10-0-120 test]# echo 100000000 > memory.memsw.limit_in_bytes [root@ip-10-10-0-120 test]# echo 100000000 > memory.limit_in_bytes [root@ip-10-10-0-120 test]# cat memory.limit_in_bytes 99999744 [root@ip-10-10-0-120 test]# cat memory.memsw.limit_in_bytes 99999744
Related Docker issue: https://github.com/docker/docker/pull/25461
Attachments
Issue Links
- is related to
-
MESOS-2128 Turning on cgroups_limit_swap effectively disables memory isolation
- Resolved