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>
Tue, 19 Dec 2017 03:38:32 +0000 (19:38 -0800)
commit6180b68c28c0fba5f844f56f2a463827e96f1ca9
treed03e74e9e393f0e620452ff9d081fb05dd5ea4c7
parent221656e4b864bf37e0ff117222e5b6d2de9ecf05
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