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@xxxxxxxxxx> 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@xxxxxxxxx/ Thank you - W.W.