mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

Message ID
State Not Applicable
Headers show
  • dax, ext4, xfs: Synchronous page faults
Related show

Commit Message

Jan Kara Nov. 1, 2017, 3:36 p.m.
Reviewed-by: Ross Zwisler <>
Signed-off-by: Jan Kara <>
 man2/mmap.2 | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)


diff --git a/man2/mmap.2 b/man2/mmap.2
index 47c3148653be..b38ee6809327 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -125,6 +125,21 @@  are carried through to the underlying file.
 to the underlying file requires the use of
 .BR msync (2).)
+.BR MAP_SHARED_VALIDATE " (since Linux 4.15)"
+The same as
+except that
+mappings ignore unknown flags in
+.IR flags .
+In contrast when creating mapping of
+mapping type, the kernel verifies all passed flags are known and fails the
+mapping with
+otherwise. This mapping type is also required to be able to use some mapping
 Create a private copy-on-write mapping.
 Updates to the mapping are not visible to other processes
@@ -134,7 +149,10 @@  It is unspecified whether changes made to the file after the
 .BR mmap ()
 call are visible in the mapped region.
-Both of these flags are described in POSIX.1-2001 and POSIX.1-2008.
+are described in POSIX.1-2001 and POSIX.1-2008.
 In addition, zero or more of the following values can be ORed in
 .IR flags :
@@ -352,6 +370,21 @@  option.
 Because of the security implications,
 that option is normally enabled only on embedded devices
 (i.e., devices where one has complete control of the contents of user memory).
+.BR MAP_SYNC " (since Linux 4.15)"
+This flags is available only with
+mapping type. Mappings of
+type will silently ignore this flag.
+This flag is supported only for files supporting DAX (direct mapping of persistent
+memory). For other files, creating mapping with this flag results in
+error. Shared file mappings with this flag provide the guarantee that while
+some memory is writeably mapped in the address space of the process, it will
+be visible in the same file at the same offset even after the system crashes or
+is rebooted. This allows users of such mappings to make data modifications
+persistent in a more efficient way using appropriate CPU instructions.
 Of the above flags, only