Re: [PATCH v2] jbd2: speed up jbd2_transaction_committed()

From: Theodore Ts'o
Date: Wed Jul 10 2024 - 22:38:25 EST



On Mon, 20 May 2024 21:18:31 +0800, Zhang Yi wrote:
> jbd2_transaction_committed() is used to check whether a transaction with
> the given tid has already committed, it holds j_state_lock in read mode
> and check the tid of current running transaction and committing
> transaction, but holding the j_state_lock is expensive.
>
> We have already stored the sequence number of the most recently
> committed transaction in journal t->j_commit_sequence, we could do this
> check by comparing it with the given tid instead. If the given tid isn't
> smaller than j_commit_sequence, we can ensure that the given transaction
> has been committed. That way we could drop the expensive lock and
> achieve about 10% ~ 20% performance gains in concurrent DIOs on may
> virtual machine with 100G ramdisk.
>
> [...]

Applied, thanks!

[1/1] jbd2: speed up jbd2_transaction_committed()
commit: 7c73ddb7589fb8ddb1136b6306dfb72089c81511

Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>