]> git.baikalelectronics.ru Git - kernel.git/commit
SELinux: tune avtab to reduce memory usage
authorYuichi Nakamura <ynakam@hitachisoft.jp>
Fri, 24 Aug 2007 02:55:11 +0000 (11:55 +0900)
committerJames Morris <jmorris@namei.org>
Tue, 16 Oct 2007 22:59:30 +0000 (08:59 +1000)
commitb2fc84ad7f22d4692385c0ae513608bb988d13e4
treeb369f8dc55e9d27bbd0b8b4b6843c0736d61b005
parentca187211755729a1905b3bb8ca1368aaddca2734
SELinux: tune avtab to reduce memory usage

This patch reduces memory usage of SELinux by tuning avtab. Number of hash
slots in avtab was 32768. Unused slots used memory when number of rules is
fewer. This patch decides number of hash slots dynamically based on number
of rules. (chain length)^2 is also printed out in avtab_hash_eval to see
standard deviation of avtab hash table.

Signed-off-by: Yuichi Nakamura<ynakam@hitachisoft.jp>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/avtab.c
security/selinux/ss/avtab.h
security/selinux/ss/conditional.c
security/selinux/ss/policydb.c