diff --git a/man2/mmap.2 b/man2/mmap.2 index 59f6fe8d0..7fe92236b 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -232,6 +232,34 @@ See the Linux kernel source file .I Documentation/vm/hugetlbpage.txt for further information. .TP +.BR MAP_HUGE_2MB ", " MAP_HUGE_1GB " (since Linux 3.8)" +.\" See https://lwn.net/Articles/533499/ +Used in conjunction with +.B MAP_HUGETLB +to select alternative hugetlb page sizes (respectively, 2 MB and 1 GB) +on systems that support multiple hugetlb page sizes. + +More generally, the desired huge page size can be configured by encoding +the base-2 logarithm of the desired page size in the six bits at the offset +.BR MAP_HUGE_SHIFT . +(A value of zero in this bit field provides the default huge page size; +the default huge page size can be discovered vie the +.I Hugepagesize +field exposed by +.IR /proc/meminfo .) +Thus, the above two constants are defined as: + +.nf +.in +4n +#define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) +#define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) +.in +.fi + +The range of huge page sizes that are supported by the system +can be discovered by listing the subdirectories in +.IR /sys/kernel/mm/hugepages . +.TP .BR MAP_LOCKED " (since Linux 2.5.37)" Lock the pages of the mapped region into memory in the manner of .BR mlock (2).