From: Liu Bo <liubo2009@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <chris.mason@oracle.com>
Subject: [PATCH 00/12 v5] Btrfs: improve write ahead log with sub transaction
Date: Sat, 6 Aug 2011 17:37:35 +0800 [thread overview]
Message-ID: <1312623467-31487-1-git-send-email-liubo2009@cn.fujitsu.com> (raw)
I've fixed a bug and rebased this to the latest for-linus branch,
and with applying my previous posted patch:
[PATCH] Btrfs: fix an oops of log replay
, I also test this sub transaction patchset with
a) sysbench 0.4.12 tool and
b) Chris's synctest tool in both _crash_ and _uncrash_ cases, and it works well.
Please test this and feel free to notice me if there are any problems.
Hope that it can get through with no bugs and be ready for merge this time :)
===
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.
In v3, thanks to Josef, we simplify several code.
In v4, rebase to the latest for-linus branch, Chris hit two problems, and we
solve them.
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!
Liu Bo (12):
Revert "Btrfs: do not flush csum items of unchanged file data during
treelog"
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: do not iput inode when inode is still in log
Btrfs: use the right generation number to read log_root_tree
fs/btrfs/btrfs_inode.h | 12 ++-
fs/btrfs/ctree.c | 87 +++++++++++++------
fs/btrfs/ctree.h | 5 +-
fs/btrfs/disk-io.c | 23 ++++--
fs/btrfs/extent-tree.c | 10 ++-
fs/btrfs/file.c | 22 ++---
fs/btrfs/inode.c | 39 ++++++---
fs/btrfs/ioctl.c | 6 +-
fs/btrfs/relocation.c | 6 +-
fs/btrfs/transaction.c | 13 ++-
fs/btrfs/transaction.h | 19 ++++-
fs/btrfs/tree-defrag.c | 2 +-
fs/btrfs/tree-log.c | 225 ++++++++++++++++++++++++++++++++----------------
13 files changed, 312 insertions(+), 157 deletions(-)
next reply other threads:[~2011-08-06 9:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-06 9:37 Liu Bo [this message]
2011-08-06 9:37 ` [PATCH 01/12 v5] Revert "Btrfs: do not flush csum items of unchanged file data during treelog" Liu Bo
2011-08-06 9:37 ` [PATCH 02/12 v5] Btrfs: introduce sub transaction stuff Liu Bo
2011-08-09 17:25 ` Mitch Harder
2011-08-06 9:37 ` [PATCH 03/12 v5] Btrfs: update block generation if should_cow_block fails Liu Bo
2011-08-06 9:37 ` [PATCH 04/12 v5] Btrfs: modify btrfs_drop_extents API Liu Bo
2011-08-06 9:37 ` [PATCH 05/12 v5] Btrfs: introduce first sub trans Liu Bo
2011-08-06 9:37 ` [PATCH 06/12 v5] Btrfs: still update inode trans stuff when size remains unchanged Liu Bo
2011-08-06 9:37 ` [PATCH 07/12 v5] Btrfs: improve log with sub transaction Liu Bo
2011-08-06 9:37 ` [PATCH 08/12 v5] Btrfs: add checksum check for log Liu Bo
2011-08-06 9:37 ` [PATCH 09/12 v5] Btrfs: fix a bug of log check Liu Bo
2011-08-06 9:37 ` [PATCH 10/12 v5] Btrfs: kick off useless code Liu Bo
2011-08-06 9:37 ` [PATCH 11/12 v5] Btrfs: do not iput inode when inode is still in log Liu Bo
2011-10-17 0:30 ` Chris Mason
2011-10-17 5:22 ` Liu Bo
2011-08-06 9:37 ` [PATCH 12/12 v5] Btrfs: use the right generation number to read log_root_tree Liu Bo
2011-09-01 17:38 ` [PATCH 00/12 v5] Btrfs: improve write ahead log with sub transaction Mitch Harder
2011-09-02 0:42 ` Liu Bo
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=1312623467-31487-1-git-send-email-liubo2009@cn.fujitsu.com \
--to=liubo2009@cn.fujitsu.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/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).