All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Handling interrupt - jitter
@ 2008-04-18 14:33 Bosko Radivojevic
  2008-04-18 14:48 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 10+ messages in thread
From: Bosko Radivojevic @ 2008-04-18 14:33 UTC (permalink / raw)
  To: xenomai-help

Hi,

I'm having (from my perspective) too big jitter on handling
interrupts. System is: ARM9, AT91SAM9260, Kernel 2.6.20.21, Adeos
1.8-03, Xenomai-2.4.2, interrupt is generated every 1ms, externally.
Interrupt source (ET1200) is connected to IRQ1 pin (PC15). I'm using
native skin from user space. Usually, handler 'reacts' after ~110us,
but, worst case delay is around 250us! Is this performance
normal/expected on my platform? Why the difference is so huge?

Is there anything I can do to get better results (with this hw:)?

Code looks like the example provided with Xenomai:

void tmng ()
{
   for (;;) {
      err = rt_intr_wait(&intr_desc,TM_INFINITE);
      if (err > 0) {
         [..]
      } else {
         [..]
      }
      rt_intr_enable (&intr_desc);
   }
}
main ()
{

  err = rt_intr_create(&intr_desc, "ET1200_sync", IRQ_NUMBER, 0);
  err = rt_task_create(&task_desc, "tmng", 0, 99, T_JOINABLE);

  rt_intr_enable (&intr_desc);

  rt_task_start(&task_desc,&tmng,NULL);
}

Thanks


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-18 14:33 [Xenomai-help] Handling interrupt - jitter Bosko Radivojevic
@ 2008-04-18 14:48 ` Gilles Chanteperdrix
  2008-04-18 15:08   ` Bosko Radivojevic
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-04-18 14:48 UTC (permalink / raw)
  To: Bosko Radivojevic; +Cc: xenomai-help

On Fri, Apr 18, 2008 at 4:33 PM, Bosko Radivojevic
<bosko.radivojevic@domain.hid> wrote:
> Hi,
>
>  I'm having (from my perspective) too big jitter on handling
>  interrupts. System is: ARM9, AT91SAM9260, Kernel 2.6.20.21, Adeos
>  1.8-03, Xenomai-2.4.2, interrupt is generated every 1ms, externally.

It's funny to notice how much you asked for the 2.6.24 patch for
actually not using it.

>  Interrupt source (ET1200) is connected to IRQ1 pin (PC15). I'm using
>  native skin from user space. Usually, handler 'reacts' after ~110us,
>  but, worst case delay is around 250us! Is this performance
>  normal/expected on my platform? Why the difference is so huge?

>
>  Is there anything I can do to get better results (with this hw:)?

250 us is the user-space dispatch latency you obtain with the
"latency" test on a properly loaded target. It is the time for a
user-space context switch with a full cache flush. To reduce this
latency you have to:
- handle interrupts in kernel space, so that you will be limited by
interrupt latency, not user-space scheduling latency
- use trunk so that user-space context switches involving real-time
threads do not happen with hardware interrupts off.

-- 
 Gilles


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-18 14:48 ` Gilles Chanteperdrix
@ 2008-04-18 15:08   ` Bosko Radivojevic
  2008-04-18 15:21     ` Gilles Chanteperdrix
  2008-04-18 16:01   ` Wolfgang Grandegger
  2008-04-21 10:07   ` Bosko Radivojevic
  2 siblings, 1 reply; 10+ messages in thread
From: Bosko Radivojevic @ 2008-04-18 15:08 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-help

On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:

>  It's funny to notice how much you asked for the 2.6.24 patch for
>  actually not using it.

:) Actually, I've tried with the 2.6.24.3, Adeos 1.9-01 & Xenomai
2.4.3 before I posted my mail, but results are the same. And, yes, I'm
using it heavily, but because of some other 'compatibility issues' I
still haven't fully migrated to the 2.6.24. Thank you very much for
migrating Adeos to 2.6.24, I really appreciate it.

>  - handle interrupts in kernel space, so that you will be limited by
>  interrupt latency, not user-space scheduling latency
>  - use trunk so that user-space context switches involving real-time
>  threads do not happen with hardware interrupts off.

Will I get anything using xenomai-trunk, and still handling interrupt
from user-space?

Thanks,
Bosko


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-18 15:08   ` Bosko Radivojevic
@ 2008-04-18 15:21     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-04-18 15:21 UTC (permalink / raw)
  To: Bosko Radivojevic; +Cc: xenomai-help

On Fri, Apr 18, 2008 at 5:08 PM, Bosko Radivojevic
<bosko.radivojevic@domain.hid> wrote:
> On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
>  <gilles.chanteperdrix@xenomai.org> wrote:
>
>  >  It's funny to notice how much you asked for the 2.6.24 patch for
>  >  actually not using it.
>
>  :) Actually, I've tried with the 2.6.24.3, Adeos 1.9-01 & Xenomai
>  2.4.3 before I posted my mail, but results are the same. And, yes, I'm
>  using it heavily, but because of some other 'compatibility issues' I
>  still haven't fully migrated to the 2.6.24. Thank you very much for
>  migrating Adeos to 2.6.24, I really appreciate it.
>
>
>  >  - handle interrupts in kernel space, so that you will be limited by
>  >  interrupt latency, not user-space scheduling latency
>  >  - use trunk so that user-space context switches involving real-time
>  >  threads do not happen with hardware interrupts off.
>
>  Will I get anything using xenomai-trunk, and still handling interrupt
>  from user-space?

