linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 0/9] free space B-tree
Date: Thu, 10 Sep 2015 20:48:20 -0700	[thread overview]
Message-ID: <20150911034820.GA22893@mew> (raw)
In-Reply-To: <55F22C89.7060502@cn.fujitsu.com>

On Fri, Sep 11, 2015 at 09:21:13AM +0800, Qu Wenruo wrote:
> Hi Omar,
> 
> Thanks for your patchset.
> Quite a nice one, and debug-tree can give better output on space cache.
> With current implement, space cache is near a black box in debug-tree
> output.
> 
> And current on disk format is not quite easy to understand.(In fact, space
> cache is restored in tree root, as a NODATACOW inode, quite wired)
> 
> Also, it should provide a quite good base for rework inode cache for future
> development.
> 
> 
> But I'm still a little concerned about the performance.
> 
> One of the problem using b-tree is, now we need to use btrfs_search_slot()
> to do modification, that means we will do level-based tree lock and COW.
> Personally speaking, I'd like to blame that for the slow metadata
> performance of btrfs.
> (Yeah personal experience, may be wrong again)
> 
> So with the new implement every space cache operation will causing tree lock
> and cow.
> Unlike the old wired structure, which is done in a NODATACOW fashion.
> 
> Hopes I'm wrong about it (and it seems I'm always wrong about all these
> assumption based performance thing).
> 
> Thanks,
> Qu

Hey, Qu,

So the thing about the free space tree is that the B-tree is only
modified while running delayed refs, so we only incur any overhead
during a transaction commit. The numbers I got showed that the overhead
was better than the old free space cache and not too much more than not
using the cache. Now that I think about it, I only profiled it under
heavy load, though, it'd probably be a good idea to get some numbers for
more typical workloads, but I don't currently have access to any
reasonable hardware.

Thanks,
Omar

> Omar Sandoval wrote on 2015/09/03 12:44 -0700:
> >Here's version 2 of the the free space B-tree patches, addressing
> >Josef's review from the last round, which you can find here:
> >http://www.spinics.net/lists/linux-btrfs/msg46713.html
> >
> >Changes from v1->v2:
> >
> >- Cleaned up a bunch of unnecessary instances of "if (ret) goto out; ret = 0"
> >- Added aborts in the free space tree code closer to the site the error
> >   is encountered: where we add or remove block groups, add or remove
> >   free space, and also when we convert formats
> >- Moved loading of the free space tree into caching_thread() and added a
> >   new patch 4 in preparation for it
> >- Commented a bunch of stuff in the extent buffer bitmap operations and
> >   refactored some of the complicated logic
> >- Added sanity tests for the extent buffer bitmap operations and free
> >   space tree (patches 2 and 6)
> >- Added Josef's Reviewed-by tags
> >
> >Omar Sandoval (9):
> >   Btrfs: add extent buffer bitmap operations
> >   Btrfs: add extent buffer bitmap sanity tests
> >   Btrfs: add helpers for read-only compat bits
> >   Btrfs: refactor caching_thread()
> >   Btrfs: introduce the free space B-tree on-disk format
> >   Btrfs: implement the free space B-tree
> >   Btrfs: add free space tree sanity tests
> >   Btrfs: wire up the free space tree to the extent tree
> >   Btrfs: add free space tree mount option
> >
> >  fs/btrfs/Makefile                      |    5 +-
> >  fs/btrfs/ctree.h                       |  107 ++-
> >  fs/btrfs/disk-io.c                     |   26 +
> >  fs/btrfs/extent-tree.c                 |  112 ++-
> >  fs/btrfs/extent_io.c                   |  183 +++-
> >  fs/btrfs/extent_io.h                   |   10 +-
> >  fs/btrfs/free-space-tree.c             | 1501 ++++++++++++++++++++++++++++++++
> >  fs/btrfs/free-space-tree.h             |   71 ++
> >  fs/btrfs/super.c                       |   24 +-
> >  fs/btrfs/tests/btrfs-tests.c           |   52 ++
> >  fs/btrfs/tests/btrfs-tests.h           |   10 +
> >  fs/btrfs/tests/extent-io-tests.c       |  138 ++-
> >  fs/btrfs/tests/free-space-tests.c      |   35 +-
> >  fs/btrfs/tests/free-space-tree-tests.c |  570 ++++++++++++
> >  fs/btrfs/tests/qgroup-tests.c          |   20 +-
> >  include/trace/events/btrfs.h           |    3 +-
> >  16 files changed, 2763 insertions(+), 104 deletions(-)
> >  create mode 100644 fs/btrfs/free-space-tree.c
> >  create mode 100644 fs/btrfs/free-space-tree.h
> >  create mode 100644 fs/btrfs/tests/free-space-tree-tests.c
> >

