Re: interrupt latency ?

Richard B. Johnson (root@chaos.analogic.com)
Mon, 10 Feb 2003 11:20:54 -0500 (EST)


On Mon, 10 Feb 2003, [iso-8859-1] Jörn Engel wrote:

> On Mon, 10 February 2003 09:58:46 -0500, Dan Parks wrote:
> >
> > Do you happen to have a program (or kernel module...) that times these
> > latencies? I've been trying to generate statistics about these kinds of
> > latencies, and have yet to be happy with any of my tests.
>
> That should be impossible to do. :)
>
> Write a simple handler for parport or so, that is called when line #1
> toggles from low to high and responds by pulling line #2 from low to
> high.
> Now hook up a signal generator and an oszilloscope and measure the
> time from signal generation to the physical reaction.
>
> This way you get all the latency, not just the small amount you can
> measure inside the kernel.
>
> Jörn
>

Yes, and you will find that you can replicate a square-wave, through
the hardware and software up to about 50 kHz with a 400 MHz Pentium
if you disconnect your network during the tests.

My tests, several years ago, in the ISR simply XOR-ed a saved
copy of bit zero with `1` to toggle it and wrote it out the
data port. This would occur at every IRQ7, generated by hitting
bit 2 of the control port with a function generator. This should
produce a symmetrical /2 when you look at bit 0. You can line up
the starting 'high' of the function generator, with either a high or
low of bit one (because it's /2) and measure the time, which from
my notebook looks like 1.2 to 1.4 microseconds on a 400MHz machine.

You can increase the interrupt rate until the machine is no longer
able to keep up. This usually occurs around 110 kHz or higher.

If you modify whatever Ethernet driver you are using to remove the
loop in its ISR, you can get good results with the network connected.
However, you will have poor results with any network driver that
contains a loop in its ISR.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.

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