linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio()
@ 2024-02-16 21:13 Sidhartha Kumar
  2024-02-16 21:13 ` [PATCH v2 2/6] mm/migrate_device: further convert migrate_device_unmap() to folios Sidhartha Kumar
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Sidhartha Kumar @ 2024-02-16 21:13 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: akpm, willy, apopple, Sidhartha Kumar

Add a folio compatible wrapper for migrate_pfn_to_page() so we can
return a folio directly.

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Suggested-by: Alistair Popple <apopple@nvidia.com>
---
 include/linux/migrate.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 2ce13e8a309bd..21a1a5e415338 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -171,6 +171,11 @@ static inline struct page *migrate_pfn_to_page(unsigned long mpfn)
 	return pfn_to_page(mpfn >> MIGRATE_PFN_SHIFT);
 }
 
+static inline struct folio *migrate_pfn_to_folio(unsigned long mpfn)
+{
+	return page_folio(migrate_pfn_to_page(mpfn));
+}
+
 static inline unsigned long migrate_pfn(unsigned long pfn)
 {
 	return (pfn << MIGRATE_PFN_SHIFT) | MIGRATE_PFN_VALID;
-- 
2.42.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-02-19  9:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 21:13 [PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio() Sidhartha Kumar
2024-02-16 21:13 ` [PATCH v2 2/6] mm/migrate_device: further convert migrate_device_unmap() to folios Sidhartha Kumar
2024-02-16 21:51   ` Matthew Wilcox
2024-02-16 21:13 ` [PATCH v2 3/6] mm/migrate_device: further convert migrate_device_finalize() " Sidhartha Kumar
2024-02-16 21:13 ` [PATCH v2 4/6] mm/migrate_device: convert __migrate_device_pages() " Sidhartha Kumar
2024-02-16 21:55   ` Matthew Wilcox
2024-02-16 22:00     ` Sidhartha Kumar
2024-02-16 23:19       ` Matthew Wilcox
2024-02-19  9:49         ` Alistair Popple
2024-02-16 21:13 ` [PATCH v2 5/6] mm/migrate_device: convert migrate_device_coherent_page() to migrate_device_coherent_folio() Sidhartha Kumar
2024-02-16 21:13 ` [PATCH v2 6/6] mm/migrate_device: convert migrate_device_range() to folios Sidhartha Kumar
2024-02-16 21:50 ` [PATCH v2 1/6] mm/migrate: introduce migrate_pfn_to_folio() Matthew Wilcox
2024-02-16 22:03   ` Sidhartha Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox