summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-02-22 23:30:55 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-04-08 03:51:06 -0700
commit10b2d001d6ace7f509bda9321a729b6949cc6ea0 (patch)
treec0cfa25e64c47d74fef1cdbc7b7085928be18e21
parenta5052f32b940d492403a8a6624ce88094bfb610e (diff)
f2fs: issue discard aggressively in the gc_urgent mode
This patch avoids to skip discard commands when user sets gc_urgent mode. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/segment.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index da498a1de469..c217a91088af 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1491,12 +1491,11 @@ static int issue_discard_thread(void *data)
if (kthread_should_stop())
return 0;
- if (dcc->discard_wake) {
+ if (dcc->discard_wake)
dcc->discard_wake = 0;
- if (sbi->gc_thread && sbi->gc_thread->gc_urgent)
- init_discard_policy(&dpolicy,
- DPOLICY_FORCE, 1);
- }
+
+ if (sbi->gc_thread && sbi->gc_thread->gc_urgent)
+ init_discard_policy(&dpolicy, DPOLICY_FORCE, 1);
sb_start_intwrite(sbi->sb);
@@ -1807,7 +1806,7 @@ void init_discard_policy(struct discard_policy *dpolicy,
} else if (discard_type == DPOLICY_FORCE) {
dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME;
dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME;
- dpolicy->io_aware = true;
+ dpolicy->io_aware = false;
} else if (discard_type == DPOLICY_FSTRIM) {
dpolicy->io_aware = false;
} else if (discard_type == DPOLICY_UMOUNT) {