No, the 250us switch time is due to the full cache flush which happens
at each user-space context switch on ARM (this happens because of the
ARM VIVT cache).

The only way to avoid it would be to use ucLinux. Unfortunately, the
status of ucLinux on ARM is quite fuzzy at the moment. It seems some
nommu patches have been merged in the mainstream Linux, but the kernel
still needs further patching. Which is why I have not yet tried
Xenomai over ucLinux on ARM.

Another approach is to use the FCSE extension found on some ARMs
cores, (I think ARM 926EJ-S and onwards). Using this extension imposes
some limitations (maximum number of processes and maximum RAM size for
each process). Richard Cochran posted a patch to modify Linux to use
this extension on Adeos mailing list. I had no time yet to test it,
but I think adapting Xenomai to this patch requires little work if
any.

-- 
 Gilles


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-18 14:48 ` Gilles Chanteperdrix
  2008-04-18 15:08   ` Bosko Radivojevic
@ 2008-04-18 16:01   ` Wolfgang Grandegger
  2008-04-21 10:07   ` Bosko Radivojevic
  2 siblings, 0 replies; 10+ messages in thread
From: Wolfgang Grandegger @ 2008-04-18 16:01 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-help

Gilles Chanteperdrix wrote:
> On Fri, Apr 18, 2008 at 4:33 PM, Bosko Radivojevic
> <bosko.radivojevic@domain.hid> wrote:
>> Hi,
>>
>>  I'm having (from my perspective) too big jitter on handling
>>  interrupts. System is: ARM9, AT91SAM9260, Kernel 2.6.20.21, Adeos
>>  1.8-03, Xenomai-2.4.2, interrupt is generated every 1ms, externally.
> 
> It's funny to notice how much you asked for the 2.6.24 patch for
> actually not using it.
> 
>>  Interrupt source (ET1200) is connected to IRQ1 pin (PC15). I'm using
>>  native skin from user space. Usually, handler 'reacts' after ~110us,
>>  but, worst case delay is around 250us! Is this performance
>>  normal/expected on my platform? Why the difference is so huge?
> 
>>  Is there anything I can do to get better results (with this hw:)?
> 
> 250 us is the user-space dispatch latency you obtain with the
> "latency" test on a properly loaded target. It is the time for a
> user-space context switch with a full cache flush. To reduce this
> latency you have to:
> - handle interrupts in kernel space, so that you will be limited by
> interrupt latency, not user-space scheduling latency
> - use trunk so that user-space context switches involving real-time
> threads do not happen with hardware interrupts off.

I started to do some external interrupt latency measurements with
gpioirqbench showing also the effect of handling the interrupt in
user-space, kernel-space or even the interrupt handler on two PowerPC
systems. For further information, have a look to

  http://www.denx.de/wiki/DULG/AN2008_03_Xenomai_gpioirqbench

Wolfgang.


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-18 14:48 ` Gilles Chanteperdrix
  2008-04-18 15:08   ` Bosko Radivojevic
  2008-04-18 16:01   ` Wolfgang Grandegger
@ 2008-04-21 10:07   ` Bosko Radivojevic
  2008-04-21 14:22     ` Gilles Chanteperdrix
  2 siblings, 1 reply; 10+ messages in thread
From: Bosko Radivojevic @ 2008-04-21 10:07 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-help

On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:

>  It's funny to notice how much you asked for the 2.6.24 patch for
>  actually not using it.

BTW, 2.6.25 is out... :)

- Bosko


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-21 10:07   ` Bosko Radivojevic
@ 2008-04-21 14:22     ` Gilles Chanteperdrix
  2008-04-21 14:36       ` Philippe Gerum
  0 siblings, 1 reply; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-04-21 14:22 UTC (permalink / raw)
  To: Bosko Radivojevic; +Cc: xenomai-help

On Mon, Apr 21, 2008 at 12:07 PM, Bosko Radivojevic
<bosko.radivojevic@domain.hid> wrote:
> On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
>  <gilles.chanteperdrix@xenomai.org> wrote:
>
>
> >  It's funny to notice how much you asked for the 2.6.24 patch for
>  >  actually not using it.
>
>  BTW, 2.6.25 is out... :)

I have just tried to apply the 2.6.24 patch to a 2.6.25 kernel there
does not seem to be much rejects, and they all seem easy to solve.
Anyway, I wait for Philippe to issue the x86 patch (and update the
I-pipe git noarch branch), and maybe for the AT91 people to issue
their patch (the I-pipe patch for ARM is such that you can apply it
with or without the AT91 patch, this requires some work).

