Commit 55ad55f1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent 2ee50b65
......@@ -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 *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment