]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: reduce lock contention on extent buffer locks
authorChris Mason <chris.mason@fusionio.com>
Tue, 29 Jan 2013 22:49:37 +0000 (17:49 -0500)
committerChris Mason <chris.mason@fusionio.com>
Fri, 1 Feb 2013 19:24:25 +0000 (14:24 -0500)
commit839cefd6e6f9fa66ea38499705c280a779375a08
treeb284eaf8ef18253eb577078f14d542154d20dd94
parent30e598b1291b8fa73b913451b1b5c9a5ee66530b
Btrfs: reduce lock contention on extent buffer locks

The extent buffers have a refs_lock which we use to make coordinate freeing
the extent buffer with operations on the radix tree.  On tree roots and
other extent buffers that very cache hot, this can be highly contended.

These are also the extent buffers that are basically pinned in memory.
This commit adds code to cmpxchg our way through the ref modifications,
and as long as the result of the reference change is still pinned in
ram, we skip the expensive spinlock.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/extent_io.c