Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH] ext4: isolate s_orphan_lock from read-mostly fields
@ 2026-09-03  2:18 JonasZhou-oc
  2026-09-03  2:23 ` sashiko-bot
  2026-09-03 10:25 ` Jan Kara
  0 siblings, 2 replies; 3+ messages in thread
From: JonasZhou-oc @ 2026-09-03  2:18 UTC (permalink / raw)
  To: linux-ext4
  Cc: tytso, adilger.kernel, libaokun, jack, ojaswin, ritesh.list,
	yi.zhang, linux-kernel, jonaszhou, louisqi, jianhuizzzzz

From: Jonas Zhou <jonaszhou@zhaoxin.com>

s_orphan_lock is modified by orphan-list operations, but currently shares
a cache line with s_journal and s_ext4_flags.  The latter fields are read
from common ext4 paths, so unrelated accesses can cause the line containing
the lock to bounce between CPUs.

On a two-socket Intel Xeon Silver 4208 system with 16 workers, throughput
improved by 4.6% for stress-ng.dnotify and 1.7% for stress-ng.unlink.  Perf
c2c showed that HITM events on the affected fields decreased from 3,699 to
3,125 (-15.5%) for stress-ng.dnotify and from 1,368 to 571 (-58.3%) for
stress-ng.unlink.  Remote HITM events decreased by 45.1% and 65.5%,
respectively.  The journal/flags line had no remote HITM events after the
change; the remaining remote HITM events were on the orphan-lock line.

Signed-off-by: Jonas Zhou <jonaszhou@zhaoxin.com>
---
 fs/ext4/ext4.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 724a27e8be61..a3f16a981664 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1644,7 +1644,7 @@ struct ext4_sb_info {
 	/* Journaling */
 	struct journal_s *s_journal;
 	unsigned long s_ext4_flags;		/* Ext4 superblock flags */
-	struct mutex s_orphan_lock;	/* Protects on disk list changes */
+	struct mutex s_orphan_lock ____cacheline_aligned_in_smp;
 	struct list_head s_orphan;	/* List of orphaned inodes in on disk
 					   list */
 	struct ext4_orphan_info s_orphan_info;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03  2:18 [PATCH] ext4: isolate s_orphan_lock from read-mostly fields JonasZhou-oc
2026-09-03  2:23 ` sashiko-bot
2026-09-03 10:25 ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox