Skip to content

Commit

Permalink
Btrfs: stop spinning on mutex_trylock and let the adaptive code spin …
Browse files Browse the repository at this point in the history
…for us

Mutexes now spin internally and the btrfs spin is no longer required for
performance.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Chris Mason authored and Ingo Molnar committed Jan 15, 2009
1 parent ac6e60e commit cf47b8f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions fs/btrfs/locking.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@

int btrfs_tree_lock(struct extent_buffer *eb)
{
int i;

if (mutex_trylock(&eb->mutex))
return 0;
for (i = 0; i < 512; i++) {
cpu_relax();
if (mutex_trylock(&eb->mutex))
return 0;
}
cpu_relax();
mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb));
return 0;
}
Expand Down

0 comments on commit cf47b8f

Please sign in to comment.