diff options
-rw-r--r-- | include/linux/hugetlb.h | 2 | ||||
-rw-r--r-- | kernel/sysctl.c | 4 | ||||
-rw-r--r-- | mm/hugetlb.c | 6 |
3 files changed, 7 insertions, 5 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 | ||
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 924c674b76ea..8b7e95411795 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -978,8 +978,8 @@ static struct ctl_table vm_table[] = { | |||
978 | { | 978 | { |
979 | .ctl_name = CTL_UNNUMBERED, | 979 | .ctl_name = CTL_UNNUMBERED, |
980 | .procname = "nr_overcommit_hugepages", | 980 | .procname = "nr_overcommit_hugepages", |
981 | .data = &nr_overcommit_huge_pages, | 981 | .data = &sysctl_overcommit_huge_pages, |
982 | .maxlen = sizeof(nr_overcommit_huge_pages), | 982 | .maxlen = sizeof(sysctl_overcommit_huge_pages), |
983 | .mode = 0644, | 983 | .mode = 0644, |
984 | .proc_handler = &hugetlb_overcommit_handler, | 984 | .proc_handler = &hugetlb_overcommit_handler, |
985 | }, | 985 | }, |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d9a380312467..cb1b3a7ecdfc 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -24,14 +24,15 @@ | |||
24 | const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; | 24 | const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL; |
25 | static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages; | 25 | static unsigned long nr_huge_pages, free_huge_pages, resv_huge_pages; |
26 | static unsigned long surplus_huge_pages; | 26 | static unsigned long surplus_huge_pages; |
27 | static unsigned long nr_overcommit_huge_pages; | ||
27 | unsigned long max_huge_pages; | 28 | unsigned long max_huge_pages; |
29 | unsigned long sysctl_overcommit_huge_pages; | ||
28 | static struct list_head hugepage_freelists[MAX_NUMNODES]; | 30 | static struct list_head hugepage_freelists[MAX_NUMNODES]; |
29 | static unsigned int nr_huge_pages_node[MAX_NUMNODES]; | 31 | static unsigned int nr_huge_pages_node[MAX_NUMNODES]; |
30 | static unsigned int free_huge_pages_node[MAX_NUMNODES]; | 32 | static unsigned int free_huge_pages_node[MAX_NUMNODES]; |
31 | static unsigned int surplus_huge_pages_node[MAX_NUMNODES]; | 33 | static unsigned int surplus_huge_pages_node[MAX_NUMNODES]; |
32 | static gfp_t htlb_alloc_mask = GFP_HIGHUSER; | 34 | static gfp_t htlb_alloc_mask = GFP_HIGHUSER; |
33 | unsigned long hugepages_treat_as_movable; | 35 | unsigned long hugepages_treat_as_movable; |
34 | unsigned long nr_overcommit_huge_pages; | ||
35 | static int hugetlb_next_nid; | 36 | static int hugetlb_next_nid; |
36 | 37 | ||
37 | /* | 38 | /* |
@@ -609,8 +610,9 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write, | |||
609 | struct file *file, void __user *buffer, | 610 | struct file *file, void __user *buffer, |
610 | size_t *length, loff_t *ppos) | 611 | size_t *length, loff_t *ppos) |
611 | { | 612 | { |
612 | spin_lock(&hugetlb_lock); | ||
613 | proc_doulongvec_minmax(table, write, file, buffer, length, ppos); | 613 | proc_doulongvec_minmax(table, write, file, buffer, length, ppos); |
614 | spin_lock(&hugetlb_lock); | ||
615 | nr_overcommit_huge_pages = sysctl_overcommit_huge_pages; | ||
614 | spin_unlock(&hugetlb_lock); | 616 | spin_unlock(&hugetlb_lock); |
615 | return 0; | 617 | return 0; |
616 | } | 618 | } |