lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82f7c99e-b83f-90b7-fceb-b8436da94339@oppo.com>
Date:   Tue, 9 Nov 2021 15:43:06 +0800
From:   Huang Jianan <huangjianan@...o.com>
To:     Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc:     linux-erofs@...ts.ozlabs.org, zhangshiming@...o.com,
        linux-kernel@...r.kernel.org, yh@...o.com, guanyuwei@...o.com,
        guoweichao@...o.com
Subject: Re: [PATCH 2/2] erofs: add sysfs node to control sync decompression
 strategy

Hi Xiang,

在 2021/11/9 11:16, Gao Xiang 写道:
> On Tue, Nov 09, 2021 at 10:54:45AM +0800, Huang Jianan via Linux-erofs wrote:
>> Although readpage is a synchronous path, there will be no additional
>> kworker scheduling overhead in non-atomic contexts. So we can add a
>> sysfs node to allow disable sync decompression.
>>
>> Signed-off-by: Huang Jianan <huangjianan@...o.com>
>> ---
>>   fs/erofs/internal.h | 2 +-
>>   fs/erofs/super.c    | 2 +-
>>   fs/erofs/sysfs.c    | 6 ++++++
>>   fs/erofs/zdata.c    | 9 ++++-----
>>   4 files changed, 12 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
>> index d0cd712dc222..1ab96878009d 100644
>> --- a/fs/erofs/internal.h
>> +++ b/fs/erofs/internal.h
>> @@ -60,7 +60,7 @@ struct erofs_mount_opts {
>>   #ifdef CONFIG_EROFS_FS_ZIP
>>   	/* current strategy of how to use managed cache */
>>   	unsigned char cache_strategy;
>> -	/* strategy of sync decompression (false - auto, true - force on) */
>> +	/* strategy of sync decompression (false - disable, true - force on) */
> Please leave false - auto.
Agree.
>>   	bool readahead_sync_decompress;
>>   
>>   	/* threshold for decompression synchronously */
>> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
>> index abc1da5d1719..26585d865503 100644
>> --- a/fs/erofs/super.c
>> +++ b/fs/erofs/super.c
>> @@ -423,7 +423,7 @@ static void erofs_default_options(struct erofs_fs_context *ctx)
>>   #ifdef CONFIG_EROFS_FS_ZIP
>>   	ctx->opt.cache_strategy = EROFS_ZIP_CACHE_READAROUND;
>>   	ctx->opt.max_sync_decompress_pages = 3;
>> -	ctx->opt.readahead_sync_decompress = false;
>> +	ctx->opt.readahead_sync_decompress = true;
> Please leave readahead_sync_decompress = false 'auto' by default.
>
> I don't like .readpage() applies async decompression since it's
> actually a sync way, otherwise, it will cause more scheduling
> overhead, see:
> https://lore.kernel.org/r/20201016160443.18685-1-willy@infradead.org
> https://lore.kernel.org/r/20201102184312.25926-16-willy@infradead.org

Maybe consider adding a disbale strategy? And then we will have:
0 - auto, 1 - force on, 2 - disable
I will try this in the next version.

for .readpage(), If the decompression can be done in a non-atomic context,
there will be no additional scheduling overhead? In this case, we can 
turn off
the syncdecompression.

Thanks,
Jianan

> Thanks,
> Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