From: Huang Jianan <huangjianan@oppo.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org, zhangshiming@oppo.com,
linux-kernel@vger.kernel.org, yh@oppo.com, guanyuwei@oppo.com,
guoweichao@oppo.com
Subject: Re: [PATCH 2/2] erofs: add sysfs node to control sync decompression strategy
Date: Tue, 9 Nov 2021 15:43:06 +0800 [thread overview]
Message-ID: <82f7c99e-b83f-90b7-fceb-b8436da94339@oppo.com> (raw)
In-Reply-To: <YYnoHw+boVFtcyfv@B-P7TQMD6M-0146.local>
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@oppo.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
next prev parent reply other threads:[~2021-11-09 7:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-09 2:54 [PATCH 1/2] erofs: add sysfs interface Huang Jianan
2021-11-09 2:54 ` [PATCH 2/2] erofs: add sysfs node to control sync decompression strategy Huang Jianan
2021-11-09 3:16 ` Gao Xiang
2021-11-09 7:43 ` Huang Jianan [this message]
2021-11-09 7:45 ` [PATCH v2 1/2] erofs: add sysfs interface Huang Jianan
2021-11-09 7:45 ` [PATCH v2 2/2] erofs: add sysfs node to control sync decompression strategy Huang Jianan
2021-11-09 13:27 ` Chao Yu
2021-11-09 13:14 ` [PATCH v2 1/2] erofs: add sysfs interface Chao Yu
2021-11-11 20:17 ` [PATCH 2/2] erofs: add sysfs node to control sync decompression strategy kernel test robot
2021-11-12 2:08 ` Huang Jianan
2021-11-09 3:10 ` [PATCH 1/2] erofs: add sysfs interface Gao Xiang
2021-11-09 7:29 ` Huang Jianan
2021-11-09 3:14 ` Joe Perches
2021-11-09 7:31 ` Huang Jianan
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=82f7c99e-b83f-90b7-fceb-b8436da94339@oppo.com \
--to=huangjianan@oppo.com \
--cc=guanyuwei@oppo.com \
--cc=guoweichao@oppo.com \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yh@oppo.com \
--cc=zhangshiming@oppo.com \
/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®