• Chris Mason's avatar
    Btrfs: reduce lock contention on extent buffer locks · 242e18c7
    Chris Mason authored
    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: default avatarChris Mason <chris.mason@fusionio.com>
    242e18c7
extent_io.c 125 KB