From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: Mohamad Raizudeen <raizudeen.kerneldev@gmail.com>
Cc: chengming.zhou@linux.dev, yosry@kernel.org, hannes@cmpxchg.org,
nphamcs@gmail.com, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: zswap: remove dead length check in zswap_store_page()
Date: Mon, 23 Nov 2026 08:26:00 -0800 [thread overview]
Message-ID: <awRoyv7oqW3e3DG3@devbig011.atn3.facebook.com> (raw)
In-Reply-To: <20261123032512.6119-1-raizudeen.kerneldev@gmail.com>
On Mon, Nov 23, 2026 at 08:55:12AM +0530, Mohamad Raizudeen wrote:
> zswap_compress() never succeeds with entry->length == 0, so the
> condition is always true. Remove it.
Hi Mohamad, nice catch! Looks right to me:
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
> 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 prev parent reply other threads:[~2026-11-23 16:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-11-23 17:06 ` + mm-zswap-remove-dead-length-check-in-zswap_store_page.patch added to mm-new branch Andrew Morton
2026-11-23 17:16 ` [PATCH] mm: zswap: remove dead length check in zswap_store_page() Nhat Pham
2026-11-24 1:21 ` SJ Park
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=awRoyv7oqW3e3DG3@devbig011.atn3.facebook.com \
--to=joshua.hahnjy@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=raizudeen.kerneldev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.