Messages in this thread Patch in this message | | | From | Nhat Pham <> | Subject | [PATCH v6 6/6] zsmalloc: Implement writeback mechanism for zsmalloc (fix) | Date | Wed, 23 Nov 2022 11:17:03 -0800 |
| |
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
| |