From: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
To: chengming.zhou@linux.dev, yosry@kernel.org
Cc: hannes@cmpxchg.org, nphamcs@gmail.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Subject: [PATCH] mm: zswap: remove dead length check in zswap_store_page()
Date: Mon, 23 Nov 2026 08:55:12 +0530 [thread overview]
Message-ID: <20261123032512.6119-1-raizudeen.kerneldev@gmail.com> (raw)
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
next reply other threads:[~2026-11-23 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 3:25 Mohamad Raizudeen [this message]
2026-11-23 16:20 ` Yosry Ahmed
2026-11-23 16:26 ` Joshua Hahn
2026-11-23 17:16 ` Nhat Pham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123032512.6119-1-raizudeen.kerneldev@gmail.com \
--to=raizudeen.kerneldev@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=chengming.zhou@linux.dev \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=yosry@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®