> On Aug. 4, 2015, 6:36 a.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");
> >       }
> >     ```
> 
> Artem Harutyunyan wrote:
>     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!
> 
> James Peach wrote:
>     IMHO it would be better to add an autoconf check for ```mlockall``` 
> availability that to check ```__APPLE__```.
> 
> Michael Park wrote:
>     @jpeach: Do you mean we should fail to configure if `mlockall` is not 
> available? If we did that, we wouldn't be able to compile on OS X though.

In autoconf, do ```AC_CHECK_FUNC(mlockall)```, then make this code conditional 
on ```#if HAVE_MLOCKALL```.


- James


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


On Aug. 4, 2015, 6:32 a.m., Artem Harutyunyan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/37065/
> -----------------------------------------------------------
> 
> (Updated Aug. 4, 2015, 6:32 a.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