All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <liubo2009@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>,
	Josef Bacik <josef@redhat.com>, Arne Jansen <sensille@gmx.net>,
	David Sterba <dsterba@suse.cz>
Subject: Re: [RFC PATCH 0/5] apply rwlock for extent state
Date: Wed, 21 Mar 2012 10:52:18 +0800	[thread overview]
Message-ID: <4F694262.6050409@cn.fujitsu.com> (raw)
In-Reply-To: <1331802737-29454-1-git-send-email-liubo2009@cn.fujitsu.com>

Any comments?

On 03/15/2012 05:12 PM, Liu Bo wrote:
> 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(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  parent reply	other threads:[~2012-03-21  2:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Liu Bo [this message]
2012-03-21 12:34   ` [RFC PATCH 0/5] apply rwlock for extent state Andrea Gelmini
2012-03-22  1:04     ` Chris Samuel
2012-03-22  1:17       ` Liu Bo
2012-03-22 13:09         ` Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F694262.6050409@cn.fujitsu.com \
    --to=liubo2009@cn.fujitsu.com \
    --cc=chris.mason@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sensille@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.