Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-7237

Enabling cgroups_limit_swap can lead to "invalid argument" error.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.0.2, 1.1.0, 1.2.0
    • 1.1.2, 1.2.1, 1.3.0
    • None
    • None
    • CentOS 7.

    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

          Activity

            People

              jieyu Jie Yu
              jieyu Jie Yu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: