Project: mesos
Issue MESOS-2128: Turning on cgroups_limit_swap effectively disables memory isolation
Our test runs show that enabling cgroups_limit_swap effectively disables memory isolation altogether. Per: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/sec-memory.html "It is important to set the memory.limit_in_bytes parameter before setting the memory.memsw.limit_in_bytes parameter: attempting to do so in the reverse order results in an error. This is because memory.memsw.limit_in_bytes becomes available only after all memory limitations (previously set in memory.limit_in_bytes) are exhausted." Looks like the flag sets "memory.memsw.limit_in_bytes" if true and "memory.limit_in_bytes" if false, but should always set "memory.limit_in_bytes" and in addition set "memory.memsw.limit_in_bytes" if true. Otherwise the limits won't be set and enforced. See: https://github.com/apache/mesos/blob/c8598f7f5a24a01b6a68e0f060b79662ee97af89/src/slave/containerizer/isolators/cgroups/mem.cpp#L365
Story points: 2