lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 25 Apr 2013 14:06:46 +0900
From:	Namjae Jeon <linkinjeon@...il.com>
To:	Jaegeuk Kim <jaegeuk.kim@...sung.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net
Subject: Re: [PATCH] f2fs: avoid frequent background GC

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@...sung.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@...sung.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@...r.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