[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210213744.2968-3-gourry@gourry.net>
Date: Tue, 10 Dec 2024 16:37:41 -0500
From: Gregory Price <gourry@...rry.net>
To: linux-mm@...ck.org
Cc: linux-kernel@...r.kernel.org,
nehagholkar@...a.com,
abhishekd@...a.com,
kernel-team@...a.com,
david@...hat.com,
nphamcs@...il.com,
gourry@...rry.net,
akpm@...ux-foundation.org,
hannes@...xchg.org,
kbusch@...a.com,
ying.huang@...ux.alibaba.com
Subject: [RFC v2 PATCH 2/5] memory: move conditionally defined enums use inside ifdef tags
NUMA_HINT_FAULTS and NUMA_HINT_FAULTS_LOCAL are only defined if
CONFIG_NUMA_BALANCING is defined, but are used outside the tags in
numa_migrate_check(). Fix this.
TNF_SHARED is only used if CONFIG_NUMA_BALANCING is enabled, so
moving this line inside the ifdef is also safe - despite use of TNF_*
elsewhere in the function. TNF_* are not conditionally defined.
Signed-off-by: Gregory Price <gourry@...rry.net>
---
mm/memory.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index 83fd35c034d7..6ad7616918c4 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5573,14 +5573,14 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf,
/* Record the current PID acceesing VMA */
vma_set_access_pid_bit(vma);
- count_vm_numa_event(NUMA_HINT_FAULTS);
#ifdef CONFIG_NUMA_BALANCING
+ count_vm_numa_event(NUMA_HINT_FAULTS);
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;
}
+#endif
return mpol_misplaced(folio, vmf, addr);
}
--
2.43.0
Powered by blists - more mailing lists