summaryrefslogtreecommitdiffstats
path: root/mm/migrate_device.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-29 05:32:59 +0100
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 18:01:35 +0100
commit4eecb8b9163df82c87c91764a02fff228ef25f6d (patch)
tree0c3857eb4ca9e26d9ce540fdbf27466b1e9a22d2 /mm/migrate_device.c
parentmm/rmap: Convert make_device_exclusive_range() to use folios (diff)
downloadlinux-4eecb8b9163df82c87c91764a02fff228ef25f6d.tar.xz
linux-4eecb8b9163df82c87c91764a02fff228ef25f6d.zip
mm/migrate: Convert remove_migration_ptes() to folios
Convert the implementation and all callers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'mm/migrate_device.c')
-rw-r--r--mm/migrate_device.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mm/migrate_device.c b/mm/migrate_device.c
index b2c611d4bdb2..70c7dc05bbfc 100644
--- a/mm/migrate_device.c
+++ b/mm/migrate_device.c
@@ -376,15 +376,17 @@ static void migrate_vma_unmap(struct migrate_vma *migrate)
for (i = 0; i < npages && restore; i++) {
struct page *page = migrate_pfn_to_page(migrate->src[i]);
+ struct folio *folio;
if (!page || (migrate->src[i] & MIGRATE_PFN_MIGRATE))
continue;
- remove_migration_ptes(page, page, false);
+ folio = page_folio(page);
+ remove_migration_ptes(folio, folio, false);
migrate->src[i] = 0;
- unlock_page(page);
- put_page(page);
+ folio_unlock(folio);
+ folio_put(folio);
restore--;
}
}
@@ -729,6 +731,7 @@ void migrate_vma_finalize(struct migrate_vma *migrate)
unsigned long i;
for (i = 0; i < npages; i++) {
+ struct folio *dst, *src;
struct page *newpage = migrate_pfn_to_page(migrate->dst[i]);
struct page *page = migrate_pfn_to_page(migrate->src[i]);
@@ -748,8 +751,10 @@ void migrate_vma_finalize(struct migrate_vma *migrate)
newpage = page;
}
- remove_migration_ptes(page, newpage, false);
- unlock_page(page);
+ src = page_folio(page);
+ dst = page_folio(newpage);
+ remove_migration_ptes(src, dst, false);
+ folio_unlock(src);
if (is_zone_device_page(page))
put_page(page);