Re: [PATCH 2/3] mm/zswap: remove the memcpy if acomp is not asynchronous
From: Yosry Ahmed
Date: Mon Jan 08 2024 - 17:37:31 EST
On Wed, Jan 3, 2024 at 1:50 AM Barry Song <21cnbao@xxxxxxxxx> wrote:
>
> From: Barry Song <v-songbaohua@xxxxxxxx>
>
> Most compressors are actually CPU-based and won't sleep during
> compression and decompression. We should remove the redundant
> memcpy for them.
>
> Signed-off-by: Barry Song <v-songbaohua@xxxxxxxx>
> Tested-by: Chengming Zhou <zhouchengming@xxxxxxxxxxxxx>
> ---
> mm/zswap.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index ca25b676048e..36898614ebcc 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -168,6 +168,7 @@ struct crypto_acomp_ctx {
> struct crypto_wait wait;
> u8 *buffer;
> struct mutex mutex;
> + bool is_async; /* if acomp can sleep */
As pointed out in patch 1, I think we should name this explicitly to
be about sleep-ability (e.g. sleepable or can_sleep).