mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
Subsystems (2)
PATCH 1/1 mm/page_alloc: include <linux/vmstat.h> for vm_numa_stat_key
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?
--- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+)
mm/page_alloc.c +1 -0
@@ -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"
Signature · 1 line
2.37.2.352.g3c44437643
Zi Yan
reviewerQuoted 11 lines · Ben Dooks
The
vm_numa_stat_keyis declared in <linux/vmstat.h> but this is currently not included inmm/page_alloc.cso 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 <[email protected]>--- 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
Quoted 13 lines · Zi Yan
Quoted 11 lines · Ben Dooks
The
vm_numa_stat_keyis declared in <linux/vmstat.h> but this is currently not included inmm/page_alloc.cso 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 <[email protected]>--- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+)
Quoted 4 lines
vmstat.his 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?
Quoted 4 lines
[1] https://elixir.bootlin.com/linux/v7.1/source/mm/page_alloc.c#L37
Best Regards,
Yan, Zi
Quoted 13 lines · Zi Yan
Quoted 11 lines · Ben Dooks
The
vm_numa_stat_keyis declared in <linux/vmstat.h> but this is currently not included inmm/page_alloc.cso 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 <[email protected]>--- mm/page_alloc.c | 1 + 1 file changed, 1 insertion(+)
Quoted 4 lines
vmstat.his already included at line 37[1].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
Signature · 4 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html