]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsck: Speed up pass 5 processing for ext4 filesystems
authorKazuya Mio <k-mio@sx.jp.nec.com>
Thu, 9 Jul 2009 17:46:59 +0000 (13:46 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 9 Jul 2009 18:56:30 +0000 (14:56 -0400)
commit479463aaf641d9b2c46bd4cda4e5e941fd767c73
tree243705bf5224937ad2f3e5cabe53fb0d135455b0
parentef1a526dfbe663bb80ab75c2e7985ae8d9021b76
e2fsck: Speed up pass 5 processing for ext4 filesystems

e2fsck_pass5() checks whether the inode and block allocation bitmaps
are consistent.  However, if EXT2_BG_[INODE/BLOCK]_BITMAP is set to a
ext4's block group, most of its bitmap is uninitialized (0).  In that
case, we can optimize e2fsck's pass 5 by checking the entire range of
an uninitalized block group instead of checking bit by bit.

This can speed up e2fsck pass 5 by up to 80%:

         +-----+--------------------+--------------------+
         |     |     old e2fsck     |     new e2fsck     |
         |Pass |       time(s)      |       time(s)      |
         |     | real | user |system| real | user |system|
         +-----+------+------+------+------+------+------+
         |  1  |  5.70|  3.29|  0.50|  5.66|  3.21|  0.54|
         |  2  |  3.33|  0.80|  0.19|  3.40|  0.82|  0.23|
         |  3  |  0.01|  0.00|  0.00|  0.01|  0.00|  0.00|
         |  4  |  1.04|  1.04|  0.00|  1.05|  1.04|  0.00|
         |  5  | 19.60| 17.27|  0.06|  3.53|  1.21|  0.05|
         +-----+------+------+------+------+------+------+
         |Total| 29.94| 22.57|  0.80| 13.90|  6.47|  0.86|
         +-----+------+------+------+------+------+------+

Comparison of e2fsck time on an ext4 500GB partition (20% blocks used)

Machine environment:
CPU:       Intel(R) Xeon(TM) CPU 3.00GHz
Memory:    1GB
Kernel:    linux-2.6.29-git2

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass5.c