From 55e0203f0d41bd61626f32c23e06aee5fbda4905 Mon Sep 17 00:00:00 2001 From: nic Date: Tue, 25 Oct 2005 22:54:10 +0000 Subject: [PATCH] p=alex - fix for write performance slowdown on 2.6 kernels. Return early when not in 'aggressive' mode and default aggressive mode to off --- ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch | 13 ++++++++----- .../kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch | 13 ++++++++----- lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch | 13 ++++++++----- .../kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch | 13 ++++++++----- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch index ed7e505..5e5268f 100644 --- a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch +++ b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch @@ -279,7 +279,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c =================================================================== --- linux-2.6.5-7.201.orig/fs/ext3/mballoc.c 2005-10-13 19:40:57.851699336 +0400 +++ linux-2.6.5-7.201/fs/ext3/mballoc.c 2005-10-14 09:02:36.000000000 +0400 -@@ -0,0 +1,1865 @@ +@@ -0,0 +1,1868 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -331,7 +331,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + * with 'ext3_mb_aggressive' set the allocator runs consistency checks over + * structures. these checks slow things down a lot + */ -+long ext3_mb_aggressive = 1; ++long ext3_mb_aggressive = 0; + + +/* @@ -571,6 +571,9 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + if (!test_opt(e3b->bd_sb, MBALLOC)) + return; + ++ if (unlikely(!ext3_mb_aggressive)) ++ return; ++ + while (order > 1) { + buddy = mb_find_buddy(e3b, order, &max); + J_ASSERT(buddy); @@ -1299,7 +1302,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + ext3_error(sb, "ext3_new_block", + "Allocating block in system zone - " + "block = %u", block); -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + for (i = 0; i < ac.ac_b_ex.fe_len; i++) + J_ASSERT(!mb_test_bit(ac.ac_b_ex.fe_start + i, + bitmap_bh->b_data)); @@ -1802,8 +1805,8 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + INIT_LIST_HEAD(&EXT3_SB(sb)->s_committed_transaction); + set_opt(EXT3_SB(sb)->s_mount_opt, MBALLOC); + ++ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + if (ext3_mb_stats) { -+ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + printk("EXT3-fs: mballoc enabled (stats)\n"); + } else { + printk("EXT3-fs: mballoc enabled\n"); @@ -2033,7 +2036,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + if (err) + goto error_return; + -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + int i; + for (i = 0; i < count; i++) + J_ASSERT(mb_test_bit(bit + i, bitmap_bh->b_data)); diff --git a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch index 1fbe1f2..c0e2e16 100644 --- a/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch +++ b/ldiskfs/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch @@ -296,7 +296,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c =================================================================== --- linux-2.6.9.orig/fs/ext3/mballoc.c 2005-10-13 19:40:57.851699336 +0400 +++ linux-2.6.9/fs/ext3/mballoc.c 2005-10-14 09:10:31.000000000 +0400 -@@ -0,0 +1,1862 @@ +@@ -0,0 +1,1865 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -348,7 +348,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + * with 'ext3_mb_aggressive' set the allocator runs consistency checks over + * structures. these checks slow things down a lot + */ -+long ext3_mb_aggressive = 1; ++long ext3_mb_aggressive = 0; + + +/* @@ -588,6 +588,9 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + if (!test_opt(e3b->bd_sb, MBALLOC)) + return; + ++ if (unlikely(!ext3_mb_aggressive)) ++ return; ++ + while (order > 1) { + buddy = mb_find_buddy(e3b, order, &max); + J_ASSERT(buddy); @@ -1316,7 +1319,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + ext3_error(sb, "ext3_new_block", + "Allocating block in system zone - " + "block = %u", block); -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + for (i = 0; i < ac.ac_b_ex.fe_len; i++) + J_ASSERT(!mb_test_bit(ac.ac_b_ex.fe_start + i, + bitmap_bh->b_data)); @@ -1819,8 +1822,8 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + INIT_LIST_HEAD(&EXT3_SB(sb)->s_committed_transaction); + set_opt(EXT3_SB(sb)->s_mount_opt, MBALLOC); + ++ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + if (ext3_mb_stats) { -+ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + printk("EXT3-fs: mballoc enabled (stats)\n"); + } else { + printk("EXT3-fs: mballoc enabled\n"); @@ -2050,7 +2053,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + if (err) + goto error_return; + -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + int i; + for (i = 0; i < count; i++) + J_ASSERT(mb_test_bit(bit + i, bitmap_bh->b_data)); diff --git a/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch b/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch index ed7e505..5e5268f 100644 --- a/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch +++ b/lustre/kernel_patches/patches/ext3-mballoc2-2.6-suse.patch @@ -279,7 +279,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c =================================================================== --- linux-2.6.5-7.201.orig/fs/ext3/mballoc.c 2005-10-13 19:40:57.851699336 +0400 +++ linux-2.6.5-7.201/fs/ext3/mballoc.c 2005-10-14 09:02:36.000000000 +0400 -@@ -0,0 +1,1865 @@ +@@ -0,0 +1,1868 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -331,7 +331,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + * with 'ext3_mb_aggressive' set the allocator runs consistency checks over + * structures. these checks slow things down a lot + */ -+long ext3_mb_aggressive = 1; ++long ext3_mb_aggressive = 0; + + +/* @@ -571,6 +571,9 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + if (!test_opt(e3b->bd_sb, MBALLOC)) + return; + ++ if (unlikely(!ext3_mb_aggressive)) ++ return; ++ + while (order > 1) { + buddy = mb_find_buddy(e3b, order, &max); + J_ASSERT(buddy); @@ -1299,7 +1302,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + ext3_error(sb, "ext3_new_block", + "Allocating block in system zone - " + "block = %u", block); -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + for (i = 0; i < ac.ac_b_ex.fe_len; i++) + J_ASSERT(!mb_test_bit(ac.ac_b_ex.fe_start + i, + bitmap_bh->b_data)); @@ -1802,8 +1805,8 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + INIT_LIST_HEAD(&EXT3_SB(sb)->s_committed_transaction); + set_opt(EXT3_SB(sb)->s_mount_opt, MBALLOC); + ++ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + if (ext3_mb_stats) { -+ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + printk("EXT3-fs: mballoc enabled (stats)\n"); + } else { + printk("EXT3-fs: mballoc enabled\n"); @@ -2033,7 +2036,7 @@ Index: linux-2.6.5-7.201/fs/ext3/mballoc.c + if (err) + goto error_return; + -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + int i; + for (i = 0; i < count; i++) + J_ASSERT(mb_test_bit(bit + i, bitmap_bh->b_data)); diff --git a/lustre/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch b/lustre/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch index 1fbe1f2..c0e2e16 100644 --- a/lustre/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch +++ b/lustre/kernel_patches/patches/ext3-mballoc2-2.6.9-rhel4.patch @@ -296,7 +296,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c =================================================================== --- linux-2.6.9.orig/fs/ext3/mballoc.c 2005-10-13 19:40:57.851699336 +0400 +++ linux-2.6.9/fs/ext3/mballoc.c 2005-10-14 09:10:31.000000000 +0400 -@@ -0,0 +1,1862 @@ +@@ -0,0 +1,1865 @@ +/* + * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com + * Written by Alex Tomas @@ -348,7 +348,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + * with 'ext3_mb_aggressive' set the allocator runs consistency checks over + * structures. these checks slow things down a lot + */ -+long ext3_mb_aggressive = 1; ++long ext3_mb_aggressive = 0; + + +/* @@ -588,6 +588,9 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + if (!test_opt(e3b->bd_sb, MBALLOC)) + return; + ++ if (unlikely(!ext3_mb_aggressive)) ++ return; ++ + while (order > 1) { + buddy = mb_find_buddy(e3b, order, &max); + J_ASSERT(buddy); @@ -1316,7 +1319,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + ext3_error(sb, "ext3_new_block", + "Allocating block in system zone - " + "block = %u", block); -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + for (i = 0; i < ac.ac_b_ex.fe_len; i++) + J_ASSERT(!mb_test_bit(ac.ac_b_ex.fe_start + i, + bitmap_bh->b_data)); @@ -1819,8 +1822,8 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + INIT_LIST_HEAD(&EXT3_SB(sb)->s_committed_transaction); + set_opt(EXT3_SB(sb)->s_mount_opt, MBALLOC); + ++ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + if (ext3_mb_stats) { -+ spin_lock_init(&EXT3_SB(sb)->s_bal_lock); + printk("EXT3-fs: mballoc enabled (stats)\n"); + } else { + printk("EXT3-fs: mballoc enabled\n"); @@ -2050,7 +2053,7 @@ Index: linux-2.6.9/fs/ext3/mballoc.c + if (err) + goto error_return; + -+ if (ext3_mb_aggressive) { ++ if (unlikely(ext3_mb_aggressive)) { + int i; + for (i = 0; i < count; i++) + J_ASSERT(mb_test_bit(bit + i, bitmap_bh->b_data)); -- 1.8.3.1