Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

migrate: expand the use of folio in __migrate_device_pages()

Removes a few calls to compound_head() and a call to page_mapping().

Link: https://lkml.kernel.org/r/20240423225552.4113447-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
e18a9faf 89f5c54b

+5 -8
+5 -8
mm/migrate_device.c
··· 696 696 struct page *newpage = migrate_pfn_to_page(dst_pfns[i]); 697 697 struct page *page = migrate_pfn_to_page(src_pfns[i]); 698 698 struct address_space *mapping; 699 + struct folio *folio; 699 700 int r; 700 701 701 702 if (!newpage) { ··· 731 730 continue; 732 731 } 733 732 734 - mapping = page_mapping(page); 733 + folio = page_folio(page); 734 + mapping = folio_mapping(folio); 735 735 736 736 if (is_device_private_page(newpage) || 737 737 is_device_coherent_page(newpage)) { 738 738 if (mapping) { 739 - struct folio *folio; 740 - 741 - folio = page_folio(page); 742 - 743 739 /* 744 740 * For now only support anonymous memory migrating to 745 741 * device private or coherent memory. ··· 759 761 760 762 if (migrate && migrate->fault_page == page) 761 763 r = migrate_folio_extra(mapping, page_folio(newpage), 762 - page_folio(page), 763 - MIGRATE_SYNC_NO_COPY, 1); 764 + folio, MIGRATE_SYNC_NO_COPY, 1); 764 765 else 765 766 r = migrate_folio(mapping, page_folio(newpage), 766 - page_folio(page), MIGRATE_SYNC_NO_COPY); 767 + folio, MIGRATE_SYNC_NO_COPY); 767 768 if (r != MIGRATEPAGE_SUCCESS) 768 769 src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; 769 770 }