Skip to content

Commit 43b5240

Browse files
songmuchunmcgrof
authored andcommitted
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: 4518085 ("mm, sysctl: make NUMA stats configurable") Signed-off-by: Muchun Song <songmuchun@bytedance.com> Cc: <stable@vger.kernel.org> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent f2906aa commit 43b5240

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

kernel/sysctl.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,6 +2091,17 @@ static struct ctl_table vm_table[] = {
20912091
.extra1 = SYSCTL_ZERO,
20922092
.extra2 = SYSCTL_TWO_HUNDRED,
20932093
},
2094+
#ifdef CONFIG_NUMA
2095+
{
2096+
.procname = "numa_stat",
2097+
.data = &sysctl_vm_numa_stat,
2098+
.maxlen = sizeof(int),
2099+
.mode = 0644,
2100+
.proc_handler = sysctl_vm_numa_stat_handler,
2101+
.extra1 = SYSCTL_ZERO,
2102+
.extra2 = SYSCTL_ONE,
2103+
},
2104+
#endif
20942105
#ifdef CONFIG_HUGETLB_PAGE
20952106
{
20962107
.procname = "nr_hugepages",
@@ -2107,15 +2118,6 @@ static struct ctl_table vm_table[] = {
21072118
.mode = 0644,
21082119
.proc_handler = &hugetlb_mempolicy_sysctl_handler,
21092120
},
2110-
{
2111-
.procname = "numa_stat",
2112-
.data = &sysctl_vm_numa_stat,
2113-
.maxlen = sizeof(int),
2114-
.mode = 0644,
2115-
.proc_handler = sysctl_vm_numa_stat_handler,
2116-
.extra1 = SYSCTL_ZERO,
2117-
.extra2 = SYSCTL_ONE,
2118-
},
21192121
#endif
21202122
{
21212123
.procname = "hugetlb_shm_group",

0 commit comments

Comments
 (0)