Skip to contentSkip to conversation

mm-migrate_devicec-fix-a-misleading-and-out-dated-comment.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 12, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/migrate_device.c: fix a misleading and outdated comment
has been removed from the -mm tree. Its filename was
mm-migrate_devicec-fix-a-misleading-and-out-dated-comment.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: Alistair Popple <[email protected]>
Subject: mm/migrate_device.c: fix a misleading and outdated comment
Date: Tue, 30 Aug 2022 12:01:38 +1000

Commit ab09243aa95a ("mm/migrate.c: remove MIGRATE_PFN_LOCKED") changed the way trylock_page() in migrate_vma_collect_pmd() works without updating the comment. Reword the comment to be less misleading and a better reflection of what happens.

---

 mm/migrate_device.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
mm/migrate_device.c renamed from mm/migrate_device.c~mm-migrate_devicec-fix-a-misleading-and-out-dated-comment +10 -3
@@ -185,9 +185,16 @@ again:
 		get_page(page);
 
 		/*
-		 * Optimize for the common case where page is only mapped once
-		 * in one process. If we can lock the page, then we can safely
-		 * set up a special migration page table entry now.
+		 * We rely on trylock_page() to avoid deadlock between
+		 * concurrent migrations where each is waiting on the others
+		 * page lock. If we can't immediately lock the page we fail this
+		 * migration as it is only best effort anyway.
+		 *
+		 * If we can lock the page it's safe to set up a migration entry
+		 * now. In the common case where the page is mapped once in a
+		 * single process setting up the migration entry now is an
+		 * optimisation to avoid walking the rmap later with
+		 * try_to_migrate().
 		 */
 		if (trylock_page(page)) {
 			bool anon_exclusive;

_

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

selftests-hmm-tests-add-test-for-dirty-bits.patch