All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-migrate_device-add-thp-splitting-during-migration-fix.patch added to mm-unstable branch
@ 2025-11-20 23:14 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-11-20 23:14 UTC (permalink / raw)
  To: mm-commits, ziy, ying.huang, simona, ryan.roberts, rcampbell,
	rakie.kim, osalvador, npache, mpenttil, lyude, lorenzo.stoakes,
	Liam.Howlett, joshua.hahnjy, gourry, francois.dugast, dev.jain,
	david, dakr, byungchul, baolin.wang, baohua, balbirs, apopple,
	airlied, matthew.brost, akpm

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3631 bytes --]


The patch titled
     Subject: fixup: mm/migrate_device: add THP splitting during migration
has been added to the -mm mm-unstable branch.  Its filename is
     mm-migrate_device-add-thp-splitting-during-migration-fix.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-migrate_device-add-thp-splitting-during-migration-fix.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Matthew Brost <matthew.brost@intel.com>
Subject: fixup: mm/migrate_device: add THP splitting during migration
Date: Thu, 20 Nov 2025 15:08:25 -0800

Fix splitting a folio in PMD collection to collect a skip on folio split
failure and continue the loop at the current position on success.  This
fixes an issue where migration entries that had already been collected
could accidentally be left behind.

Link: https://lkml.kernel.org/r/20251120230825.181072-2-matthew.brost@intel.com
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Gregory Price <gourry@gourry.net>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Mika Penttilä <mpenttil@redhat.com>
Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Balbir Singh <balbirs@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/migrate_device.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/mm/migrate_device.c~mm-migrate_device-add-thp-splitting-during-migration-fix
+++ a/mm/migrate_device.c
@@ -313,16 +313,18 @@ again:
 			if (folio_test_large(folio)) {
 				int ret;
 
+				arch_leave_lazy_mmu_mode();
 				pte_unmap_unlock(ptep, ptl);
 				ret = migrate_vma_split_folio(folio,
 							  migrate->fault_page);
 
 				if (ret) {
-					ptep = pte_offset_map_lock(mm, pmdp, addr, &ptl);
-					goto next;
+					if (unmapped)
+						flush_tlb_range(walk->vma, start, end);
+
+					return migrate_vma_collect_skip(addr, end, walk);
 				}
 
-				addr = start;
 				goto again;
 			}
 
_

Patches currently in -mm which might be from matthew.brost@intel.com are

mm-migrate_device-handle-partially-mapped-folios-during-collection-fix.patch
mm-migrate_device-add-thp-splitting-during-migration-fix.patch
selftests-mm-hmm-tests-partial-unmap-mremap-and-anon_write-tests.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-20 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 23:14 + mm-migrate_device-add-thp-splitting-during-migration-fix.patch added to mm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.