All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] avtab hotspot optimizations
@ 2023-09-06 15:46 Jacob Satterfield
  2023-09-06 15:46 ` [PATCH 1/3] selinux: use arrays for avtab hashtable nodes Jacob Satterfield
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jacob Satterfield @ 2023-09-06 15:46 UTC (permalink / raw)
  To: selinux; +Cc: Jacob Satterfield, stephen.smalley.work, paul, omosnace

As the refpolicy and the default Fedora policy continue to grow in
size, especially with regard to rules / access vectors, the memory
usage of the policydb and runtime to search through it increases.
Looking at /proc/slabinfo indicates that the avtab_node_cachep
kmem_cache is significantly responsible for overall memory usage and
was a good target for optimizations. Running "perf record" on the
"load_policy" command shows that a majority of time is spent adding
rules into the avtab.

This patch series is a first attempt at optimizing these hot spots
within the security server implementation to help it scale with 
additional rules in the future.

Patches 1-2 deal specifically with the hashtable implementation within
avtab and how memory is allocated for individual nodes.

Patch 3 is a runtime optimization discovered through profiling the
"load_policy".

Jacob Satterfield (3):
  selinux: use arrays for avtab hashtable nodes
  selinux: shrink conditional avtab node array
  selinux: hweight optimization in avtab_read_item

 security/selinux/ss/avtab.c       | 143 ++++++++++++++++++------------
 security/selinux/ss/avtab.h       |  36 ++++++--
 security/selinux/ss/conditional.c |  57 +++++++-----
 security/selinux/ss/conditional.h |   2 +-
 security/selinux/ss/services.c    |  20 +++--
 5 files changed, 166 insertions(+), 92 deletions(-)

-- 
2.41.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-09-18  0:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 15:46 [PATCH 0/3] avtab hotspot optimizations Jacob Satterfield
2023-09-06 15:46 ` [PATCH 1/3] selinux: use arrays for avtab hashtable nodes Jacob Satterfield
2023-09-06 17:16   ` Stephen Smalley
2023-09-13  3:23   ` Paul Moore
2023-09-14 21:57     ` Jacob Satterfield
2023-09-15  1:10       ` Paul Moore
2023-09-18  0:12         ` Jacob Satterfield
2023-09-06 15:46 ` [PATCH 2/3] selinux: shrink conditional avtab node array Jacob Satterfield
2023-09-06 17:17   ` Stephen Smalley
2023-09-06 15:46 ` [PATCH 3/3] selinux: hweight optimization in avtab_read_item Jacob Satterfield
2023-09-06 17:18   ` Stephen Smalley
2023-09-13 17:54   ` Paul Moore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.