2022-06-06 20:57:57

by Matthew Wilcox

[permalink] [raw]
Subject: [PATCH 18/20] zsmalloc: Convert to migrate_folio

zsmalloc doesn't really use folios, but it needs to be called like this
in order to migrate an individual page. Convert from a folio back to
a page until we decide how to handle migration better for zsmalloc.

Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
---
mm/zsmalloc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 5d5fc04385b8..8ed79121195a 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1865,9 +1865,11 @@ static bool zs_page_isolate(struct page *page, isolate_mode_t mode)
return true;
}

-static int zs_page_migrate(struct address_space *mapping, struct page *newpage,
- struct page *page, enum migrate_mode mode)
+static int zs_migrate_folio(struct address_space *mapping,
+ struct folio *dst, struct folio *src, enum migrate_mode mode)
{
+ struct page *newpage = &dst->page;
+ struct page *page = &src->page;
struct zs_pool *pool;
struct size_class *class;
struct zspage *zspage;
@@ -1966,7 +1968,7 @@ static void zs_page_putback(struct page *page)

static const struct address_space_operations zsmalloc_aops = {
.isolate_page = zs_page_isolate,
- .migratepage = zs_page_migrate,
+ .migrate_folio = zs_migrate_folio,
.putback_page = zs_page_putback,
};

--
2.35.1