Btrfs: Reduce contention on the root node
authorChris Mason <chris.mason@oracle.com>
Wed, 25 Jun 2008 20:14:04 +0000 (16:14 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:04 +0000 (11:04 -0400)
commitf9efa9c784aa3b801feb367f72c6867d26fb348e
treed9f678310c6c8a4daf2003fa4f6b4164111dbbd7
parent3f157a2fd2ad731e1ed9964fecdc5f459f04a4a4
Btrfs: Reduce contention on the root node

This calls unlock_up sooner in btrfs_search_slot in order to decrease the
amount of work done with the higher level tree locks held.

Also, it changes btrfs_tree_lock to spin for a big against the page lock
before scheduling.  This makes a big difference in context switch rate under
highly contended workloads.

Longer term, a better locking structure is needed than the page lock.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.c
fs/btrfs/locking.c