diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2008-02-08 07:18:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:23 -0500 |
commit | a3d0c6aa1bb342b9b2c7b123b52ac2f48a4d4d0a (patch) | |
tree | 0c6766dd2add1f08c6153769c655e46ddff82a42 /mm | |
parent | ac74c00e499ed276a965e5b5600667d5dc04a84a (diff) |
hugetlb: add locking for overcommit sysctl
When I replaced hugetlb_dynamic_pool with nr_overcommit_hugepages I used
proc_doulongvec_minmax() directly. However, hugetlb.c's locking rules
require that all counter modifications occur under the hugetlb_lock. Add a
callback into the hugetlb code similar to the one for nr_hugepages. Grab
the lock around the manipulation of nr_overcommit_hugepages in
proc_doulongvec_minmax().
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.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>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 1a5642074e34..d9a380312467 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -605,6 +605,16 @@ int hugetlb_treat_movable_handler(struct ctl_table *table, int write, | |||
605 | return 0; | 605 | return 0; |
606 | } | 606 | } |
607 | 607 | ||
608 | int hugetlb_overcommit_handler(struct ctl_table *table, int write, | ||
609 | struct file *file, void __user *buffer, | ||
610 | size_t *length, loff_t *ppos) | ||
611 | { | ||
612 | spin_lock(&hugetlb_lock); | ||
613 | proc_doulongvec_minmax(table, write, file, buffer, length, ppos); | ||
614 | spin_unlock(&hugetlb_lock); | ||
615 | return 0; | ||
616 | } | ||
617 | |||
608 | #endif /* CONFIG_SYSCTL */ | 618 | #endif /* CONFIG_SYSCTL */ |
609 | 619 | ||
610 | int hugetlb_report_meminfo(char *buf) | 620 | int hugetlb_report_meminfo(char *buf) |