X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=fs%2Ffile_table.c;h=bbeeac6efa1a85eca90bd59e85c620022502f3d7;hb=1d889d9958490888b3fad1d486145d9a03559cbc;hp=0fbcacc3ea754a01e92e2529f7955ea1fcf08c13;hpb=541ef5cbb8e68189d47272cea52a69abc30259bc;p=linux-2.6-omap-h63xx.git diff --git a/fs/file_table.c b/fs/file_table.c index 0fbcacc3ea7..bbeeac6efa1 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -32,6 +32,9 @@ struct files_stat_struct files_stat = { /* public. Not pretty! */ __cacheline_aligned_in_smp DEFINE_SPINLOCK(files_lock); +/* SLAB cache for file structures */ +static struct kmem_cache *filp_cachep __read_mostly; + static struct percpu_counter nr_files __cacheline_aligned_in_smp; static inline void file_free_rcu(struct rcu_head *head) @@ -397,7 +400,12 @@ too_bad: void __init files_init(unsigned long mempages) { int n; - /* One file with associated inode and dcache is very roughly 1K. + + filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0, + SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); + + /* + * One file with associated inode and dcache is very roughly 1K. * Per default don't use more than 10% of our memory for files. */