add patch mm-retry-writepages-on-ENOMEM-when-doing-an-data-int
[ext4-patch-queue.git] / preload-block-group-descriptors
blobc2f03807a9def041a2436440ce335e9da781330a
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>
10 ---
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
16 --- a/fs/ext4/super.c
17 +++ b/fs/ext4/super.c
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);
26 +       }
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);
31 -- 
32 1.8.3.1