> On Aug. 3, 2015, 11:36 p.m., Michael Park wrote:
> > src/tests/containerizer/memory_test_helper.cpp, line 81
> > <https://reviews.apache.org/r/37065/diff/1/?file=1028301#file1028301line81>
> >
> >     What's the significance in the order in which these are called? I 
> > would've expected something like:
> >     
> >     ```
> >       // Make sure that all pages that are going to be mapped into the
> >       // address space of this process become unevictable. This is needed
> >       // for testing cgroup oom killer.
> >     #ifdef __APPLE__
> >       if (mlock(rss, size.bytes()) != 0)
> >     #else
> >       if (mlockall(MCL_FUTURE) != 0)
> >     #endif
> >       {
> >         return ErrnoError("Failed to make pages to be mapped unevictable");
> >       }
> >     ```

The mlockall(MCL_FUTURE) has to be called before the memory allocation is made 
(because it affects future allocations), whereas mlock() is called for already 
allocated pages. I could probably change mlockall(MCL_FUTURE) to 
mlockall(MCL_CURRENT) in your snippet and make it work that way. I'll test to 
verify and will update the patch accordingly. Thanks!


- Artem


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/37065/#review94001
-----------------------------------------------------------


On Aug. 3, 2015, 11:32 p.m., Artem Harutyunyan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37065/
> -----------------------------------------------------------
> 
> (Updated Aug. 3, 2015, 11:32 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Michael Park.
> 
> 
> Bugs: MESOS-3197
>     https://issues.apache.org/jira/browse/MESOS-3197
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   src/tests/containerizer/memory_test_helper.cpp 
> 5e40b747f4266e7532baf8fd02ea5db0955124d2 
> 
> Diff: https://reviews.apache.org/r/37065/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Artem Harutyunyan
> 
>

Reply via email to