aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2009-03-12 20:12:45 -0400
committerChris Mason <chris.mason@oracle.com>2009-03-24 16:14:26 -0400
commitb7ec40d7845bffca8bb3af2ea3f192d6257bbe21 (patch)
tree65b833b979417d36f0fd26d647573de1df0646b9 /fs/btrfs/transaction.h
parentc3e69d58e86c3917ae4e9e31b4acf490a7cafe60 (diff)
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>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 94876709217f..94f5bde2b58d 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -23,7 +23,12 @@
23 23
24struct btrfs_transaction { 24struct btrfs_transaction {
25 u64 transid; 25 u64 transid;
26 /*
27 * total writers in this transaction, it must be zero before the
28 * transaction can end
29 */
26 unsigned long num_writers; 30 unsigned long num_writers;
31
27 unsigned long num_joined; 32 unsigned long num_joined;
28 int in_commit; 33 int in_commit;
29 int use_count; 34 int use_count;