summaryrefslogtreecommitdiffstats
path: root/man2/mremap.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/mremap.2')
-rw-r--r--man2/mremap.238
1 files changed, 19 insertions, 19 deletions
diff --git a/man2/mremap.2 b/man2/mremap.2
index e4dd9d0ce..62487f9ae 100644
--- a/man2/mremap.2
+++ b/man2/mremap.2
@@ -44,7 +44,7 @@ below.
.P
If the value of \fIold_size\fP is zero, and \fIold_address\fP refers to
a shareable mapping (see
-.BR mmap (2)
+.MR mmap 2
.BR MAP_SHARED ),
then
.BR mremap ()
@@ -76,7 +76,7 @@ the mapping should be employed).
This flag serves a similar purpose to the
.B MAP_FIXED
flag of
-.BR mmap (2).
+.MR mmap 2 .
If this flag is specified, then
.BR mremap ()
accepts a fifth argument,
@@ -110,7 +110,7 @@ flag can be used only with private anonymous mappings
and
.B MAP_ANONYMOUS
in
-.BR mmap (2)).
+.MR mmap 2 ).
.IP
After completion,
any access to the range specified by
@@ -119,10 +119,10 @@ and
.I old_size
will result in a page fault.
The page fault will be handled by a
-.BR userfaultfd (2)
+.MR userfaultfd 2
handler
if the address is in a range previously registered with
-.BR userfaultfd (2).
+.MR userfaultfd 2 .
Otherwise, the kernel allocates a zero-filled page to handle the fault.
.IP
The
@@ -137,7 +137,7 @@ If the memory segment specified by
and
.I old_size
is locked (using
-.BR mlock (2)
+.MR mlock 2
or similar), then this lock is maintained when the segment is
resized and/or relocated.
As a consequence, the amount of memory locked by the process may change.
@@ -261,7 +261,7 @@ argument.
changes the
mapping between virtual addresses and memory pages.
This can be used to implement a very efficient
-.BR realloc (3).
+.MR realloc 3 .
.P
In Linux, memory is divided into pages.
A process has (one or)
@@ -280,7 +280,7 @@ segments will also cause a segmentation violation.
If
.BR mremap ()
is used to move or expand an area locked with
-.BR mlock (2)
+.MR mlock 2
or equivalent, the
.BR mremap ()
call will make a best effort to populate the new area but will not fail
@@ -294,18 +294,18 @@ Possible applications for
include:
.IP \[bu] 3
Non-cooperative
-.BR userfaultfd (2):
+.MR userfaultfd 2 :
an application can yank out a virtual address range using
.B MREMAP_DONTUNMAP
and then employ a
-.BR userfaultfd (2)
+.MR userfaultfd 2
handler to handle the page faults that subsequently occur
as other threads in the process touch pages in the yanked range.
.IP \[bu]
Garbage collection:
.B MREMAP_DONTUNMAP
can be used in conjunction with
-.BR userfaultfd (2)
+.MR userfaultfd 2
to implement garbage collection algorithms (e.g., in a Java virtual machine).
Such an implementation can be cheaper (and simpler)
than conventional garbage collection techniques that involve
@@ -336,14 +336,14 @@ fails with the error
.B EINVAL
in this scenario.
.SH SEE ALSO
-.BR brk (2),
-.BR getpagesize (2),
-.BR getrlimit (2),
-.BR mlock (2),
-.BR mmap (2),
-.BR sbrk (2),
-.BR malloc (3),
-.BR realloc (3)
+.MR brk 2 ,
+.MR getpagesize 2 ,
+.MR getrlimit 2 ,
+.MR mlock 2 ,
+.MR mmap 2 ,
+.MR sbrk 2 ,
+.MR malloc 3 ,
+.MR realloc 3
.P
Your favorite text book on operating systems
for more information on paged memory