diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-10-31 20:01:08 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-31 20:01:08 -0800 |
| commit | 55ad55f101bab05e2b2e474ed0df1aa41d60e9e9 (patch) | |
| tree | c7c85c8a1af4ef0d848662494bf04740584f3887 /include/linux | |
| parent | 2ee50b65e1000c7b2cda3ec8a6092c174dec3343 (diff) | |
[PATCH] improved space efficiency in dcache
Currently we are storing filenames which are 16-chars or less
inside struct dentry itself and then separately allocating
larger names.
But this leaves spare space in the dentry - the dentry slab cache
is using cacheline alignment. In my build, struct dentry is 112
bytes so there are at least an additional 16 bytes in there.
And the number of files which have names in the 16-32 char range
will be significant.
So Manfred's patch changes the dcache code to utilise _all_ the space
between the last member of the dentry and the start of the next cacheline.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dcache.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 76a5085043e1..a4ea79e81e45 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -64,7 +64,7 @@ static __inline__ unsigned int full_name_hash(const unsigned char * name, unsign return end_name_hash(hash); } -#define DNAME_INLINE_LEN 16 +#define DNAME_INLINE_LEN_MIN 16 struct dcookie_struct; @@ -85,10 +85,12 @@ struct dentry { struct super_block * d_sb; /* The root of the dentry tree */ unsigned long d_vfs_flags; void * d_fsdata; /* fs-specific data */ - unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ struct dcookie_struct * d_cookie; /* cookie, if any */ -}; + unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ +} ____cacheline_aligned; +#define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname)) + struct dentry_operations { int (*d_revalidate)(struct dentry *, int); int (*d_hash) (struct dentry *, struct qstr *); |
