mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
Subsystems (2)
PATCH 1/1 mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
The vm_numa_stat_key is only exported if CONFIG_NUMA is set, so avoid the following warning by guarding it in an #ifdef on CONFIG_NUMA:
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?
--- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+)
mm/page_alloc.c +2 -0
@@ -162,7 +162,9 @@ DEFINE_PER_CPU(int, numa_node);EXPORT_PER_CPU_SYMBOL (numa_node);#endif +#ifdef CONFIG_NUMA DEFINE_STATIC_KEY_TRUE (vm_numa_stat_key); +#endif #ifdef CONFIG_HAVE_MEMORYLESS_NODES /*
Signature · 1 line
2.37.2.352.g3c44437643
Quoted 7 lines · Ben Dooks
The
vm_numa_stat_keyis only exported ifCONFIG_NUMAis set, so avoid the following warning by guarding it in an #ifdef onCONFIG_NUMA:
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?Signed-off-by Ben Dooks <[email protected]>
Quoted 11 lines · Ben Dooks
The
vm_numa_stat_keyis only exported ifCONFIG_NUMAis set, so avoid the following warning by guarding it in an #ifdef onCONFIG_NUMA:
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?Signed-off-by Ben Dooks <[email protected]>--- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+)
LGTM. Thanks.
Signature · 2 lines
Best Regards, Yan, Zi
Quoted 3 lines · On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <[email protected]> wrote:
The
vm_numa_stat_keyis only exported ifCONFIG_NUMAis set, so avoid the following warning by guarding it in an #ifdef onCONFIG_NUMA:
Makes sense.
Quoted 4 lines
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?Signed-off-by Ben Dooks <[email protected]>
Thanks,
SJ
[...]
Andrew Morton
maintainerQuoted 11 lines · On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <[email protected]> wrote:
The
vm_numa_stat_keyis only exported ifCONFIG_NUMAis set, so avoid the following warning by guarding it in an #ifdef onCONFIG_NUMA:
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?...
mm/page_alloc.c DEFINE_PER_CPU(int, numa_node); · line 170
Quoted 9 lines
mm/page_alloc.c +2
-0@@ -162,7 +162,9 @@ DEFINE_PER_CPU(int, numa_node);EXPORT_PER_CPU_SYMBOL (numa_node);#endif +#ifdef CONFIG_NUMA DEFINE_STATIC_KEY_TRUE (vm_numa_stat_key); +#endif #ifdef CONFIG_HAVE_MEMORYLESS_NODES /*
It might be tidier to move this into mm/vmstat.c, around line 38?
Quoted 16 lines · Andrew Morton
Quoted 14 lines · On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <[email protected]> wrote:
The
vm_numa_stat_keyis only exported ifCONFIG_NUMAis set, so avoid the following warning by guarding it in an #ifdef onCONFIG_NUMA:
mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?...
mm/page_alloc.c +0
-0@@ -162,7 +162,9 @@ DEFINE_PER_CPU(int, numa_node);EXPORT_PER_CPU_SYMBOL (numa_node);#endif
Quoted 8 lines
mm/page_alloc.c DEFINE_PER_CPU(int, numa_node); · line 170
Quoted 6 lines
mm/page_alloc.c +2
-0+#ifdef CONFIG_NUMA DEFINE_STATIC_KEY_TRUE (vm_numa_stat_key); +#endif #ifdef CONFIG_HAVE_MEMORYLESS_NODES /* It might be tidier to move this into
mm/vmstat.c, around line 38?
Is it worth sending a version of the patch?
Signature · 4 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html