linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk.kim@samsung.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Namjae Jeon <namjae.jeon@samsung.com>,
	Amit Sahrawat <a.sahrawat@samsung.com>
Subject: Re: [PATCH 1/3] f2fs: avoid redundant call to has_not_enough_free_secs in f2fs_gc
Date: Thu, 31 Jan 2013 10:03:52 +0900	[thread overview]
Message-ID: <1359594232.22847.56.camel@kjgkr> (raw)
In-Reply-To: <1359553622-7449-1-git-send-email-linkinjeon@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1348 bytes --]

2013-01-30 (수), 22:47 +0900, Namjae Jeon:
> From: Namjae Jeon <namjae.jeon@samsung.com>
> 
> After doing a write_checkpoint from garbage collection path if there is still
> need to do more garbage collection, gc_more label is used to jump and start
> the process again. And in that process, first step before getting victim is to
> check if there are not enough free sections, which is already done before
> doing a jump to gc_more. We can avoid the redundant call to check free
> sections, by checking the gc_type flag which will remain FG_GC(value 1) under
> this condition.
> 
> Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.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 9b5d0aa..0dfdaa5 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -672,7 +672,7 @@ gc_more:
>  	if (!(sbi->sb->s_flags & MS_ACTIVE))
>  		goto stop;
>  
> -	if (has_not_enough_free_secs(sbi))
> +	if (!gc_type && has_not_enough_free_secs(sbi))

I applied this patch with the following change:
	if (gc_type == BG_GC && has_not_enough_free_secs(sbi))

Thank you. :)

>  		gc_type = FG_GC;
>  
>  	if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE))

-- 
Jaegeuk Kim
Samsung

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-01-31  1:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 13:47 [PATCH 1/3] f2fs: avoid redundant call to has_not_enough_free_secs in f2fs_gc Namjae Jeon
2013-01-31  1:03 ` Jaegeuk Kim [this message]
2013-01-31  1:10   ` Namjae Jeon

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=1359594232.22847.56.camel@kjgkr \
    --to=jaegeuk.kim@samsung.com \
    --cc=a.sahrawat@samsung.com \
    --cc=linkinjeon@gmail.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namjae.jeon@samsung.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).