diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2008-02-13 18:03:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-13 19:21:18 -0500 |
commit | 064d9efe947542097be669581f82d6b097e81d1a (patch) | |
tree | ddfc9f1c4d60135a7d7a1c5ebb7d0e85f683cfcb /include/linux/hugetlb.h | |
parent | 2695a14d315c014474ccadbaed40b0169b00cb5b (diff) |
hugetlb: fix overcommit locking
proc_doulongvec_minmax() calls copy_to_user()/copy_from_user(), so we can't
hold hugetlb_lock over the call. Use a dummy variable to store the sysctl
result, like in hugetlb_sysctl_handler(), then grab the lock to update
nr_overcommit_huge_pages.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Reported-by: Miles Lane <miles.lane@gmail.com>
Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 7ca198b379af..addca4cd4f11 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -33,8 +33,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to); | |||
33 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); | 33 | void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); |
34 | 34 | ||
35 | extern unsigned long max_huge_pages; | 35 | extern unsigned long max_huge_pages; |
36 | extern unsigned long sysctl_overcommit_huge_pages; | ||
36 | extern unsigned long hugepages_treat_as_movable; | 37 | extern unsigned long hugepages_treat_as_movable; |
37 | extern unsigned long nr_overcommit_huge_pages; | ||
38 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 38 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
39 | extern int sysctl_hugetlb_shm_group; | 39 | extern int sysctl_hugetlb_shm_group; |
40 | 40 | ||