summaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2016-04-12 00:37:40 +0300
committerChris Mason <clm@fb.com>2016-06-23 03:54:18 +0300
commit31b9655f439a26856edca0f3f8daa368a61f16d5 (patch)
treeac17462f6647fa2740ba9854ffeff250917db675 /fs/btrfs/inode.c
parentde18c165509edb36bde42ca6ff930854f85e21ea (diff)
downloadlinux-31b9655f439a26856edca0f3f8daa368a61f16d5.tar.xz
Btrfs: track transid for delayed ref flushing
Using the offwakecputime bpf script I noticed most of our time was spent waiting on the delayed ref throttling. This is what is supposed to happen, but sometimes the transaction can commit and then we're waiting for throttling that doesn't matter anymore. So change this stuff to be a little smarter by tracking the transid we were in when we initiated the throttling. If the transaction we get is different then we can just bail out. This resulted in a 50% speedup in my fs_mark test, and reduced the amount of time spent throttling by 60 seconds over the entire run (which is about 30 minutes). Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index bb62418b8023..78582e339f33 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4558,6 +4558,7 @@ delete:
BUG_ON(ret);
if (btrfs_should_throttle_delayed_refs(trans, root))
btrfs_async_run_delayed_refs(root,
+ trans->transid,
trans->delayed_ref_updates * 2, 0);
if (be_nice) {
if (truncate_space_check(trans, root,