diff options
| author | Breno Leitao <leitao@debian.org> | 2026-09-15 03:51:05 -0700 |
|---|---|---|
| committer | Catalin Marinas <catalin.marinas@arm.com> | 2026-10-02 19:02:51 +0100 |
| commit | d6ae12c900f28d5ae79599947c77b2079e1f55ae (patch) | |
| tree | 89d6f9485f064cc77631f9323346444a8818abb5 /tools/perf/scripts/python/flamegraph.py | |
| parent | f73411ae5be68b19a36a4ddc0e4e9a399c18f7fa (diff) | |
arm64/sve: Don't zero the SVE state buffer when the SVE state is live
Currently do_sve_acc() always zeroes current->thread.sve_state. This is
not necessary in the common case, and avoiding the zeroing has a
measurable impact on some benchmarks.
In the common case where the task is not preempted and its state is not
altered by a tracer, do_sve_acc() will observe that TIF_FOREIGN_FPSTATE
is clear. In such cases, only the live register values matter, and the
in-memory copy is stale regardless of whether it is saved in
FP_STATE_FPSIMD format or FP_STATE_SVE format.
It is worth skipping the zeroing because the SVE state is discarded on
syscall entry, so userspace that mixes SVE and syscalls re-traps
constantly. A fleet profile of arm64 hosts running services whose
memset() is SVE shows the memset under do_sve_acc() accounting for 29%
of the trap handling cost.
Measured on a 72-core Neoverse V2 (SVE VL 128, sve_state_size 546,
performance governor) with perf bench sched pipe pinned to one CPU, and
SVE operation on write, so that each loop also takes an SVE access trap.
* -0.99% kernel instructions
* -1.38% kernel cycles
* -1.12% wall clock
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Mark Rutlame <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions
