Re: interrupt latency

Richard B. Johnson (root@chaos.analogic.com)
Mon, 10 Aug 1998 22:10:56 -0400 (EDT)


On Mon, 10 Aug 1998, Larry McVoy wrote:

> : >Are there and patches/utilities/anything to measure interrupt latency
> : >under linux ?
> :
> : The easiest way to measure interrupt latency is with a signal generator
> : and an oscilloscope. No software solution is likely to give good results.
>
> I reall wish this wasn't the case because I would dearly love to be able to
> have interrupt latency as a benchmark test in lmbench. Are you sure there
> is no way to do this in software? What if you had some way to generate
> interrupts essentially continuously?
>

With the Intel machines, you can. You can generate a software interrupt.
You have to make, perhaps, a dummy driver that operates in ring 0 (kernel
mode).

This device could acquire an interrupt (IRQ) from the kernel. It could
also generate a software interrupt for the IRQ number (they are not the
same). The device could measure the time from which it generated a
software interrupt to the time its ISR was called by the kernel.

This time would include all the software overhead, but not the hardware
overhead (which should be very, very much smaller than the software
overhead). The fact that the kernel will mask/ACK/unmask the hardware
controller(s) will not hurt the execution of the software interrupt.

Now, that said, since all interrupts are handled the same except for
the very small interval for the cascade, you could just review the
generated assembly and calculate the execution times which might
be simpler than writing the dummy driver. Nevertheless, if the driver
was ismod-ed, and you could talk to it via ioctls (some new device
in /dev), you could have a useful tool. It might not be useful for
very long because I doubt that you could remove much code or improve
upon the interrupt handling very much.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.115 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html