From: "rae l" <crquan@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: It's time to hack on dentry_stat?
Date: Wed, 7 May 2008 22:26:58 +0800 [thread overview]
Message-ID: <91b13c310805070726k7eb1384ex7d557b5dca4b567@mail.gmail.com> (raw)
I have noticed that struct dentry_stat_t dentry_stat is a struct with
six fields,
but only 2 of them are used, other 4 have never been used since v2.6.11,
from include/linux/dcache.h:
struct dentry_stat_t {
int nr_dentry;
int nr_unused;
int age_limit; /* age in seconds */
int want_pages; /* pages requested by system */
int dummy[2];
};
extern struct dentry_stat_t dentry_stat;
(I don't know things before v2.6.11, my local linux-2.6.git repository
can only grep to v2.6.11)
$ PAGER= git grep -w -e dentry_stat
Documentation/sysctl/fs.txt:} dentry_stat = {0, 0, 45, 0,};
fs/dcache.c:struct dentry_stat_t dentry_stat = {
fs/dcache.c: * no dcache_lock, please. The caller must decrement
dentry_stat.nr_dentry
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_dentry--; /* For d_free, below */
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: dentry_stat.nr_unused--;
fs/dcache.c: dentry_stat.nr_dentry -= detached;
fs/dcache.c: dentry_stat.nr_unused++;
fs/dcache.c: return (dentry_stat.nr_unused / 100) *
sysctl_vfs_cache_pressure;
fs/dcache.c: dentry_stat.nr_dentry++;
include/linux/dcache.h:extern struct dentry_stat_t dentry_stat;
kernel/sysctl.c: .data = &dentry_stat,
it's the same as that of v2.6.11:
$ PAGER= git grep -w -e dentry_stat v2.6.11 --
v2.6.11:Documentation/sysctl/fs.txt:} dentry_stat = {0, 0, 45, 0,};
v2.6.11:fs/dcache.c:struct dentry_stat_t dentry_stat = {
v2.6.11:fs/dcache.c: * no dcache_lock, please. The caller must
decrement dentry_stat.nr_dentry
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry--; /* For
d_free, below */
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry--; /* For d_free, below */
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused--;
v2.6.11:fs/dcache.c: dentry_stat.nr_unused++;
v2.6.11:fs/dcache.c: return (dentry_stat.nr_unused / 100) *
sysctl_vfs_cache_pressure;
v2.6.11:fs/dcache.c: dentry_stat.nr_dentry++;
v2.6.11:include/linux/dcache.h:extern struct dentry_stat_t dentry_stat;
v2.6.11:kernel/sysctl.c: .data = &dentry_stat,
So I think that struct is outdated and can be simplified.
--
Cheng
next reply other threads:[~2008-05-07 14:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-07 14:26 rae l [this message]
2008-05-07 14:51 ` It's time to hack on dentry_stat? Matthew Wilcox
2008-05-07 15:06 ` rae l
2008-05-07 15:08 ` Ray Lee
2008-05-07 15:25 ` Matthew Wilcox
2008-05-07 16:10 ` Ray Lee
2008-05-07 16:32 ` rae l
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=91b13c310805070726k7eb1384ex7d557b5dca4b567@mail.gmail.com \
--to=crquan@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox