f2fs: fix long latency due to discard during umount
authorSahitya Tummala <stummala@codeaurora.org>
Wed, 15 Apr 2020 09:07:53 +0000 (14:37 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 17 Apr 2020 16:17:00 +0000 (09:17 -0700)
commit141af6ba5216d4d49de683582b600d5c9b51792c
tree8779ca2b527b73136c3c4ce491e577b6fe839f87
parent2bc4bea33848e4c5f441fcec4a94497082c1cc9f
f2fs: fix long latency due to discard during umount

F2FS already has a default timeout of 5 secs for discards that
can be issued during umount, but it can take more than the 5 sec
timeout if the underlying UFS device queue is already full and there
are no more available free tags to be used. Fix this by submitting a
small batch of discard requests so that it won't cause the device
queue to be full at any time and thus doesn't incur its wait time
in the umount context.

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