]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix transaction throttling for delayed refs
authorJosef Bacik <jbacik@fusionio.com>
Wed, 12 Jun 2013 17:56:06 +0000 (13:56 -0400)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 1 Jul 2013 12:52:28 +0000 (08:52 -0400)
commit714240ec168893d3a9a0f18a4929d16a307fc584
treeca8e1c5dc3b74b867d2e68215ff7f3d8526457d5
parent4e3b86a48925f5e625db7379b8a4e36abf839798
Btrfs: fix transaction throttling for delayed refs

Dave has this fs_mark script that can make btrfs abort with sufficient amount of
ram.  This is because with more ram we can keep more dirty metadata in cache
which in a round about way makes for many more pending delayed refs.  What
happens is we end up not throttling the transaction enough so when we go to
commit the transaction when we've completely filled the file system we'll
abort() because we use all of the space in the global reserve and we still have
delayed refs to run.  To fix this we need to make the delayed ref flushing and
the transaction throttling dependant upon the number of delayed refs that we
have instead of how much reserved space is left in the global reserve.  With
this patch we not only stop aborting transactions but we also get a smoother run
speed with fs_mark and it makes us about 10% faster.  Thanks,

Reported-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c