[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a5acb5cb-2e77-902f-0a5e-063f7cbd0643@kernel.org>
Date: Tue, 30 Jul 2019 00:00:45 +0800
From: Chao Yu <chao@...nel.org>
To: Sahitya Tummala <stummala@...eaurora.org>,
Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <yuchao0@...wei.com>,
linux-f2fs-devel@...ts.sourceforge.net
Cc: linux-kernel@...r.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: Fix indefinite loop in f2fs_gc()
Hi Sahitya,
On 2019-7-29 13:20, Sahitya Tummala wrote:
> Policy - foreground GC, LFS mode and greedy GC mode.
>
> Under this policy, f2fs_gc() loops forever to GC as it doesn't have
> enough free segements to proceed and thus it keeps calling gc_more
> for the same victim segment. This can happen if the selected victim
> segment could not be GC'd due to failed blkaddr validity check i.e.
> is_alive() returns false for the blocks set in current validity map.
>
> Fix this by not resetting the sbi->cur_victim_sec to NULL_SEGNO, when
> the segment selected could not be GC'd. This helps to select another
> segment for GC and thus helps to proceed forward with GC.
>
> Signed-off-by: Sahitya Tummala <stummala@...eaurora.org>
> ---
> fs/f2fs/gc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 8974672..7bbcc4a 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -1303,7 +1303,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync,
> round++;
> }
>
> - if (gc_type == FG_GC)
> + if (gc_type == FG_GC && seg_freed)
> sbi->cur_victim_sec = NULL_SEGNO;
In some cases, we may remain last victim in sbi->cur_victim_sec, and jump out of
GC cycle, then SSR can skip the last victim due to sec_usage_check()...
Thanks,
>
> if (sync)
>
Powered by blists - more mailing lists