linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namjae Jeon <linkinjeon@gmail.com>
To: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: avoid frequent background GC
Date: Thu, 25 Apr 2013 14:06:46 +0900	[thread overview]
Message-ID: <CAKYAXd-7dkROw0wGQU-9yth90ObRm5b9Vr8aB_zMd4HX2=+ZrQ@mail.gmail.com> (raw)
In-Reply-To: <1366857842-17240-1-git-send-email-jaegeuk.kim@samsung.com>

Hi Jaegeuk,

With the change in the value of GC_THREAD_NOGC_SLEEP_TIME to 600000,
we will need to rewrite the gc_thread_func().
As there will be several paths which will not be reached or will have
no meaning after this change.

Considering the cases:
/* if return value is not zero, no victim was selected */
                if (f2fs_gc(sbi))
                        wait_ms = GC_THREAD_NOGC_SLEEP_TIME;
                else if (wait_ms == GC_THREAD_NOGC_SLEEP_TIME)
                        wait_ms = GC_THREAD_MAX_SLEEP_TIME;

Before this point, there are ‘2’ functions to change ‘wait_ms” ->
increase_sleep_time and decrease_sleep_time.
When we consider increase_sleep_time()  - the maximum possible value
for ‘wait_ms’ after coming out of this can be:
GC_THREAD_MAX_SLEEP_TIME
And in case in the last iteration it was set to
GC_THREAD_NOGC_SLEEP_TIME, once it enters increase_sleep_time() - the
value will be reseted to maximum GC_THREAD_MAX_SLEEP_TIME.
So,
                else if (wait_ms == GC_THREAD_NOGC_SLEEP_TIME)
                        wait_ms = GC_THREAD_MAX_SLEEP_TIME;
becomes unreachable path.

And second, maybe, After setting to GC_THREAD_NOGC_SLEEP_TIME(10min),
Although there are invalid blocks, GC thread might be sleep 9min
50sec.
Let me know your opinion.

Thanks.

2013/4/25, Jaegeuk Kim <jaegeuk.kim@samsung.com>:
> If there is no victim segments selected by background GC, let's wait
> a little bit longer time to collect dirty segments.
> By default, let's give 10 minutes.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
> ---
>  fs/f2fs/gc.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h
> index 30b2db0..1190d57 100644
> --- a/fs/f2fs/gc.h
> +++ b/fs/f2fs/gc.h
> @@ -13,9 +13,9 @@
>  						 * whether IO subsystem is idle
>  						 * or not
>  						 */
> -#define GC_THREAD_MIN_SLEEP_TIME	10000 /* milliseconds */
> +#define GC_THREAD_MIN_SLEEP_TIME	10000	/* milliseconds */
>  #define GC_THREAD_MAX_SLEEP_TIME	30000
> -#define GC_THREAD_NOGC_SLEEP_TIME	10000
> +#define GC_THREAD_NOGC_SLEEP_TIME	600000	/* wait 10 min */
>  #define LIMIT_INVALID_BLOCK	40 /* percentage over total user space */
>  #define LIMIT_FREE_BLOCK	40 /* percentage over invalid + free space */
>
> --
> 1.8.1.3.566.gaa39828
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2013-04-25  5:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-25  2:44 [PATCH] f2fs: avoid frequent background GC Jaegeuk Kim
2013-04-25  5:06 ` Namjae Jeon [this message]
2013-04-25 11:00   ` [PATCH v2] " Jaegeuk Kim
2013-04-25 23:52     ` 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='CAKYAXd-7dkROw0wGQU-9yth90ObRm5b9Vr8aB_zMd4HX2=+ZrQ@mail.gmail.com' \
    --to=linkinjeon@gmail.com \
    --cc=jaegeuk.kim@samsung.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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).