linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: qixiaoyu1 <qxy65535@gmail.com>
Cc: qixiaoyu1 <qixiaoyu1@xiaomi.com>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: don't bother wait_ms by foreground gc
Date: Thu, 21 Jul 2022 19:40:26 -0700	[thread overview]
Message-ID: <YtoOGu/wyqKBJd1v@google.com> (raw)
In-Reply-To: <20220718032840.9653-1-qixiaoyu1@xiaomi.com>

On 07/18, qixiaoyu1 wrote:
> f2fs_gc returns -EINVAL via f2fs_balance_fs when there is enough free
> secs after write checkpoint, but with gc_merge enabled, it will cause
> the sleep time of gc thread to be set to no_gc_sleep_time even if there
> are many dirty segments can be selected.
> 
> Signed-off-by: qixiaoyu1 <qixiaoyu1@xiaomi.com>
> ---
>  fs/f2fs/gc.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index d5fb426e0747..cb8ca992d986 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -150,8 +150,12 @@ static int gc_thread_func(void *data)
>  		gc_control.nr_free_secs = foreground ? 1 : 0;
>  
>  		/* if return value is not zero, no victim was selected */
> -		if (f2fs_gc(sbi, &gc_control))
> -			wait_ms = gc_th->no_gc_sleep_time;
> +		if (f2fs_gc(sbi, &gc_control)) {
> +			/* don't bother wait_ms by foreground gc */
> +			if (!foreground) {
> +				wait_ms = gc_th->no_gc_sleep_time;
> +			}

I applied without {} to match the coding style.

Thanks,

> +		}
>  
>  		if (foreground)
>  			wake_up_all(&gc_th->fggc_wq);
> -- 
> 2.36.1


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

  reply	other threads:[~2022-07-22  2:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  3:28 [f2fs-dev] [PATCH] f2fs: don't bother wait_ms by foreground gc qixiaoyu1
2022-07-22  2:40 ` Jaegeuk Kim [this message]
2022-07-22  3:39   ` [f2fs-dev] [PATCH v2] " qixiaoyu1
2022-07-24 10:00   ` [f2fs-dev] [PATCH] " 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=YtoOGu/wyqKBJd1v@google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qixiaoyu1@xiaomi.com \
    --cc=qxy65535@gmail.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;
as well as URLs for NNTP newsgroup(s).