Re: [PATCH] jbd2: avoid false sharing with j_state_lock
From: Theodore Ts'o
Date: Fri Oct 09 2026 - 04:57:45 EST
On Wed, 02 Sep 2026 15:03:31 +0800, JonasZhou-oc wrote:
> is_journal_aborted() reads journal->j_flags from ext4 and JBD2 hot
> paths. At the same time, transaction start and stop paths repeatedly
> acquire and release j_state_lock. read_lock() and read_unlock() update
> the lock word, so this traffic invalidates the cache line containing
> j_flags.
>
> On the tested x86-64 build, j_flags, j_errno, and j_state_lock occupy
> the same 64-byte cache line. j_flags starts at offset 0, j_errno at
> offset 8, and j_state_lock at offset 56.
>
> [...]
Applied, thanks!
[1/1] jbd2: avoid false sharing with j_state_lock
commit: b5501f970dbc039df1f7c720b7a481b62de125cd
Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>