Re: [PATCH] irq: add support for warning on long-running IRQ handlers

From: Peter Zijlstra
Date: Mon Jun 30 2025 - 09:29:05 EST


On Mon, Jun 30, 2025 at 02:46:44PM +0200, Wladislav Wiebe wrote:
> Introduce a new option CONFIG_IRQ_LATENCY_WARN that enables warnings when
> IRQ handlers take an unusually long time to execute.
>
> When triggered, the warning includes the CPU, IRQ number, handler address,
> name, and execution duration, for example:
>
> [CPU0] latency on IRQ[787:bad_irq_handler+0x1/0x34 [bad_irq]], took: 5 jiffies (~50 ms)
>
> To keep runtime overhead minimal, this implementation uses a jiffies-based
> timing mechanism. While coarse, it is sufficient to detect problematic IRQs.

local_clock() was found to be excessively expensive?