title: mlockall & shared libs
body: <p>I am bit confused about the following sentence which appears in the manual of mlockall.</p>
  
  <blockquote>
    <p>mlockall() locks all pages mapped into the address space of the calling process. This includes the pages of the code, data and stack segment, as well as shared libraries, user space kernel data, shared memory, and memory-mapped files.</p>
  </blockquote>
  
  <p>Does this mean that <code>mlockall(MCL_CURRENT | MCL_FUTURE)</code> will read in advance all the pages of a shared library and lock them into memory when the function is invoked? Or when those pages are actually needed by the process?</p>