Subject: Re: measuring interrupt latency etc.
To: Leo Weppelman <leo@wau.mis.ah.nl>
From: Eduardo Horvath <eeh@turbolinux.com>
List: tech-kern
Date: 05/02/2000 09:06:20
On Tue, 2 May 2000, Leo Weppelman wrote:

> On port-atari, I seem to have a problem handling ISDN interrupts. I should
> handle them within 4ms and sometimes, that is condition is not met.
> Since 4ms is quite some time, even on a 64MHz 68060, I suspect that someone
> is blocking interrupts for a bit too long.
> 
> I was wondering if someone on this list has experience in tracking down these
> kinds of problems. I'd like to share ideas...

This sort of problem usually manifests itself in two ways.  Either there's
a critical section that blocks interrupts for too long, or there's a
higher level interrupt handler that takes too long.  

Detecting the cause for the first case is quite simple.  Test for the
delay in your interrupt handler and when you do break in to DDB.  The
interrupt should have occured just after the instruction that re-enabled
the interrupt, so all you need to do is find the appropriate trap frame
and figure out what instruction that is.  The problem code should
immediately precede that.

The second case is more complicated.  You need to instrument the interrupt
dispatch code to time each interrupt handler and break when it finds one
that took too long.

Finally, it may be an issue with acknowledging the interrupt to the H/W
properly.  That I can't easily help you with.

Eduardo Horvath