Skip to contentSkip to conversation

mm, doc: cleanup and clarify munmap behavior for hugetlb memory fix

PATCH Hillf Danton 1 participant 1 message Apr 3, 2015 1 message not in the archive Memory management

lore
Share & tools
lore

Hillf Danton

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 7 lines

Don't only specify munmap(2) behavior with respect the hugetlb memory, all other syscalls get naturally aligned to the native page size of the processor. Rather, pick out munmap(2) as a specific example.

---

Quoted 27 lines
 Documentation/vm/hugetlbpage.txt | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Documentation/vm/hugetlbpage.txt +5 -3
index 1270fb1..030977f 100644
@@ -313,8 +313,11 @@ into /proc/sys/vm/hugetlb_shm_group.  It is possible for same or different
 applications to use any combination of mmaps and shm* calls, though the mount of
 filesystem will be required for using mmap calls without MAP_HUGETLB.
 
-When using munmap(2) to unmap hugetlb memory, the length specified must be
-hugepage aligned, otherwise it will fail with errno set to EINVAL.
+Syscalls that operate on memory backed by hugetlb pages only have their lengths
+aligned to the native page size of the processor; they will normally fail with
+errno set to EINVAL or exclude hugetlb pages that extend beyond the length if
+not hugepage aligned.  For example, munmap(2) will fail if memory is backed by
+a hugetlb page and the length is smaller than the hugepage size.
 
 
 Examples
 
--

To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>