[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221123191703.2902079-3-nphamcs@gmail.com>
Date: Wed, 23 Nov 2022 11:17:03 -0800
From: Nhat Pham <nphamcs@...il.com>
To: akpm@...ux-foundation.org
Cc: hannes@...xchg.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, minchan@...nel.org,
ngupta@...are.org, senozhatsky@...omium.org, sjenning@...hat.com,
ddstreet@...e.org, vitaly.wool@...sulko.com
Subject: [PATCH v6 6/6] zsmalloc: Implement writeback mechanism for zsmalloc (fix)
Use get_first_page(), and add cond_resched() in retry loop.
Signed-off-by: Nhat Pham <nphamcs@...il.com>
Suggested-by: Sergey Senozhatsky <senozhatsky@...omium.org>
---
mm/zsmalloc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index e2bd41f37b5b..ab4fa17a0fad 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -2488,12 +2488,13 @@ static int zs_reclaim_page(struct zs_pool *pool, unsigned int retries)
remove_zspage(class, zspage, fullness);
spin_unlock(&pool->lock);
+ cond_resched();
/* Lock backing pages into place */
lock_zspage(zspage);
obj_idx = 0;
- page = zspage->first_page;
+ page = get_first_page(zspage);
while (1) {
handle = find_alloced_obj(class, page, &obj_idx);
if (!handle) {
--
2.30.2
Powered by blists - more mailing lists