f2fs: avoid high cpu usage in discard thread
authorChao Yu <yuchao0@huawei.com>
Mon, 8 Jan 2018 10:48:33 +0000 (18:48 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 27 Jan 2018 21:30:00 +0000 (13:30 -0800)
commit6e899a83f5e02a832e9a947b71ed7549141eadbd
treeac6d5eb0dedb793d6e7c5d8f45733105de0b06fd
parentbb1af976c2a281323f3b7ade3662f35741fc210f
f2fs: avoid high cpu usage in discard thread

We take very long time to finish generic/476, this is because we will
check consistence of all discard entries in global rb tree while
traversing all different granularity pending lists, even when the list
is empty, in order to avoid that unneeded overhead, we have to skip
the check when coming up an empty list.

generic/476 time consumption:
cost
Before patch & w/o consistence check 57s
Before patch & w/ consistence check 1426s
After patch 78s

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