-- 
 Gilles


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-21 14:22     ` Gilles Chanteperdrix
@ 2008-04-21 14:36       ` Philippe Gerum
  2008-04-21 14:38         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 10+ messages in thread
From: Philippe Gerum @ 2008-04-21 14:36 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-help

Gilles Chanteperdrix wrote:
> On Mon, Apr 21, 2008 at 12:07 PM, Bosko Radivojevic
> <bosko.radivojevic@domain.hid> wrote:
>> On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
>>  <gilles.chanteperdrix@xenomai.org> wrote:
>>
>>
>>>  It's funny to notice how much you asked for the 2.6.24 patch for
>>  >  actually not using it.
>>
>>  BTW, 2.6.25 is out... :)
> 
> I have just tried to apply the 2.6.24 patch to a 2.6.25 kernel there
> does not seem to be much rejects, and they all seem easy to solve.
> Anyway, I wait for Philippe to issue the x86 patch (and update the
> I-pipe git noarch branch)

I have nothing pending right now for 2.6.24-noarch. The public repo should be in
sync.

, and maybe for the AT91 people to issue
> their patch (the I-pipe patch for ARM is such that you can apply it
> with or without the AT91 patch, this requires some work).
> 


-- 
Philippe.


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-21 14:36       ` Philippe Gerum
@ 2008-04-21 14:38         ` Gilles Chanteperdrix
  2008-04-21 14:48           ` Philippe Gerum
  0 siblings, 1 reply; 10+ messages in thread
From: Gilles Chanteperdrix @ 2008-04-21 14:38 UTC (permalink / raw)
  To: philippe.gerum; +Cc: xenomai-help

On Mon, Apr 21, 2008 at 4:36 PM, Philippe Gerum
<philippe.gerum@domain.hid> wrote:
> Gilles Chanteperdrix wrote:
>  > On Mon, Apr 21, 2008 at 12:07 PM, Bosko Radivojevic
>  > <bosko.radivojevic@domain.hid> wrote:
>  >> On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
>  >>  <gilles.chanteperdrix@xenomai.org> wrote:
>  >>
>  >>
>  >>>  It's funny to notice how much you asked for the 2.6.24 patch for
>  >>  >  actually not using it.
>  >>
>  >>  BTW, 2.6.25 is out... :)
>  >
>  > I have just tried to apply the 2.6.24 patch to a 2.6.25 kernel there
>  > does not seem to be much rejects, and they all seem easy to solve.
>  > Anyway, I wait for Philippe to issue the x86 patch (and update the
>  > I-pipe git noarch branch)
>
>  I have nothing pending right now for 2.6.24-noarch. The public repo should be in
>  sync.

I meant the 2.6.25-noarch...

-- 
 Gilles


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

* Re: [Xenomai-help] Handling interrupt - jitter
  2008-04-21 14:38         ` Gilles Chanteperdrix
@ 2008-04-21 14:48           ` Philippe Gerum
  0 siblings, 0 replies; 10+ messages in thread
From: Philippe Gerum @ 2008-04-21 14:48 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai-help

Gilles Chanteperdrix wrote:
> On Mon, Apr 21, 2008 at 4:36 PM, Philippe Gerum
> <philippe.gerum@domain.hid> wrote:
>> Gilles Chanteperdrix wrote:
>>  > On Mon, Apr 21, 2008 at 12:07 PM, Bosko Radivojevic
>>  > <bosko.radivojevic@domain.hid> wrote:
>>  >> On Fri, Apr 18, 2008 at 4:48 PM, Gilles Chanteperdrix
>>  >>  <gilles.chanteperdrix@xenomai.org> wrote:
>>  >>
>>  >>
>>  >>>  It's funny to notice how much you asked for the 2.6.24 patch for
>>  >>  >  actually not using it.
>>  >>
>>  >>  BTW, 2.6.25 is out... :)
>>  >
>>  > I have just tried to apply the 2.6.24 patch to a 2.6.25 kernel there
>>  > does not seem to be much rejects, and they all seem easy to solve.
>>  > Anyway, I wait for Philippe to issue the x86 patch (and update the
>>  > I-pipe git noarch branch)
>>
>>  I have nothing pending right now for 2.6.24-noarch. The public repo should be in
>>  sync.
> 
> I meant the 2.6.25-noarch...
> 

Ok. I will probably address this in a couple of weeks.

-- 
Philippe.


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

end of thread, other threads:[~2008-04-21 14:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18 14:33 [Xenomai-help] Handling interrupt - jitter Bosko Radivojevic
2008-04-18 14:48 ` Gilles Chanteperdrix
2008-04-18 15:08   ` Bosko Radivojevic
2008-04-18 15:21     ` Gilles Chanteperdrix
2008-04-18 16:01   ` Wolfgang Grandegger
2008-04-21 10:07   ` Bosko Radivojevic
2008-04-21 14:22     ` Gilles Chanteperdrix
2008-04-21 14:36       ` Philippe Gerum
2008-04-21 14:38         ` Gilles Chanteperdrix
2008-04-21 14:48           ` Philippe Gerum

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.