mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: zswap: remove dead length check in zswap_store_page()
@ 2026-11-23  3:25 Mohamad Raizudeen
  2026-11-23 16:20 ` Yosry Ahmed
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mohamad Raizudeen @ 2026-11-23  3:25 UTC (permalink / raw)
  To: chengming.zhou, yosry
  Cc: hannes, nphamcs, akpm, linux-mm, linux-kernel, Mohamad Raizudeen

zswap_compress() never succeeds with entry->length == 0, so the
condition is always true. Remove it.

Signed-off-by: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
---
 mm/zswap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/mm/zswap.c b/mm/zswap.c
index ae19e301fced..9590f333d83f 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1509,10 +1509,8 @@ static bool zswap_store_page(struct folio *folio, long index,
 	entry->swpentry = page_swpentry;
 	entry->objcg = objcg;
 	entry->referenced = true;
-	if (entry->length) {
-		INIT_LIST_HEAD(&entry->lru);
-		zswap_lru_add(entry);
-	}
+	INIT_LIST_HEAD(&entry->lru);
+	zswap_lru_add(entry);
 
 	return true;
 
-- 
2.53.0


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

end of thread, other threads:[~2026-11-23 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  3:25 [PATCH] mm: zswap: remove dead length check in zswap_store_page() Mohamad Raizudeen
2026-11-23 16:20 ` Yosry Ahmed
2026-11-23 16:26 ` Joshua Hahn
2026-11-23 17:16 ` Nhat Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®