lkml.org 
[lkml]   [2013]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] f2fs: avoid frequent background GC
From
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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2013-04-25 07:21    [W:0.046 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site