Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf47b8f3 authored by Chris Mason's avatar Chris Mason Committed by Ingo Molnar
Browse files

Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us



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

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ac6e60ee
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -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;
}