Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
@ 2026-06-17 13:27 Ben Dooks
  2026-06-17 15:47 ` Zi Yan
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2026-06-17 13:27 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 declared in <linux/vmstat.h> but this is
currently not included in mm/page_alloc.c so include it to fix
the following sparse warning:

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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d49c254174da..58aa960a8dd0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -54,6 +54,7 @@
 #include <linux/delayacct.h>
 #include <linux/cacheinfo.h>
 #include <linux/pgalloc_tag.h>
+#include <linux/vmstat.h>
 #include <asm/div64.h>
 #include "internal.h"
 #include "shuffle.h"
-- 
2.37.2.352.g3c44437643



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

* Re: [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
  2026-06-17 13:27 [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key Ben Dooks
@ 2026-06-17 15:47 ` Zi Yan
  2026-06-18  8:04   ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Zi Yan @ 2026-06-17 15:47 UTC (permalink / raw)
  To: Ben Dooks
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, linux-mm, linux-kernel

On 17 Jun 2026, at 9:27, Ben Dooks wrote:

> The vm_numa_stat_key is declared in <linux/vmstat.h> but this is
> currently not included in mm/page_alloc.c so include it to fix
> the following sparse warning:
>
> 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 | 1 +
>  1 file changed, 1 insertion(+)
>
vmstat.h is already included at line 37[1].

I wonder why sparse complains and why adding a duplicated one below fixes
it.

[1] https://elixir.bootlin.com/linux/v7.1/source/mm/page_alloc.c#L37

Best Regards,
Yan, Zi


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

* Re: [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
  2026-06-17 15:47 ` Zi Yan
@ 2026-06-18  8:04   ` Ben Dooks
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Dooks @ 2026-06-18  8:04 UTC (permalink / raw)
  To: Zi Yan
  Cc: Andrew Morton, Vlastimil Babka, Suren Baghdasaryan, Michal Hocko,
	Brendan Jackman, Johannes Weiner, linux-mm, linux-kernel



On 2026-06-17 16:47, Zi Yan wrote:
> On 17 Jun 2026, at 9:27, Ben Dooks wrote:
> 
>> The vm_numa_stat_key is declared in <linux/vmstat.h> but this is
>> currently not included in mm/page_alloc.c so include it to fix
>> the following sparse warning:
>> 
>> 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 | 1 +
>>  1 file changed, 1 insertion(+)
>> 
> vmstat.h is already included at line 37[1].
> 
> I wonder why sparse complains and why adding a duplicated one below 
> fixes
> it.

I'll check, maybe the order is an issue here?

> [1] https://elixir.bootlin.com/linux/v7.1/source/mm/page_alloc.c#L37
> 
> Best Regards,
> Yan, Zi


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

end of thread, other threads:[~2026-06-18  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17 13:27 [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key Ben Dooks
2026-06-17 15:47 ` Zi Yan
2026-06-18  8:04   ` Ben Dooks

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