]> git.ipfire.org Git - thirdparty/linux.git/commit
perf/core: Speed up kexec shutdown by avoiding unnecessary cross CPU calls
authorJan H. Schönherr <jschoenh@amazon.de>
Tue, 13 Jan 2026 20:34:46 +0000 (21:34 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 13 Jan 2026 20:39:01 +0000 (21:39 +0100)
commiteebe6446ccb75ecb36cb145ab1cbc3db06cbc8d6
tree5dcb7050959e856bc0e6b1945c99251ed06b2d2c
parenta491c02c2770c9c2d02b96fad7e3a176d77bb737
perf/core: Speed up kexec shutdown by avoiding unnecessary cross CPU calls

There are typically a lot of PMUs registered, but in many cases only few
of them have an event registered (like the "cpu" PMU in the presence of
the watchdog). As the mutex is already held, it's safe to just check for
existing events before doing the cross CPU call.

This change saves tens of milliseconds from kexec time (perceived as
steal time during a hypervisor host update), with <2ms remaining for
this step in the shutdown. There might be additional potential for
parallelization or we could just disable performance monitoring during
the actual shutdown and be less graceful about it.

Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
kernel/events/core.c