summaryrefslogtreecommitdiff
path: root/scripts/Makefile.thinlto
diff options
context:
space:
mode:
authorJonasZhou-oc <jonaszhou-oc@zhaoxin.com>2026-09-02 15:03:31 +0800
committerTheodore Ts'o <tytso@mit.edu>2026-10-08 11:07:51 -0400
commitb5501f970dbc039df1f7c720b7a481b62de125cd (patch)
treebda700ac9ee958114cea833c2d84d611bca7a6be /scripts/Makefile.thinlto
parent4a87cfb9b45ae07cd28bdc1ab9059ea73eab312e (diff)
downloadlinux-b5501f970dbc039df1f7c720b7a481b62de125cd.tar.gz
linux-b5501f970dbc039df1f7c720b7a481b62de125cd.zip
jbd2: avoid false sharing with j_state_lock
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. Align j_state_lock to a cacheline boundary on SMP builds. This moves it to offset 64 and prevents lock traffic from invalidating j_flags and j_errno. Tests were run on Linux 7.3-rc1. On a two-socket Intel Xeon Silver 4208 system with SMT disabled, CPUs fixed at 2 GHz, and 16 stress-ng workers, ten-run average bogo-ops/s for stress-ng.utime, stress-ng.access, stress-ng.file-ioctl, and stress-ng.open increased by 9.60%, 5.42%, 2.05%, and 4.65%, respectively. In separate five-run perf c2c measurements, average Remote HITM samples for the affected j_flags/j_errno line decreased from 1996, 2041, 1555, and 383 to zero, respectively. Signed-off-by: JonasZhou-oc <jonaszhou-oc@zhaoxin.com> Link: https://patch.msgid.link/20260902070331.820322-1-jonaszhou-oc@zhaoxin.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions