f2fs: let fstrim issue discard commands in lower priority
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 24 May 2018 20:57:26 +0000 (13:57 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 30 May 2018 18:41:16 +0000 (11:41 -0700)
commit13e346436f4e5c11538f73647ff2239e46d2cb67
tree3d66c51703f1b4e15d75acc2a7ae49793667f0cf
parent1ccd6c4ff9ccd74bb87903067618815d326af242
f2fs: let fstrim issue discard commands in lower priority

The fstrim gathers huge number of large discard commands, and tries to issue
without IO awareness, which results in long user-perceive IO latencies on
READ, WRITE, and FLUSH in UFS. We've observed some of commands take several
seconds due to long discard latency.

This patch limits the maximum size to 2MB per candidate, and check IO congestion
when issuing them to disk.

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