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

From: Stephen Rothwell <[email-masked]>
Date: Mon, 12 Aug 2024 09:30:16 +1000

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 <[email-masked]>
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 <[email-masked]>
---
 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