Whamcloud - gitweb
b=18456 Patch to reduce group prealloc size, skip groups with little free space....
authorGirish Shilamkar <girish.shilamkar@sun.com>
Tue, 4 May 2010 11:36:29 +0000 (17:06 +0530)
committerJohann Lombardi <johann@sun.com>
Wed, 5 May 2010 07:36:00 +0000 (09:36 +0200)
i=alex.zhuravlev
i=girish

ldiskfs/kernel_patches/patches/ext3-mballoc3-core.patch
ldiskfs/kernel_patches/patches/ext4-mballoc-skip-grps.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series

index 197e8cc..6e87ccc 100644 (file)
@@ -288,7 +288,7 @@ Index: linux-2.6.22.19/fs/ext3/mballoc.c
 ===================================================================
 --- /dev/null
 +++ linux-2.6.22.19/fs/ext3/mballoc.c
-@@ -0,0 +1,4483 @@
+@@ -0,0 +1,4486 @@
 +/*
 + * Copyright 2009 Sun Microsystems, Inc.
 + * Written by Alex Zhuravlev <alex.zhuravlev@sun.com>
@@ -2126,9 +2126,12 @@ Index: linux-2.6.22.19/fs/ext3/mballoc.c
 +                      if (group == EXT3_SB(sb)->s_groups_count)
 +                              group = 0;
 +
-+                      /* quick check to skip empty groups */
++                      /* If there's no chance that this group has a better
++                       * extent, just skip it instead of seeking to read
++                       * block bitmap from disk. Initially ac_b_ex.fe_len = 0,
++                       * so this always skips groups with no free space. */
 +                      grp = EXT3_GROUP_INFO(ac->ac_sb, group);
-+                      if (grp->bb_free == 0)
++                      if (grp->bb_free <= ac->ac_b_ex.fe_len)
 +                              continue;
 +
 +                      if (EXT3_MB_GRP_NEED_INIT(EXT3_GROUP_INFO(sb, group))) {
@@ -2802,7 +2805,7 @@ Index: linux-2.6.22.19/fs/ext3/mballoc.c
 +
 +              sbi->s_mb_small_req = 256;
 +              sbi->s_mb_large_req = 1024;
-+              sbi->s_mb_group_prealloc = 512;
++              sbi->s_mb_group_prealloc = 256;
 +      } else {
 +              sbi->s_mb_prealloc_table_size = 3;
 +              i = sbi->s_mb_prealloc_table_size * sizeof(unsigned long);
@@ -2821,7 +2824,7 @@ Index: linux-2.6.22.19/fs/ext3/mballoc.c
 +
 +              sbi->s_mb_small_req = sbi->s_stripe;
 +              sbi->s_mb_large_req = sbi->s_stripe * 8;
-+              sbi->s_mb_group_prealloc = sbi->s_stripe * 4;
++              sbi->s_mb_group_prealloc = sbi->s_stripe;
 +      }
 +
 +      i = sizeof(struct ext3_locality_group) * num_possible_cpus();
diff --git a/ldiskfs/kernel_patches/patches/ext4-mballoc-skip-grps.patch b/ldiskfs/kernel_patches/patches/ext4-mballoc-skip-grps.patch
new file mode 100644 (file)
index 0000000..53a1190
--- /dev/null
@@ -0,0 +1,38 @@
+Index: linux-stage/fs/ext4/mballoc.c
+===================================================================
+--- linux-stage.orig/fs/ext4/mballoc.c
++++ linux-stage/fs/ext4/mballoc.c
+@@ -2009,9 +2009,13 @@ repeat:
+                       if (group == EXT4_SB(sb)->s_groups_count)
+                               group = 0;
+-                      /* quick check to skip empty groups */
++                      /* If there's no chance that this group has a better
++                       * extent, just skip it instead of seeking to read
++                       * block bitmap from disk. Initially ac_b_ex.fe_len = 0,
++                       * so this always skips groups with no free space. */
++
+                       grp = ext4_get_group_info(sb, group);
+-                      if (grp->bb_free == 0)
++                      if (grp->bb_free <= ac->ac_b_ex.fe_len)
+                               continue;
+                       /*
+@@ -2780,7 +2784,7 @@ int ext4_mb_init(struct super_block *sb,
+               sbi->s_mb_small_req = 256;
+               sbi->s_mb_large_req = 1024;
+-              sbi->s_mb_group_prealloc = 512;
++              sbi->s_mb_group_prealloc = 256;
+       } else {
+               sbi->s_mb_prealloc_table_size = 3;
+               i = sbi->s_mb_prealloc_table_size * sizeof(unsigned long);
+@@ -2798,7 +2802,7 @@ int ext4_mb_init(struct super_block *sb,
+               sbi->s_mb_small_req = sbi->s_stripe;
+               sbi->s_mb_large_req = sbi->s_stripe * 8;
+-              sbi->s_mb_group_prealloc = sbi->s_stripe * 4;
++              sbi->s_mb_group_prealloc = sbi->s_stripe;
+       }
+       sbi->s_locality_groups = alloc_percpu(struct ext4_locality_group);
index 53b761d..d920bb1 100644 (file)
@@ -29,3 +29,4 @@ ext4-ext_generation-sles11.patch
 ext4-kill-dx_root.patch
 ext4-extents-mount-option-rhel5.patch
 ext4-fiemap-2.6-rhel5.patch
+ext4-mballoc-skip-grps.patch
index bcf9753..909a704 100644 (file)
@@ -33,3 +33,4 @@ ext4-dynlocks-common-sles11.patch
 ext4-dynlocks-2.6-rhel5.patch
 ext4-hash-indexed-dir-dotdot-update.patch
 ext4-disable-write-bar-by-default.patch
+ext4-mballoc-skip-grps.patch