public inbox for audit@vger.kernel.org
 help / color / mirror / Atom feed
From: Haakon Bugge <haakon.bugge@oracle.com>
To: Haakon Bugge <haakon.bugge@oracle.com>
Cc: Paul Moore <paul@paul-moore.com>, Eric Paris <eparis@redhat.com>,
	"audit@vger.kernel.org" <audit@vger.kernel.org>,
	Ankur Arora <ankur.a.arora@oracle.com>
Subject: Re: [PATCH 2/2] audit: Apply special optimizations
Date: Tue, 12 Dec 2023 10:39:28 +0000	[thread overview]
Message-ID: <9CB090E7-F00D-4EA0-B44E-E9393D3D4402@oracle.com> (raw)
In-Reply-To: <20231212102857.803984-4-haakon.bugge@oracle.com>



> On 12 Dec 2023, at 11:28, Håkon Bugge <Haakon.Bugge@oracle.com> wrote:
> 
> For the most time-consuming function, when running a syscall benchmark
> with STIG compliant audit rules:
> 
>  Overhead  Command       Shared Object      Symbol
> .........  ............  .................  ........................
> 
>    27.62%  syscall_lat   [kernel.kallsyms]  [k] __audit_filter_op
> 
> we apply special optimizations, which speeds up the syscall
> performance by around 17% on an Intel Cascade Lake system.
> 
> We run "perf stat -d -r 5 ./syscall_lat", where syscall_lat is a C
> application that measures average syscall latency from getpid()
> running 100 million rounds.
> 
> Between each perf run, we reboot the system and waits until the last
> minute load is less than 1.0.
> 
> We boot the kernel, v6.6-rc4, with "mitigations=off", in order to
> amplify the changes in the audit system.
> 
> Let the base kernel be v6.6-rc4 with booted with "audit=1" and
> "mitigations=off" and with the commit "audit: Vary struct audit_entry
> alignment" on an Intel Cascade Lake system. The following three
> metrics are reported, nanoseconds per syscall, L1D misses per syscall,
> and finally Intructions Per Cycle, ipc.
> 
> Base vs. base + this commit gives:
> 
> ns per call:
>  min avg max   pstdev
> - 203 203 209 0.954149
> + 173 173 178 0.884534
> 
> L1d misses per syscall:
>     min    avg    max   pstdev
> -  0.012  0.103  0.817 0.238352
> +  0.010  0.209  1.235 0.399416
> 
> ipc:
>    min    avg    max   pstdev
> - 2.320  2.329  2.330 0.003000
> + 2.430  2.436  2.440 0.004899
> 
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>

Please disregard this message.


Thxs, Håkon

> ---
> kernel/auditsc.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/auditsc.c b/kernel/auditsc.c
> index 6f0d6fb6523fa..84d0dfe75a4ac 100644
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@ -822,6 +822,7 @@ static int audit_in_mask(const struct audit_krule *rule, unsigned long val)
>  * parameter can be NULL, but all others must be specified.
>  * Returns 1/true if the filter finds a match, 0/false if none are found.
>  */
> +#pragma GCC optimize("unswitch-loops", "align-loops=16", "align-jumps=16")
> static int __audit_filter_op(struct task_struct *tsk,
>   struct audit_context *ctx,
>   struct list_head *list,
> @@ -841,6 +842,7 @@ static int __audit_filter_op(struct task_struct *tsk,
> }
> return 0;
> }
> +#pragma GCC reset_options
> 
> /**
>  * audit_filter_uring - apply filters to an io_uring operation
> -- 
> 2.39.3
> 
> 


      reply	other threads:[~2023-12-12 10:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 10:28 [PATCH 0/2] audit: Further reduce syscall latency Håkon Bugge
2023-12-12 10:28 ` [PATCH 1/2] audit: Vary struct audit_entry alignment Håkon Bugge
2023-12-13 23:54   ` Paul Moore
2023-12-16 16:25     ` Haakon Bugge
2023-12-18 22:07       ` Paul Moore
2023-12-19 21:07         ` Ankur Arora
2023-12-19 21:27           ` Paul Moore
2023-12-12 10:28 ` [PATCH 2/2] audit: Apply codegen optimizations Håkon Bugge
2023-12-13 23:45   ` Paul Moore
2023-12-16 16:28     ` Haakon Bugge
2023-12-18 22:09       ` Paul Moore
2023-12-21 19:05         ` Haakon Bugge
2023-12-22  4:31           ` Paul Moore
2023-12-12 10:28 ` [PATCH 2/2] audit: Apply special optimizations Håkon Bugge
2023-12-12 10:39   ` Haakon Bugge [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9CB090E7-F00D-4EA0-B44E-E9393D3D4402@oracle.com \
    --to=haakon.bugge@oracle.com \
    --cc=ankur.a.arora@oracle.com \
    --cc=audit@vger.kernel.org \
    --cc=eparis@redhat.com \
    --cc=paul@paul-moore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox