Dmitry Adamushko wrote:
> On 11/02/06, Jan Kiszka <[EMAIL PROTECTED]> wrote:
>> Dmitry Adamushko wrote:
>>> And as an additional option,
>>> it could be interesting to print out to the log if not all "counter"
>> values
>>> then min,max,average (the same like for the latency :) per second or per
>>> 1000 interrupts; so to see whether tweaking the MAX_EDGEIRQ_COUNTER may
>> make
>>> the things better.
>> Yes, maybe it's too small. But this also depends on the absolute time
>> required for so many loops, something we should see in the traces then.
>> I'm afraid that we will finally have to move the UART's read-from-fifo
>> to task context to reduce the time spent in IRQ context.
> 
> Good. Keep me informed as before.
> 

We got it working. :)

First, we had to fix our own stupidity: the reception fifo depth of the
serial ports were set to one, thus we basically got one IRQ every 20 us.
Of course the CPU was too slow for this storm and therefore we got the
overruns. After increasing this threshold to 14, things improved
significantly - but also the worst-case IRQ-off time. Well, that's a
trade-off we likely have to make somehow between low IRQ load and long
IRQ-off times. Reducing the threshold to 4 e.g. gives shorter IRQ-off
times and still no overruns but also causes higher system load. This all
requires some more thoughts on the xeno_16550 design (IRQ handler vs.
user task for receiving and sending), will see when I find time for it.

Anyway, this works now. But we also found a bug, as usual, a clean-up
bug: You released the IRQ line based on the wrong test, see attached
patch. With this fix applied and the IRQ flags as well as the
/proc/xenomai/irq output cleaned up, I would say you great work is ready
for merge!

Thanks,
Jan
--- ksrc/nucleus/intr.c.orig    2006-02-13 11:15:45.000000000 +0100
+++ ksrc/nucleus/intr.c 2006-02-13 19:22:57.000000000 +0100
@@ -393,9 +393,12 @@ int xnintr_detach (xnintr_t *intr)
        if (e == intr)
            {
            /* Remove a given interrupt object from the list. */
-           if ((*p = e->next) == NULL)
+           *p = e->next;
+
+           /* Release IRQ line if this was the last user */
+           if (shirq->handlers == NULL)
                err = xnarch_release_irq(intr->irq);
-    
+
            xnarch_critical_exit(flags);
 
            /* The idea here is to keep a detached interrupt object valid as 
long

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to