From: Zaslonko Mikhail <zaslonko@linux.ibm.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Ilya Leoshkevich <iii@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCHv7 10/24] zram: add zlib compression backend support
Date: Thu, 8 May 2025 16:19:55 +0200 [thread overview]
Message-ID: <6046d139-2a46-4824-bdfc-687750c1ee5b@linux.ibm.com> (raw)
In-Reply-To: <20240902105656.1383858-11-senozhatsky@chromium.org>
Hello Sergey,
On 02.09.2024 12:55, Sergey Senozhatsky wrote:
> Add s/w zlib (inflate/deflate) compression.
>
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.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
next prev parent reply other threads:[~2025-05-08 14:20 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 10:55 [PATCHv7 00/24] zram: introduce custom comp backends API Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 01/24] lib: zstd: export API needed for dictionary support Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 02/24] lib: lz4hc: export LZ4_resetStreamHC symbol Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 03/24] lib: zstd: fix null-deref in ZSTD_createCDict_advanced2() Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 04/24] zram: introduce custom comp backends API Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 05/24] zram: add lzo and lzorle compression backends support Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 06/24] zram: add lz4 compression backend support Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 07/24] zram: add lz4hc " Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 08/24] zram: add zstd " Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 09/24] zram: pass estimated src size hint to zstd Sergey Senozhatsky
2024-09-02 10:55 ` [PATCHv7 10/24] zram: add zlib compression backend support Sergey Senozhatsky
2025-05-08 14:19 ` Zaslonko Mikhail [this message]
2025-05-09 1:38 ` Sergey Senozhatsky
2025-05-09 15:18 ` Zaslonko Mikhail
2025-05-13 5:41 ` Sergey Senozhatsky
2025-05-13 12:58 ` Zaslonko Mikhail
2025-05-14 2:56 ` Sergey Senozhatsky
2025-05-14 2:59 ` Herbert Xu
2024-09-02 10:55 ` [PATCHv7 11/24] zram: add 842 " Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 12/24] zram: check that backends array has at least one backend Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 13/24] zram: introduce zcomp_params structure Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 14/24] zram: recalculate zstd compression params once Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 15/24] zram: introduce algorithm_params device attribute Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 16/24] zram: add support for dict comp config Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 17/24] zram: introduce zcomp_req structure Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 18/24] zram: introduce zcomp_ctx structure Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 19/24] zram: move immutable comp params away from per-CPU context Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 20/24] zram: add dictionary support to lz4 Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 21/24] zram: add dictionary support to lz4hc Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 22/24] zram: add dictionary support to zstd backend Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 23/24] Documentation/zram: add documentation for algorithm parameters Sergey Senozhatsky
2024-09-03 6:37 ` [PATCH] Documentation/zram: trivial fixup Sergey Senozhatsky
2024-09-02 10:56 ` [PATCHv7 24/24] zram: support priority parameter in recompression Sergey Senozhatsky
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=6046d139-2a46-4824-bdfc-687750c1ee5b@linux.ibm.com \
--to=zaslonko@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=senozhatsky@chromium.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®