Skip to content

Commit

Permalink
mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE
Browse files Browse the repository at this point in the history
"numa_stat" should not be included in the scope of CONFIG_HUGETLB_PAGE, if
CONFIG_HUGETLB_PAGE is not configured even if CONFIG_NUMA is configured,
"numa_stat" is missed form /proc. Move it out of CONFIG_HUGETLB_PAGE to
fix it.

Fixes: 4518085 ("mm, sysctl: make NUMA stats configurable")
Signed-off-by: Muchun Song <[email protected]>
Cc: <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Mel Gorman <[email protected]>
Signed-off-by: Luis Chamberlain <[email protected]>
  • Loading branch information
Muchun Song authored and mcgrof committed Jul 14, 2022
1 parent f2906aa commit 43b5240
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,17 @@ static struct ctl_table vm_table[] = {
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO_HUNDRED,
},
#ifdef CONFIG_NUMA
{
.procname = "numa_stat",
.data = &sysctl_vm_numa_stat,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = sysctl_vm_numa_stat_handler,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
},
#endif
#ifdef CONFIG_HUGETLB_PAGE
{
.procname = "nr_hugepages",
Expand All @@ -2107,15 +2118,6 @@ static struct ctl_table vm_table[] = {
.mode = 0644,
.proc_handler = &hugetlb_mempolicy_sysctl_handler,
},
{
.procname = "numa_stat",
.data = &sysctl_vm_numa_stat,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = sysctl_vm_numa_stat_handler,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
},
#endif
{
.procname = "hugetlb_shm_group",
Expand Down

0 comments on commit 43b5240

Please sign in to comment.