summaryrefslogtreecommitdiff
path: root/security/selinux/ss/hashtab.h
diff options
context:
space:
mode:
authorKyeongdon Kim <kyeongdon.kim@lge.com>2017-09-06 12:50:19 +0300
committerPaul Moore <paul@paul-moore.com>2017-09-20 19:01:58 +0300
commit7c620ece125cbab7b5dfcb574ee1e64ab8b562cd (patch)
tree53535c964faebf8e3ced3151353c8577213a59cc /security/selinux/ss/hashtab.h
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
downloadlinux-7c620ece125cbab7b5dfcb574ee1e64ab8b562cd.tar.xz
selinux: Use kmem_cache for hashtab_node
During random test as own device to check slub account, we found some slack memory from hashtab_node(kmalloc-64). By using kzalloc(), middle of test result like below: allocated size 240768 request size 45144 slack size 195624 allocation count 3762 So, we want to use kmem_cache_zalloc() and that can reduce memory size 52byte(slack size/alloc count) per each struct. Signed-off-by: Kyeongdon Kim <kyeongdon.kim@lge.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss/hashtab.h')
-rw-r--r--security/selinux/ss/hashtab.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/security/selinux/ss/hashtab.h b/security/selinux/ss/hashtab.h
index 009fb5e06172..d6883d3e7c5b 100644
--- a/security/selinux/ss/hashtab.h
+++ b/security/selinux/ss/hashtab.h
@@ -84,4 +84,8 @@ int hashtab_map(struct hashtab *h,
/* Fill info with some hash table statistics */
void hashtab_stat(struct hashtab *h, struct hashtab_info *info);
+/* Use kmem_cache for hashtab_node */
+void hashtab_cache_init(void);
+void hashtab_cache_destroy(void);
+
#endif /* _SS_HASHTAB_H */