From: Zaslonko Mikhail <zaslonko@linux.ibm.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Heiko Carstens <hca@linux.ibm.com>,
Ilya Leoshkevich <iii@linux.ibm.com>,
Herbert Xu <herbert@gondor.apana.org.au>
Subject: Re: [PATCH 2/2] zram: support deflate-specific params
Date: Fri, 23 May 2025 14:22:52 +0200 [thread overview]
Message-ID: <ad10fe2a-2065-48a4-a200-a0c91be2d439@linux.ibm.com> (raw)
In-Reply-To: <ystv6cvrdllh64eqkislh47a3bnx5d2lk42ox4eiuuubioin6u@gmt5pwbkwiz3>
Hello,
On 15.05.2025 05:14, Sergey Senozhatsky wrote:
> Cc-ing Herbert
>
> On (25/05/14 12:58), Zaslonko Mikhail wrote:
>> Looks good to me.
>>
>> Also, here is another patch suggestion from my side on top of this one.
>> Let me know what you think.
>>
>> ---8<---
>>
>> zram: Utilize s390 hardware deflate acceleration for zram
>>
>> Utilize s390 hardware deflate acceleration for zram deflate compression
>> by default when the facility is available.
>>
>> Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
>>
>> diff --git a/drivers/block/zram/backend_deflate.c b/drivers/block/zram/backend_deflate.c
>> index b75016e0e654..5bfc57522e3a 100644
>> --- a/drivers/block/zram/backend_deflate.c
>> +++ b/drivers/block/zram/backend_deflate.c
>> @@ -22,10 +22,23 @@ static void deflate_release_params(struct zcomp_params *params)
>>
>> static int deflate_setup_params(struct zcomp_params *params)
>> {
>> - if (params->level == ZCOMP_PARAM_NOT_SET)
>> - params->level = Z_DEFAULT_COMPRESSION;
>> - if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET)
>> - params->deflate.winbits = DEFLATE_DEF_WINBITS;
>> + /*
>> + * In case of s390 zlib hardware support available,
>> + * use maximum window size and level one as default compression
>> + * parameters in order to utilize hardware deflate acceleration.
>> + */
>> + if (params->level == ZCOMP_PARAM_NOT_SET) {
>> + if (zlib_deflate_dfltcc_enabled())
>> + params->level = Z_BEST_SPEED;
>> + else
>> + params->level = Z_DEFAULT_COMPRESSION;
>> + }
>> + if (params->deflate.winbits == ZCOMP_PARAM_NOT_SET) {
>> + if (zlib_deflate_dfltcc_enabled())
>> + params->deflate.winbits = -MAX_WBITS;
>> + else
>> + params->deflate.winbits = DEFLATE_DEF_WINBITS;
>> + }
>
> I'm not sure if we want this much of s390 specific code in the generic
> zram/Crypto API code. Both of these params can be configured by user-space
> via the algorithm_params device attribute.
I understand the concern. My intention was to use special defaults for s390
when no algorithm_params configured by the user (which is the common case,
I assume). Do you see other way of doing so without touching zram generic
code?
Thanks,
Mikhail
prev parent reply other threads:[~2025-05-23 12:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 2:47 [PATCH 0/2] zram: support algorithm-specific parameters Sergey Senozhatsky
2025-05-14 2:47 ` [PATCH 1/2] zram: rename ZCOMP_PARAM_NO_LEVEL Sergey Senozhatsky
2025-05-14 10:56 ` Zaslonko Mikhail
2025-05-14 2:47 ` [PATCH 2/2] zram: support deflate-specific params Sergey Senozhatsky
2025-05-14 10:58 ` Zaslonko Mikhail
2025-05-15 3:14 ` Sergey Senozhatsky
2025-05-15 3:17 ` Herbert Xu
2025-05-15 3:19 ` Sergey Senozhatsky
2025-05-15 3:24 ` Herbert Xu
2025-05-15 3:32 ` Sergey Senozhatsky
2025-05-15 3:38 ` Herbert Xu
2025-05-19 12:09 ` Zaslonko Mikhail
2025-05-23 12:22 ` Zaslonko Mikhail [this message]
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=ad10fe2a-2065-48a4-a200-a0c91be2d439@linux.ibm.com \
--to=zaslonko@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hca@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=iii@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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