aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorZhang, Yanmin <[email protected]>2006-07-10 04:44:49 -0700
committerLinus Torvalds <[email protected]>2006-07-10 13:24:21 -0700
commitb6174df5eec9cdfd598c03d6d0807e344e109213 (patch)
treed61c8627138a8feee31de8320e337251d567fca9 /include
parentd6b7d3b62069be60d5b13358bac8670dacdd7a81 (diff)
[PATCH] mmap zero-length hugetlb file with PROT_NONE to protect a hugetlb virtual area
Sometimes, applications need below call to be successful although "/mnt/hugepages/file1" doesn't exist. fd = open("/mnt/hugepages/file1", O_CREAT|O_RDWR, 0755); *addr = mmap(NULL, 0x1024*1024*256, PROT_NONE, 0, fd, 0); As for regular pages (or files), above call does work, but as for huge pages, above call would fail because hugetlbfs_file_mmap would fail if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size). This capability on huge page is useful on ia64 when the process wants to protect one area on region 4, so other threads couldn't read/write this area. A famous JVM (Java Virtual Machine) implementation on IA64 needs the capability. Signed-off-by: Zhang Yanmin <[email protected]> Cc: David Gibson <[email protected]> Cc: Hugh Dickins <[email protected]> [ Expand-on-mmap semantics again... this time matching normal fs's. wli ] Acked-by: William Lee Irwin III <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions