[Devel] [PATCH RHEL10 COMMIT] mm: export for_each_gen_type_zone() macros

Konstantin Khorenko khorenko at virtuozzo.com
Fri Sep 5 22:58:07 MSK 2025


The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.13.1.2.3.vz10
------>
commit 9d6ab35ef058c40478734f6198d4f8a0bdca2719
Author: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
Date:   Tue Sep 2 18:59:12 2025 +0800

    mm: export for_each_gen_type_zone() macros
    
    We need it to walk over lru lists for Multi-Gen LRU case for our
    memory.numa_migrate feature.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-114298
    Fixes: c92459bc18307 ("mm: memcontrol: add memory.numa_migrate file")
    Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
    
    Feature: mm: interface to migrate memory between NUMA nodes upon userspace request
---
 include/linux/mmzone.h | 5 +++++
 mm/vmscan.c            | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index ffbe13f6f285e..8b0cb56cf251e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -507,6 +507,11 @@ struct lru_gen_mm_walk {
 	RH_KABI_RESERVE(2)
 };
 
+#define for_each_gen_type_zone(gen, type, zone)				\
+	for ((gen) = 0; (gen) < MAX_NR_GENS; (gen)++)			\
+		for ((type) = 0; (type) < ANON_AND_FILE; (type)++)	\
+			for ((zone) = 0; (zone) < MAX_NR_ZONES; (zone)++)
+
 /*
  * For each node, memcgs are divided into two generations: the old and the
  * young. For each generation, memcgs are randomly sharded into multiple bins
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 1769f08bde8df..94004428c0937 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2621,11 +2621,6 @@ static bool should_clear_pmd_young(void)
 		READ_ONCE((lruvec)->lrugen.min_seq[LRU_GEN_FILE]),	\
 	}
 
-#define for_each_gen_type_zone(gen, type, zone)				\
-	for ((gen) = 0; (gen) < MAX_NR_GENS; (gen)++)			\
-		for ((type) = 0; (type) < ANON_AND_FILE; (type)++)	\
-			for ((zone) = 0; (zone) < MAX_NR_ZONES; (zone)++)
-
 #define get_memcg_gen(seq)	((seq) % MEMCG_NR_GENS)
 #define get_memcg_bin(bin)	((bin) % MEMCG_NR_BINS)
 


More information about the Devel mailing list