summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 15:38:26 -0800
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 17:32:39 +0200
commitc2a70ba1f43bdf30f35479cf0e641136d5f979e7 (patch)
tree573ef711eeaf6ff492fd50ddbf7acb6d6e426775
parentb5acee084dabd0916f73c65a42fd25e94bc3cd21 (diff)
downloadlwn-c2a70ba1f43bdf30f35479cf0e641136d5f979e7.tar.gz
lwn-c2a70ba1f43bdf30f35479cf0e641136d5f979e7.zip
dcache-percpu-nr_dentry
The nr_dentry stat is a globally touched cacheline and atomic operation twice over the lifetime of a dentry. It is used for the benfit of userspace only. We could make a per-cpu counter or something for it, but it is only accessed via proc, so we could use slab stats. XXX: must implement slab routines to return stats for a single cache, and implement the proc handler. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--fs/dcache.c5
-rw-r--r--include/linux/dcache.h2
2 files changed, 2 insertions, 5 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index c992c5aed5d1..eb74151b22e3 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -90,7 +90,7 @@ static struct dcache_hash_bucket *dentry_hashtable __read_mostly;
/* Statistics gathering. */
struct dentry_stat_t dentry_stat = {
- .nr_dentry = ATOMIC_INIT(0),
+ .nr_dentry = 0,
.age_limit = 45,
};
@@ -121,7 +121,6 @@ static void d_callback(struct rcu_head *head)
*/
static void d_free(struct dentry *dentry)
{
- atomic_dec(&dentry_stat.nr_dentry);
BUG_ON(dentry->d_count);
if (dentry->d_op && dentry->d_op->d_release)
dentry->d_op->d_release(dentry);
@@ -1211,8 +1210,6 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
spin_unlock(&parent->d_lock);
}
- atomic_inc(&dentry_stat.nr_dentry);
-
return dentry;
}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 1ca2e7fb7a86..efdeb3582a17 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -37,7 +37,7 @@ struct qstr {
};
struct dentry_stat_t {
- atomic_t nr_dentry;
+ int nr_dentry; /* unused */
int nr_unused; /* protected by dcache_lru_lock */
int age_limit; /* age in seconds */
int want_pages; /* pages requested by system */