All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Liao Yuanhong <liaoyuanhong@vivo.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	"open list:F2FS FILE SYSTEM"
	<linux-f2fs-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [f2fs-dev] [PATCH 2/2] f2fs: Enhance the subsequent logic of valid_thresh_ratio to prevent unnecessary background GC
Date: Mon, 15 Sep 2025 16:36:55 +0800	[thread overview]
Message-ID: <b42b161d-cd5d-45dc-8e84-c2b28eb632e5@kernel.org> (raw)
In-Reply-To: <20250909134418.502922-3-liaoyuanhong@vivo.com>

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@vivo.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);



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Liao Yuanhong <liaoyuanhong@vivo.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	"open list:F2FS FILE SYSTEM"
	<linux-f2fs-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>
Cc: chao@kernel.org
Subject: Re: [PATCH 2/2] f2fs: Enhance the subsequent logic of valid_thresh_ratio to prevent unnecessary background GC
Date: Mon, 15 Sep 2025 16:36:55 +0800	[thread overview]
Message-ID: <b42b161d-cd5d-45dc-8e84-c2b28eb632e5@kernel.org> (raw)
In-Reply-To: <20250909134418.502922-3-liaoyuanhong@vivo.com>

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@vivo.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);


  reply	other threads:[~2025-09-15  8:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09 13:44 [f2fs-dev] [PATCH 0/2] f2fs: Some optimizations for background GC in Zoned UFS Liao Yuanhong via Linux-f2fs-devel
2025-09-09 13:44 ` Liao Yuanhong
2025-09-09 13:44 ` [f2fs-dev] [PATCH 1/2] f2fs: Optimize excessive write operations caused by continuous background garbage collection " Liao Yuanhong via Linux-f2fs-devel
2025-09-09 13:44   ` Liao Yuanhong
2025-09-15  8:25   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-09-15  8:25     ` Chao Yu
2025-09-16  2:28   ` [f2fs-dev] " Jaegeuk Kim via Linux-f2fs-devel
2025-09-16  2:28     ` Jaegeuk Kim
2025-09-17  7:15     ` [f2fs-dev] " Liao Yuanhong via Linux-f2fs-devel
2025-09-17  7:15       ` Liao Yuanhong
2025-09-09 13:44 ` [f2fs-dev] [PATCH 2/2] f2fs: Enhance the subsequent logic of valid_thresh_ratio to prevent unnecessary background GC Liao Yuanhong via Linux-f2fs-devel
2025-09-09 13:44   ` Liao Yuanhong
2025-09-15  8:36   ` Chao Yu via Linux-f2fs-devel [this message]
2025-09-15  8:36     ` Chao Yu
2025-09-17  7:08     ` [f2fs-dev] " Liao Yuanhong via Linux-f2fs-devel
2025-09-17  7:08       ` Liao Yuanhong
2025-09-17  7:57       ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-09-17  7:57         ` Chao Yu
2025-09-17  8:13         ` [f2fs-dev] " Liao Yuanhong via Linux-f2fs-devel
2025-09-17  8:13           ` Liao Yuanhong
2025-09-18  2:16           ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-09-18  2:16             ` Chao Yu
2025-09-20  2:49             ` [f2fs-dev] " Liao Yuanhong via Linux-f2fs-devel
2025-09-20  2:49               ` Liao Yuanhong
2025-09-23  6:43               ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2025-09-23  6:43                 ` 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=b42b161d-cd5d-45dc-8e84-c2b28eb632e5@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=liaoyuanhong@vivo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.