mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Yunlong Song <yunlong.song@huawei.com>, <jaegeuk@kernel.org>,
	<chao@kernel.org>, <yunlong.song@icloud.com>
Cc: <miaoxie@huawei.com>, <bintian.wang@huawei.com>,
	<linux-fsdevel@vger.kernel.org>,
	<linux-f2fs-devel@lists.sourceforge.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] f2fs: clear get_ssr_cost
Date: Mon, 4 Sep 2017 09:17:56 +0800	[thread overview]
Message-ID: <2503831f-3868-4037-307d-1e5fb4833a29@huawei.com> (raw)
In-Reply-To: <1504268075-81858-1-git-send-email-yunlong.song@huawei.com>

On 2017/9/1 20:14, Yunlong Song wrote:
> se->ckpt_valid_blocks is always larger than se->valid_blocks, so
> get_ssr_cost can be cleared.

I think this is not correct.

Thanks,

> 
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
>  fs/f2fs/gc.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index cd147e7..b226760 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
>  				valid_blocks * 2 : valid_blocks;
>  }
>  
> -static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
> -						unsigned int segno)
> -{
> -	struct seg_entry *se = get_seg_entry(sbi, segno);
> -
> -	return se->ckpt_valid_blocks > se->valid_blocks ?
> -				se->ckpt_valid_blocks : se->valid_blocks;
> -}
> -
>  static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
>  			unsigned int segno, struct victim_sel_policy *p)
>  {
>  	if (p->alloc_mode == SSR)
> -		return get_ssr_cost(sbi, segno);
> +		return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
>  
>  	/* alloc_mode == LFS */
>  	if (p->gc_mode == GC_GREEDY)
> 

  reply	other threads:[~2017-09-04  1:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 12:14 Yunlong Song
2017-09-04  1:17 ` Chao Yu [this message]
2017-09-04  1:54   ` Yunlong Song
2017-09-04  2:48     ` Chao Yu
2017-09-04  3:10 ` [PATCH v2] Revert "f2fs: add a new function get_ssr_cost" Yunlong Song

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=2503831f-3868-4037-307d-1e5fb4833a29@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=bintian.wang@huawei.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=yunlong.song@huawei.com \
    --cc=yunlong.song@icloud.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®