lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v6 6/6] zsmalloc: Implement writeback mechanism for zsmalloc (fix)
Date
Use get_first_page(), and add cond_resched() in retry loop.

Signed-off-by: Nhat Pham <nphamcs@gmail.com>
Suggested-by: Sergey Senozhatsky <senozhatsky@chromium.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
\
 
 \ /
  Last update: 2022-11-23 20:18    [W:0.026 / U:3.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site