All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hou Pengyang <houpengyang@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: guoweichao@huawei.com, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: avoid unnecessary fg_gc
Date: Sat, 25 Feb 2017 10:54:41 +0800	[thread overview]
Message-ID: <58B0F1F1.4040207@huawei.com> (raw)
In-Reply-To: <20170225020733.GB50867@jaegeuk.local>

On 2017/2/25 10:07, Jaegeuk Kim wrote:
> On 02/25, Hou Pengyang wrote:
>> On 2017/2/24 18:28, Chao Yu wrote:
>>> On 2017/2/24 18:01, Hou Pengyang wrote:
>>>> Under scenerio with large number of dirty nodes, and these nodes are flushed
>>>> in SSR mode during cp. enough free segemts now, no need to do fggc.
>>>
>>> We'd better break out of GC flow once we encounter cp error, so additional
>>> condition judgment is not needed.
>>>
>>
>> In (ret || !has_not_enough_free_secs(sbi, sec_freed, 0)),
>> if cp return error(NOT zero), flow will goto stop directly without
>> has_not_enough_free_secs checking;
>> if cp return ok(zero), has_not_enough_free_secs would be checked.
>
> Well, I think it'd be fine to do one gc by a background thread.
>
Currently we decide whether convert a bggc to fggc by:

if (gc_type == BG_GC && has_not_enough_free_secs(sbi, sec_freed, 0)) { 

          gc_type = FG_GC;

So how about move up write_checkpoint before gc_type = FG_GC, like:

if (gc_type == BG_GC && has_not_enough_free_secs(sbi, sec_freed, 0)) {
          write_checkpoint;
	 if still has_not_enough_free_secs:
               gc_type = FG_GC;
          else
               stay BG_GC;

Thanks,

> Thanks,
>
>>
>> Thanks,
>>
>>> Thanks,
>>>
>>>>
>>>> Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
>>>> ---
>>>>    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 6c996e3..41bdfb7 100644
>>>> --- a/fs/f2fs/gc.c
>>>> +++ b/fs/f2fs/gc.c
>>>> @@ -959,7 +959,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, bool background)
>>>>    		 * garbage collections.
>>>>    		 */
>>>>    		ret = write_checkpoint(sbi, &cpc);
>>>> -		if (ret)
>>>> +		if (ret || !has_not_enough_free_secs(sbi, sec_freed, 0))
>>>>    			goto stop;
>>>>    	} else if (gc_type == BG_GC && !background) {
>>>>    		/* f2fs_balance_fs doesn't need to do BG_GC in critical path. */
>>>>
>>>
>>>
>>> .
>>>
>>
>
> .
>



------------------------------------------------------------------------------
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-25  2:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 10:01 [PATCH] f2fs: avoid unnecessary fg_gc Hou Pengyang
2017-02-24 10:28 ` Chao Yu
2017-02-25  1:44   ` Hou Pengyang
2017-02-25  2:07     ` Chao Yu
2017-02-25  2:07     ` Jaegeuk Kim
2017-02-25  2:23       ` heyunlei
2017-02-25 19:39         ` Jaegeuk Kim
2017-02-27  1:59           ` Hou Pengyang
2017-02-27  2:28             ` heyunlei
2017-02-27 23:40               ` Jaegeuk Kim
2017-02-28  2:06                 ` heyunlei
2017-02-27  6:25           ` Chao Yu
2017-02-25  2:54       ` Hou Pengyang [this message]
2017-02-25  3:57       ` [PATCH 1/2] remove stale comment info about cp before fggc Hou Pengyang
2017-02-25  3:57         ` [PATCH 2/2] f2fs: avoid bggc->fggc when enough free segments are avaliable after cp Hou Pengyang

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=58B0F1F1.4040207@huawei.com \
    --to=houpengyang@huawei.com \
    --cc=guoweichao@huawei.com \
    --cc=jaegeuk@kernel.org \
    --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 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.