linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/zswap: don't return LRU_SKIP if we have dropped lru lock
@ 2024-01-26  8:30 chengming.zhou
  2024-01-26  8:30 ` [PATCH 2/2] mm/zswap: fix race between lru writeback and swapoff chengming.zhou
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: chengming.zhou @ 2024-01-26  8:30 UTC (permalink / raw)
  To: hannes, yosryahmed, nphamcs, akpm
  Cc: linux-mm, linux-kernel, chengming.zhou, Chengming Zhou

From: Chengming Zhou <zhouchengming@bytedance.com>

LRU_SKIP can only be returned if we don't ever dropped lru lock, or
we need to return LRU_RETRY to restart from the head of lru list.

Actually we may need to introduce another LRU_STOP to really terminate
the ongoing shrinking scan process, when we encounter a warm page
already in the swap cache. The current list_lru implementation
doesn't have this function to early break from __list_lru_walk_one.

Fixes: b5ba474f3f51 ("zswap: shrink zswap pool based on memory pressure")
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
---
 mm/zswap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/zswap.c b/mm/zswap.c
index 00e90b9b5417..81cb3790e0dd 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -901,10 +901,8 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o
 		 * into the warmer region. We should terminate shrinking (if we're in the dynamic
 		 * shrinker context).
 		 */
-		if (writeback_result == -EEXIST && encountered_page_in_swapcache) {
-			ret = LRU_SKIP;
+		if (writeback_result == -EEXIST && encountered_page_in_swapcache)
 			*encountered_page_in_swapcache = true;
-		}
 
 		goto put_unlock;
 	}
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-27 15:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26  8:30 [PATCH 1/2] mm/zswap: don't return LRU_SKIP if we have dropped lru lock chengming.zhou
2024-01-26  8:30 ` [PATCH 2/2] mm/zswap: fix race between lru writeback and swapoff chengming.zhou
2024-01-26 15:31   ` Johannes Weiner
2024-01-26 19:31     ` Nhat Pham
2024-01-27 14:53     ` Chengming Zhou
2024-01-26 19:50   ` Nhat Pham
2024-01-27 15:12     ` Chengming Zhou
2024-01-26 14:28 ` [PATCH 1/2] mm/zswap: don't return LRU_SKIP if we have dropped lru lock Johannes Weiner
2024-01-27 14:33   ` Chengming Zhou
2024-01-26 18:01 ` Nhat Pham
2024-01-27 14:37   ` Chengming Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).