mm-migrate_device-implement-thp-migration-of-zone-device-pages.patch removed from -mm tree
The quilt patch titled
Subject: mm/migrate_device: implement THP migration of zone device pages
has been removed from the -mm tree. Its filename was
mm-migrate_device-implement-thp-migration-of-zone-device-pages.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: Balbir Singh <[email protected]>
Subject: mm/migrate_device: implement THP migration of zone device pages
Date: Wed, 1 Oct 2025 16:56:58 +1000
MIGRATE_VMA_SELECT_COMPOUND will be used to select THP pages during migrate_vma_setup() and MIGRATE_PFN_COMPOUND will make migrating device pages as compound pages during device pfn migration.
migrate_device code paths go through the collect, setup and finalize phases of migration.
The entries in src and dst arrays passed to these functions still remain at a PAGE_SIZE granularity. When a compound page is passed, the first entry has the PFN along with MIGRATE_PFN_COMPOUND and other flags set (MIGRATE_PFN_MIGRATE, MIGRATE_PFN_VALID), the remaining entries (HPAGE_PMD_NR - 1) are filled with 0's. This representation allows for the compound page to be split into smaller page sizes.
migrate_vma_collect_hole(), migrate_vma_collect_pmd() are now THP page aware. Two new helper functions migrate_vma_collect_huge_pmd() and migrate_vma_insert_huge_pmd_page() have been added.
migrate_vma_collect_huge_pmd() can collect THP pages, but if for some reason this fails, there is fallback support to split the folio and migrate it.
migrate_vma_insert_huge_pmd_page() closely follows the logic of migrate_vma_insert_page()
Support for splitting pages as needed for migration will follow in later patches in this series.
---
include/linux/migrate.h | 2 mm/migrate_device.c | 469 ++++++++++++++++++++++++++++++++------ 2 files changed, 408 insertions(+), 63 deletions(-)
include/linux/migrate.h renamed from include/linux/migrate.h~mm-migrate_device-implement-thp-migration-of-zone-device-pages +2 -0
@@ -125,6 +125,7 @@ static inline int migrate_misplaced_foli#define MIGRATE_PFN_VALID (1UL << 0)#define MIGRATE_PFN_MIGRATE (1UL << 1)#define MIGRATE_PFN_WRITE (1UL << 3) +#define MIGRATE_PFN_COMPOUND (1UL << 4)#define MIGRATE_PFN_SHIFT 6static inline struct page *migrate_pfn_to_page (unsigned long mpfn)
@@ -143,6 +144,7 @@ enum migrate_vma_direction {MIGRATE_VMA_SELECT_SYSTEM =1 <<0 ,MIGRATE_VMA_SELECT_DEVICE_PRIVATE =1 <<1 ,MIGRATE_VMA_SELECT_DEVICE_COHERENT =1 <<2 , + MIGRATE_VMA_SELECT_COMPOUND = 1 << 3, }; struct migrate_vma {
mm/migrate_device.c renamed from mm/migrate_device.c~mm-migrate_device-implement-thp-migration-of-zone-device-pages +406 -63
632 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are