The commit is pushed to "branch-rh10-6.12.0-55.13.1.2.x.vz10-ovz" and will appear at g...@bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-55.13.1.2.3.vz10 ------> commit 44b9e7dae417f29e3fbebb114b3bbee04a373543 Author: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> Date: Tue Sep 2 18:59:15 2025 +0800
mm/memcontrol: use lruvec_del_folio() in memcg_numa_isolate_pages() The lruvec_del_folio() is a universal helper which works fine both with old lru and new Multi-Gen LRU, and we want to support the new version. So let's switch to lruvec_del_folio(). The lruvec_del_folio() + node_stat_mod_folio() used exactly the same way as they are used in isolate_migratepages_block() now already do the same as our old __mod_node_page_state/update_lru_sizes, but universaly for both cases of lru. After lruvec_del_folio() let's reinitialize folio->lru (with INIT_LIST_HEAD) to allow consecutive list_move(). Let's also remove now unused pgdat and nr_zone_taken variables. https://virtuozzo.atlassian.net/browse/VSTOR-114298 Fixes: c92459bc18307 ("mm: memcontrol: add memory.numa_migrate file") Signed-off-by: Pavel Tikhomirov <ptikhomi...@virtuozzo.com> Feature: mm: interface to migrate memory between NUMA nodes upon userspace request --- mm/memcontrol.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6eb8202f5d4c0..4321ac0ef7cb0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3511,8 +3511,6 @@ static long memcg_numa_isolate_pages(struct lruvec *lruvec, enum lru_list lru, long nr_to_scan, struct list_head *dst) { struct list_head *src = &lruvec->lists[lru]; - struct pglist_data *pgdat = lruvec_pgdat(lruvec); - unsigned long nr_zone_taken[MAX_NR_ZONES] = { 0 }; long scanned = 0, taken = 0; struct folio *folio = NULL; struct address_space *mapping; @@ -3626,16 +3624,18 @@ static long memcg_numa_isolate_pages(struct lruvec *lruvec, enum lru_list lru, goto isolate_fail; } + /* Successfully isolated */ + lruvec_del_folio(lruvec, folio); + INIT_LIST_HEAD(&folio->lru); + node_stat_mod_folio(folio, NR_ISOLATED_ANON + folio_is_file_lru(folio), + folio_nr_pages(folio)); + nr_pages = folio_nr_pages(folio); taken += nr_pages; - nr_zone_taken[folio_zonenum(folio)] += nr_pages; move_to = dst; isolate_fail: list_move(&folio->lru, move_to); } - __mod_node_page_state(pgdat, NR_LRU_BASE + lru, -taken); - __mod_node_page_state(pgdat, NR_ISOLATED_ANON + is_file_lru(lru), taken); - update_lru_sizes(lruvec, lru, nr_zone_taken); spin_unlock_irq(&lruvec->lru_lock); return scanned; _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel