You need to sign in or sign up before continuing.
提交 cf47b8f3 编写于 作者: C Chris Mason 提交者: Ingo Molnar

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: NChris Mason <chris.mason@oracle.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 ac6e60ee
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册