[PATCH] Reduce SELinux kernel memory use on 64-bit systems
The patch below reduces kernel memory used by SELinux policy rules by about
37% on 64-bit systems. This is because the size of struct avtab_node is 40
bytes on 64-bit, and defaults to a size-64 slab.
Creating a slab cache specifically for these structs saves considerable
amounts of kernel memory on 64-bit systems with large rulesets. 'Strict'
policy has over 300k rules, while 'targeted' policy has around 3k rules.
Here's the slabtop output with 64 and 40 byte sized slabs to show the
memory savings, for strict policy: