f2fs: turn down IO priority of discard from background
authorChao Yu <yuchao0@huawei.com>
Tue, 10 Apr 2018 07:43:09 +0000 (15:43 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 30 May 2018 15:58:59 +0000 (08:58 -0700)
In order to avoid interfering normal r/w IO, let's turn down IO
priority of discard issued from background.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 3db035bf7203834c1dade01d789a116fec643f49..bef74d628f66990853632041b5b54b460bb71219 100644 (file)
@@ -931,6 +931,7 @@ static void __init_discard_policy(struct f2fs_sb_info *sbi,
                dpolicy->min_interval = DEF_MIN_DISCARD_ISSUE_TIME;
                dpolicy->max_interval = DEF_MAX_DISCARD_ISSUE_TIME;
                dpolicy->io_aware = true;
+               dpolicy->sync = false;
                if (utilization(sbi) > DEF_DISCARD_URGENT_UTIL) {
                        dpolicy->granularity = 1;
                        dpolicy->max_interval = DEF_MIN_DISCARD_ISSUE_TIME;