Skip to contentSkip to conversation

mm-migrate_device-cleanup-up-pmd-checks-and-warnings.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 29

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/migrate_device: cleanup up PMD Checks and warnings
has been removed from the -mm tree. Its filename was
mm-migrate_device-cleanup-up-pmd-checks-and-warnings.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: Sunny Patel <[email protected]>
Subject: mm/migrate_device: cleanup up PMD Checks and warnings
Date: Sun, 19 Apr 2026 23:17:43 +0530

Remove the odd VM_WARN_ON_FOLIO(!folio, folio) usage and replace it with a simpler VM_WARN_ON_ONCE(!folio) check.

Drop the redundant VM_WARN_ON_ONCE(!pmd_none(*pmdp) && !is_huge_zero_pmd(*pmdp)).

Refactor the PMD checks, making the control flow clearer and avoiding duplicate condition checks.

---

 mm/migrate_device.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
mm/migrate_device.c renamed from mm/migrate_device.c~mm-migrate_device-cleanup-up-pmd-checks-and-warnings +3 -6
@@ -801,8 +801,7 @@ static int migrate_vma_insert_huge_pmd_p
 	bool flush = false;
 	unsigned long i;
 
-	VM_WARN_ON_FOLIO(!folio, folio);
-	VM_WARN_ON_ONCE(!pmd_none(*pmdp) && !is_huge_zero_pmd(*pmdp));
+	VM_WARN_ON_ONCE(!folio);
 
 	if (!thp_vma_suitable_order(vma, addr, HPAGE_PMD_ORDER))
 		return -EINVAL;
@@ -859,11 +858,9 @@ static int migrate_vma_insert_huge_pmd_p
 	if (userfaultfd_missing(vma))
 		goto unlock_abort;
 
-	if (!pmd_none(*pmdp)) {
-		if (!is_huge_zero_pmd(*pmdp))
-			goto unlock_abort;
+	if (is_huge_zero_pmd(*pmdp))
 		flush = true;
-	} else if (!pmd_none(*pmdp))
+	else if (!pmd_none(*pmdp))
 		goto unlock_abort;
 
 	add_mm_counter(vma->vm_mm, MM_ANONPAGES, HPAGE_PMD_NR);

_

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