aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/jbd2.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2018-12-03 23:16:07 -0500
committerTheodore Ts'o <tytso@mit.edu>2018-12-03 23:16:07 -0500
commit96f1e097457506f215adfe3c47aacc15a88f6dd7 (patch)
tree60a2865f4e0f909fdea3b069ba80534148200ab0 /include/linux/jbd2.h
parentext4: add ext4_sb_bread() to disambiguate ENOMEM cases (diff)
downloadwireguard-linux-96f1e097457506f215adfe3c47aacc15a88f6dd7.tar.xz
wireguard-linux-96f1e097457506f215adfe3c47aacc15a88f6dd7.zip
jbd2: avoid long hold times of j_state_lock while committing a transaction
We can hold j_state_lock for writing at the beginning of jbd2_journal_commit_transaction() for a rather long time (reportedly for 30 ms) due cleaning revoke bits of all revoked buffers under it. The handling of revoke tables as well as cleaning of t_reserved_list, and checkpoint lists does not need j_state_lock for anything. It is only needed to prevent new handles from joining the transaction. Generally T_LOCKED transaction state prevents new handles from joining the transaction - except for reserved handles which have to allowed to join while we wait for other handles to complete. To prevent reserved handles from joining the transaction while cleaning up lists, add new transaction state T_SWITCH and watch for it when starting reserved handles. With this we can just drop the lock for operations that don't need it. Reported-and-tested-by: Adrian Hunter <adrian.hunter@intel.com> Suggested-by: "Theodore Y. Ts'o" <tytso@mit.edu> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/jbd2.h')
-rw-r--r--include/linux/jbd2.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index b708e5169d1d..118d00a64184 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -575,6 +575,7 @@ struct transaction_s
enum {
T_RUNNING,
T_LOCKED,
+ T_SWITCH,
T_FLUSH,
T_COMMIT,
T_COMMIT_DFLUSH,