aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs/inode.c
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2005-10-29 21:16:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 00:40:43 -0400
commit4c887265977213985091476be40ab11dfdcb4caf (patch)
tree82ee135f8678094664d7311617287802d54d52cf /fs/hugetlbfs/inode.c
parent551110a94aa15890d1709b179c4be1e66ff6db53 (diff)
[PATCH] hugetlb: demand fault handler
Below is a patch to implement demand faulting for huge pages. The main motivation for changing from prefaulting to demand faulting is so that huge page memory areas can be allocated according to NUMA policy. Thanks to consolidated hugetlb code, switching the behavior requires changing only one fault handler. The bulk of the patch just moves the logic from hugelb_prefault() to hugetlb_pte_fault() and find_get_huge_page(). Signed-off-by: Adam Litke <agl@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r--fs/hugetlbfs/inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 8f94feb24c0a..2627efe767cf 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -48,7 +48,6 @@ int sysctl_hugetlb_shm_group;
48static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) 48static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
49{ 49{
50 struct inode *inode = file->f_dentry->d_inode; 50 struct inode *inode = file->f_dentry->d_inode;
51 struct address_space *mapping = inode->i_mapping;
52 loff_t len, vma_len; 51 loff_t len, vma_len;
53 int ret; 52 int ret;
54 53
@@ -79,10 +78,8 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
79 if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size) 78 if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size)
80 goto out; 79 goto out;
81 80
82 ret = hugetlb_prefault(mapping, vma); 81 ret = 0;
83 if (ret) 82 hugetlb_prefault_arch_hook(vma->vm_mm);
84 goto out;
85
86 if (inode->i_size < len) 83 if (inode->i_size < len)
87 inode->i_size = len; 84 inode->i_size = len;
88out: 85out: