Skip to contentSkip to conversation

mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 10, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: migrate: simplify the refcount validation when migrating hugetlb mapping
has been removed from the -mm tree. Its filename was
mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch

This patch was dropped because it was merged into mm-stable

------------------------------------------------------
From: Baolin Wang <[email protected]>
Subject: mm: migrate: simplify the refcount validation when migrating hugetlb mapping

There is no need to validate the hugetlb page's refcount before trying to freeze the hugetlb page's expected refcount, instead we can just rely on the page_ref_freeze() to simplify the validation.

Moreover we are always under the page lock when migrating the hugetlb page mapping, which means nowhere else can remove it from the page cache, so we can remove the xas_load() validation under the i_pages lock.

---

 mm/migrate.c |    5 -----
 1 file changed, 5 deletions(-)
mm/migrate.c renamed from mm/migrate.c~mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping +0 -5
@@ -471,11 +471,6 @@ int migrate_huge_page_move_mapping(struc
 
 	xas_lock_irq(&xas);
 	expected_count = 2 + page_has_private(page);
-	if (page_count(page) != expected_count || xas_load(&xas) != page) {
-		xas_unlock_irq(&xas);
-		return -EAGAIN;
-	}
-
 	if (!page_ref_freeze(page, expected_count)) {
 		xas_unlock_irq(&xas);
 		return -EAGAIN;

_

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