3 ms·
Random curious person here: does mlock() itself cause the pre-fault? Or do you have to scribble over that memory yourself, too? (I understand that mlock preven
by interroboink 10mo ago
Random curious person here: does mlock() itself cause the pre-fault? Or do you have to scribble over that memory yourself, too?
(I understand that mlock prevents paging-out, but in my mind that's a separate concern from pre-faulting?)
- 10000truths 10mo agoFreeBSD and OpenBSD explicitly mention the prefaulting behavior in the mlock(2) manpage. The Linux manpage alludes to it in that you have to explicitly pass the MLOCK_ONFAULT flag to the mlock2() variant of the syscall in order to disable the prefaulting behavior.