linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: sunqiuyang <sunqiuyang@huawei.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] f2fs: simplify the calculation of fggc_threshold
Date: Tue, 17 Oct 2017 22:33:08 +0800	[thread overview]
Message-ID: <a1c60acf-1a71-9acd-279b-341440d14981@kernel.org> (raw)
In-Reply-To: <1508244140-8831-1-git-send-email-sunqiuyang@huawei.com>

On 2017/10/17 20:42, sunqiuyang wrote:
> From: Qiuyang Sun <sunqiuyang@huawei.com>
> 
> Do not need to convert segment counts to blocks for this calculation.
> 
> Signed-off-by: Qiuyang Sun <sunqiuyang@huawei.com> 

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

> ---
>  fs/f2fs/gc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 197ebf4..9df8cae 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1073,16 +1073,16 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
>  
>  void build_gc_manager(struct f2fs_sb_info *sbi)
>  {
> -	u64 main_count, resv_count, ovp_count;
> +	unsigned int main_count, resv_count, ovp_count;
>  
>  	DIRTY_I(sbi)->v_ops = &default_v_ops;
>  
>  	/* threshold of # of valid blocks in a section for victims of FG_GC */
> -	main_count = SM_I(sbi)->main_segments << sbi->log_blocks_per_seg;
> -	resv_count = SM_I(sbi)->reserved_segments << sbi->log_blocks_per_seg;
> -	ovp_count = SM_I(sbi)->ovp_segments << sbi->log_blocks_per_seg;
> +	main_count = SM_I(sbi)->main_segments;
> +	resv_count = SM_I(sbi)->reserved_segments;
> +	ovp_count = SM_I(sbi)->ovp_segments;
>  
> -	sbi->fggc_threshold = div64_u64((main_count - ovp_count) *
> +	sbi->fggc_threshold = div_u64((u64)(main_count - ovp_count) *
>  				BLKS_PER_SEC(sbi), (main_count - resv_count));
>  
>  	/* give warm/cold data area from slower device */
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2017-10-17 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 12:42 [PATCH 1/1] f2fs: simplify the calculation of fggc_threshold sunqiuyang
2017-10-17 14:33 ` Chao Yu [this message]
2017-10-27  3:13   ` Sun Qiuyang
     [not found]     ` <249859c1-668d-5236-ec6f-1f35b9843f42@huawei.com>
2017-10-27  3:47       ` Fwd: " Chao Yu
2017-10-27 11:42         ` Jaegeuk Kim
2017-10-27 12:31           ` 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=a1c60acf-1a71-9acd-279b-341440d14981@kernel.org \
    --to=chao@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=sunqiuyang@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;
as well as URLs for NNTP newsgroup(s).