mmap.2: Clarify that MAP_POPULATE is best-effort

As discussed on linux-mm
(https://marc.info/?l=linux-mm&m=161528594100612&w=2), MAP_POPULATE can
fail silently if the hugetlb cgroup settings allow huge page reservation
but prevents huge pages being allocated.

Closes https://bugzilla.kernel.org/show_bug.cgi?id=212153.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Bruce Merry 2021-03-23 09:48:31 +02:00 committed by Michael Kerrisk
parent 1f72eb7511
commit 285a7373e7
1 changed files with 5 additions and 0 deletions

View File

@ -400,6 +400,11 @@ private writable mappings.
Populate (prefault) page tables for a mapping.
For a file mapping, this causes read-ahead on the file.
This will help to reduce blocking on page faults later.
The
.BR mmap ()
call doesn't fail if the mapping cannot be populated (for example, due
to limitations on the number of mapped huge pages when using
.BR MAP_HUGETLB ).
.BR MAP_POPULATE
is supported for private mappings only since Linux 2.6.23.
.TP