From: Anton Blanchard <anton@samba.org>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, jrsantos@austin.ibm.com
Subject: [PATCH] reduce size of struct dentry on 64bit
Date: Mon, 16 Aug 2004 07:45:47 +1000 [thread overview]
Message-ID: <20040815214547.GJ5637@krispykreme> (raw)
Reduce size of struct dentry from 248 to 232 bytes on 64bit.
- Reduce size of qstr by 8 bytes, placing int hash and int len together.
We gain a further 4 byte saving when qstr is used in struct dentry
since qstr goes from 24 to 16 bytes and the next member (d_lru)
requires 8 byte alignment (which means 4 bytes of padding).
- Move d_mounted to the end, since char d_iname[] only requires 1 byte
alignment. This reduces struct dentry by another 4 bytes.
With these changes the number of objects we can fit into a 4kB slab
goes from 16 to 17 on ppc64.
Note the above assumes the architecture naturally aligns types.
Signed-off-by: Anton Blanchard <anton@samba.org>
diff -puN include/linux/dcache.h~optimize_structs include/linux/dcache.h
--- gr_work/include/linux/dcache.h~optimize_structs 2004-08-14 10:51:08.700491559 -0500
+++ gr_work-anton/include/linux/dcache.h 2004-08-14 10:51:08.718488705 -0500
@@ -33,8 +33,8 @@ struct vfsmount;
*/
struct qstr {
unsigned int hash;
- const unsigned char *name;
unsigned int len;
+ const unsigned char *name;
};
struct dentry_stat_t {
@@ -101,11 +101,11 @@ struct dentry {
unsigned long d_time; /* used by d_revalidate */
struct dentry_operations *d_op;
struct super_block *d_sb; /* The root of the dentry tree */
- int d_mounted;
void *d_fsdata; /* fs-specific data */
struct rcu_head d_rcu;
struct dcookie_struct *d_cookie; /* cookie, if any */
struct hlist_node d_hash; /* lookup hash list */
+ int d_mounted;
unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */
};
reply other threads:[~2004-08-15 21:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040815214547.GJ5637@krispykreme \
--to=anton@samba.org \
--cc=akpm@osdl.org \
--cc=jrsantos@austin.ibm.com \
--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