Re: [PATCH v2 1/1] alpha/perf: Account for time spent handling PMU interrupts
From: Matt Turner
Date: Tue Nov 10 2026 - 18:06:19 EST
On Tue, Nov 10, 2026 at 2:31 PM Magnus Lindholm <linmag7@xxxxxxxxx> wrote:
> Alpha does not report PMU interrupt duration to perf, preventing its
> adaptive throttling from reducing an excessively costly sampling rate.
> Short sampling periods can leave the machine unresponsive with RCU
> grace-period kthread starvation reports.
[snip]
> #include <asm/hwrpb.h>
> +#include <asm/timex.h>
<linux/timex.h> is the usual include for get_cycles(), though it makes
no practical difference here.
[snip]
> @@ -862,11 +869,28 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
>
>
>
> +/* sched_clock() is tick-based on Alpha; measure a short same-CPU interval. */
> +static void alpha_perf_event_irq_handler(unsigned long la_ptr,
> + struct pt_regs *regs)
Since you're touching this spot anyway, you could drop two of the three
blank lines above the new function.
Neither of these needs a respin. If you end up sending a v3 for some
other reason, feel free to fold them in.
The mult/shift version looks good. cycles_t is 32 bits, so the
subtraction is fine across a wrap, and init_hw_perf_events() runs well
after time_init() has settled est_cycle_freq. I built it here with W=1
and got no warnings, and the handler has no divide in it.
Thanks!