diff --git a/man2/mmap.2 b/man2/mmap.2 index 4ed9f66ef..700d53dbd 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -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 ()