Subject: Re: measuring interrupt latency etc.
To: Michael L. Hitch <osymh@terra.oscs.montana.edu>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 05/05/2000 21:40:51
On Wed, May 03, 2000 at 11:21:14AM -0600, Michael L. Hitch wrote:
> On Wed, 3 May 2000, Wolfgang Solfrank wrote:
> 
> > > > Actually, I'm pretty sure mi_switch() is supposed to be called at
> > > > splstatclock().
> 
>   It looks to me like it's called at splhigh() from tsleep().
> 
> > Hmm, just guessing here, but are you sure that the stack backtrace is
> > correct via the interrupt?  On some (most?) architectures getting the
> > backtrace right for those is not easy (to say the least).  Just a thought...
> 
>   I don't recall the 68k stack backtrace process at the moment, but if
> it's using the framepointer information, mi_switch() looks like it would
> be the last 'frame' prior to the interrupt.  In the 3 68k ports I looked
> at (hp300, amiga, atari), cpu_switch() is defined in locore.s and does
> not use the framepointer on entry.  If cpu_switch() doesn't find a
> runnable process, it jumps to the idle routine, which executes a stop
> instruction with PSL_LOWIPL - which is where I would expect the interrupt
> to occur.

This seems to be correct. The interrupt stack frame contains a PC in _Idle.
So, unless I am completely wrong (or my debugging method is ;-), the problem
can't be a delayed interrupt... I'll advance to the next case, the pre-empted
interrupt handler.

PS: Many thanks for the helpful responses! They might save some hair ;-)

Leo.