public inbox for audit@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] audit: Further reduce syscall latency
@ 2023-12-12 10:28 Håkon Bugge
  2023-12-12 10:28 ` [PATCH 1/2] audit: Vary struct audit_entry alignment Håkon Bugge
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Håkon Bugge @ 2023-12-12 10:28 UTC (permalink / raw)
  To: Paul Moore, Eric Paris, audit; +Cc: Ankur Arora

On an Intel Cascade Lake, booted with "audit=0" and "mitigations=off",
syscall latency in nanoseconds over 10 reboots and 5 runs is:

getpid() latency:
Boot parameters           kernel            min    avg     max      pstdev
                                           (ns)   (ns)    (ns)        (ns)

audit=0, mitigations=off  v6.6-rc4           55    55       58    0.797245
audit=1, mitigations=off  v6.6-rc4          205   210      227    6.402000
audit=1, mitigations=off  v6.6-rc4+[1]      203   203      209    0.954149
audit=1, mitigations=off  v6.6-rc4+[1]+[2]  173   173      178    0.884534

So, audit contributes significantly to the cost of a system call.

This series, hopefully applicable to audit/next (if accepted), reduces
the syscall latency by a decent 21% on an Intel Cascade Lake system.

The above numbers are derived using the same methodology as mentioned
in the commit messages.

The first commit, "audit: Vary struct audit_entry alignment", fixes a
huge L1D miss ratio and greatly reduces the variability on the three
metrics, nanoseconds per syscall, L1D misses per syscall, and
Instructions per Cycle (ipc). It does not greatly reduce on the
syscall latency, only a decent 3.5% reduction. But, it serves as a
pre-requisite for the second commit, "audit: Apply codegen
optimizations".

Please review.

Håkon Bugge (2):
[1] audit: Vary struct audit_entry alignment
[2] audit: Apply codegen optimizations

 kernel/auditfilter.c | 14 +++++++++++---
 kernel/auditsc.c     |  2 ++
 2 files changed, 13 insertions(+), 3 deletions(-)

--
2.39.3


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

end of thread, other threads:[~2023-12-22  4:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox