diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-01-28 20:29:43 +0100 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 18:01:32 +0100 |
commit | 4b8554c527f3cfa183f6c06d231a9387873205a0 (patch) | |
tree | cba1023980f8eaca5ae0f9c917056179113a1516 /mm/migrate_device.c | |
parent | mm/rmap: Convert try_to_unmap() to take a folio (diff) | |
download | linux-4b8554c527f3cfa183f6c06d231a9387873205a0.tar.xz linux-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.c | 6 |
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)) { |