diff options
Diffstat (limited to 'fs/f2fs/gc.h')
-rw-r--r-- | fs/f2fs/gc.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h index 30b2db003acd..2c6a6bd08322 100644 --- a/fs/f2fs/gc.h +++ b/fs/f2fs/gc.h | |||
@@ -13,9 +13,9 @@ | |||
13 | * whether IO subsystem is idle | 13 | * whether IO subsystem is idle |
14 | * or not | 14 | * or not |
15 | */ | 15 | */ |
16 | #define GC_THREAD_MIN_SLEEP_TIME 10000 /* milliseconds */ | 16 | #define GC_THREAD_MIN_SLEEP_TIME 30000 /* milliseconds */ |
17 | #define GC_THREAD_MAX_SLEEP_TIME 30000 | 17 | #define GC_THREAD_MAX_SLEEP_TIME 60000 |
18 | #define GC_THREAD_NOGC_SLEEP_TIME 10000 | 18 | #define GC_THREAD_NOGC_SLEEP_TIME 300000 /* wait 5 min */ |
19 | #define LIMIT_INVALID_BLOCK 40 /* percentage over total user space */ | 19 | #define LIMIT_INVALID_BLOCK 40 /* percentage over total user space */ |
20 | #define LIMIT_FREE_BLOCK 40 /* percentage over invalid + free space */ | 20 | #define LIMIT_FREE_BLOCK 40 /* percentage over invalid + free space */ |
21 | 21 | ||
@@ -58,6 +58,9 @@ static inline block_t limit_free_user_blocks(struct f2fs_sb_info *sbi) | |||
58 | 58 | ||
59 | static inline long increase_sleep_time(long wait) | 59 | static inline long increase_sleep_time(long wait) |
60 | { | 60 | { |
61 | if (wait == GC_THREAD_NOGC_SLEEP_TIME) | ||
62 | return wait; | ||
63 | |||
61 | wait += GC_THREAD_MIN_SLEEP_TIME; | 64 | wait += GC_THREAD_MIN_SLEEP_TIME; |
62 | if (wait > GC_THREAD_MAX_SLEEP_TIME) | 65 | if (wait > GC_THREAD_MAX_SLEEP_TIME) |
63 | wait = GC_THREAD_MAX_SLEEP_TIME; | 66 | wait = GC_THREAD_MAX_SLEEP_TIME; |
@@ -66,6 +69,9 @@ static inline long increase_sleep_time(long wait) | |||
66 | 69 | ||
67 | static inline long decrease_sleep_time(long wait) | 70 | static inline long decrease_sleep_time(long wait) |
68 | { | 71 | { |
72 | if (wait == GC_THREAD_NOGC_SLEEP_TIME) | ||
73 | wait = GC_THREAD_MAX_SLEEP_TIME; | ||
74 | |||
69 | wait -= GC_THREAD_MIN_SLEEP_TIME; | 75 | wait -= GC_THREAD_MIN_SLEEP_TIME; |
70 | if (wait <= GC_THREAD_MIN_SLEEP_TIME) | 76 | if (wait <= GC_THREAD_MIN_SLEEP_TIME) |
71 | wait = GC_THREAD_MIN_SLEEP_TIME; | 77 | wait = GC_THREAD_MIN_SLEEP_TIME; |