Skip to contentSkip to conversation

fs: super: do not cacheline align s_{inode,dentry}_lru

PATCH New Vladimir Davydov 1 participant 1 message Jan 19, 2015 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: super: do not cacheline align s_{inode,dentry}_lru

super_block->s_{inode,dentry}_lru were made cacheline aligned, because the list_lru struct had a spinlock and a list embedded to it and therefore could be actively modified.

Today, struct list_lru is, in fact, read-only: the lists and locks live in list_lru_node's, which list_lru points to. The list_lru_node struct is already cacheline aligned by definition.

So let us drop the cacheline aligned annotation in order not to waste space in struct super_block.

---
 include/linux/fs.h |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
include/linux/fs.h +3 -6
index 0bd9669ce91d..790e534adbc7 100644
@@ -1309,12 +1309,9 @@ struct super_block {
 	struct workqueue_struct *s_dio_done_wq;
 	struct hlist_head s_pins;
 
-	/*
-	 * Keep the lru lists last in the structure so they always sit on their
-	 * own individual cachelines.
-	 */
-	struct list_lru		s_dentry_lru ____cacheline_aligned_in_smp;
-	struct list_lru		s_inode_lru ____cacheline_aligned_in_smp;
+	struct list_lru		s_dentry_lru;
+	struct list_lru		s_inode_lru;
+
 	struct rcu_head		rcu;
 
 	/*
Signature · 1 line
1.7.10.4