1 ext4: preload block group descriptors
3 From: Andrew Perepechko <andrew.perepechko@seagate.com>
5 With enabled meta_bg option block group descriptors
6 reading IO is not sequential and requires optimization.
8 Signed-off-by: Andrew Perepechko <andrew.perepechko@seagate.com>
9 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 fs/ext4/super.c | 6 ++++++
12 1 file changed, 6 insertions(+)
14 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
15 index a673558..0e52c91 100644
18 @@ -3879,6 +3879,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
20 bgl_lock_init(sbi->s_blockgroup_lock);
22 + /* Pre-read the descriptors into the buffer cache */
23 + for (i = 0; i < db_count; i++) {
24 + block = descriptor_loc(sb, logical_sb_block, i);
25 + sb_breadahead(sb, block);
28 for (i = 0; i < db_count; i++) {
29 block = descriptor_loc(sb, logical_sb_block, i);
30 sbi->s_group_desc[i] = sb_bread_unmovable(sb, block);