Commit 150549ed authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

jbd2: Drop pointless check from jbd2_journal_stop()

If a transaction is larger than journal->j_max_transaction_buffers, that
is a bug and not a trigger for transaction commit. Also the very next
attempt to start new handle will start transaction commit anyway. So
just remove the pointless check. Arguably, we could start transaction
commit whenever the transaction size is *close* to
journal->j_max_transaction_buffers. This has a potential to reduce
latency of the next jbd2_journal_start() at the cost of somewhat smaller
transactions. However for this to have any effect, it would mean that
there isn't someone already waiting in jbd2_journal_start() which means
metadata load for the fs is pretty light anyway so probably this
optimization is not worth it.
Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191105164437.32602-15-jack@suse.czSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent dfaf5ffd
...@@ -1803,13 +1803,10 @@ int jbd2_journal_stop(handle_t *handle) ...@@ -1803,13 +1803,10 @@ int jbd2_journal_stop(handle_t *handle)
/* /*
* If the handle is marked SYNC, we need to set another commit * If the handle is marked SYNC, we need to set another commit
* going! We also want to force a commit if the current * going! We also want to force a commit if the transaction is too
* transaction is occupying too much of the log, or if the * old now.
* transaction is too old now.
*/ */
if (handle->h_sync || if (handle->h_sync ||
(atomic_read(&transaction->t_outstanding_credits) >
journal->j_max_transaction_buffers) ||
time_after_eq(jiffies, transaction->t_expires)) { time_after_eq(jiffies, transaction->t_expires)) {
/* Do this even for aborted journals: an abort still /* Do this even for aborted journals: an abort still
* completes the commit thread, it just doesn't write * completes the commit thread, it just doesn't write
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment