mremap.2: Add note about mremap() with locked areas

When mremap() is used to move or expand a mapping that is locked
with mlock() or equivalent it will attempt to populate the new
area.  However, like mmap(MAP_LOCKED), mremap() will not fail if
the area cannot be populated.  Also like mmap(MAP_LOCKED) this
might come as a surprise to users and should be noted.

Signed-off-by: Eric B Munson <emunson@akamai.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Cc: linux-man@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Eric B Munson 2015-08-28 14:42:52 -04:00 committed by Michael Kerrisk
parent e8aa7100f5
commit a0742a27be
1 changed files with 11 additions and 0 deletions

View File

@ -196,6 +196,17 @@ and the prototype for
did not allow for the
.I new_address
argument.
If
.BR mremap ()
is used to move or expand an area locked with
.BR mlock (2)
or equivalent, the
.BR mremap ()
call will make a best effort to populate the new area but will not fail
with
.B ENOMEM
if the area cannot be populated.
.SH SEE ALSO
.BR brk (2),
.BR getpagesize (2),