Re: [PATCH] mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
From: Ben Dooks
Date: Thu Jun 18 2026 - 06:01:12 EST
On 17/06/2026 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 isvmstat.h is already included at line 37[1].
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@xxxxxxxxxxxxxxx>
---
mm/page_alloc.c | 1 +
1 file changed, 1 insertion(+)
I wonder why sparse complains and why adding a duplicated one below fixes
it.
Thanks for catching this, it turns out this warning is coming from the
riscv64 build and I re-ran the arm64 thinking this had been fixed. The
issue is actually riscv64 does not default CONFIG_NUMA which then does
not define the 'vm_numa_stat_key' but mm/page_alloc.c creates in anyway.
Will re-test by guarding 'vm_numa_stat_key' with CONFIG_NUMA
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html