Commit 43b5240c authored by Muchun Song's avatar Muchun Song Committed by Luis Chamberlain

mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE

"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: 4518085e ("mm, sysctl: make NUMA stats configurable")
Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
Cc: <stable@vger.kernel.org>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent f2906aa8
...@@ -2091,6 +2091,17 @@ static struct ctl_table vm_table[] = { ...@@ -2091,6 +2091,17 @@ static struct ctl_table vm_table[] = {
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_TWO_HUNDRED, .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 #ifdef CONFIG_HUGETLB_PAGE
{ {
.procname = "nr_hugepages", .procname = "nr_hugepages",
...@@ -2107,15 +2118,6 @@ static struct ctl_table vm_table[] = { ...@@ -2107,15 +2118,6 @@ static struct ctl_table vm_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = &hugetlb_mempolicy_sysctl_handler, .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 #endif
{ {
.procname = "hugetlb_shm_group", .procname = "hugetlb_shm_group",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment