OSDN Git Service

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>
Thu, 8 Feb 2018 02:05:48 +0000 (18:05 -0800)
commitd4f19f6266abaf573312c78723e09fb6498980ab
tree90901ee725aa368247207c0c4552cd3a5a8f4450
parentb78e9302e2e358d45ea4377bf2c20d045f1c3b8a
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