Re: [RFC][PATCH] x86: Lazy disabling of interrupts

From: Ingo Molnar
Date: Thu Oct 10 2013 - 00:53:17 EST



* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> - That said, I think a software CLI/STI is somewhat useful for
> profiling, as it can allow to measure how long interrupts are delayed by
> CLI/STI. [...]

That could be measured directly in a simpler way, without disrupting
CLI/STI: by turning all IRQs into NMIs and resending them from a special
NMI handler. (and of course timestamping the NMI arrival time and the IRQ
entry time so that instrumentation can recover it.)

If indirect, statistical measurement suffices then IRQ delivery latencies
can also be estimated statistically without any kernel changes: by
profiling IRQ disable/enable sections (there's a counter for that),
calculating average IRQ-disable section length from that. The average IRQ
delay will be 50% of that value, assuming normal distribution of IRQs.
This should be good enough for most cases.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/