From: David Chinner <dgc@sgi.com>
To: Jan Blunck <jblunck@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
viro@zeniv.linux.org.uk, dgc@sgi.com
Subject: Re: [patch 4/5] vfs: per superblock dentry stats
Date: Mon, 29 May 2006 12:24:01 +1000 [thread overview]
Message-ID: <20060529022401.GT8069029@melbourne.sgi.com> (raw)
In-Reply-To: <20060526110802.852609000@suse.de>
On Fri, May 26, 2006 at 01:06:59PM +0200, Jan Blunck wrote:
> Index: work-2.6/fs/super.c
> ===================================================================
> --- work-2.6.orig/fs/super.c
> +++ work-2.6/fs/super.c
> @@ -71,6 +71,9 @@ static struct super_block *alloc_super(v
> INIT_LIST_HEAD(&s->s_instances);
> INIT_HLIST_HEAD(&s->s_anon);
> INIT_LIST_HEAD(&s->s_inodes);
> + s->s_dentry_stat.nr_dentry = 0;
> + s->s_dentry_stat.nr_unused = 0;
No need for these as the superblock is memset to zero....
> -struct dentry_stat_t {
> +struct dentry_stat {
> int nr_dentry;
> int nr_unused;
> - int age_limit; /* age in seconds */
> - int want_pages; /* pages requested by system */
> - int dummy[2];
> + int age_limit; /* age in seconds */
> };
that changes the size of the structure from 6*sizeof(int) to
3*sizeof(int)....
> -extern struct dentry_stat_t dentry_stat;
> +extern struct dentry_stat global_dentry_stat;
> +
> +#define dentry_stat_inc(sb, x) \
> +do { \
> + global_dentry_stat.x++; \
> + if (sb) \
> + (sb)->s_dentry_stat.x++;\
> +} while(0)
> +
> +#define dentry_stat_dec(sb, x) \
> +do { \
> + global_dentry_stat.x--; \
> + if (sb) \
> + (sb)->s_dentry_stat.x--;\
> +} while(0)
if (likely(sb)) ???
> Index: work-2.6/kernel/sysctl.c
> ===================================================================
> --- work-2.6.orig/kernel/sysctl.c
> +++ work-2.6/kernel/sysctl.c
> @@ -958,7 +958,7 @@ static ctl_table fs_table[] = {
> {
> .ctl_name = FS_DENTRY,
> .procname = "dentry-state",
> - .data = &dentry_stat,
> + .data = &global_dentry_stat,
> .maxlen = 6*sizeof(int),
With the above change, maxlen = 3*sizeof(int).
Given that's a userspace visible change, should the above structure
change use a "int dummy[3];" to keep the global structure and userspace
export the same?
Cheers,
Dave.
--
Dave Chinner
R&D Software Enginner
SGI Australian Software Group
next prev parent reply other threads:[~2006-05-29 2:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060526110655.197949000@suse.de>
2006-05-29 1:57 ` [patch 0/5] [RFC] vfs: per-superblock unused dentries list David Chinner
[not found] ` <20060526110802.852609000@suse.de>
2006-05-29 2:24 ` David Chinner [this message]
2006-05-29 9:43 ` [patch 4/5] vfs: per superblock dentry stats Jan Blunck
[not found] ` <20060526110803.159085000@suse.de>
2006-05-29 3:08 ` [patch 5/5] vfs: per superblock dentry unused list David Chinner
2006-05-29 11:54 ` Jan Blunck
2006-05-30 0:04 ` David Chinner
2006-05-30 10:06 ` Jan Blunck
2006-05-30 23:56 ` David Chinner
2006-06-01 9:51 [patch 0/5] [PATCH,RFC] vfs: per-superblock unused dentries list (2nd version) jblunck
2006-06-01 9:51 ` [patch 4/5] vfs: per superblock dentry stats jblunck
-- strict thread matches above, loose matches on Subject: below --
2006-06-16 10:43 [PATCH 0/5] vfs: per-superblock unused dentries list (3rd version) jblunck
2006-06-16 10:43 ` [PATCH 4/5] vfs: per superblock dentry stats jblunck
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=20060529022401.GT8069029@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=jblunck@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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