Skip to content

Commit eb64fc6

Browse files
author
Rafael Aquini
committed
mm: migrate_device: convert try_to_migrate() to folios
JIRA: https://issues.redhat.com/browse/RHEL-84184 JIRA: https://issues.redhat.com/browse/RHEL-83249 Upstream Status: RHEL only These are hunks from upstream's commit 4b8554c ("mm/rmap: Convert try_to_migrate() to folios") that ended up lost in RHEL-9 due to out-of-order backports of commits 4b8554c and 76cbbea ("mm: move the migrate_vma_* device migration code into its own file"). There is nothing functionally wrong with the current RHEL-9 backported code, but it is better to bring these bits back to their original upstream form, so it becomes easier and less error-prone to perform further backports to this area in the future. Signed-off-by: Rafael Aquini <raquini@redhat.com>
1 parent 9345f8c commit eb64fc6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mm/migrate_device.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns,
366366

367367
for (i = 0; i < npages; i++) {
368368
struct page *page = migrate_pfn_to_page(src_pfns[i]);
369+
struct folio *folio;
369370

370371
if (!page) {
371372
if (src_pfns[i] & MIGRATE_PFN_MIGRATE)
@@ -391,8 +392,9 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns,
391392
put_page(page);
392393
}
393394

394-
if (page_mapped(page))
395-
try_to_migrate(page_folio(page), 0);
395+
folio = page_folio(page);
396+
if (folio_mapped(folio))
397+
try_to_migrate(folio, 0);
396398

397399
if (page_mapped(page) ||
398400
!migrate_vma_check_page(page, fault_page)) {

0 commit comments

Comments
 (0)