e2fsprogs/e2fsck
Darrick J. Wong a5abfe0382 e2fsck: read-ahead metadata during passes 1, 2, and 4
e2fsck pass1 is modified to use the block group data prefetch function
to try to fetch the inode tables into the pagecache before it is
needed.  We iterate through the blockgroups until we have enough inode
tables that need reading such that we can issue readahead; then we sit
and wait until the last inode table block read of the last group to
start fetching the next bunch.

pass2 is modified to use the dirblock prefetching function to prefetch
the list of directory blocks that are assembled in pass1.  We use the
"iterate a subset of a dblist" and avoid copying the dblist.  Directory
blocks are fetched incrementally as we walk through the directory
block list.  In previous iterations of this patch we would free the
directory blocks after processing, but the performance hit to e2fsck
itself wasn't worth it.  Furthermore, it is anticipated that most
users will then mount the FS and start using the directories, so they
may as well remain in the page cache.

pass4 is modified to prefetch the block and inode bitmaps in
anticipation of pass 5, because pass4 is entirely CPU bound.

In general, these mechanisms can decrease fsck time by 10-40%, if the
host system has sufficient memory and the storage system can provide a
lot of IOPs.  Pretty much any storage system capable of handling
multiple IOs in-flight at any time will see a fairly large performance
boost.  (Single-issue USB mass storage disks seem to suffer badly.)

By default, the readahead buffer size will be set to the size of a block
group's inode table (which is 2MiB for a regular ext4 FS).  The -E
readahead_kb= option can be given to specify the amount of memory to
use for readahead or zero to disable it entirely; or an option can be
given in e2fsck.conf.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-04-21 10:40:21 -04:00
..
Android.mk Clean up and fix Android build files 2015-03-30 14:50:55 -04:00
CHANGES Many files: 1997-04-26 13:21:57 +00:00
Makefile.in libext2fs/e2fsck: provide routines to read-ahead metadata 2015-04-21 10:40:15 -04:00
Makefile.pq Many files: 1997-11-14 05:23:04 +00:00
argv_parse.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
argv_parse.h Remove trailing whitespace for the entire source tree 2008-08-27 23:07:54 -04:00
badblocks.c e2fsck: fix memory leak on error path in read_bad_blocks_files() 2014-01-07 09:10:24 -05:00
dict.c e2fsck: clean up assertions in dict.c 2015-03-01 15:44:55 -05:00
dict.h Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
dirinfo.c e2fsck: fix dangling pointer when dir_info array is resized 2014-11-05 11:14:26 -05:00
dx_dirinfo.c e2fsck: notice when the realloc of dir_info fails 2014-09-11 12:24:07 -04:00
e2fsck.8.in e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
e2fsck.c e2fsck: suppress bad name checks for encrypted directories 2015-02-23 17:44:23 -05:00
e2fsck.conf.5.in e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
e2fsck.h e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
ea_refcount.c e2fsck: fix printf conversion specs in ea_refcount.c 2013-12-24 22:50:23 -05:00
ehandler.c e2fsck: on read error, don't rewrite blocks past the end of the fs 2015-01-27 13:12:37 -05:00
emptydir.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
extend.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
flushb.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
iscan.c debugfs, e2fsck: fix s_desc_size handling 2013-12-24 22:50:19 -05:00
jfs_user.h define bitwise types and annotate conversion routines 2014-11-04 11:24:44 -05:00
journal.c e2fsck: fix message when the journal is deleted and regenerated 2015-01-27 13:12:52 -05:00
logfile.c e2fsck: close the progress_fd in the logfile child process 2015-01-12 19:42:29 -05:00
message.c Merge branch 'maint' into next 2014-07-06 00:09:27 -04:00
mtrace.awk Many files: 1997-04-26 13:21:57 +00:00
mtrace.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
mtrace.h ChangeLog, super.c: 2001-01-12 21:05:57 +00:00
pass1.c e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
pass1b.c Remove compression support 2015-04-12 08:42:40 -04:00
pass2.c e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
pass3.c e2fsck: don't complain about root dir csum failures when getting lnf 2014-12-13 21:55:22 -05:00
pass4.c e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
pass5.c e2fsck: fix compiler warnings 2014-11-04 11:35:56 -05:00
problem.c Remove compression support 2015-04-12 08:42:40 -04:00
problem.h Remove compression support 2015-04-12 08:42:40 -04:00
problemP.h e2fsck: add ability to limit the # of problems of a particular type 2012-03-14 17:44:54 -04:00
prof_err.et Fix more spelling errors found by translators and add pluralization 2011-10-09 17:54:23 -04:00
profile.c e2fsck, mke2fs: enable octal integers in the profile/config file 2014-01-30 13:58:18 -05:00
profile.h mke2fs: Allow specifying reserved_ratio via mke2fs.conf 2011-05-14 23:34:48 -04:00
profile_helpers.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
profile_helpers.h Simplify profile core functionality 2006-01-02 22:04:41 -05:00
quota.c quota: integrate mkquota.h into quotaio.h 2014-05-13 10:13:04 -04:00
readahead.c libext2fs/e2fsck: provide routines to read-ahead metadata 2015-04-21 10:40:15 -04:00
recovery.c e2fsck: free bh when descriptor block checksum fails 2014-09-18 21:46:22 -04:00
region.c misc: fix compiler warnings and minor build errors 2014-11-07 21:23:41 -05:00
rehash.c Remove compression support 2015-04-12 08:42:40 -04:00
revoke.c e2fsck/debugfs: fix descriptor block size handling errors with journal_csum 2014-09-11 12:40:54 -04:00
scantest.c e2fsprogs: introduce ext2fs_close_free() helper 2014-07-05 21:06:48 -04:00
sigcatcher.c Merge branch 'maint' into next 2013-06-16 18:54:01 -04:00
super.c Remove compression support 2015-04-12 08:42:40 -04:00
unix.c e2fsck: read-ahead metadata during passes 1, 2, and 4 2015-04-21 10:40:21 -04:00
util.c libext2fs/e2fsck: provide routines to read-ahead metadata 2015-04-21 10:40:15 -04:00