Skip to contentSkip to conversation

interrupt latency

DISCUSSION Mark Hapke 2 participants 4 messages Jul 19, 2002 – Jul 22, 2002

lore
Share & tools
lore

Mark Hapke

author
#0 lore raw

Hello,

I need the information about the time consumed when an interrupt occurs. Especially interesting is the time it takes from where the interrupt is generated (the device) until such time as the interrupt is reported to the cpu.
Second, I need to know the elapsed time from that point until the isr is entered.

On linuxdevices.com there is an article "Linux Scheduler Latency" by Clark Williams in which a comment by Ingo Molnar is quoted saying that the elapsed time takes 10 microseconds. Is that correct? Is there maybe any other source of information, someone could point me to?

BTW, i refer to the intel platform.

Thanks,
Mark

#1 lore raw
Quoted 6 lines · Mark Hapke

On linuxdevices.com there is an article "Linux Scheduler Latency" by Clark Williams in which a comment by Ingo Molnar is quoted saying that the elapsed time takes 10 microseconds. Is that correct? Is there maybe any other source of information, someone could point me to?

BTW, i refer to the intel platform.

You need a fast timer that sees the IRQ raise and is read in the IRQ handler to measure it easily. Be aware that the apic bus is message based so the apic worst case times on PIII at least are an order of magnitude above average. Furthermore on a PC your instruction fetch for the first instruction of the IRQ handler might end up triggering ITLB, DTLB fetches which in turn have to fetch a page directory and a page table each from main memory and then an additional line fetched for the code itself.

If you think that is getting complicated each of the memory accesses may in turn collide with other bus traffic (invalidates, memory writes by other masters or processors) and so forth.

Your processor might be running at varying speeds (including thermal events).

Finally your processor may be stalled on a PCI space access when the IRQ arrives. That on some badly behaved graphics cards can push your IRQ response up near the millisecond level.

You need to define your entire system very carefully before you can answer the question for PC class systems.

author
#2 lore raw

Hello,
thanks for your answer!

I am aware of the fact that this issue depends completely on the equipment used, as well on the load of the concerned bus systems etc. I actually need some information of that sort to mention in my diploma thesis, so I don't have to really quantify the microsconds consumed, although the points listed below are still interesting.
It is not so important, whether the latency is about 10 microseconds or 11, I only need some approximation and I appreciate any hint.

Thanks,
Mark

Quoted 22 lines

You need a fast timer that sees the IRQ raise and is read in the IRQ handler to measure it easily. Be aware that the apic bus is message based so the apic worst case times on PIII at least are an order of magnitude above average. Furthermore on a PC your instruction fetch for the first instruction of the IRQ handler might end up triggering ITLB, DTLB fetches which in turn have to fetch a page directory and a page table each from main memory and then an additional line fetched for the code itself.

If you think that is getting complicated each of the memory accesses may in turn collide with other bus traffic (invalidates, memory writes by other masters or processors) and so forth.

Your processor might be running at varying speeds (including thermal events).

Finally your processor may be stalled on a PCI space access when the IRQ arrives. That on some badly behaved graphics cards can push your IRQ response up near the millisecond level.

You need to define your entire system very carefully before you can answer the question for PC class systems.

#3 lore raw
Quoted 2 lines · Mark Hapke

It is not so important, whether the latency is about 10 microseconds or 11, I only need some approximation and I appreciate any hint.

Read what I said. For a PC class machine its anything between a few useconds and in theory several milliseconds (consider the case where each cache line evicted to get the tlb/code for the irq handler is a writeback to a write gathering mtrr pci space.

So it varies by three orders of magnitude depending on all sorts of stuff