diff mbox series

[RFC,23/25] mm/zsmalloc: convert zs_reclaim_page() to use zsdesc

Message ID 20230220132218.546369-24-42.hyeyoo@gmail.com (mailing list archive)
State New
Headers show
Series mm/zsmalloc: Split zsdesc from struct page | expand

Commit Message

Hyeonggon Yoo Feb. 20, 2023, 1:22 p.m. UTC
Convert zs_reclaim_page() to use zsdesc and update its comments
accordingly.

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

Patch

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index b6ca93012c9a..7153688f5bca 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -2802,7 +2802,7 @@  static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries)
 	int i, obj_idx, ret = 0;
 	unsigned long handle;
 	struct zspage *zspage;
-	struct page *page;
+	struct zsdesc *zsdesc;
 	enum fullness_group fullness;
 
 	/* Lock LRU and fullness list */
@@ -2830,16 +2830,16 @@  static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries)
 		spin_unlock(&pool->lock);
 		cond_resched();
 
-		/* Lock backing pages into place */
+		/* Lock backing zsdescs into place */
 		lock_zspage(zspage);
 
 		obj_idx = 0;
-		page = get_first_page(zspage);
+		zsdesc = get_first_zsdesc(zspage);
 		while (1) {
-			handle = find_alloced_obj(class, page_zsdesc(page), &obj_idx);
+			handle = find_alloced_obj(class, zsdesc, &obj_idx);
 			if (!handle) {
-				page = get_next_page(page);
-				if (!page)
+				zsdesc = get_next_zsdesc(zsdesc);
+				if (!zsdesc)
 					break;
 				obj_idx = 0;
 				continue;
@@ -2870,7 +2870,7 @@  static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries)
 		if (!get_zspage_inuse(zspage)) {
 			/*
 			 * Fullness went stale as zs_free() won't touch it
-			 * while the page is removed from the pool. Fix it
+			 * while the zsdesc is removed from the pool. Fix it
 			 * up for the check in __free_zspage().
 			 */
 			zspage->fullness = ZS_EMPTY;