linux-next: build failure after merge of the mm tree

Stephen Rothwell posted 1 patch 1 year, 5 months ago
There is a newer version of this series
mm/memory.c | 2 ++
1 file changed, 2 insertions(+)
linux-next: build failure after merge of the mm tree
Posted by Stephen Rothwell 1 year, 5 months ago
Hi all,

After merging the mm tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

mm/memory.c: In function 'numa_migrate_check':
mm/memory.c:5403:41: error: 'NUMA_HINT_FAULTS' undeclared (first use in this function)
 5403 |         count_memcg_folio_events(folio, NUMA_HINT_FAULTS, 1);
      |                                         ^~~~~~~~~~~~~~~~
mm/memory.c:5403:41: note: each undeclared identifier is reported only once for each function it appears in

Caused by commit

  75747a26eec1 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")

from the mm-unstable branch of the mm tree.

CONFIG_NUMA_BALANCING is not set for this build.  I note that the
preexisting calls to count_vm_numa_event() compile because it is
implemented as a macro ...

Not the best fix, but I applied the patch below.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 12 Aug 2024 09:09:52 +1000
Subject: [PATCH] fixup for "mm,memcg: provide per-cgroup counters for NUMA
 balancing operations"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 mm/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/memory.c b/mm/memory.c
index 231c7b2297bd..13b679ad182c 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5400,7 +5400,9 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf,
 	vma_set_access_pid_bit(vma);
 
 	count_vm_numa_event(NUMA_HINT_FAULTS);
+#ifdef CONFIG_NUMA_BALANCING
 	count_memcg_folio_events(folio, NUMA_HINT_FAULTS, 1);
+#endif
 	if (folio_nid(folio) == numa_node_id()) {
 		count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL);
 		*flags |= TNF_FAULT_LOCAL;
-- 
2.43.0

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the mm tree
Posted by Kaiyang Zhao 1 year, 5 months ago
On Mon, Aug 12, 2024 at 09:30:16AM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the mm tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> mm/memory.c: In function 'numa_migrate_check':
> mm/memory.c:5403:41: error: 'NUMA_HINT_FAULTS' undeclared (first use in this function)
>  5403 |         count_memcg_folio_events(folio, NUMA_HINT_FAULTS, 1);
>       |                                         ^~~~~~~~~~~~~~~~
> mm/memory.c:5403:41: note: each undeclared identifier is reported only once for each function it appears in
>
> Caused by commit
>
>   75747a26eec1 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
>
> from the mm-unstable branch of the mm tree.
>
> CONFIG_NUMA_BALANCING is not set for this build.  I note that the
> preexisting calls to count_vm_numa_event() compile because it is
> implemented as a macro ...
>
> Not the best fix, but I applied the patch below.

Sorry about it. I should have tested with more configs. I'll send a v2
with a fix for this compilation error and the other compilation warning
about the documentation (and remember to run make htmldocs in the future).

Bear with me, from a newbie trying to learn...

Best,
Kaiyang Zhao