Skip to contentSkip to conversation

mm-migrate-putback-split-folios-when-numa-hint-migration-fails.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 12, 2024 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/migrate: putback split folios when numa hint migration fails
has been removed from the -mm tree. Its filename was
mm-migrate-putback-split-folios-when-numa-hint-migration-fails.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Peter Xu <[email protected]>
Subject: mm/migrate: putback split folios when numa hint migration fails
Date: Mon, 8 Jul 2024 17:55:37 -0400

This issue is not from any report yet, but by code observation only.

This is yet another fix besides Hugh's patch [1] but on relevant code path, where eager split of folio can happen if the folio is already on deferred list during a folio migration.

Here the issue is NUMA path (migrate_misplaced_folio()) may start to encounter such folio split now even with MR_NUMA_MISPLACED hint applied. Then when migrate_pages() didn't migrate all the folios, it's possible the split small folios be put onto the list instead of the original folio. Then putting back only the head page won't be enough.

Fix it by putting back all the folios on the list.

[1] https://lore.kernel.org/all/[email protected]/

[[email protected]: remove now unused local `nr_pages']
Fixes 7262f208ca68 ("mm/migrate: split source folio if it is on deferred split list")
Cc Yang Shi <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Huang Ying <[email protected]>
Cc David Hildenbrand <[email protected]>

---

 mm/migrate.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
mm/migrate.c renamed from mm/migrate.c~mm-migrate-putback-split-folios-when-numa-hint-migration-fails +2 -9
@@ -2621,20 +2621,13 @@ int migrate_misplaced_folio(struct folio
 	int nr_remaining;
 	unsigned int nr_succeeded;
 	LIST_HEAD(migratepages);
-	int nr_pages = folio_nr_pages(folio);
 
 	list_add(&folio->lru, &migratepages);
 	nr_remaining = migrate_pages(&migratepages, alloc_misplaced_dst_folio,
 				     NULL, node, MIGRATE_ASYNC,
 				     MR_NUMA_MISPLACED, &nr_succeeded);
-	if (nr_remaining) {
-		if (!list_empty(&migratepages)) {
-			list_del(&folio->lru);
-			node_stat_mod_folio(folio, NR_ISOLATED_ANON +
-					folio_is_file_lru(folio), -nr_pages);
-			folio_putback_lru(folio);
-		}
-	}
+	if (nr_remaining && !list_empty(&migratepages))
+		putback_movable_pages(&migratepages);
 	if (nr_succeeded) {
 		count_vm_numa_events(NUMA_PAGE_MIGRATE, nr_succeeded);
 		if (!node_is_toptier(folio_nid(folio)) && node_is_toptier(node))

_

Patches currently in -mm which might be from [email protected] are