mlock.2: Explain purpose of mlock() MLOCK_ONFAULT and mlockall() MCL_ONFAULT

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-12-14 23:14:04 +01:00
parent 9f1eb9e08d
commit f97c12d18b
1 changed files with 11 additions and 0 deletions

View File

@ -376,6 +376,17 @@ flag is followed by another call that does not specify this flag, the
changes made by the
.B MCL_FUTURE
call will be lost.
The
.BR mlock2 ()
.B MLOCK_ONFAULT
flag and the
.BR mlockall ()
.B MCL_ONFAULT
flag allow efficient memory locking for applications that deal with
large mappings where only a (small) portion of pages in the mapping are touched.
In such cases, locking all of the pages in a mapping would incur
a significant penalty for memory locking.
.SS Linux notes
Under Linux,
.BR mlock (),