Skip to content

mm/migrate: batch PTE restoration for large folios

Wandun Chen linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: factor out common softleaf offset PTE batch scanningmm/internal.h+14 -82 replies
2/3mm/migrate: batch PTE restoration in remove_migration_pte()mm/internal.h mm/migrate.c+35 -62 replies
3/3mm/migrate: batch PTE restoration for device-private foliosmm/migrate.c+19 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] mm/migrate: batch PTE restoration for large folios

From: Wandun Chen <[email protected]>

remove_migration_pte() restores PTE-mapped large folios one PTE at a time, constructing each new PTE and updating the folio references and rmap separately.

Following David Hildenbrand's suggestion [1], this series batches adjacent migration entries with consecutive PFNs and matching type and flags. When a batch restores the whole folio in an mlocked VMA, the rmap helpers automatically mark the folio as mlocked. It also extends pte-batching to device-private folios.

The series applies on top of the mlock tracking fix for PTE-mapped large-folio migration [2].

[1] https://lore.kernel.org/lkml/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

Wandun Chen (3):
mm: factor out common softleaf offset PTE batch scanning mm/migrate: batch PTE restoration in remove_migration_pte() mm/migrate: batch PTE restoration for device-private folios

 mm/internal.h | 28 ++++++++++++++++++++--------
 mm/migrate.c  | 51 +++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 65 insertions(+), 14 deletions(-)
Signature · 1 line
2.43.0