2006-09-15 20:33:48

by Dave Kleikamp

[permalink] [raw]
Subject: ext2 lock contention

Do you remember this patch:
[PATCH] Make EXT2_DEBUG work again

The second part causes a 30% performance degradation running dbench with
16 threads.

> Second, debug versions of ext2_count_free_{inodes/blocks} reacquires
> superblock lock. Moved lock into callers.

The problem is that before your patch, the superblock lock was taken
only when EXT2_DEBUG was enabled, but with your patch, the superblock
lock is held during the entire call to ext2_statfs() with our without
EXT2_DEBUG defined.

Was there a reason the lock needed to be held across both calls? Since
the patch didn't mention fixing the non-debug case, I assume the lack of
the lock in the non-debug case was okay.
David Kleikamp
IBM Linux Technology Center