diff options
author | Chen, Kenneth W <kenneth.w.chen@intel.com> | 2006-06-23 05:03:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:42:48 -0400 |
commit | a43a8c39bbb493c9e93f6764b350de2e33e18e92 (patch) | |
tree | a3f0042371810ce6d076751d8e403baaa3d2630e /include | |
parent | e8f03d02080b25f53cd6bba8dc3a297803f18c01 (diff) |
[PATCH] tightening hugetlb strict accounting
Current hugetlb strict accounting for shared mapping always assume mapping
starts at zero file offset and reserves pages between zero and size of the
file. This assumption often reserves (or lock down) a lot more pages then
necessary if application maps at none zero file offset. libhugetlbfs is
one example that requires proper reservation on shared mapping starts at
none zero offset.
This patch extends the reservation and hugetlb strict accounting to support
any arbitrary pair of (offset, len), resulting a much more robust and
accurate scheme. More importantly, it won't lock down any hugetlb pages
outside file mapping.
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hugetlb.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 4c5e610fe442..c25a38d8f600 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -23,6 +23,8 @@ int hugetlb_report_node_meminfo(int, char *); | |||
23 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
25 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
26 | int hugetlb_reserve_pages(struct inode *inode, long from, long to); | ||
27 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | ||
26 | 28 | ||
27 | extern unsigned long max_huge_pages; | 29 | extern unsigned long max_huge_pages; |
28 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info { | |||
139 | 141 | ||
140 | struct hugetlbfs_inode_info { | 142 | struct hugetlbfs_inode_info { |
141 | struct shared_policy policy; | 143 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
144 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
145 | }; | 145 | }; |
146 | 146 | ||
@@ -157,10 +157,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
157 | extern const struct file_operations hugetlbfs_file_operations; | 157 | extern const struct file_operations hugetlbfs_file_operations; |
158 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
159 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
164 | int hugetlb_get_quota(struct address_space *mapping); | 160 | int hugetlb_get_quota(struct address_space *mapping); |
165 | void hugetlb_put_quota(struct address_space *mapping); | 161 | void hugetlb_put_quota(struct address_space *mapping); |
166 | 162 | ||