Skip to contentSkip to conversation

mm: hugetlb: move hugeltb sysctls to its own file

PATCH Superseded Kefeng Wang 2 participants 2 messages Mar 11, 2023

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mm: hugetlb: move hugeltb sysctls to its own file

This moves all hugetlb sysctls to its own file, also kill an useless hugetlb_treat_movable_handler() since commit d6cb41cc44c6 ("mm, hugetlb: remove hugepages_treat_as_movable sysctl").

---
v2:
- add __init to hugetlb_sysfs_init
- update commit and add RBs

 include/linux/hugetlb.h |  8 -------
 kernel/sysctl.c         | 32 --------------------------
 mm/hugetlb.c            | 51 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 48 insertions(+), 43 deletions(-)
include/linux/hugetlb.h +0 -8
index 7c977d234aba..4056b05d81ed 100644
@@ -124,14 +124,6 @@ void hugepage_put_subpool(struct hugepage_subpool *spool);
 
 void hugetlb_dup_vma_private(struct vm_area_struct *vma);
 void clear_vma_resv_huge_pages(struct vm_area_struct *vma);
-int hugetlb_sysctl_handler(struct ctl_table *, int, void *, size_t *, loff_t *);
-int hugetlb_overcommit_handler(struct ctl_table *, int, void *, size_t *,
-		loff_t *);
-int hugetlb_treat_movable_handler(struct ctl_table *, int, void *, size_t *,
-		loff_t *);
-int hugetlb_mempolicy_sysctl_handler(struct ctl_table *, int, void *, size_t *,
-		loff_t *);
-
 int move_hugetlb_page_tables(struct vm_area_struct *vma,
 			     struct vm_area_struct *new_vma,
 			     unsigned long old_addr, unsigned long new_addr,
kernel/sysctl.c +0 -32
index c14552a662ae..ce0297acf97c 100644
@@ -2140,38 +2140,6 @@ static struct ctl_table vm_table[] = {
 		.extra1		= SYSCTL_ZERO,
 		.extra2		= SYSCTL_ONE,
 	},
-#endif
-#ifdef CONFIG_HUGETLB_PAGE
-	{
-		.procname	= "nr_hugepages",
-		.data		= NULL,
-		.maxlen		= sizeof(unsigned long),
-		.mode		= 0644,
-		.proc_handler	= hugetlb_sysctl_handler,
-	},
-#ifdef CONFIG_NUMA
-	{
-		.procname       = "nr_hugepages_mempolicy",
-		.data           = NULL,
-		.maxlen         = sizeof(unsigned long),
-		.mode           = 0644,
-		.proc_handler   = &hugetlb_mempolicy_sysctl_handler,
-	},
-#endif
-	 {
-		.procname	= "hugetlb_shm_group",
-		.data		= &sysctl_hugetlb_shm_group,
-		.maxlen		= sizeof(gid_t),
-		.mode		= 0644,
-		.proc_handler	= proc_dointvec,
-	 },
-	{
-		.procname	= "nr_overcommit_hugepages",
-		.data		= NULL,
-		.maxlen		= sizeof(unsigned long),
-		.mode		= 0644,
-		.proc_handler	= hugetlb_overcommit_handler,
-	},
 #endif
 	{
 		.procname	= "lowmem_reserve_ratio",
mm/hugetlb.c +48 -3

87 lines not on this page · raw message

Signature · 1 line
2.35.3
#1 lore raw
Quoted 8 lines · Kefeng Wang

This moves all hugetlb sysctls to its own file, also kill an useless hugetlb_treat_movable_handler() since commit d6cb41cc44c6 ("mm, hugetlb: remove hugepages_treat_as_movable sysctl").

Thanks queued up onto sysctl-testing [0]. Eventually I'll move this to sysctl-next.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=sysctl-testing

Luis