The patch titled EXT2: Remove superblock lock contention in ext2_statfs has been added to the -mm tree. Its filename is ext2-remove-superblock-lock-contention-in-ext2_statfs.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: EXT2: Remove superblock lock contention in ext2_statfs From: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx> Fix a performance degradation introduced in 2.6.17. (30% degradation running dbench with 16 threads) Patch 21730eed11de42f22afcbd43f450a1872a0b5ea1, which claims to make EXT2_DEBUG work again, moves the taking of the kernel lock out of debug-only code in ext2_count_free_inodes and ext2_count_free_blocks and into ext2_statfs. This patch reverses that part of the patch. Signed-off-by: Dave Kleikamp <shaggy@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/ext2/balloc.c | 3 ++- fs/ext2/ialloc.c | 3 ++- fs/ext2/super.c | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff -puN fs/ext2/balloc.c~ext2-remove-superblock-lock-contention-in-ext2_statfs fs/ext2/balloc.c --- a/fs/ext2/balloc.c~ext2-remove-superblock-lock-contention-in-ext2_statfs +++ a/fs/ext2/balloc.c @@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct bu #endif /* EXT2FS_DEBUG */ -/* Superblock must be locked */ unsigned long ext2_count_free_blocks (struct super_block * sb) { struct ext2_group_desc * desc; @@ -549,6 +548,7 @@ unsigned long ext2_count_free_blocks (st unsigned long bitmap_count, x; struct ext2_super_block *es; + lock_super(sb); es = EXT2_SB(sb)->s_es; desc_count = 0; bitmap_count = 0; @@ -572,6 +572,7 @@ unsigned long ext2_count_free_blocks (st printk("ext2_count_free_blocks: stored = %lu, computed = %lu, %lu\n", (long)le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count); + unlock_super(sb); return bitmap_count; #else for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { diff -puN fs/ext2/ialloc.c~ext2-remove-superblock-lock-contention-in-ext2_statfs fs/ext2/ialloc.c --- a/fs/ext2/ialloc.c~ext2-remove-superblock-lock-contention-in-ext2_statfs +++ a/fs/ext2/ialloc.c @@ -637,7 +637,6 @@ fail: return ERR_PTR(err); } -/* Superblock must be locked */ unsigned long ext2_count_free_inodes (struct super_block * sb) { struct ext2_group_desc *desc; @@ -649,6 +648,7 @@ unsigned long ext2_count_free_inodes (st unsigned long bitmap_count = 0; struct buffer_head *bitmap_bh = NULL; + lock_super(sb); es = EXT2_SB(sb)->s_es; for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { unsigned x; @@ -671,6 +671,7 @@ unsigned long ext2_count_free_inodes (st printk("ext2_count_free_inodes: stored = %lu, computed = %lu, %lu\n", percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter), desc_count, bitmap_count); + unlock_super(sb); return desc_count; #else for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) { diff -puN fs/ext2/super.c~ext2-remove-superblock-lock-contention-in-ext2_statfs fs/ext2/super.c --- a/fs/ext2/super.c~ext2-remove-superblock-lock-contention-in-ext2_statfs +++ a/fs/ext2/super.c @@ -1044,7 +1044,6 @@ static int ext2_statfs (struct dentry * unsigned long overhead; int i; - lock_super(sb); if (test_opt (sb, MINIX_DF)) overhead = 0; else { @@ -1085,7 +1084,6 @@ static int ext2_statfs (struct dentry * buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count); buf->f_ffree = ext2_count_free_inodes (sb); buf->f_namelen = EXT2_NAME_LEN; - unlock_super(sb); return 0; } _ Patches currently in -mm which might be from shaggy@xxxxxxxxxxxxxx are ext2-remove-superblock-lock-contention-in-ext2_statfs.patch fs-removing-useless-casts.patch fs-jfs-conversion-to-generic-boolean.patch ext3-more-whitespace-cleanups.patch ext3-fix-sparse-warnings.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html