Re: [PATCH v1 0/8] Batched zswap_store() with compression batching
From: Kanchana P. Sridhar
Date: Sat Oct 17 2026 - 01:03:02 EST
On Fri, Oct 16, 2026 at 9:12 PM Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Oct 16, 2026 at 08:03:07PM -0700, Kanchana P. Sridhar wrote:
> >
> > The Average throughput of 10 iterations usemem is 19,058 KB/s. IOW, I
> > don't get the same performance boost as making the localized change in
> > crypto_acomp_compress(), likely because of added computes per compress
> > call (one function call, two conditionals).
>
> What are we comparing against?
Sorry, I should have clarified! The comparison is against having the
conditional and short-circuit in crypto_acomp_compress() [1]. I was
referring to this as the "localized change in crypto_acomp_compress".
10 iterations usemem Average throughput with Conditional &
short-circuit placement in:
crypto_acomp_compress(): 20,946 KB/s
acomp_do_req_chain(): 19,058 KB/s
>
> The thing is that the conditional will have to be there at some
> point as otherwise this becomes pointless.
>
> What if you just do the conditional and short-circuit in
> crypto_acomp_compress?
Yes, this is the first option I tried (20,946 KB/s).
[1]:
int crypto_acomp_compress(struct acomp_req *req)
{
struct crypto_acomp *tfm = crypto_acomp_reqtfm(req);
if (unlikely(acomp_req_on_stack(req) && acomp_is_async(tfm)))
return -EAGAIN;
if (likely(req->unit_size && acomp_request_issg(req))) {
if (likely(!crypto_acomp_req_seg(tfm))) {
int err = tfm->compress(req);
req->dst->length = unlikely(err) ? err : req->dlen;
return err;
}
return tfm->compress(req);
}
if (crypto_acomp_req_virt(tfm) || acomp_request_issg(req))
return tfm->compress(req);
return acomp_do_req_chain(req, true);
}
Thanks,
Kanchana
>
> Thanks,
> --
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt