Skip to content

Commit

Permalink
[PATCH] EXT2: Remove superblock lock contention in ext2_statfs
Browse files Browse the repository at this point in the history
Fix a performance degradation introduced in 2.6.17.  (30% degradation
running dbench with 16 threads)

Commit 21730ee, 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
5b11687)

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dave Kleikamp authored and Linus Torvalds committed Sep 19, 2006
1 parent ac7fb27 commit 833f732
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion fs/ext2/balloc.c
Expand Up @@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)

#endif /* EXT2FS_DEBUG */

/* Superblock must be locked */
unsigned long ext2_count_free_blocks (struct super_block * sb)
{
struct ext2_group_desc * desc;
Expand Down
1 change: 0 additions & 1 deletion fs/ext2/ialloc.c
Expand Up @@ -637,7 +637,6 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
return ERR_PTR(err);
}

/* Superblock must be locked */
unsigned long ext2_count_free_inodes (struct super_block * sb)
{
struct ext2_group_desc *desc;
Expand Down
2 changes: 0 additions & 2 deletions fs/ext2/super.c
Expand Up @@ -1083,7 +1083,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
unsigned long overhead;
int i;

lock_super(sb);
if (test_opt (sb, MINIX_DF))
overhead = 0;
else {
Expand Down Expand Up @@ -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_ffree = ext2_count_free_inodes (sb);
buf->f_namelen = EXT2_NAME_LEN;
unlock_super(sb);
return 0;
}

Expand Down

0 comments on commit 833f732

Please sign in to comment.