From: Chengming Zhou <chengming.zhou@linux.dev>
To: SeongJae Park <sj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Nhat Pham <nphamcs@gmail.com>,
Yosry Ahmed <yosry.ahmed@linux.dev>,
kernel-team@meta.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH 1/4] mm/zswap: remove unnecessary dlen writes for incompressible pages
Date: Thu, 9 Oct 2025 11:02:09 +0800 [thread overview]
Message-ID: <c6c9bb5e-b70e-4daa-9b8b-53b6a8ac87fc@linux.dev> (raw)
In-Reply-To: <20251003203851.43128-2-sj@kernel.org>
On 2025/10/4 04:38, SeongJae Park wrote:
> Incompressible pages handling logic in zswap_compress() is setting
> 'dlen' as PAGE_SIZE twice. Once before deciding whether to save the
> content as is, and once again after it is decided to save it as is.
> But the value of 'dlen' is used only if it is decided to save the
> content as is, so the first write is unnecessary. It is not causing
> real user issues, but making code confusing to read. Remove the
> unnecessary write operation.
>
> Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
> ---
> mm/zswap.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index c1af782e54ec..80619c8589a7 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -894,7 +894,6 @@ static bool zswap_compress(struct page *page, struct zswap_entry *entry,
> * to the active LRU list in the case.
> */
> if (comp_ret || !dlen || dlen >= PAGE_SIZE) {
> - dlen = PAGE_SIZE;
> if (!mem_cgroup_zswap_writeback_enabled(
> folio_memcg(page_folio(page)))) {
> comp_ret = comp_ret ? comp_ret : -EINVAL;
next prev parent reply other threads:[~2025-10-09 3:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 20:38 [PATCH 0/4] mm/zswap: misc cleanup of code and documentations SeongJae Park
2025-10-03 20:38 ` [PATCH 1/4] mm/zswap: remove unnecessary dlen writes for incompressible pages SeongJae Park
2025-10-07 23:40 ` Yosry Ahmed
2025-10-08 15:45 ` Nhat Pham
2025-10-09 3:02 ` Chengming Zhou [this message]
2025-10-03 20:38 ` [PATCH 2/4] mm/zswap: fix typos: s/zwap/zswap/ SeongJae Park
2025-10-07 23:40 ` Yosry Ahmed
2025-10-08 15:46 ` Nhat Pham
2025-10-09 3:02 ` Chengming Zhou
2025-10-03 20:38 ` [PATCH 3/4] mm/zswap: s/red-black tree/xarray/ SeongJae Park
2025-10-07 23:41 ` Yosry Ahmed
2025-10-08 15:46 ` Nhat Pham
2025-10-09 3:03 ` Chengming Zhou
2025-10-03 20:38 ` [PATCH 4/4] Docs/admin-guide/mm/zswap: " SeongJae Park
2025-10-07 23:42 ` Yosry Ahmed
2025-10-08 15:48 ` Nhat Pham
2025-10-09 3:03 ` Chengming Zhou
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=c6c9bb5e-b70e-4daa-9b8b-53b6a8ac87fc@linux.dev \
--to=chengming.zhou@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=sj@kernel.org \
--cc=yosry.ahmed@linux.dev \
/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