[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ad10fe2a-2065-48a4-a200-a0c91be2d439@linux.ibm.com>
Date: Fri, 23 May 2025 14:22:52 +0200
From: Zaslonko Mikhail <zaslonko@...ux.ibm.com>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Minchan Kim <minchan@...nel.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Heiko Carstens <hca@...ux.ibm.com>,
Ilya Leoshkevich <iii@...ux.ibm.com>,
Herbert Xu <herbert@...dor.apana.org.au>
Subject: Re: [PATCH 2/2] zram: support deflate-specific params
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@...ux.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
Powered by blists - more mailing lists