Re: [PATCH] ext4: isolate s_orphan_lock from read-mostly fields

From: JonasZhou-oc

Date: Mon Sep 07 2026 - 07:21:37 EST


Hi Jan,

Thanks for the review. My original test filesystem did not have
orphan_file enabled. I agree that enabling it is the main scalability
improvement; this change only targets filesystems still using the
legacy list.

For v2, I exchanged s_journal and s_ext4_flags with s_err_report_sec
and s_li_request. Moving the readers keeps the orphan lock/list and
the intervening allocator fields at their original offsets. It adds
no padding and preserves the mutex comment.

sizeof(struct ext4_sb_info) remains 2496 bytes with my x86-64 config.
Compiled checks with quota disabled, lockdep, PREEMPT_RT and i386 also
show only these four offsets changing, with no structure-size increase.

Test results comparing v7.3-rc1 and v2 on two Xeon Silver 4208 sockets:

Mean throughput change Paired 95% interval
legacy dnotify +13.52% [+4.83%, +22.92%]
legacy unlink +31.70% [+22.53%, +41.48%]
legacy fallocate +0.25% [-1.40%, +1.94%]
orphan_file dnotify -0.43% [-5.44%, +4.96%]
orphan_file unlink -0.34% [-2.76%, +2.13%]
orphan_file fallocate +0.29% [-0.82%, +1.42%]

The intervals use four paired log ratios; the mean-change column uses
the ratio of arithmetic means. All four legacy dnotify/unlink pairs
improved. The orphan_file results show boot-to-boot variation, so I am
not claiming equivalence or a general filesystem speedup. These are
new measurements on memory-backed images, not the original v1 numbers.

Separate perf c2c dnotify captures on legacy filesystems show remote
HITM samples on the original journal/flags offsets in all four base
captures and none on their new cache line in the four v2 captures.

Thanks,
Jonas