[RFC,v2,19/21] mm/zsmalloc: convert SetZsPageMovable() to use zsdesc

Message ID 20230713042037.980211-20-42.hyeyoo@gmail.com
State New
Headers
Series mm/zsmalloc: Split zsdesc from struct page |

Commit Message

Hyeonggon Yoo July 13, 2023, 4:20 a.m. UTC
  Convert SetZsPageMovable() to use zsdesc.

Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
---
 mm/zsmalloc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 6cb216b8564a..5f07e3d92a99 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -2117,13 +2117,13 @@  static void init_deferred_free(struct zs_pool *pool)
 
 static void SetZsPageMovable(struct zs_pool *pool, struct zspage *zspage)
 {
-	struct page *page = get_first_page(zspage);
+	struct zsdesc *zsdesc = get_first_zsdesc(zspage);
 
 	do {
-		WARN_ON(!trylock_page(page));
-		__SetPageMovable(page, &zsmalloc_mops);
-		unlock_page(page);
-	} while ((page = get_next_page(page)) != NULL);
+		WARN_ON(!trylock_zsdesc(zsdesc));
+		zsdesc_set_movable(zsdesc);
+		unlock_zsdesc(zsdesc);
+	} while ((zsdesc = get_next_zsdesc(zsdesc)) != NULL);
 }
 #else
 static inline void zs_flush_migration(struct zs_pool *pool) { }