linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL v3] Btrfs: improve write ahead log with sub transaction
@ 2011-06-21  8:49 Liu Bo
  2011-06-21  8:49 ` [PATCH 01/12 v3] Btrfs: introduce sub transaction stuff Liu Bo
                   ` (12 more replies)
  0 siblings, 13 replies; 20+ messages in thread
From: Liu Bo @ 2011-06-21  8:49 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dave, chris.mason, josef

I've been working to try to improve the write-ahead log's performance,
and I found that the bottleneck addresses in the checksum items,
especially when we want to make a random write on a large file, e.g a 4G file.

Then a idea for this suggested by Chris is to use sub transaction ids and just
to log the part of inode that had changed since either the last log commit or
the last transaction commit.  And as we also push the sub transid into the btree
blocks, we'll get much faster tree walks.  As a result, we abandon the original
brute force approach, which is "to delete all items of the inode in log",
to making sure we get the most uptodate copies of everything, and instead
we manage to "find and merge", i.e. finding extents in the log tree and merging
in the new extents from the file.

This patchset puts the above idea into code, and although the code is now more
complex, it brings us a great deal of performance improvement:

in my sysbench "write + fsync" test:

	451.01Kb/sec -> 4.3621Mb/sec

In v2, thanks to Chris, we worked together to solve 2 bugs, and after that it
works as expected.

Since there are some vital changes in recent rc, like "kill trans_mutex" and
"use cur_trans", as David asked, I rebase the patchset to the latest for-linus
branch.

More tests are welcome!

You can also get this patchset from:

	git://repo.or.cz/linux-btrfs-devel.git sub-trans

Liu Bo (12):
  Btrfs: introduce sub transaction stuff
  Btrfs: update block generation if should_cow_block fails
  Btrfs: modify btrfs_drop_extents API
  Btrfs: introduce first sub trans
  Btrfs: still update inode trans stuff when size remains unchanged
  Btrfs: improve log with sub transaction
  Btrfs: add checksum check for log
  Btrfs: fix a bug of log check
  Btrfs: kick off useless code
  Btrfs: deal with EEXIST after iput
  Btrfs: use the right generation number to read log_root_tree
  Revert "Btrfs: do not flush csum items of unchanged file data during
    treelog"

 fs/btrfs/btrfs_inode.h |   12 ++-
 fs/btrfs/ctree.c       |   69 +++++++++---
 fs/btrfs/ctree.h       |    5 +-
 fs/btrfs/disk-io.c     |   12 +-
 fs/btrfs/extent-tree.c |   10 +-
 fs/btrfs/file.c        |   22 ++---
 fs/btrfs/inode.c       |   33 ++++---
 fs/btrfs/ioctl.c       |    6 +-
 fs/btrfs/relocation.c  |    6 +-
 fs/btrfs/transaction.c |   14 ++-
 fs/btrfs/transaction.h |   19 +++-
 fs/btrfs/tree-defrag.c |    2 +-
 fs/btrfs/tree-log.c    |  272 ++++++++++++++++++++++++++++++++++-------------
 13 files changed, 331 insertions(+), 151 deletions(-)


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

end of thread, other threads:[~2011-08-06  9:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21  8:49 [GIT PULL v3] Btrfs: improve write ahead log with sub transaction Liu Bo
2011-06-21  8:49 ` [PATCH 01/12 v3] Btrfs: introduce sub transaction stuff Liu Bo
2011-06-21  8:49 ` [PATCH 02/12 v3] Btrfs: update block generation if should_cow_block fails Liu Bo
2011-06-21  8:49 ` [PATCH 03/12 v3] Btrfs: modify btrfs_drop_extents API Liu Bo
2011-06-21  8:49 ` [PATCH 04/12 v3] Btrfs: introduce first sub trans Liu Bo
2011-06-21  8:49 ` [PATCH 05/12 v3] Btrfs: still update inode trans stuff when size remains unchanged Liu Bo
2011-06-21  8:49 ` [PATCH 06/12 v3] Btrfs: improve log with sub transaction Liu Bo
2011-06-21 13:46   ` Josef Bacik
2011-06-21  8:49 ` [PATCH 07/12 v3] Btrfs: add checksum check for log Liu Bo
2011-06-21 13:49   ` Josef Bacik
2011-06-21  8:49 ` [PATCH 08/12 v3] Btrfs: fix a bug of log check Liu Bo
2011-06-21  8:49 ` [PATCH 09/12 v3] Btrfs: kick off useless code Liu Bo
2011-06-21  8:49 ` [PATCH 10/12 v3] Btrfs: deal with EEXIST after iput Liu Bo
2011-06-21 14:00   ` Josef Bacik
2011-06-22  1:57     ` liubo
2011-06-21  8:49 ` [PATCH 11/12 v3] Btrfs: use the right generation number to read log_root_tree Liu Bo
2011-06-21  8:49 ` [PATCH 12/12 v3] Revert "Btrfs: do not flush csum items of unchanged file data during treelog" Liu Bo
2011-08-04 13:57 ` [GIT PULL v3] Btrfs: improve write ahead log with sub transaction Chris Mason
2011-08-06  3:44   ` liubo
2011-08-06  9:23     ` liubo

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).