diff options
author | John Stultz <johnstul@us.ibm.com> | 2010-02-22 19:58:20 -0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:33:01 +0200 |
commit | 9e0b2cfd72583db7ad50e3e73958926fb65e0557 (patch) | |
tree | b265079c95ea1846026c5664e82c169404fc4e31 /include | |
parent | a3426080b810723f1bed95b8d08146738126d324 (diff) | |
download | lwn-9e0b2cfd72583db7ad50e3e73958926fb65e0557.tar.gz lwn-9e0b2cfd72583db7ad50e3e73958926fb65e0557.zip |
Revert d_count back to an atomic_t
This patch reverts the portion of Nick's vfs scalability patch that
converts the dentry d_count from an atomic_t to an int protected by
the d_lock.
This greatly improves vfs scalability with the -rt kernel, as
the extra lock contention on the d_lock hurts very badly when
CONFIG_PREEMPT_RT is enabled and the spinlocks become rtmutexes.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dcache.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a522454180f6..39872ea86c6a 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -96,7 +96,7 @@ struct dentry { * * XXX: d_sb for revalidate needs to be duplicated into a d_flag. */ - unsigned int d_count; /* protected by d_lock */ + atomic_t d_count; unsigned int d_flags; /* protected by d_lock */ spinlock_t d_lock; /* per dentry lock */ seqcount_t d_seq; /* per dentry seqlock */ @@ -329,16 +329,14 @@ extern char *dentry_path(struct dentry *, char *, int); static inline struct dentry *dget_dlock(struct dentry *dentry) { if (dentry) - dentry->d_count++; + atomic_inc(&dentry->d_count); return dentry; } static inline struct dentry *dget(struct dentry *dentry) { if (dentry) { - spin_lock(&dentry->d_lock); dget_dlock(dentry); - spin_unlock(&dentry->d_lock); } return dentry; } |