[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6046d139-2a46-4824-bdfc-687750c1ee5b@linux.ibm.com>
Date: Thu, 8 May 2025 16:19:55 +0200
From: Zaslonko Mikhail <zaslonko@...ux.ibm.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: Minchan Kim <minchan@...nel.org>, linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Ilya Leoshkevich <iii@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>, linux-s390@...r.kernel.org
Subject: Re: [PATCHv7 10/24] zram: add zlib compression backend support
Hello Sergey,
On 02.09.2024 12:55, Sergey Senozhatsky wrote:
> Add s/w zlib (inflate/deflate) compression.
>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
> ---
> diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c
> new file mode 100644
> index 000000000000..acefb86701b9
> --- /dev/null
> +++ b/drivers/block/zram/backend_deflate.c
> @@ -0,0 +1,132 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +
> +#include <linux/kernel.h>
> +#include <linux/slab.h>
> +#include <linux/vmalloc.h>
> +#include <linux/zlib.h>
> +
> +#include "backend_deflate.h"
> +
> +/* Use the same value as crypto API */
> +#define DEFLATE_DEF_WINBITS 11
> +#define DEFLATE_DEF_MEMLEVEL MAX_MEM_LEVEL
> +
I was trying to use a zram device with a deflate compression algorithm tuned for s390 hardware acceleration. While I was able to set the compression level via algorithm_params sysfs attribute, I figured out that the window size used by zram zlib compression is limited to 4K since windowBits parameter is hardcoded to DEFLATE_DEF_WINBITS. In order to utilize s390 hardware deflate acceleration, the maximum window size is needed (windowBits of 15), which is also a zlib default. Thus, I'm wondering why windowBits value of 11 was picked for zram zlib compression backend support. The comment line says 'Use the same value as crypto API'... could you please clarify here? Are there some memory constraints?
I tried to build the kernel with DEFLATE_DEF_WINBITS set to 15 and verified that s390 hardware deflate acceleration works for zram devices with a deflate compression.
Thanks,
Mikhail
Powered by blists - more mailing lists