aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2006-06-23 05:03:15 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 10:42:48 -0400
commita43a8c39bbb493c9e93f6764b350de2e33e18e92 (patch)
treea3f0042371810ce6d076751d8e403baaa3d2630e /include/linux/hugetlb.h
parente8f03d02080b25f53cd6bba8dc3a297803f18c01 (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/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h8
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 *);
23unsigned long hugetlb_total_pages(void); 23unsigned long hugetlb_total_pages(void);
24int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 24int 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);
26int hugetlb_reserve_pages(struct inode *inode, long from, long to);
27void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
26 28
27extern unsigned long max_huge_pages; 29extern unsigned long max_huge_pages;
28extern const unsigned long hugetlb_zero, hugetlb_infinity; 30extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -139,8 +141,6 @@ struct hugetlbfs_sb_info {
139 141
140struct hugetlbfs_inode_info { 142struct 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)
157extern const struct file_operations hugetlbfs_file_operations; 157extern const struct file_operations hugetlbfs_file_operations;
158extern struct vm_operations_struct hugetlb_vm_ops; 158extern struct vm_operations_struct hugetlb_vm_ops;
159struct file *hugetlb_zero_setup(size_t); 159struct file *hugetlb_zero_setup(size_t);
160int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info,
161 unsigned long atleast_hpages);
162void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info,
163 unsigned long atmost_hpages);
164int hugetlb_get_quota(struct address_space *mapping); 160int hugetlb_get_quota(struct address_space *mapping);
165void hugetlb_put_quota(struct address_space *mapping); 161void hugetlb_put_quota(struct address_space *mapping);
166 162