Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us
authorChris Mason <chris.mason@oracle.com>
Wed, 14 Jan 2009 18:40:46 +0000 (13:40 -0500)
committerIngo Molnar <mingo@elte.hu>
Thu, 15 Jan 2009 09:53:00 +0000 (10:53 +0100)
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>
fs/btrfs/locking.c

index 39bae7761db6c20ae87686a70d383a12c6285ee6..40ba8e8962f861f41dfa1684170b07f0ded1941d 100644 (file)
 
 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;
 }