All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xenomai-help] Interrupt latency questions
@ 2008-09-22  9:15 Fillod Stephane
  2008-09-23  8:22 ` Antonio Del Cinque
  0 siblings, 1 reply; 7+ messages in thread
From: Fillod Stephane @ 2008-09-22  9:15 UTC (permalink / raw)
  To: Antonio Del Cinque, xenomai

Antonio Del Cinque wrote:
[...]
>Then I open an ssh connection with the target, and run a "cat /dev/zero
> file". The target 
>is mounted on an NFS root filesystem, so this generates a high number
of 
>fast ethernet interrupts. Now the oscilloscope shows 15 uS jitter in
the worst case, 
>and a visible variance. I would assume this effect as increased max
latency.

This figure has already been seen with SoC in the range of the e300, 
and sometime worse.

>The ethernet interrupt is handled only in Linux domain by the original
vanilla handler, 
>but Linux should be stalled/preempted when the timer interrupt occurs.
So I assume 
>that latency is to be justified by the time it takes to adeos to record
an 
>ethernet interrupt event in the i-logs when the timer interrupt is
executing or ready to
>execute. Is this correct? 

Cache miss and TLB miss are also good latency killers.
To some extent, long DMA transfers can bog down the system bus.

>Is there any way to lower max latency for the timer interrupt?

Has anybody tried to play with cache locking?

-- 
Stephane


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Xenomai-help] Interrupt latency questions
@ 2008-09-19 15:06 Antonio Del Cinque
  0 siblings, 0 replies; 7+ messages in thread
From: Antonio Del Cinque @ 2008-09-19 15:06 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 2637 bytes --]

Hi all,
I need confirmations on the ipipe model, to interpret test results. Excuse
me, I'm new to this
kind of work, I only read introductory articles on the adeos/xenomai
architecture.

I'm testing Xenomai on an e300 Core PowerPC, and, to get lowest latencies, I
realized an RTDM
driver which handles an external timer interrupt:

-sh-2.05b# cat /proc/ipipe/Xenomai
       +----- Handling ([A]ccepted, [G]rabbed, [W]ired, [D]iscarded)
       |+---- Sticky
       ||+--- Locked
       |||+-- Exclusive
       ||||+- Virtual
[IRQ]  |||||
  75:  W..X.
 512:  W..XV
 515:  W...V

IRQ 75 is the timer interrupt. It is not handled in the Linux domain:

-sh-2.05b# cat /proc/ipipe/Linux | grep " 75"
  75:  A....

The Xenomai interrupt handler simply toggles a pin
generating a squarewave measured by an oscilloscope, so this is a jitter
test:

static int demo_interrupt(rtdm_irq_t *irq_context)
{
    int ret = RTDM_IRQ_HANDLED;
    struct gpt_drv_context *ctx;

    ctx = rtdm_irq_get_arg(irq_context, struct gpt_drv_context);

    // re-enable timer interrupt
    out_be32((ctx->gpt) + GPT_STATUS, GPT_STATUS_TEXP);

    // toggle GPIO
    if (read_pin(PIN, ctx)) {
        set_pin_low(PIN, ctx);
    } else {
        set_pin_high(PIN, ctx);
    }

    return ret;
}

The test shows a 2/3 uS jitter with no load.

Then I open an ssh connection with the target, and run a "cat /dev/zero >
file". The target
is mounted on an NFS root filesystem, so this generates a high number of
fast ethernet interrupts. Now the oscilloscope shows 15 uS jitter in the
worst case,
and a visible variance. I would assume this effect as increased max latency.

The ethernet interrupt is handled only in Linux domain by the original
vanilla handler,
but Linux should be stalled/preempted when the timer interrupt occurs. So I
assume
that latency is to be justified by the time it takes to adeos to record an
ethernet interrupt event in the i-logs when the timer interrupt is executing
or ready to
execute. Is this correct?

Assuming it is correct, what i-logs are concerned in the case of the
ethernet interrupt?
Is only the Xenomai i-log, only the Linux i-log, or both i-logs concerned? I
removed the
Interrupt Shield, but did not notice jitter differences.

Is there any way to lower max latency for the timer interrupt?

May I assume the max jitter measured is the upper bound, when there is only
this Xenomai
interrupt handler, and no other real time tasks?

May I assume that increasing the number of non real time related interrupts
in the system
would determine an increased mean latency, but not an increased max latency?

Thank you very much,
Antonio

[-- Attachment #2: Type: text/html, Size: 3346 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-07 12:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-22  9:15 [Xenomai-help] Interrupt latency questions Fillod Stephane
2008-09-23  8:22 ` Antonio Del Cinque
2008-09-23  8:25   ` Gilles Chanteperdrix
2008-10-06 14:44     ` Antonio Del Cinque
2008-10-06 14:48       ` Gilles Chanteperdrix
2008-10-07 12:02       ` Wolfgang Grandegger
  -- strict thread matches above, loose matches on Subject: below --
2008-09-19 15:06 Antonio Del Cinque

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.