1 Index: linux-stage/fs/ext4/mballoc.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/mballoc.c
4 +++ linux-stage/fs/ext4/mballoc.c
5 @@ -2009,9 +2009,13 @@ repeat:
6 if (group == EXT4_SB(sb)->s_groups_count)
9 - /* quick check to skip empty groups */
10 + /* If there's no chance that this group has a better
11 + * extent, just skip it instead of seeking to read
12 + * block bitmap from disk. Initially ac_b_ex.fe_len = 0,
13 + * so this always skips groups with no free space. */
15 grp = ext4_get_group_info(sb, group);
16 - if (grp->bb_free == 0)
17 + if (grp->bb_free <= ac->ac_b_ex.fe_len)
21 @@ -2780,7 +2784,7 @@ int ext4_mb_init(struct super_block *sb,
23 sbi->s_mb_small_req = 256;
24 sbi->s_mb_large_req = 1024;
25 - sbi->s_mb_group_prealloc = 512;
26 + sbi->s_mb_group_prealloc = 256;
28 sbi->s_mb_prealloc_table_size = 3;
29 i = sbi->s_mb_prealloc_table_size * sizeof(unsigned long);
30 @@ -2798,7 +2802,7 @@ int ext4_mb_init(struct super_block *sb,
32 sbi->s_mb_small_req = sbi->s_stripe;
33 sbi->s_mb_large_req = sbi->s_stripe * 8;
34 - sbi->s_mb_group_prealloc = sbi->s_stripe * 4;
35 + sbi->s_mb_group_prealloc = sbi->s_stripe;
38 sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);