Re: [PATCH V7] irq: Track the interrupt timings
From: Thomas Gleixner
Date: Thu Jun 23 2016 - 04:44:13 EST
On Fri, 17 Jun 2016, Daniel Lezcano wrote:
> The interrupt framework gives a lot of information about each interrupt.
>
> It does not keep track of when those interrupts occur though.
>
> This patch provides a mean to record the elapsed time between successive
> interrupt occurrences in a per-IRQ per-CPU circular buffer to help with the
> prediction of the next occurrence using a statistical model.
>
> A new function is added to browse the different interrupts and retrieve the
> timing information stored in it.
>
> A static key is introduced so when the irq prediction is switched off at
> runtime, we can reduce the overhead near to zero. The irq timings is
> supposed to be potentially used by different sub-systems and for this reason
> the static key is a ref counter, so when the last use releases the irq
> timings that will result on the effective deactivation of the irq measurement.
Before merging this I really have to ask a few more questions. I'm a bit
worried about the usage site of this. It's going to iterate over all
interrupts in the system to do a next interrupt prediction. On larger machines
that's going to be quite some work and you touch a gazillion of cache lines
and many of them just to figure out that nothing happened.
Is it really required to do this per interrupt rather than providing per cpu
statistics of interrupts which arrived in the last X seconds or whatever
timeframe is relevant for this.
Thanks,
tglx