diff --git a/man2/mremap.2 b/man2/mremap.2 index 92303804f..7f2e718c4 100644 --- a/man2/mremap.2 +++ b/man2/mremap.2 @@ -133,18 +133,22 @@ must also be specified. .TP .BR MREMAP_DONTUNMAP " (since Linux 5.7)" .\" commit e346b3813067d4b17383f975f197a9aa28a3b077 -This flag which must be used in conjunction with -.B MREMAP_MAYMOVE -remaps a mapping to a new address and it does not unmap the mapping at -.BR old_address . -This flag can only be used with private anonymous mappings. +This flag, which must be used in conjunction with +.BR MREMAP_MAYMOVE , +remaps a mapping to a new address but does not unmap the mapping at +.IR old_address . +.IP +The +.B MREMAP_DONTUNMAP +flag can be used only with private anonymous mappings. +.IP Any access to the range specified at -.BR old_address +.IR old_address after completion will result in an anonymous page fault. The anonymous page fault will be handled by a .BR userfaultfd (2) if the range was previously registered on the mapping specified by -.BR old_address . +.IR old_address . Otherwise, it will be zero filled by the kernel. .PP If the memory segment specified by @@ -222,15 +226,15 @@ was specified without also specifying .BR MREMAP_MAYMOVE ; .IP * .B MREMAP_DONTUNMAP -was specified with and -.BR old_address +was specified with an +.IR old_address that was not private anonymous; .IP * .B MREMAP_DONTUNMAP was specified and -.BR old_size +.IR old_size was not equal to -.BR new_size ; +.IR new_size ; .IP * \fIold_size\fP was zero and \fIold_address\fP does not refer to a shareable mapping (but see BUGS); @@ -287,7 +291,7 @@ flag may be used to atomically move a mapping while leaving the source mapped. Possible applications for this behavior might be garbage collection or non-cooperative -.BR userfaultfd (2) . +.BR userfaultfd (2). .SH BUGS Before Linux 4.14, if