On Thu, May 13, 2010 at 12:15:18PM +0100, Luca Bigliardi wrote: > On Wed, May 12, 2010 at 6:27 PM, Iustin Pop <[email protected]> wrote: > > > This is (IMHO) useless. The point of mlockall, as discussed offline, is > > to make sure we can reach this point. If we already reached this > > function, it means openssl/etc. negotiation was successful, we don't > > need to lock memory just before reboot. > > Ok, but if the fork succeeds then the child which is going to reboot is > not guaranteed to run in memory..
We don't need to be "in memory" after this fork. Look at what the code does: write to a /proc file. All the text/libraries are already locked in memory by virtue of being shared with the parent, with the only thing that is non-shared being the stack/variables, which for this code path are very very small. iustin
