diff options
author | Daeho Jeong <daehojeong@google.com> | 2020-07-02 13:14:14 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-07-07 21:51:49 -0700 |
commit | 0e5e81114de1c4ac32e36f057256653a04f27a33 (patch) | |
tree | 82b722cb81adf2219906c8d8cf75e50b699edddf /fs/f2fs/sysfs.c | |
parent | 6b12367da22f1c9d4d0073f8d802f616c735f95b (diff) |
f2fs: add GC_URGENT_LOW mode in gc_urgent
Added a new gc_urgent mode, GC_URGENT_LOW, in which mode
F2FS will lower the bar of checking idle in order to
process outstanding discard commands and GC a little bit
aggressively.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/sysfs.c')
-rw-r--r-- | fs/f2fs/sysfs.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index e877c59b9fdb..2a140657fc4d 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -350,16 +350,20 @@ out: return -EINVAL; if (!strcmp(a->attr.name, "gc_urgent")) { - if (t >= 1) { - sbi->gc_mode = GC_URGENT; + if (t == 0) { + sbi->gc_mode = GC_NORMAL; + } else if (t == 1) { + sbi->gc_mode = GC_URGENT_HIGH; if (sbi->gc_thread) { sbi->gc_thread->gc_wake = 1; wake_up_interruptible_all( &sbi->gc_thread->gc_wait_queue_head); wake_up_discard_thread(sbi, true); } + } else if (t == 2) { + sbi->gc_mode = GC_URGENT_LOW; } else { - sbi->gc_mode = GC_NORMAL; + return -EINVAL; } return count; } |