Whamcloud - gitweb
e2fsck: only consult inode_dir_map if needed in pass4
authorTheodore Ts'o <tytso@mit.edu>
Wed, 10 Oct 2012 02:45:40 +0000 (22:45 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Oct 2012 11:36:09 +0000 (07:36 -0400)
commitdd0c9a3c9cfdd250bfac283da05fd8920c823977
treea722419b9e6581ce7800495468f3e5f72a116f0a
parent51fb43dd271b1413d8203d95fe40be05caef8dd1
e2fsck: only consult inode_dir_map if needed in pass4

In e2fsck_pass4(), we were consulting inode_dir_map using
ext2fs_test_inode_bitmap2() for every single inode in the file system.
However, there were many cases where we never needed the result of the
test --- most notably if the inode is not in use.

I was a bit surprised that GCC 4.7 with CFLAGS set to "-g -O2" wasn't
able to optimize this out for us, but here is the pass 4 timing for an
empty 3T file system before this patch:

Pass 4: Memory used: 672k/772k (422k/251k), time:  3.67/ 3.66/ 0.00

and afterwards, we see a 43% improvement:

Pass 4: Memory used: 672k/772k (422k/251k), time:  2.09/ 2.08/ 0.00

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass4.c