[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b42b161d-cd5d-45dc-8e84-c2b28eb632e5@kernel.org>
Date: Mon, 15 Sep 2025 16:36:55 +0800
From: Chao Yu <chao@...nel.org>
To: Liao Yuanhong <liaoyuanhong@...o.com>, Jaegeuk Kim <jaegeuk@...nel.org>,
"open list:F2FS FILE SYSTEM" <linux-f2fs-devel@...ts.sourceforge.net>,
open list <linux-kernel@...r.kernel.org>
Cc: chao@...nel.org
Subject: Re: [PATCH 2/2] f2fs: Enhance the subsequent logic of
valid_thresh_ratio to prevent unnecessary background GC
On 9/9/25 21:44, Liao Yuanhong wrote:
> When the proportion of dirty segments within a section exceeds the
> valid_thresh_ratio, the gc_cost of that section is set to UINT_MAX,
> indicating that these sections should not be released. However, if all
> section costs within the scanning range of get_victim() are UINT_MAX,
> background GC will still occur. Add a condition to prevent this situation.
For this case, f2fs_get_victim() will return 0, and f2fs_gc() will use unchanged
segno for GC?
Thanks,
>
> Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
> ---
> fs/f2fs/gc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index 4a8c08f970e3..ffc3188416f4 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -936,6 +936,11 @@ int f2fs_get_victim(struct f2fs_sb_info *sbi, unsigned int *result,
> }
> }
>
> + if (f2fs_sb_has_blkzoned(sbi) && p.min_cost == UINT_MAX) {
> + ret = -ENODATA;
> + goto out;
> + }
> +
> /* get victim for GC_AT/AT_SSR */
> if (is_atgc) {
> lookup_victim_by_age(sbi, &p);
Powered by blists - more mailing lists