diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2020-07-09 21:19:52 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2020-07-09 19:08:16 -0400 |
commit | 54b27f9287a7b3dfc85549f01fc9d292c92c68b9 (patch) | |
tree | 199b02edb0cb7db79325043e7de30761a8ef8b78 /drivers/parisc/wax.c | |
parent | 24def7bb92c19337cee26d506f87dc4eeeba7a19 (diff) | |
download | linux-54b27f9287a7b3dfc85549f01fc9d292c92c68b9.tar.bz2 |
selinux: complete the inlining of hashtab functions
Move (most of) the definitions of hashtab_search() and hashtab_insert()
to the header file. In combination with the previous patch, this avoids
calling the callbacks indirectly by function pointers and allows for
better optimization, leading to a drastic performance improvement of
these operations.
With this patch, I measured a speed up in the following areas (measured
on x86_64 F32 VM with 4 CPUs):
1. Policy load (`load_policy`) - takes ~150 ms instead of ~230 ms.
2. `chcon -R unconfined_u:object_r:user_tmp_t:s0:c381,c519 /tmp/linux-src`
where /tmp/linux-src is an extracted linux-5.7 source tarball -
takes ~522 ms instead of ~576 ms. This is because of many
symtab_search() calls in string_to_context_struct() when there are
many categories specified in the context.
3. `stress-ng --msg 1 --msg-ops 10000000` - takes 12.41 s instead of
13.95 s (consumes 18.6 s of kernel CPU time instead of 21.6 s).
This is thanks to security_transition_sid() being ~43% faster after
this patch.
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'drivers/parisc/wax.c')
0 files changed, 0 insertions, 0 deletions