Whamcloud - gitweb
b=21137 ext4 extent allocation is slower than in ext3
authorDmitry Zogin <dmitry.zoguine@oracle.com>
Tue, 10 Aug 2010 19:27:14 +0000 (23:27 +0400)
committerMikhail Pershin <tappro@sun.com>
Sun, 15 Aug 2010 09:44:56 +0000 (13:44 +0400)
 Increase the default value of MB_DEFAULT_ORDER2_REQS to 8, enlarge ext4
 preallocation table for 2048 4K blocks extents creation.

 i=alex.zhuravlev
 i=andrew.perepechko

ldiskfs/kernel_patches/patches/ext4-mballoc-extra-checks-rhel5.patch
ldiskfs/kernel_patches/patches/ext4-mballoc-extra-checks-sles11.patch
ldiskfs/kernel_patches/patches/ext4-prealloc-rhel5.patch
ldiskfs/kernel_patches/patches/ext4-prealloc-sles11.patch

index 45e95bb..9e19012 100644 (file)
@@ -332,6 +332,15 @@ Index: linux-2.6.18-128.1.6/fs/ext4/mballoc.h
 ===================================================================
 --- linux-2.6.18-128.1.6.orig/fs/ext4/mballoc.h
 +++ linux-2.6.18-128.1.6/fs/ext4/mballoc.h
+@@ -92,7 +92,7 @@
+ /*
+  * for which requests use 2^N search using buddies
+  */
+-#define MB_DEFAULT_ORDER2_REQS                2
++#define MB_DEFAULT_ORDER2_REQS                8
+
+ /*
+  * default group prealloc size 512 blocks
 @@ -228,7 +229,7 @@ struct ext4_mb_history {
        __u16 tail;     /* what tail broke some buddy */
        __u16 buddy;    /* buddy the tail ^^^ broke */
index 6fc1683..590ea77 100644 (file)
@@ -260,6 +260,15 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.h
 ===================================================================
 --- linux-2.6.27.21-0.1.orig/fs/ext4/mballoc.h
 +++ linux-2.6.27.21-0.1/fs/ext4/mballoc.h
+@@ -92,7 +92,7 @@
+ /*
+  * for which requests use 2^N search using buddies
+  */
+-#define MB_DEFAULT_ORDER2_REQS                2
++#define MB_DEFAULT_ORDER2_REQS                8
+
+ /*
+  * default group prealloc size 512 blocks
 @@ -219,7 +219,7 @@ struct ext4_mb_history {
        __u16 tail;     /* what tail broke some buddy */
        __u16 buddy;    /* buddy the tail ^^^ broke */
index d09f8f5..d2272bb 100644 (file)
@@ -58,7 +58,7 @@ Index: linux-2.6.18-128.1.6/fs/ext4/mballoc.c
  int ext4_mb_init(struct super_block *sb, int needs_recovery)
  {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
-@@ -2542,13 +2562,55 @@
+@@ -2542,13 +2562,57 @@
        sbi->s_mb_max_to_scan = MB_DEFAULT_MAX_TO_SCAN;
        sbi->s_mb_min_to_scan = MB_DEFAULT_MIN_TO_SCAN;
        sbi->s_mb_stats = MB_DEFAULT_STATS;
@@ -68,7 +68,7 @@ Index: linux-2.6.18-128.1.6/fs/ext4/mballoc.c
 -      sbi->s_mb_group_prealloc = MB_DEFAULT_GROUP_PREALLOC;
 +
 +      if (sbi->s_stripe == 0) {
-+              sbi->s_mb_prealloc_table_size = 8;
++              sbi->s_mb_prealloc_table_size = 10;
 +              i = sbi->s_mb_prealloc_table_size * sizeof(unsigned long);
 +              sbi->s_mb_prealloc_table = kmalloc(i, GFP_NOFS);
 +              if (sbi->s_mb_prealloc_table == NULL) {
@@ -86,6 +86,8 @@ Index: linux-2.6.18-128.1.6/fs/ext4/mballoc.c
 +              ext4_mb_prealloc_table_add(sbi, 128);
 +              ext4_mb_prealloc_table_add(sbi, 256);
 +              ext4_mb_prealloc_table_add(sbi, 512);
++              ext4_mb_prealloc_table_add(sbi, 1024);
++              ext4_mb_prealloc_table_add(sbi, 2048);
 +
 +              sbi->s_mb_small_req = 256;
 +              sbi->s_mb_large_req = 1024;
index 029a91a..7a0fa06 100644 (file)
@@ -58,7 +58,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
  int ext4_mb_init(struct super_block *sb, int needs_recovery)
  {
        struct ext4_sb_info *sbi = EXT4_SB(sb);
-@@ -2738,13 +2758,55 @@
+@@ -2738,13 +2758,57 @@
        sbi->s_mb_max_to_scan = MB_DEFAULT_MAX_TO_SCAN;
        sbi->s_mb_min_to_scan = MB_DEFAULT_MIN_TO_SCAN;
        sbi->s_mb_stats = MB_DEFAULT_STATS;
@@ -68,7 +68,7 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
 -      sbi->s_mb_group_prealloc = MB_DEFAULT_GROUP_PREALLOC;
 +
 +      if (sbi->s_stripe == 0) {
-+              sbi->s_mb_prealloc_table_size = 8;
++              sbi->s_mb_prealloc_table_size = 10;
 +              i = sbi->s_mb_prealloc_table_size * sizeof(unsigned long);
 +              sbi->s_mb_prealloc_table = kmalloc(i, GFP_NOFS);
 +              if (sbi->s_mb_prealloc_table == NULL) {
@@ -86,6 +86,8 @@ Index: linux-2.6.27.21-0.1/fs/ext4/mballoc.c
 +              ext4_mb_prealloc_table_add(sbi, 128);
 +              ext4_mb_prealloc_table_add(sbi, 256);
 +              ext4_mb_prealloc_table_add(sbi, 512);
++              ext4_mb_prealloc_table_add(sbi, 1024);
++              ext4_mb_prealloc_table_add(sbi, 2048);
 +
 +              sbi->s_mb_small_req = 256;
 +              sbi->s_mb_large_req = 1024;