From: Alexey Lyashkov Date: Wed, 1 Mar 2017 20:03:54 +0000 (-0500) Subject: libext2fs: readahead for meta_bg X-Git-Tag: v1.43.5~68 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2521c50d98442dbec2733f8cf9c88d2444be9075;p=tools%2Fe2fsprogs.git libext2fs: readahead for meta_bg There are ~37k of random IOs with meta_bg option on 300T target. Debugfs requires 20 minutes to be started. Enabling readahead for group blocks metadata save time dramatically. Only 12s to start. Signed-off-by: Alexey Lyashkov Signed-off-by: Theodore Ts'o Reviewed-by: Darrick J. Wong Reviewed-by: Andreas Dilger --- diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c index ba39e01..93b02ed 100644 --- a/lib/ext2fs/openfs.c +++ b/lib/ext2fs/openfs.c @@ -421,6 +421,12 @@ errcode_t ext2fs_open2(const char *name, const char *io_options, #endif dest += fs->blocksize*first_meta_bg; } + + for (i = first_meta_bg ; i < fs->desc_blocks; i++) { + blk = ext2fs_descriptor_block_loc2(fs, group_block, i); + io_channel_cache_readahead(fs->io, blk, 1); + } + for (i=first_meta_bg ; i < fs->desc_blocks; i++) { blk = ext2fs_descriptor_block_loc2(fs, group_block, i); retval = io_channel_read_blk64(fs->io, blk, 1, dest);