All of lore.kernel.org
 help / color / mirror / Atom feed
* + crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep.patch added to mm-unstable branch
@ 2024-03-12 15:55 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-03-12 15:55 UTC (permalink / raw)
  To: mm-commits, zhouchengming, yosryahmed, vitaly.wool, sjenning,
	nphamcs, herbert, hannes, ddstreet, davem, chrisl, v-songbaohua,
	akpm


The patch titled
     Subject: crypto: introduce: acomp_is_async to expose if comp drivers might sleep
has been added to the -mm mm-unstable branch.  Its filename is
     crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Barry Song <v-songbaohua@oppo.com>
Subject: crypto: introduce: acomp_is_async to expose if comp drivers might sleep
Date: Thu, 22 Feb 2024 21:11:34 +1300

acomp's users might want to know if acomp is really async to optimize
themselves.  One typical user which can benefit from exposed async stat is
zswap.

In zswap, zsmalloc is the most commonly used allocator for (and perhaps
the only one).  For zsmalloc, we cannot sleep while we map the compressed
memory, so we copy it to a temporary buffer.  By knowing the alg won't
sleep can help zswap to avoid the need for a buffer.  This shows
noticeable improvement in load/store latency of zswap.

Link: https://lkml.kernel.org/r/20240222081135.173040-2-21cnbao@gmail.com
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Chris Li <chrisl@kernel.org>
Cc: Chengming Zhou <zhouchengming@bytedance.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/crypto/acompress.h |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/include/crypto/acompress.h~crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep
+++ a/include/crypto/acompress.h
@@ -160,6 +160,12 @@ static inline void acomp_request_set_tfm
 	req->base.tfm = crypto_acomp_tfm(tfm);
 }
 
+static inline bool acomp_is_async(struct crypto_acomp *tfm)
+{
+	return crypto_comp_alg_common(tfm)->base.cra_flags &
+	       CRYPTO_ALG_ASYNC;
+}
+
 static inline struct crypto_acomp *crypto_acomp_reqtfm(struct acomp_req *req)
 {
 	return __crypto_acomp_tfm(req->base.tfm);
_

Patches currently in -mm which might be from v-songbaohua@oppo.com are

mm-prohibit-the-last-subpage-from-reusing-the-entire-large-folio.patch
crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep.patch
mm-zswap-remove-the-memcpy-if-acomp-is-not-sleepable.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-12 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 15:55 + crypto-introduce-acomp_is_async-to-expose-if-comp-drivers-might-sleep.patch added to mm-unstable branch Andrew Morton

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.