----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/24316/#review49817 -----------------------------------------------------------
src/linux/cgroups.cpp <https://reviews.apache.org/r/24316/#comment87175> This should fit in one line src/slave/containerizer/isolators/cgroups/mem.cpp <https://reviews.apache.org/r/24316/#comment87194> Hum, here is what I think is the right way to do this: 1) Added a field 'limitSwap' in the isolator class. 2) In ::create(), based on the flag.limit_swap and whether "memory.memsw.limit_in_bytes" is available (by calling cgroups::memory::memsw_limit_in_bytes() on cgroups_root), set 'limitSwap' field accordingly (when create the isolator). More specifically: - if flag.limit_swap == false, set limitSwap to false - if flag.limit_swap == true but memsw_limit_in_bytes is not available, return error on ::create - if flag.limit_swap = true and memsw_limit_in_bytes is available, set limitSwap to true 3) If 'limitSwap == true', we always read/write memsw_limit_in_bytes. Otherwise, we always read/write limit_in_bytes. src/slave/flags.hpp <https://reviews.apache.org/r/24316/#comment87178> Add a period at the end of a sentence. - Jie Yu On Aug. 6, 2014, 6:52 p.m., Anton Lindström wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/24316/ > ----------------------------------------------------------- > > (Updated Aug. 6, 2014, 6:52 p.m.) > > > Review request for mesos. > > > Bugs: MESOS-1662 > https://issues.apache.org/jira/browse/MESOS-1662 > > > Repository: mesos-git > > > Description > ------- > > Changed memory.limit_in_bytes to memory.memsw.limit_in_bytes where memory is > limited. This makes Mesos limit both memory and swap as described in the Jira > ticket. > > Using --limit-swap, it's possible to use memory.memsw.limit_in_bytes. If it > doesn't exist it will fallback on memory.limit_in_bytes. > > > Diffs > ----- > > src/linux/cgroups.hpp 9dfba6eb9059728386d053f8c2e92edab0caa295 > src/linux/cgroups.cpp 39a4874ee0030110d7a61f1b73653af116d66549 > src/slave/containerizer/isolators/cgroups/mem.cpp > e8160efc4f5baa06470a8a3c774bf97d5b9e83cc > src/slave/flags.hpp 841de2364085c66e4272734d5b11dbf8efa845a5 > > Diff: https://reviews.apache.org/r/24316/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Anton Lindström > >
