Skip to content

Commit 833f732

Browse files
Dave KleikampLinus Torvalds
authored andcommitted
[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 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>
1 parent ac7fb27 commit 833f732

3 files changed

Lines changed: 0 additions & 4 deletions

File tree

‎fs/ext2/balloc.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
539539

540540
#endif /* EXT2FS_DEBUG */
541541

542-
/* Superblock must be locked */
543542
unsigned long ext2_count_free_blocks (struct super_block * sb)
544543
{
545544
struct ext2_group_desc * desc;

‎fs/ext2/ialloc.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
637637
return ERR_PTR(err);
638638
}
639639

640-
/* Superblock must be locked */
641640
unsigned long ext2_count_free_inodes (struct super_block * sb)
642641
{
643642
struct ext2_group_desc *desc;

‎fs/ext2/super.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
10831083
unsigned long overhead;
10841084
int i;
10851085

1086-
lock_super(sb);
10871086
if (test_opt (sb, MINIX_DF))
10881087
overhead = 0;
10891088
else {
@@ -1124,7 +1123,6 @@ static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
11241123
buf->f_files = le32_to_cpu(sbi->s_es->s_inodes_count);
11251124
buf->f_ffree = ext2_count_free_inodes (sb);
11261125
buf->f_namelen = EXT2_NAME_LEN;
1127-
unlock_super(sb);
11281126
return 0;
11291127
}
11301128

0 commit comments

Comments
 (0)