linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] apply rwlock for extent state
@ 2012-03-15  9:12 Liu Bo
  2012-03-15  9:12 ` [PATCH 1/5] Btrfs: use radix tree for checksum Liu Bo
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Liu Bo @ 2012-03-15  9:12 UTC (permalink / raw)
  To: linux-btrfs

This patchset is against one of project ideas, RBtree lock contention:
"Btrfs uses a number of rbtrees to index in-memory data structures.
Some of these are dominated by reads, and the lock contention from searching
them is showing up in profiles.  We need to look into an RCU and sequence
counter combination to allow lockless reads."

The goal is to use RCU, but we take it as a long term one, and instead we use
rwlock until we find a mature rcu structure for lockless read.

So what we need to do is to make the code RCU friendly, and the idea mainly
comes from Chris Mason:
Quoted:
"I think the extent_state code can be much more RCU friendly if we separate
the operations on the tree from operations on the individual state.
In general, we can gain a lot of performance if we are able to reduce
the write locks taken at endio time.  Especially for reads, these are
critical."

If we read a 10M file with pagecache,
$ dd if=/mnt/btrfs/foobar of=/dev/null bs=1M

without this patchset,
        lock for read : lock for write ~= 2:1
with this patchset,
        lock for read : lock for write ~= 200:1

I've run through xfstests, and no bugs jump out by then.
MORE TESTS ARE WELCOME!


Liu Bo (5):
  Btrfs: use radix tree for checksum
  Btrfs: merge adjacent states as much as possible
  Btrfs: use large extent range for read and its endio
  Btrfs: apply rwlock for extent state
  Btrfs: avoid splitting state when truncating pagecache

 fs/btrfs/extent_io.c        |  768 +++++++++++++++++++++++++++++++++----------
 fs/btrfs/extent_io.h        |    5 +-
 fs/btrfs/free-space-cache.c |    5 +
 fs/btrfs/inode.c            |   22 +-
 4 files changed, 614 insertions(+), 186 deletions(-)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-03-22 13:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-15  9:12 [RFC PATCH 0/5] apply rwlock for extent state Liu Bo
2012-03-15  9:12 ` [PATCH 1/5] Btrfs: use radix tree for checksum Liu Bo
2012-03-15  9:12 ` [PATCH 2/5] Btrfs: merge adjacent states as much as possible Liu Bo
2012-03-15  9:12 ` [PATCH 3/5] Btrfs: use large extent range for read and its endio Liu Bo
2012-03-15  9:12 ` [PATCH 4/5] Btrfs: apply rwlock for extent state Liu Bo
2012-03-15  9:12 ` [PATCH 5/5] Btrfs: avoid splitting state when truncating pagecache Liu Bo
2012-03-21  2:52 ` [RFC PATCH 0/5] apply rwlock for extent state Liu Bo
2012-03-21 12:34   ` Andrea Gelmini
2012-03-22  1:04     ` Chris Samuel
2012-03-22  1:17       ` Liu Bo
2012-03-22 13:09         ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).