xxxxx@hollistech.com said:
The numbers cited 6us vs 60us on identical dual boot hardware are
silly. One has to wonder exactly what NT could be doing between the
interrupt assertion and the isr that would account for an order of
magnitude difference. Without some explanation I have to consider this
to be a measuring error rather than anything real.
xxxxx@pmatrix.com said:
Seems like there could indeed be many things that could account for a
difference. I’m not an expert on the fine details of the Linux kernel,
but some possibilities are:
Depending on how interrupts are handled in an operating system, there
may even be an entire context switch. Linux avoids dumping things like
FP registers unless a process is suspended, for example (no FP in the
kernel).
I can easily imagine excessive ISR dispatching “cleverness” causing an
unreasonably long code path between IRQ and the device driver’s ISR.
I tried to measure the situation as carefully as I could. I used an
oscilloscope to measure the times that the INTA# signal was active so
there was no chance of timer sampling error. I also put the register write
that cleared the IRQ in the beginning of the ISR (*not* the DPC) in both
NT and Linux. Then I set the device generating interrupts.
The measurement was from the falling edge of INTA# (the scope trigger)
to the rising edge. The interrupts were generated continuously, and I
got a nice clean trace on the scope. The performance was very regular,
with little jitter in the position of the rising edge (clearing) of the
INTA# signal.
The difference was really quite shocking, and it was pretty obvious in
the macroscopic scale–file transfers from the board really did seem
much slower under NT. I since redesigned the communication process to
depend much less on interrupts and use shared memory instead. The device
has an embedded i960 and can DMA to host memory, so I redesigned the
protocol with the host driver to use huge shared buffers and generate
fewer interrupts.
You really want to avoid interrupts when designing hardware for NT.
Now I have not repeated the measurement with W2K or Linux 2.2, so the
gulf may have since closed a bit, but…
Anyhow, that’s my experience. Learn from it or laugh at the fact that
I had to learn it the hard way:-)
Steve Williams “The woods are lovely, dark and deep.
xxxxx@icarus.com But I have promises to keep,
xxxxx@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep.”