f2fs: optimize the way of traversing free_nid_bitmap
authorFan Li <fanofcode.li@samsung.com>
Tue, 7 Nov 2017 11:14:24 +0000 (19:14 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 9 Nov 2017 17:43:09 +0000 (09:43 -0800)
commit974565744955b6154a93c85b77cb94026c85ff5a
treefefdedfa4ff3872c5a10affb50ebcd47cba59927
parent74986213adaff2ceab81fc0bb29dbb80d05665b3
f2fs: optimize the way of traversing free_nid_bitmap

We call scan_free_nid_bits only when there isn't many
free nids left, it means that marked bits in free_nid_bitmap
are supposed to be few, use find_next_bit_le is more
efficient in such case.
According to my tests, use find_next_bit_le instead of
test_bit_le will cut down the traversal time to one
third of its original.

Signed-off-by: Fan li <fanofcode.li@samsung.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c