From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,nphamcs@gmail.com,kasong@tencent.com,hannes@cmpxchg.org,flintglass@gmail.com,david@redhat.com,chrisl@kernel.org,chengming.zhou@linux.dev,bhe@redhat.com,baohua@kernel.org,sj@kernel.org,akpm@linux-foundation.org
Subject: [folded-merged] mm-zswap-store-page_size-compression-failed-page-as-is-fix-2.patch removed from -mm tree
Date: Sat, 13 Sep 2025 15:15:39 -0700 [thread overview]
Message-ID: <20250913221539.E940DC4CEEB@smtp.kernel.org> (raw)
The quilt patch titled
Subject: mm/zswap: cleanup incompressible pages handling code
has been removed from the -mm tree. Its filename was
mm-zswap-store-page_size-compression-failed-page-as-is-fix-2.patch
This patch was dropped because it was folded into mm-zswap-store-page_size-compression-failed-page-as-is.patch
------------------------------------------------------
From: SeongJae Park <sj@kernel.org>
Subject: mm/zswap: cleanup incompressible pages handling code
Date: Wed, 27 Aug 2025 13:18:38 -0700
Following Chris Li's suggestions [1], make the code easier to read and
manage.
Link: https://lkml.kernel.org/r/20250828163913.57957-1-sj@kernel.org
Kink: https://lore.kernel.org/CACePvbWGPApYr7G29FzbmWzRw-BJE39WH7kUHSaHs+Lnw8=-qQ@mail.gmail.com [1]
Signed-off-by: SeongJae Park <sj@kernel.org>
Acked-by: Chris Li <chrisl@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: David Hildenbrand <david@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Takero Funaki <flintglass@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/zswap.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/mm/zswap.c~mm-zswap-store-page_size-compression-failed-page-as-is-fix-2
+++ a/mm/zswap.c
@@ -952,6 +952,7 @@ static bool zswap_compress(struct page *
struct zpool *zpool;
gfp_t gfp;
u8 *dst;
+ bool mapped = false;
acomp_ctx = acomp_ctx_get_cpu_lock(pool);
dst = acomp_ctx->buffer;
@@ -988,9 +989,8 @@ static bool zswap_compress(struct page *
* only adds metadata overhead. swap_writeout() will put the page back
* to the active LRU list in the case.
*/
- if (comp_ret || !dlen)
+ if (comp_ret || !dlen || dlen >= PAGE_SIZE) {
dlen = PAGE_SIZE;
- if (dlen >= PAGE_SIZE) {
if (!mem_cgroup_zswap_writeback_enabled(
folio_memcg(page_folio(page)))) {
comp_ret = comp_ret ? comp_ret : -EINVAL;
@@ -999,6 +999,7 @@ static bool zswap_compress(struct page *
comp_ret = 0;
dlen = PAGE_SIZE;
dst = kmap_local_page(page);
+ mapped = true;
}
zpool = pool->zpool;
@@ -1012,7 +1013,7 @@ static bool zswap_compress(struct page *
entry->length = dlen;
unlock:
- if (dst != acomp_ctx->buffer)
+ if (mapped)
kunmap_local(dst);
if (comp_ret == -ENOSPC || alloc_ret == -ENOSPC)
zswap_reject_compress_poor++;
@@ -1030,7 +1031,7 @@ static bool zswap_decompress(struct zswa
struct zpool *zpool = entry->pool->zpool;
struct scatterlist input, output;
struct crypto_acomp_ctx *acomp_ctx;
- int decomp_ret, dlen;
+ int decomp_ret = 0, dlen = PAGE_SIZE;
u8 *src, *obj;
acomp_ctx = acomp_ctx_get_cpu_lock(entry->pool);
@@ -1039,9 +1040,7 @@ static bool zswap_decompress(struct zswa
/* zswap entries of length PAGE_SIZE are not compressed. */
if (entry->length == PAGE_SIZE) {
memcpy_to_folio(folio, 0, obj, entry->length);
- zpool_obj_read_end(zpool, entry->handle, obj);
- acomp_ctx_put_unlock(acomp_ctx);
- return true;
+ goto read_done;
}
/*
@@ -1064,6 +1063,7 @@ static bool zswap_decompress(struct zswa
decomp_ret = crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait);
dlen = acomp_ctx->req->dlen;
+read_done:
zpool_obj_read_end(zpool, entry->handle, obj);
acomp_ctx_put_unlock(acomp_ctx);
_
Patches currently in -mm which might be from sj@kernel.org are
mm-zswap-store-page_size-compression-failed-page-as-is.patch
mm-damon-core-add-damon_ctx-addr_unit.patch
mm-damon-paddr-support-addr_unit-for-access-monitoring.patch
mm-damon-paddr-support-addr_unit-for-damos_pageout.patch
mm-damon-paddr-support-addr_unit-for-damos_lru_prio.patch
mm-damon-paddr-support-addr_unit-for-migrate_hotcold.patch
mm-damon-paddr-support-addr_unit-for-damos_stat.patch
mm-damon-sysfs-implement-addr_unit-file-under-context-dir.patch
docs-mm-damon-design-document-address-unit-parameter.patch
docs-admin-guide-mm-damon-usage-document-addr_unit-file.patch
docs-abi-damon-document-addr_unit-file.patch
reply other threads:[~2025-09-13 22:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250913221539.E940DC4CEEB@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=david@redhat.com \
--cc=flintglass@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=kasong@tencent.com \
--cc=mm-commits@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=sj@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.