summaryrefslogtreecommitdiff
path: root/mm/migrate_device.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-01-28 14:29:43 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-21 13:01:32 -0400
commit4b8554c527f3cfa183f6c06d231a9387873205a0 (patch)
treecba1023980f8eaca5ae0f9c917056179113a1516 /mm/migrate_device.c
parent869f7ee6f6477341f859c8b0949ae81caf9ca7f3 (diff)
downloadlwn-4b8554c527f3cfa183f6c06d231a9387873205a0.tar.gz
lwn-4b8554c527f3cfa183f6c06d231a9387873205a0.zip
mm/rmap: Convert try_to_migrate() to folios
Convert the callers to pass a folio and the try_to_migrate_one() worker to use a folio throughout. Fixes an assumption that a folio must be <= PMD size. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Diffstat (limited to 'mm/migrate_device.c')
-rw-r--r--mm/migrate_device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/migrate_device.c b/mm/migrate_device.c
index 0326b901d2fd..b2c611d4bdb2 100644
--- a/mm/migrate_device.c
+++ b/mm/migrate_device.c
@@ -333,6 +333,7 @@ static void migrate_vma_unmap(struct migrate_vma *migrate)
for (i = 0; i < npages; i++) {
struct page *page = migrate_pfn_to_page(migrate->src[i]);
+ struct folio *folio;
if (!page)
continue;
@@ -356,8 +357,9 @@ static void migrate_vma_unmap(struct migrate_vma *migrate)
put_page(page);
}
- if (page_mapped(page))
- try_to_migrate(page, 0);
+ folio = page_folio(page);
+ if (folio_mapped(folio))
+ try_to_migrate(folio, 0);
if (page_mapped(page) || !migrate_vma_check_page(page)) {
if (!is_zone_device_page(page)) {