diff options
| author | Ayush Mittal <[email protected]> | 2019-02-06 04:55:42 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2019-02-08 11:57:32 +0000 |
| commit | 26e28d68b146ec17ecc1b1833077bc712de19637 (patch) | |
| tree | 80cbc5a23bfefac2591b31c10b2e4c82a6767020 /fs/kernfs/kernfs-internal.h | |
| parent | sysfs: remove unused include of kernfs-internal.h (diff) | |
| download | kernel-26e28d68b146ec17ecc1b1833077bc712de19637.tar.gz kernel-26e28d68b146ec17ecc1b1833077bc712de19637.zip | |
kernfs: Allocating memory for kernfs_iattrs with kmem_cache.
Creating a new cache for kernfs_iattrs.
Currently, memory is allocated with kzalloc() which
always gives aligned memory. On ARM, this is 64 byte aligned.
To avoid the wastage of memory in aligning the size requested,
a new cache for kernfs_iattrs is created.
Size of struct kernfs_iattrs is 80 Bytes.
On ARM, it will come in kmalloc-128 slab.
and it will come in kmalloc-192 slab if debug info is enabled.
Extra bytes taken 48 bytes.
Total number of objects created : 4096
Total saving = 48*4096 = 192 KB
After creating new slab(When debug info is enabled) :
sh-3.2# cat /proc/slabinfo
...
kernfs_iattrs_cache 4069 4096 128 32 1 : tunables 0 0 0 : slabdata 128 128 0
...
All testing has been done on ARM target.
Signed-off-by: Ayush Mittal <[email protected]>
Signed-off-by: Vaneet Narang <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
| -rw-r--r-- | fs/kernfs/kernfs-internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h index 3d83b114bb08..dba810cd83b1 100644 --- a/fs/kernfs/kernfs-internal.h +++ b/fs/kernfs/kernfs-internal.h @@ -78,7 +78,7 @@ static inline struct kernfs_node *kernfs_dentry_node(struct dentry *dentry) } extern const struct super_operations kernfs_sops; -extern struct kmem_cache *kernfs_node_cache; +extern struct kmem_cache *kernfs_node_cache, *kernfs_iattrs_cache; /* * inode.c |
