linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Yunlei He <heyunlei@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/2] f2fs: replace __get_victim by dirty_segments in FG_GC
Date: Fri, 17 Feb 2017 11:15:04 -0800	[thread overview]
Message-ID: <20170217191504.GC2951@jaegeuk.local> (raw)
In-Reply-To: <20170217091639.29433-1-heyunlei@huawei.com>

Hi Yunlei,

I also removed "segno = NULL_SEGNO;" in the beginning part near gc_more.

Thanks,

On 02/17, Yunlei He wrote:
> In FG_GC process, it will search victim section twice. This will
> cause some dirty section with less valid blocks skip garbage
> collection.
> 
> section # 26425 : valid blocks # 3
> 142.037567: get_victim_by_default: victim 26425 : valid blocks # 3
> 142.037585: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 244
> 142.039494: f2fs_get_victim: dev = (259,30), type = Hot DATA, policy = (Background GC, SSR-mode, Greedy), victim = 19022 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 24
> 142.070247: new_curseg: Debug: alloc new segment 26746
> 142.244341: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26054 ofs_unit = 1, pre_victim_secno = 26054, prefree = 0, free = 243
> 142.254475: do_garbage_collect: Debug: FG_GC, seg_freed = 1
> 142.293131: f2fs_get_victim: dev = (259,30), type = Warm DATA, policy = (Background GC, SSR-mode, Greedy), victim = 23466 ofs_unit = 1, pre_victim_secno = -1, prefree = 0, free = 244
> 142.319001: f2fs_get_victim: dev = (259,30), type = Warm DATA, policy = (Background GC, SSR-mode, Greedy), victim = 23467 ofs_unit = 1, pre_victim_secno = -1, prefree = 0, free = 244
> 142.368879: get_victim_by_default: victim 26425 : valid blocks # 3
> 142.368894: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 244
> 142.378127: f2fs_get_victim: dev = (259,30), type = Hot DATA, policy = (Background GC, SSR-mode, Greedy), victim = 19612 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 24
> 142.416917: new_curseg: Debug: alloc new segment 26054
> 142.656794: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 25404 ofs_unit = 1, pre_victim_secno = 25404, prefree = 0, free = 243
> 142.662139: do_garbage_collect: Debug: FG_GC, seg_freed = 1
> 142.684159: new_curseg: Debug: alloc new segment 25197
> 142.685059: get_victim_by_default: victim 26425 : valid blocks # 3
> 142.685079: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 243
> 142.701427: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26238 ofs_unit = 1, pre_victim_secno = 26238, prefree = 0, free = 243
> 142.707105: do_garbage_collect: Debug: FG_GC, seg_freed = 1
> 142.802444: f2fs_get_victim: dev = (259,30), type = Warm DATA, policy = (Background GC, SSR-mode, Greedy), victim = 23473 ofs_unit = 1, pre_victim_secno = -1, prefree = 0, free = 244
> 142.804422: get_victim_by_default: victim 26425 : valid blocks # 3
> 142.804443: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 244
> 142.851567: f2fs_get_victim: dev = (259,30), type = Hot DATA, policy = (Background GC, SSR-mode, Greedy), victim = 19092 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 24
> 142.865014: new_curseg: Debug: alloc new segment 26238
> 143.082245: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26307 ofs_unit = 1, pre_victim_secno = 26307, prefree = 0, free = 244
> 143.088252: do_garbage_collect: Debug: FG_GC, seg_freed = 1
> 143.128307: new_curseg: Debug: alloc new segment 25404
> 143.181846: get_victim_by_default: victim 26425 : valid blocks # 3
> 143.181872: f2fs_get_victim: dev = (259,30), type = No TYPE, policy = (Foreground GC, LFS-mode, Greedy), victim = 26425 ofs_unit = 1, pre_victim_secno = 26425, prefree = 0, free = 244
> 
> Signed-off-by: Yunlei He <heyunlei@huawei.com>
> ---
>  fs/f2fs/gc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 88e5e7b..74e1553 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -943,12 +943,10 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
>  		 * enough free sections, we should flush dent/node blocks and do
>  		 * garbage collections.
>  		 */
> -		if (__get_victim(sbi, &segno, gc_type) ||
> -						prefree_segments(sbi)) {
> +		if (dirty_segments(sbi) || prefree_segments(sbi)) {
>  			ret = write_checkpoint(sbi, &cpc);
>  			if (ret)
>  				goto stop;
> -			segno = NULL_SEGNO;
>  		} else if (has_not_enough_free_secs(sbi, 0, 0)) {
>  			ret = write_checkpoint(sbi, &cpc);
>  			if (ret)
> @@ -959,7 +957,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
>  		goto stop;
>  	}
>  
> -	if (segno == NULL_SEGNO && !__get_victim(sbi, &segno, gc_type))
> +	if (!__get_victim(sbi, &segno, gc_type))
>  		goto stop;
>  	ret = 0;
>  
> -- 
> 2.10.1

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

  parent reply	other threads:[~2017-02-17 19:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  9:16 [PATCH 1/2] f2fs: replace __get_victim by dirty_segments in FG_GC Yunlei He
2017-02-17  9:16 ` [PATCH 2/2] f2fs: remove unnecessary wait in write_begin Yunlei He
2017-02-17 18:21   ` Jaegeuk Kim
2017-02-23 11:57     ` Chao Yu
2017-02-17 19:15 ` Jaegeuk Kim [this message]
2017-02-23 11:59   ` [PATCH 1/2] f2fs: replace __get_victim by dirty_segments in FG_GC 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=20170217191504.GC2951@jaegeuk.local \
    --to=jaegeuk@kernel.org \
    --cc=heyunlei@huawei.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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).