mmap.2: Describe mmap()/munmap() argument requirements for huge-page mappings

Acked-by: David Rientjes <rientjes@google.com>
Reported-by: David Rientjes <rientjes@google.com>
Reported-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-07-23 15:14:36 +02:00
parent 0f319769bc
commit f1461fe180
1 changed files with 24 additions and 1 deletions

View File

@ -230,7 +230,7 @@ should extend downward in memory.
Allocate the mapping using "huge pages."
See the Linux kernel source file
.I Documentation/vm/hugetlbpage.txt
for further information.
for further information, as well as NOTES, below.
.TP
.BR MAP_HUGE_2MB ", " MAP_HUGE_1GB " (since Linux 3.8)"
.\" See https://lwn.net/Articles/533499/
@ -637,6 +637,29 @@ or
.B MS_ASYNC
flag, if one occurs.
.\"
.SS Huge page (Huge TLB) mappings
For mappings that employ huge pages, the requirements for the arguments of
.BR mmap ()
and
.BR munmap ()
differ somewhat from the requirements for mappings
that use the native system page size.
For
.BR mmap (),
.I offset
must be a multiple of the underlying huge page size.
The system automatically aligns
.I length
to be a multiple of the underlying huge page size.
For
.BR munmap (),
.I addr
and
.I length
must both be a multiple of the underlying huge page size.
.\"
.SS C library/kernel differences
This page describes the interface provided by the glibc
.BR mmap ()