Skip to contentSkip to conversation

fs: Move bh_cachep to the __read_mostly section

PATCH In review Vlad Zolotarov 1 participant 2 messages Apr 24, 2012 – May 3, 2012 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Move bh_cachep to the __read_mostly section

From: Shai Fultheim <[email protected]>

bh_cachep is only written to once on initialization, so move it to the __read_mostly section.

---
 fs/buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/buffer.c +1 -1
index 36d6665..a1d82fb 100644
@@ -3151,7 +3151,7 @@ SYSCALL_DEFINE2(bdflush, int, func, long, data)
 /*
  * Buffer-head allocation
  */
-static struct kmem_cache *bh_cachep;
+static struct kmem_cache *bh_cachep __read_mostly;
 
 /*
  * Once the number of bh's in the machine exceeds this level, we start
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 16 lines · Vlad Zolotarov

From: Shai Fultheim <[email protected]>

bh_cachep is only written to once on initialization, so move it to the __read_mostly section.

---
 fs/buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/buffer.c +0 -0
index 36d6665..a1d82fb 100644

fs/buffer.c SYSCALL_DEFINE2(bdflush, int, func, long, data) · line 3157

Quoted 8 lines
fs/buffer.c +1 -1
@@ -3151,7 +3151,7 @@ SYSCALL_DEFINE2(bdflush, int, func, long, data)
 /*
  * Buffer-head allocation
  */
-static struct kmem_cache *bh_cachep;
+static struct kmem_cache *bh_cachep __read_mostly;
 
 /*
  * Once the number of bh's in the machine exceeds this level, we start

Thomas, Ingo, Peter, Alan, do u want me to respin this patch? (Alan, this one is not x86 ;))

Could u, pls., advice what should be done for it to be applied?

thanks,
vlad