Zhang, Yanmin
b6174df5ee
[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 <yanmin.zhang@intel.com >
Cc: David Gibson <david@gibson.dropbear.id.au >
Cc: Hugh Dickins <hugh@veritas.com >
[ Expand-on-mmap semantics again... this time matching normal fs's. wli ]
Acked-by: William Lee Irwin III <wli@holomorphy.com >
Signed-off-by: Andrew Morton <akpm@osdl.org >
Signed-off-by: Linus Torvalds <torvalds@osdl.org >
2006-07-10 13:24:21 -07:00
..
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-06-28 14:59:04 -07:00
2006-06-28 14:59:04 -07:00
2006-06-23 07:42:45 -07:00
2006-06-26 09:58:18 -07:00
2006-06-30 18:23:04 +02:00
2006-06-28 14:59:04 -07:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-06-29 14:43:01 -07:00
2006-06-28 14:59:04 -07:00
2006-06-30 19:25:36 +02:00
2006-06-23 07:42:45 -07:00
2006-06-28 14:59:04 -07:00
2006-05-21 12:59:16 -07:00
2006-07-03 15:27:08 -07:00
2006-07-03 15:27:08 -07:00
2006-06-28 14:59:04 -07:00
2006-06-28 14:59:04 -07:00
2006-06-28 14:59:04 -07:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-06-28 14:59:04 -07:00
2006-06-28 14:59:04 -07:00
2006-06-23 07:42:45 -07:00
2006-07-10 13:24:21 -07:00
2006-06-30 19:25:36 +02:00
2006-06-27 17:32:38 -07:00
2006-06-30 19:25:36 +02:00
2006-07-03 21:29:08 -07:00
2006-06-30 19:25:36 +02:00
2006-07-05 13:13:18 -04:00
2006-06-28 14:59:04 -07:00
2006-06-23 07:42:45 -07:00
2006-06-30 15:39:30 -07:00
2006-07-05 13:19:25 -04:00
2006-06-30 15:39:30 -07:00
2006-06-30 19:25:36 +02:00
2006-07-03 15:27:08 -07:00
2006-06-29 16:13:35 -07:00
2006-06-25 23:19:14 -07:00
2006-07-10 13:24:14 -07:00
2006-07-03 22:37:13 -07:00
2006-06-30 19:25:36 +02:00
2006-06-28 14:59:04 -07:00
2006-07-10 13:24:13 -07:00
2006-06-28 14:59:04 -07:00
2006-06-30 19:25:36 +02:00
2006-06-28 14:59:04 -07:00
2006-06-28 14:59:04 -07:00
2006-06-30 19:25:36 +02:00
2006-07-03 15:27:08 -07:00
2006-06-23 07:42:45 -07:00
2006-06-30 19:25:36 +02:00
2006-06-26 18:35:02 +02:00
2006-03-28 09:16:06 -08:00
2006-06-23 07:42:54 -07:00
2006-07-03 15:26:59 -07:00
2006-06-30 19:25:36 +02:00
2006-06-24 13:07:53 -04:00
2006-06-30 19:25:36 +02:00
2006-06-17 10:52:12 -07:00
2006-07-03 15:27:10 -07:00
2006-06-30 15:39:30 -07:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-06-26 10:48:16 -07:00
2006-07-03 15:27:06 -07:00
2006-06-30 19:25:36 +02:00
2006-07-03 15:27:06 -07:00
2006-03-26 08:56:56 -08:00
2006-06-26 09:58:17 -07:00
2006-07-03 15:27:11 -07:00
2006-06-30 19:25:36 +02:00
2006-04-02 13:37:19 +02:00
2006-04-11 13:53:33 +02:00
2006-06-30 19:25:36 +02:00
2006-03-28 09:16:05 -08:00
2006-06-30 11:25:36 -07:00
2006-06-30 15:39:30 -07:00
2006-06-23 07:42:45 -07:00
2006-06-20 05:25:19 -04:00
2006-06-30 19:25:36 +02:00
2006-06-30 11:25:37 -07:00
2006-06-29 14:56:12 -07:00
2006-06-26 09:58:17 -07:00
2006-07-05 13:13:18 -04:00
2006-06-26 12:25:05 -07:00
2006-03-28 09:16:08 -08:00
2006-06-23 07:42:49 -07:00
2006-07-03 15:27:06 -07:00
2006-06-30 19:25:36 +02:00
2006-06-30 19:25:36 +02:00
2006-06-25 10:01:15 -07:00
2006-06-23 07:42:45 -07:00
2006-06-26 09:58:17 -07:00
2006-03-23 07:38:11 -08:00
2006-03-23 07:38:11 -08:00
2006-07-10 13:24:18 -07:00
2006-06-25 10:01:22 -07:00
2006-03-23 07:38:12 -08:00
2006-06-23 17:10:39 +02:00
2006-06-30 19:25:36 +02:00
2006-07-03 15:27:09 -07:00
2006-06-23 07:42:49 -07:00
2006-06-20 05:25:28 -04:00