mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@aol.com>
To: Chao Yu <chao@kernel.org>, Chao Yu <yuchao0@huawei.com>
Cc: devel@driverdev.osuosl.org, Gao Xiang <gaoxiang25@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-erofs@lists.ozlabs.org, Miao Xie <miaoxie@huawei.com>,
	LKML <linux-kernel@vger.kernel.org>, Du Wei <weidu.du@huawei.com>
Subject: Re: [PATCH 4/6] staging: erofs: cleanup `z_erofs_vle_normalaccess_readpages'
Date: Wed, 19 Sep 2018 23:51:22 +0800	[thread overview]
Message-ID: <f49a05f6-c6cb-db9f-3fa3-d38881708ab3@aol.com> (raw)
In-Reply-To: <37b566ea-273b-8d81-7428-06bd35d60092@kernel.org>

Hi Chao,

On 2018/9/19 23:45, Chao Yu wrote:
> Hi Xiang,
> 
> On 2018/9/19 23:32, Gao Xiang wrote:
>> Hi Chao,
>>
>> On 2018/9/19 23:26, Chao Yu wrote:
>>> Hi Xiang,
>>>
>>> On 2018/9/19 13:49, Gao Xiang wrote:
>>>> This patch introduces `__should_decompress_synchronously' to
>>>> cleanup `z_erofs_vle_normalaccess_readpages'.
>>>>
>>>> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
>>>> ---
>>>>  drivers/staging/erofs/internal.h  | 11 +++++++++++
>>>>  drivers/staging/erofs/super.c     |  5 +++++
>>>>  drivers/staging/erofs/unzip_vle.c | 20 ++++++--------------
>>>>  3 files changed, 22 insertions(+), 14 deletions(-)
>>>>
>>>> diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h
>>>> index cfcc6db..c84eb97 100644
>>>> --- a/drivers/staging/erofs/internal.h
>>>> +++ b/drivers/staging/erofs/internal.h
>>>> @@ -95,6 +95,9 @@ struct erofs_sb_info {
>>>>  	/* the dedicated workstation for compression */
>>>>  	struct radix_tree_root workstn_tree;
>>>>  
>>>> +	/* threshold for decompression synchronously */
>>>> +	unsigned int max_sync_decompress_pages;
>>>> +
>>>>  #ifdef EROFS_FS_HAS_MANAGED_CACHE
>>>>  	struct inode *managed_cache;
>>>>  #endif
>>>> @@ -273,6 +276,14 @@ extern int erofs_try_to_free_cached_page(struct address_space *mapping,
>>>>  	struct page *page);
>>>>  #endif
>>>>  
>>>> +#define DEFAULT_MAX_SYNC_DECOMPRESS_PAGES	4
>>>> +
>>>> +static inline bool __should_decompress_synchronously(struct erofs_sb_info *sbi,
>>>> +						     unsigned int nr)
>>>> +{
>>>> +	return nr <= sbi->max_sync_decompress_pages;
>>> -		nr_pages < 4 /* sync */);
>>>
>>> There is a little bit changed except cleanup, IIUC, would it be any difference
>>> of performance around boundary of four pages?
>>
>> No.. Once synchronous decompression is applied for 1,2,3 pages for no special reasons.
>> But I think it could be better to adjust it to the power of two --- 1,2,3,4 is preferred.
>> Since I have no idea to measure which is better or what value is best for all platform or use cases...
>>
>> Therefore I tune it in this patch since I don't like the number
>> DEFAULT_MAX_SYNC_DECOMPRESS_PAGES == 3 ...
> 
> Yeah, how about adding one more patch to tune this magic number first? as that
> change would not be part of cleanup thing. I guess later maybe we could export a
> sysfs node to provider tuning ability on that threshold.

OK, I think we can leave the original "3" for now. I will fix that value and resend this patch soon.

The sysfs interface could be necessary later since it seems some arguments
involved in decompression could impact the decompression performance.

Thanks,
Gao Xiang

> 
> Thanks,
> 
>>
>> Thanks,
>> Gao Xiang
>>
>>>
>>> Thanks,
>>>

  reply	other threads:[~2018-09-19 15:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  5:49 [PATCH 1/6] staging: erofs: remove redundant CONFIG_EROFS_FS_XATTRs Gao Xiang
2018-09-19  5:49 ` [PATCH 2/6] staging: erofs: fold in `__update_workgrp_llen' Gao Xiang
2018-09-19 15:14   ` Chao Yu
2018-09-19  5:49 ` [PATCH 3/6] staging: erofs: drop multiref support temporarily Gao Xiang
2018-09-19 15:20   ` Chao Yu
2018-09-19  5:49 ` [PATCH 4/6] staging: erofs: cleanup `z_erofs_vle_normalaccess_readpages' Gao Xiang
2018-09-19 15:26   ` Chao Yu
2018-09-19 15:32     ` Gao Xiang
2018-09-19 15:40       ` Gao Xiang
2018-09-19 15:45       ` Chao Yu
2018-09-19 15:51         ` Gao Xiang [this message]
2018-09-19 16:06   ` [PATCH v2 " Gao Xiang
2018-09-20  1:29     ` Chao Yu
2018-09-19  5:49 ` [PATCH 5/6] staging: erofs: add some comments for xattr subsystem Gao Xiang
2018-09-19 15:27   ` Chao Yu
2018-09-19  5:49 ` [PATCH 6/6] staging: erofs: simplify return value of `xattr_foreach' Gao Xiang
2018-09-19 15:28   ` Chao Yu
2018-09-19 15:07 ` [PATCH 1/6] staging: erofs: remove redundant CONFIG_EROFS_FS_XATTRs Chao Yu

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=f49a05f6-c6cb-db9f-3fa3-d38881708ab3@aol.com \
    --to=hsiangkao@aol.com \
    --cc=chao@kernel.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gaoxiang25@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=weidu.du@huawei.com \
    --cc=yuchao0@huawei.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®