From a3d0c6aa1bb342b9b2c7b123b52ac2f48a4d4d0a Mon Sep 17 00:00:00 2001 From: Nishanth Aravamudan Date: Fri, 8 Feb 2008 04:18:18 -0800 Subject: 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 Acked-by: Adam Litke Cc: David Gibson Cc: William Lee Irwin III Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 8c98d8147d88..9dadc9d88a03 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -982,7 +982,7 @@ static struct ctl_table vm_table[] = { .data = &nr_overcommit_huge_pages, .maxlen = sizeof(nr_overcommit_huge_pages), .mode = 0644, - .proc_handler = &proc_doulongvec_minmax, + .proc_handler = &hugetlb_overcommit_handler, }, #endif { -- cgit v1.2.1