Btrfs: track transid for delayed ref flushing
authorJosef Bacik <jbacik@fb.com>
Mon, 11 Apr 2016 21:37:40 +0000 (17:37 -0400)
committerChris Mason <clm@fb.com>
Thu, 23 Jun 2016 00:54:18 +0000 (17:54 -0700)
commit31b9655f439a26856edca0f3f8daa368a61f16d5
treeac17462f6647fa2740ba9854ffeff250917db675
parentde18c165509edb36bde42ca6ff930854f85e21ea
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>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/transaction.c