mbox series

[0/4] Inline some hashtab functions to improve performance

Message ID 20200428125514.2780171-1-omosnace@redhat.com (mailing list archive)
Headers show
Series Inline some hashtab functions to improve performance | expand

Message

Ondrej Mosnacek April 28, 2020, 12:55 p.m. UTC
Right now, hashtab_search(), hashtab_insert(), and hashtab_map() are
defined in hashtab.c and need to call functions indirectly. It turns
out that defining (the relevent parts of) these functions inline in the
header and passing the function pointers as arguments makes them
significantly faster (at least in the hashtab_search() case).

The first two patches in the series are two small simplifications that
are not directly related, but the rest won't apply without them. The
third patch then converts the hashtab interface to prepare for the
inlining and the last one finishes the job by just moving some of the
function definitions to the header. These could be also just one patch,
but are kept separate for easier review of changes in the functions
being moved around.

For more details, please refer to the respective patch descriptions.

Ondrej Mosnacek (4):
  selinux: simplify range_write()
  selinux: do not allocate hashtabs dynamically
  selinux: prepare for inlining of hashtab functions
  selinux: complete the inlining of hashtab functions

 security/selinux/ss/conditional.c |   4 +-
 security/selinux/ss/conditional.h |   2 +-
 security/selinux/ss/hashtab.c     | 112 ++-------------
 security/selinux/ss/hashtab.h     | 101 ++++++++++---
 security/selinux/ss/mls.c         |  23 +--
 security/selinux/ss/policydb.c    | 230 ++++++++++++++++--------------
 security/selinux/ss/policydb.h    |  15 +-
 security/selinux/ss/services.c    |  54 +++----
 security/selinux/ss/symtab.c      |  25 +++-
 security/selinux/ss/symtab.h      |   5 +-
 10 files changed, 294 insertions(+), 277 deletions(-)