From: Herbert Xu <herbert@gondor.apana.org.au>
To: Usama Arif <usama.arif@linux.dev>
Cc: Andrew Morton <akpm@linux-foundation.org>,
chengming.zhou@linux.dev, dsterba@suse.com, hannes@cmpxchg.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
nphamcs@gmail.com, terrelln@fb.com, yosry@kernel.org,
riel@surriel.com, shakeel.butt@linux.dev, alex@ghiti.fr,
senozhatsky@chromium.org, davem@davemloft.net,
linux-crypto@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH v2 1/2] mm: zswap: use separate compression and decompression requests
Date: Tue, 13 Oct 2026 20:28:28 +1100 [thread overview]
Message-ID: <as35vERorcRxFwGb@gondor.apana.org.au> (raw)
In-Reply-To: <20261009163146.83112-2-usama.arif@linux.dev>
On Fri, Oct 09, 2026 at 09:30:30AM -0700, Usama Arif wrote:
> Stores and loads serialize on the same per-CPU acomp request and mutex.
> A low-priority store can be preempted as soon as the compressor drops
> its stream lock, while it still holds the mutex. A higher-priority load
> on that CPU then waits until the store runs again, which can take a
> long time when other tasks are runnable.
>
> Give compression and decompression their own request, completion wait
> and mutex. Since commit e2c3b6b21c77f ("mm: zswap: use SG list
> decompression APIs from zsmalloc"), the per-CPU buffer is only used for
> compression, so group it with the compression request. Independent
> requests can share the per-CPU transform; the codecs and drivers
> synchronize their shared state internally. Loads can still wait for
> each other on the decompression mutex, and stores still serialize on
> the compression mutex.
>
> acomp_request_free() ignores NULL requests, so drop the check in
> acomp_ctx_free().
>
> This follows the proposal from Sergey Senozhatsky for the same split
> for zram [1].
>
> [1] https://lore.kernel.org/all/20261005122036.718976-10-senozhatsky@chromium.org/
>
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
> ---
> mm/zswap.c | 108 +++++++++++++++++++++++++++++++----------------------
> 1 file changed, 64 insertions(+), 44 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2026-10-13 9:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 16:30 [PATCH v2 0/2] mm: zswap: reduce request contention on loads Usama Arif
2026-10-09 16:30 ` [PATCH v2 1/2] mm: zswap: use separate compression and decompression requests Usama Arif
2026-10-10 10:14 ` Nhat Pham
2026-10-13 0:21 ` Kanchana P. Sridhar
2026-10-13 9:28 ` Herbert Xu [this message]
2026-10-09 16:30 ` [PATCH v2 2/2] mm: zswap: use stack requests for synchronous decompression Usama Arif
2026-10-13 9:44 ` [PATCH] crypto: acomp - Enforce MAX_SYNC_COMP_REQSIZE in init_tfm Herbert Xu
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=as35vERorcRxFwGb@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=chengming.zhou@linux.dev \
--cc=davem@davemloft.net \
--cc=dsterba@suse.com \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=riel@surriel.com \
--cc=senozhatsky@chromium.org \
--cc=shakeel.butt@linux.dev \
--cc=terrelln@fb.com \
--cc=usama.arif@linux.dev \
--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®