Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH RFC] fs: cache-align lock_class_keys in struct file_system_type
@ 2025-12-30 21:07 Eric Sandeen
  2025-12-30 22:04 ` Mateusz Guzik
  2025-12-31  6:07 ` Oliver Sang
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2025-12-30 21:07 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel
  Cc: Christian Brauner, David Howells, lkp, oe-lkp, Alexander Viro

LKP reported that one of their tests was failing to even boot with my
"old mount API code" removal patch. The test was booting an i386 kernel
under QEMU, with lockdep enabled. Rather than a functional failure, it
seemed to have been slowed to a crawl and eventually timed out.

I narrowed the problem down to the removal of the ->mount op from
file_system_type, which changed structure alignment and seems to have
caused cacheline issues with this structure. Annotating the alignment
fixes the problem for me.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202512230315.1717476b-lkp@intel.com
Fixes: 51a146e05 ("fs: Remove internal old mount API code")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

RFC because I honestly don't understand why this should be so critical,
especially the structure was not explicitly (or even very well) aligned
before. I would welcome insights from folks who are smarter than me!

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9949d253e5aa..b3d8cad15de1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2279,7 +2279,7 @@ struct file_system_type {
 	struct file_system_type * next;
 	struct hlist_head fs_supers;
 
-	struct lock_class_key s_lock_key;
+	struct lock_class_key s_lock_key ____cacheline_aligned;
 	struct lock_class_key s_umount_key;
 	struct lock_class_key s_vfs_rename_key;
 	struct lock_class_key s_writers_key[SB_FREEZE_LEVELS];


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

end of thread, other threads:[~2026-01-03 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-30 21:07 [PATCH RFC] fs: cache-align lock_class_keys in struct file_system_type Eric Sandeen
2025-12-30 22:04 ` Mateusz Guzik
2025-12-30 22:45   ` Eric Sandeen
2026-01-03 12:23     ` Mateusz Guzik
2025-12-31  6:07 ` Oliver Sang

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