-- 
Omar

  reply	other threads:[~2015-09-11  3:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 19:01 [PATCH 0/6] free space B-tree Omar Sandoval
2015-09-01 19:01 ` [PATCH 1/6] Btrfs: add extent buffer bitmap operations Omar Sandoval
2015-09-01 19:25   ` Josef Bacik
2015-09-01 19:37     ` Omar Sandoval
2015-09-01 19:01 ` [PATCH 2/6] Btrfs: add helpers for read-only compat bits Omar Sandoval
2015-09-01 19:26   ` Josef Bacik
2015-09-01 19:01 ` [PATCH 3/6] Btrfs: introduce the free space B-tree on-disk format Omar Sandoval
2015-09-01 19:28   ` Josef Bacik
2015-09-01 19:05 ` [PATCH 5/6] Btrfs: wire up the free space tree to the extent tree Omar Sandoval
2015-09-01 19:48   ` Josef Bacik
2015-09-02  4:42     ` Omar Sandoval
2015-09-02 15:29       ` Josef Bacik
2015-09-01 19:05 ` [PATCH 6/6] Btrfs: add free space tree mount option Omar Sandoval
2015-09-01 19:49   ` Josef Bacik
2015-09-01 19:13 ` [PATCH 4/6] Btrfs: implement the free space B-tree Omar Sandoval
2015-09-01 19:44   ` Josef Bacik
2015-09-01 20:06     ` Omar Sandoval
2015-09-01 20:08       ` Josef Bacik
2015-09-01 19:17 ` [PATCH 0/6] " Omar Sandoval
2015-09-01 19:22 ` [PATCH 1/3] btrfs-progs: use calloc instead of malloc+memset for tree roots Omar Sandoval
2015-09-01 19:22   ` [PATCH 2/3] btrfs-progs: add basic awareness of the free space tree Omar Sandoval
2015-09-01 19:22   ` [PATCH 3/3] btrfs-progs: check the free space tree in btrfsck Omar Sandoval
2015-09-02 15:02   ` [PATCH 1/3] btrfs-progs: use calloc instead of malloc+memset for tree roots David Sterba
2015-09-03 19:44 ` [PATCH v2 0/9] free space B-tree Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 1/9] Btrfs: add extent buffer bitmap operations Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 2/9] Btrfs: add extent buffer bitmap sanity tests Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 3/9] Btrfs: add helpers for read-only compat bits Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 4/9] Btrfs: refactor caching_thread() Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 5/9] Btrfs: introduce the free space B-tree on-disk format Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 6/9] Btrfs: implement the free space B-tree Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 7/9] Btrfs: add free space tree sanity tests Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 8/9] Btrfs: wire up the free space tree to the extent tree Omar Sandoval
2015-09-04  5:56     ` Omar Sandoval
2015-09-03 19:44   ` [PATCH v2 9/9] Btrfs: add free space tree mount option Omar Sandoval
2015-09-09 12:00     ` David Sterba
2015-09-11  0:52       ` Omar Sandoval
2015-09-04  1:29   ` [PATCH v2 0/9] free space B-tree Zhao Lei
2015-09-04  5:43     ` Omar Sandoval
2015-09-11  1:21   ` Qu Wenruo
2015-09-11  3:48     ` Omar Sandoval [this message]
2015-09-11  3:58       ` Qu Wenruo
2015-09-11  4:15         ` Omar Sandoval
2015-09-22 14:41     ` David Sterba

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=20150911034820.GA22893@mew \
    --to=osandov@osandov.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.fujitsu.com \
    /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 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).