Btrfs: reduce stalls during transaction commit
authorChris Mason <chris.mason@oracle.com>
Fri, 13 Mar 2009 00:12:45 +0000 (20:12 -0400)
committerChris Mason <chris.mason@oracle.com>
Tue, 24 Mar 2009 20:14:26 +0000 (16:14 -0400)
commitb7ec40d7845bffca8bb3af2ea3f192d6257bbe21
tree65b833b979417d36f0fd26d647573de1df0646b9
parentc3e69d58e86c3917ae4e9e31b4acf490a7cafe60
Btrfs: reduce stalls during transaction commit

To avoid deadlocks and reduce latencies during some critical operations, some
transaction writers are allowed to jump into the running transaction and make
it run a little longer, while others sit around and wait for the commit to
finish.

This is a bit unfair, especially when the callers that jump in do a bunch
of IO that makes all the others procs on the box wait.  This commit
reduces the stalls this produces by pre-reading file extent pointers
during btrfs_finish_ordered_io before the transaction is joined.

It also tunes the drop_snapshot code to politely wait for transactions
that have started writing out their delayed refs to finish.  This avoids
new delayed refs being flooded into the queue while we're trying to
close off the transaction.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c
fs/btrfs/inode.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h