[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0d0393d0-d913-4595-86b2-59cbaf0dd076@nokia.com>
Date: Mon, 4 Aug 2025 11:47:34 +0200
From: Wladislav Wiebe <wladislav.wiebe@...ia.com>
To: Jiri Slaby <jirislaby@...nel.org>, tglx@...utronix.de, corbet@....net
Cc: akpm@...ux-foundation.org, paulmck@...nel.org, rostedt@...dmis.org,
Neeraj.Upadhyay@....com, david@...hat.com, bp@...en8.de, arnd@...db.de,
fvdl@...gle.com, linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
peterz@...radead.org
Subject: Re: [PATCH v4] genirq: add support for warning on long-running IRQ
handlers
On 31/07/2025 09:46, Jiri Slaby wrote:
>
>
> On 24. 07. 25, 17:50, Wladislav Wiebe wrote:
>> Introduce a mechanism to detect and warn about prolonged IRQ handlers.
>> With a new command-line parameter (irqhandler.duration_warn_us=),
>> users can configure the duration threshold in microseconds when a warning
>> in such format should be emitted:
>>
>> "[CPU14] long duration of IRQ[159:bad_irq_handler [long_irq]], took: 1330 us"
>>
>> The implementation uses local_clock() to measure the execution duration of the
>> generic IRQ per-CPU event handler.
>
>
> This version LGTM
>
> Reviewed-by: Jiri Slaby <jirislaby@...nel.org>
Thanks a lot!
>
>> --- a/kernel/irq/handle.c
>> +++ b/kernel/irq/handle.c
> ...
>> +static inline void irqhandler_duration_check(u64 ts_start, unsigned int irq,
>> + const struct irqaction *action)
>> +{
>> + u64 delta_ns = local_clock() - ts_start;
>> +
>> + if (unlikely(delta_ns > irqhandler_duration_threshold_ns)) {
>> + pr_warn_ratelimited("[CPU%u] long duration of IRQ[%u:%ps], took: %llu us\n",
>> + smp_processor_id(), irq, action->handler,
>> + delta_ns >> 10);
>
> Only that: would the division matter in here? Or print ns? But feel free
> to ignore this.
In principle one could think when the paramater interface is provided in microseconds,
the duration print might be in the same resolution - hmm.
However, for the division part I have no objection going with
precise devision as we are kind of no longer in the "fast-path", hence v5 prepared:
https://lore.kernel.org/lkml/20250804093525.851-1-wladislav.wiebe@nokia.com/
Thank you
- W.W.
Powered by blists - more mailing lists