diff options
author | Eric Dumazet <dada1@cosmosbay.com> | 2006-03-26 04:37:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:56 -0500 |
commit | fa3536cc144c1298f2ed9416c33f3b77fa2cd37a (patch) | |
tree | 5484541319b86ae7dac0def4db7925f7cc7008e7 /fs/inode.c | |
parent | 878a9f30d7b13015f3aa4534d7877d985f150183 (diff) |
[PATCH] Use __read_mostly on some hot fs variables
I discovered on oprofile hunting on a SMP platform that dentry lookups were
slowed down because d_hash_mask, d_hash_shift and dentry_hashtable were in
a cache line that contained inodes_stat. So each time inodes_stats is
changed by a cpu, other cpus have to refill their cache line.
This patch moves some variables to the __read_mostly section, in order to
avoid false sharing. RCU dentry lookups can go full speed.
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/inode.c b/fs/inode.c index 85da11044adc..1fddf2803af8 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -56,8 +56,8 @@ | |||
56 | #define I_HASHBITS i_hash_shift | 56 | #define I_HASHBITS i_hash_shift |
57 | #define I_HASHMASK i_hash_mask | 57 | #define I_HASHMASK i_hash_mask |
58 | 58 | ||
59 | static unsigned int i_hash_mask; | 59 | static unsigned int i_hash_mask __read_mostly; |
60 | static unsigned int i_hash_shift; | 60 | static unsigned int i_hash_shift __read_mostly; |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * Each inode can be on two separate lists. One is | 63 | * Each inode can be on two separate lists. One is |
@@ -73,7 +73,7 @@ static unsigned int i_hash_shift; | |||
73 | 73 | ||
74 | LIST_HEAD(inode_in_use); | 74 | LIST_HEAD(inode_in_use); |
75 | LIST_HEAD(inode_unused); | 75 | LIST_HEAD(inode_unused); |
76 | static struct hlist_head *inode_hashtable; | 76 | static struct hlist_head *inode_hashtable __read_mostly; |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * A simple spinlock to protect the list manipulations. | 79 | * A simple spinlock to protect the list manipulations. |
@@ -98,7 +98,7 @@ static DEFINE_MUTEX(iprune_mutex); | |||
98 | */ | 98 | */ |
99 | struct inodes_stat_t inodes_stat; | 99 | struct inodes_stat_t inodes_stat; |
100 | 100 | ||
101 | static kmem_cache_t * inode_cachep; | 101 | static kmem_cache_t * inode_cachep __read_mostly; |
102 | 102 | ||
103 | static struct inode *alloc_inode(struct super_block *sb) | 103 | static struct inode *alloc_inode(struct super_block *sb) |
104 | { | 104 | { |