Interrupt priority and latency

Paolo Mantegazza mantegazza at aero.polimi.it
Wed Dec 1 11:58:13 CET 2004


Ney Philippe wrote:
> Hi all,
> 
> Sorry for the last message I sent. It seems it was polluted
> with 64 base encoded characters. I hope this time my message
> is ok.
> 
> In my application, I send a square signal on the CTS pin of
> the COM port. A level interrupt is generated that I trap with
> a rtai module.
> 
> The interrupt handler ~copy~ the signal from the CTS pin to
> the DTR one.
> 
> I mesure the latency between the input and output signal.
> 
> This latency as a mean value of 10 musec but the max is much
> higher, say 75 to 90 musec.
> 
> I guess this is due to some interrupt handlers that are treated
> before my own.
> 
> With a ~cleaner~ kernel and in level 1 (no services, no gui),
> the problem doesn't occure.
> 
> I then suppose the problem could be due to :
> 
>     * i/o scheduler (for the IDE drive)
>     * ext3 journaling
>     * swap
>     * L2 cache flush
> 
> I will go further on discovering the reason of this big latency
> jump as soon as possible.
> 
> Did someone already have an idea about that ?
> 
> And another question I have is about interrupt prioritization
> with RTAI.
> 
> This experience show me that some interrupts from linux seems to be
> treated before my rtai one. I know that it's not possible to set
> priority on the interrupt's handler but I guessed that the interrupt
> handler in RTAI were treated before the ones that come from the linux
> task.
> 
> Mmmm... Maybe what occure is that my interrupt is effectively treated
> before until that some interrupt from linux _must_ be treated. And as
> this linux interrupt has waited so long to have its turn it has many
> things to do...
> 

Before saying anything:
Linux/RTAI version, RTAI patching, CPU, SMP/UP, your "cat 
/proc/interrupts" and your test code;
please!

Paolo.





More information about the Rtai mailing list