----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/20137/#review45539 -----------------------------------------------------------
It looks like the API could be made a little more clear here, see my comment below. src/linux/cgroups.hpp <https://reviews.apache.org/r/20137/#comment80385> I would suggest the following scheme: (1) Try<bool> enabled = memory::oom::killer::enabled(hierarchy, cgroup) (2) Try<Nothing> enable = memory::oom::killer::enable(hierarchy, cgroup) (3) Try<Nothing> disable = memory::oom::killer::disable(hierarchy, cgroup) (4) Future<Nothing> oom = memory::oom::listen(hierarchy, cgroup) Isn't it more intuitive to say "killer" than "control"? It also seems confusing to read the enable/disable cases as inquiries. Without the comment above the following code I'm not sure it would read intuitively: // Disable the oom killer. Try<bool> enabled = memory::oom_control_enabled(hierarchy, cgroup, false); I think our snake_case matching with the control file names breaks down now and we should move away from it. Let's do that later though: Try<Nothing> limit = memory::setLimit(hierarchy, cgroup, Megabytes(1)); Try<Bytes> limit = memory::limit(hierarchy, cgroup); Try<Nothing> softLimit = memory::setSoftLimit(hierarchy, cgroup, Megabytes(1)); Try<Bytes> softLimit = memory::softLimit(hierarchy, cgroup); Try<Bytes> usage = memory::usage(hierarchy, cgroup); Try<Bytes> usage = memory::maxUsage(hierarchy, cgroup); src/linux/cgroups.cpp <https://reviews.apache.org/r/20137/#comment80386> Does this need to be a Future<Nothing> or can it just be a Nothing? - Ben Mahler On June 9, 2014, 3:54 a.m., Ian Downes wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/20137/ > ----------------------------------------------------------- > > (Updated June 9, 2014, 3:54 a.m.) > > > Review request for mesos, Ben Mahler and Vinod Kone. > > > Bugs: MESOS-1178 > https://issues.apache.org/jira/browse/MESOS-1178 > > > Repository: mesos-git > > > Description > ------- > > Added cgroups::memory::oom_control and cgroups::memory::listen. > > cgroups::memory::oom_control will not write to the control file unless it > needs to change the state. > > > Diffs > ----- > > src/linux/cgroups.hpp 21d87a0783c2edd653d28fa89c59773200ae647e > src/linux/cgroups.cpp 142ac437d6d53b678ef284bda46444e1615ff0d1 > src/slave/containerizer/isolators/cgroups/mem.hpp > 362ebcfa2e16701b225deea0fbeb92e4a56d51aa > src/slave/containerizer/isolators/cgroups/mem.cpp > 60013d4e840f6b1f131b796b95916d1978b37c70 > src/tests/cgroups_tests.cpp 5f674cd678e67f10bfef4620d927bb5af7c93753 > > Diff: https://reviews.apache.org/r/20137/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Ian Downes > >
