mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
@ 2026-06-18 10:06 Ben Dooks
  2026-06-18 18:09 ` Johannes Weiner
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ben Dooks @ 2026-06-18 10:06 UTC (permalink / raw)
  To: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, Zi Yan, linux-mm, linux-kernel
  Cc: Ben Dooks

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?

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 mm/page_alloc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d49c254174da..b7d303a94cc1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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
 /*
-- 
2.37.2.352.g3c44437643


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
  2026-06-18 10:06 [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n Ben Dooks
@ 2026-06-18 18:09 ` Johannes Weiner
  2026-06-18 19:08 ` Zi Yan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Johannes Weiner @ 2026-06-18 18:09 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Zi Yan, linux-mm, linux-kernel

On Thu, Jun 18, 2026 at 11:06:14AM +0100, Ben Dooks wrote:
> 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?
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
  2026-06-18 10:06 [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n Ben Dooks
  2026-06-18 18:09 ` Johannes Weiner
@ 2026-06-18 19:08 ` Zi Yan
  2026-06-19  0:10 ` SeongJae Park
  2026-06-25  2:27 ` Andrew Morton
  3 siblings, 0 replies; 6+ messages in thread
From: Zi Yan @ 2026-06-18 19:08 UTC (permalink / raw)
  To: Ben Dooks, Andrew Morton, Vlastimil Babka, Suren Baghdasaryan,
	Michal Hocko, Brendan Jackman, Johannes Weiner, Zi Yan, linux-mm,
	linux-kernel
  Cc: srv_ts003

On Thu Jun 18, 2026 at 6:06 AM EDT, Ben Dooks wrote:
> 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?
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  mm/page_alloc.c | 2 ++
>  1 file changed, 2 insertions(+)
>

LGTM. Thanks.

Reviewed-by: Zi Yan <ziy@nvidia.com>

-- 
Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
  2026-06-18 10:06 [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n Ben Dooks
  2026-06-18 18:09 ` Johannes Weiner
  2026-06-18 19:08 ` Zi Yan
@ 2026-06-19  0:10 ` SeongJae Park
  2026-06-25  2:27 ` Andrew Morton
  3 siblings, 0 replies; 6+ messages in thread
From: SeongJae Park @ 2026-06-19  0:10 UTC (permalink / raw)
  To: Ben Dooks
  Cc: SeongJae Park, Andrew Morton, Vlastimil Babka,
	Suren Baghdasaryan, Michal Hocko, Brendan Jackman,
	Johannes Weiner, Zi Yan, linux-mm, linux-kernel

On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <ben.dooks@codethink.co.uk> wrote:

> 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:

Makes sense.

> 
> mm/page_alloc.c:165:1: warning: symbol 'vm_numa_stat_key' was not declared. Should it be static?
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
  2026-06-18 10:06 [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n Ben Dooks
                   ` (2 preceding siblings ...)
  2026-06-19  0:10 ` SeongJae Park
@ 2026-06-25  2:27 ` Andrew Morton
  2026-06-29 11:08   ` Ben Dooks
  3 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2026-06-25  2:27 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, Zi Yan, linux-mm, linux-kernel

On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <ben.dooks@codethink.co.uk> wrote:

> 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?
> 
> ...
>
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -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?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n
  2026-06-25  2:27 ` Andrew Morton
@ 2026-06-29 11:08   ` Ben Dooks
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Dooks @ 2026-06-29 11:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, Zi Yan, linux-mm, linux-kernel

On 25/06/2026 03:27, Andrew Morton wrote:
> On Thu, 18 Jun 2026 11:06:14 +0100 Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> 
>> 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?
>>
>> ...
>>
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -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?

Is it worth sending a version of the patch?

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-29 11:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-18 10:06 [PATCH] mm/page_alloc: don't build vm_numa_stat_key if CONFIG_NUMA=n Ben Dooks
2026-06-18 18:09 ` Johannes Weiner
2026-06-18 19:08 ` Zi Yan
2026-06-19  0:10 ` SeongJae Park
2026-06-25  2:27 ` Andrew Morton
2026-06-29 11:08   ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome