Commit 833f7329 authored by Dave Kleikamp's avatar Dave Kleikamp Committed by Linus Torvalds

[PATCH] EXT2: Remove superblock lock contention in ext2_statfs

Fix a performance degradation introduced in 2.6.17.  (30% degradation
running dbench with 16 threads)

Commit 21730eed, 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.

The same problem was fixed in ext3 by removing the lock completely (commit
5b116879)
Signed-off-by: default avatarDave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ac7fb273
...@@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars) ...@@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
#endif /* EXT2FS_DEBUG */ #endif /* EXT2FS_DEBUG */
/* Superblock must be locked */
unsigned long ext2_count_free_blocks (struct super_block * sb) unsigned long ext2_count_free_blocks (struct super_block * sb)
{ {
struct ext2_group_desc * desc; struct ext2_group_desc * desc;
......
...@@ -637,7 +637,6 @@ struct inode *ext2_new_inode(struct inode *dir, int mode) ...@@ -637,7 +637,6 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
return ERR_PTR(err); return ERR_PTR(err);
} }
/* Superblock must be locked */
unsigned long ext2_count_free_inodes (struct super_block * sb) unsigned long ext2_count_free_inodes (struct super_block * sb)
{ {
struct ext2_group_desc *desc; struct ext2_group_desc *desc;
......
...@@ -1083,7 +1083,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) ...@@ -1083,7 +1083,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
unsigned long overhead; unsigned long overhead;
int i; int i;
lock_super(sb);
if (test_opt (sb, MINIX_DF)) if (test_opt (sb, MINIX_DF))
overhead = 0; overhead = 0;
else { else {
...@@ -1124,7 +1123,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) ...@@ -1124,7 +1123,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count); buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count);
buf->f_ffree = ext2_count_free_inodes (sb); buf->f_ffree = ext2_count_free_inodes (sb);
buf->f_namelen = EXT2_NAME_LEN; buf->f_namelen = EXT2_NAME_LEN;
unlock_super(sb);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment