Skip to contentSkip to conversation

mm-migrate-use-folio_likely_mapped_shared-in-add_page_for_migration.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 6, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/migrate: use folio_likely_mapped_shared() in add_page_for_migration()
has been removed from the -mm tree. Its filename was
mm-migrate-use-folio_likely_mapped_shared-in-add_page_for_migration.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: David Hildenbrand <[email protected]>
Subject: mm/migrate: use folio_likely_mapped_shared() in add_page_for_migration()
Date: Tue, 9 Apr 2024 21:22:54 +0200

We want to limit the use of page_mapcount() to the places where it is absolutely necessary. In add_page_for_migration(), we actually want to check if the folio is mapped shared, to reject such folios. So let's use folio_likely_mapped_shared() instead.

For small folios, fully mapped THP, and hugetlb folios, there is no change. For partially mapped, shared THP, we should now do a better job at rejecting such folios.

Cc Chris Zankel <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc John Paul Adrian Glaubitz <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc Max Filippov <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Muchun Song <[email protected]>
Cc Naoya Horiguchi <[email protected]>
Cc Peter Xu <[email protected]>
Cc Richard Chang <[email protected]>
Cc Rich Felker <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Yang Shi <[email protected]>
Cc Yin Fengwei <[email protected]>
Cc Yoshinori Sato <[email protected]>
Cc Zi Yan <[email protected]>

---

 mm/migrate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/migrate.c renamed from mm/migrate.c~mm-migrate-use-folio_likely_mapped_shared-in-add_page_for_migration +1 -1
@@ -2140,7 +2140,7 @@ static int add_page_for_migration(struct
 		goto out_putfolio;
 
 	err = -EACCES;
-	if (page_mapcount(page) > 1 && !migrate_all)
+	if (folio_likely_mapped_shared(folio) && !migrate_all)
 		goto out_putfolio;
 
 	err = -EBUSY;

_

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