Re: [PATCH v3 3/3] selinux: complete the inlining of hashtab functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 8, 2020 at 7:24 AM Ondrej Mosnacek <omosnace@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>

Acked-by: Stephen Smalley <stephen.smalley.work@xxxxxxxxx>



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux