diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2024-03-26 23:28:24 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-26 06:56:19 +0300 |
commit | b002a7b0a58aceaed0e3c5dd80d6f549df6490b2 (patch) | |
tree | 6674d9230ce88a4cc505b70032fe62ce0f445fb2 /mm/migrate_device.c | |
parent | e06d03d5590ae1c257b8aa2cfbfe6765e0755c14 (diff) | |
download | linux-b002a7b0a58aceaed0e3c5dd80d6f549df6490b2.tar.xz |
mm: convert migrate_vma_collect_pmd to use a folio
Convert the pmd directly to a folio and use it. Turns four calls to
compound_head() into one.
Link: https://lkml.kernel.org/r/20240326202833.523759-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/migrate_device.c')
-rw-r--r-- | mm/migrate_device.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mm/migrate_device.c b/mm/migrate_device.c index b6c27c76e1a0..d40b46ae9d65 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -71,7 +71,7 @@ again: return migrate_vma_collect_hole(start, end, -1, walk); if (pmd_trans_huge(*pmdp)) { - struct page *page; + struct folio *folio; ptl = pmd_lock(mm, pmdp); if (unlikely(!pmd_trans_huge(*pmdp))) { @@ -79,21 +79,21 @@ again: goto again; } - page = pmd_page(*pmdp); - if (is_huge_zero_page(page)) { + folio = pmd_folio(*pmdp); + if (is_huge_zero_folio(folio)) { spin_unlock(ptl); split_huge_pmd(vma, pmdp, addr); } else { int ret; - get_page(page); + folio_get(folio); spin_unlock(ptl); - if (unlikely(!trylock_page(page))) + if (unlikely(!folio_trylock(folio))) return migrate_vma_collect_skip(start, end, walk); - ret = split_huge_page(page); - unlock_page(page); - put_page(page); + ret = split_folio(folio); + folio_unlock(folio); + folio_put(folio); if (ret) return migrate_vma_collect_skip(start, end, walk); |