Whamcloud - gitweb
libext2fs: optimize ext2fs_convert_subcluster_bitmap()
authorLi Dongyang <dongyangli@ddn.com>
Mon, 27 Jan 2020 02:52:02 +0000 (21:52 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 27 Jan 2020 02:52:02 +0000 (21:52 -0500)
commitbd828b0d44221455e667dd739e97f7f9ff9a19cf
treec9bb24935d961930e1c49cf468b8b8fe8aa85b31
parent0b47dde9fd8859d8962b601e6cc8d4d705d303ab
libext2fs: optimize ext2fs_convert_subcluster_bitmap()

For a bigalloc filesystem, converting the block bitmap from blocks
to chunks in ext2fs_convert_subcluster_bitmap() can take a long time
when the device is huge, because we test the bitmap
bit-by-bit using ext2fs_test_block_bitmap2().
Use ext2fs_find_first_set_block_bitmap2() which is more efficient
for mke2fs when the fs is mostly empty.

e2fsck can also benefit from this during pass1 block scanning.

Time taken for "mke2fs -O bigalloc,extent -C 131072 -b 4096" on a 1PB
device:

without patch:
real    27m49.457s
user    21m36.474s
sys     6m9.514s

with patch:
real    6m31.908s
user    0m1.806s
sys    6m29.697s

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/gen_bitmap64.c