Skip to contentSkip to conversation

Event flag from ISR

Xenomai-help Patrick 5 participants 7 messages Oct 25, 2007 – Oct 26, 2007

lore
Share & tools
lore

Patrick

author
#0 lore raw

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR executes rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the first occurrence lasts about 20us and all the next occurrences last about 4us.

My question is why the first ISR is so long?

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with 2.6.20 kernel.

Thanks in advance,

Patrick

#1 lore raw
Quoted 15 lines · Patrick

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR executes rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the first occurrence lasts about 20us and all the next occurrences last about 4us.

Quoted 6 lines

My question is why the first ISR is so long?

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with 2.6.20 kernel.

Typical worst case interrupt latency on ARM is around 50 us, so 20 us is not that long. What you are observing is probably a cache effect. In this case, you should observe 20us after each user-space context switch since on ARM, cache is flushed at each user-space context switch.

Signature · 1 line
					    Gilles Chanteperdrix.
#2 lore raw
Quoted 2 lines

-----Original Message-----
From: [email protected]

[mailto:[email protected]]

Quoted 29 lines

On Behalf Of Gilles Chanteperdrix
Sent: jeudi 25 octobre 2007 19:48
To: Patrick
Cc: [email protected]
Subject: Re: [Xenomai-help] Event flag from ISR

Quoted 7 lines · Patrick

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR

executes

Quoted 4 lines

rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the

first

Quoted 1 line

occurrence lasts about 20us and all the next occurrences last about

4us.

Quoted 7 lines

My question is why the first ISR is so long?

Quoted 5 lines
Quoted 1 line

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with

2.6.20

Quoted 1 line

kernel.

Typical worst case interrupt latency on ARM is around 50 us, so 20 us

is

Quoted 3 lines

not that long. What you are observing is probably a cache effect. In this case, you should observe 20us after each user-space context switch since on ARM, cache is flushed at each user-space context switch.

It could make sense to have a look at the L4-embedded microkernel which uses the Fast Context Switch Extension (FCSE) of ARM
and to adapt the mm switch accordingly. But as far as I remember, this could introduce some limitations to a process
size since all threads are sharing a same virtual address space subdivided into smaller virtual regions.
Benchmarks with FCSE reported some significant improvements and I know this technics is commonly used for virtualization layer on ARM.

Quoted 10 lines

--

Gilles Chanteperdrix.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Daniel

#3 lore raw
Quoted 40 lines · ROSSIER Daniel
Quoted 2 lines

-----Original Message-----
From: [email protected]

[mailto:[email protected]]

Quoted 24 lines

On Behalf Of Gilles Chanteperdrix
Sent: jeudi 25 octobre 2007 19:48
To: Patrick
Cc: [email protected]
Subject: Re: [Xenomai-help] Event flag from ISR

Quoted 7 lines · Patrick

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR

executes

Quoted 4 lines

rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the

first

Quoted 1 line

occurrence lasts about 20us and all the next occurrences last about

4us.

Quoted 2 lines
Quoted 8 lines
Quoted 5 lines

My question is why the first ISR is so long?

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with

2.6.20

Quoted 1 line

kernel.

Typical worst case interrupt latency on ARM is around 50 us, so 20 us

is

Quoted 3 lines

not that long. What you are observing is probably a cache effect. In this case, you should observe 20us after each user-space context switch since on ARM, cache is flushed at each user-space context switch.

Quoted 8 lines

It could make sense to have a look at the L4-embedded microkernel which uses the Fast Context Switch Extension (FCSE) of ARM
and to adapt the mm switch accordingly. But as far as I remember, this could introduce some limitations to a process
size since all threads are sharing a same virtual address space subdivided into smaller virtual regions.
Benchmarks with FCSE reported some significant improvements and I know this technics is commonly used for virtualization layer on ARM.

There is already ongoing work toward FCSE for current Linux, which could then be used by Xenomai as well, see linux-arm-kernel and xenomai-core
[1] archives. I guess anyone willing to join this effort is welcome.

Jan

[1] https://mail.gna.org/public/xenomai-core/2007-09/msg00059.html

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 7 lines

-----Original Message-----
From: Jan Kiszka [mailto:[email protected]]
Sent: vendredi 26 octobre 2007 10:27
To: ROSSIER Daniel
Cc: Gilles Chanteperdrix; Patrick; [email protected]
Subject: Re: [Xenomai-help] Event flag from ISR

Quoted 36 lines
Quoted 35 lines · ROSSIER Daniel
Quoted 2 lines

-----Original Message-----
From: [email protected]

[mailto:[email protected]]

Quoted 32 lines

On Behalf Of Gilles Chanteperdrix
Sent: jeudi 25 octobre 2007 19:48
To: Patrick
Cc: [email protected]
Subject: Re: [Xenomai-help] Event flag from ISR

Quoted 7 lines · Patrick

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR

executes

Quoted 4 lines

rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the

first

Quoted 1 line

occurrence lasts about 20us and all the next occurrences last about

4us.

Quoted 7 lines

My question is why the first ISR is so long?

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with

2.6.20

Quoted 1 line

kernel.

Typical worst case interrupt latency on ARM is around 50 us, so 20

us

Quoted 10 lines
Quoted 3 lines

is

Quoted 2 lines

not that long. What you are observing is probably a cache effect. In this case, you should observe 20us after each user-space context

switch

Quoted 3 lines
Quoted 1 line

since on ARM, cache is flushed at each user-space context switch.

It could make sense to have a look at the L4-embedded microkernel

which

Quoted 2 lines

uses the Fast Context Switch Extension (FCSE) of ARM and to adapt the mm switch accordingly. But as far as I remember,

this

Quoted 4 lines
Quoted 4 lines

could introduce some limitations to a process
size since all threads are sharing a same virtual address space subdivided into smaller virtual regions.
Benchmarks with FCSE reported some significant improvements and I

know

Quoted 3 lines
Quoted 1 line

this technics is commonly used for virtualization layer on ARM.

There is already ongoing work toward FCSE for current Linux, which

could

Quoted 3 lines

then be used by Xenomai as well, see linux-arm-kernel and xenomai-core
[1] archives. I guess anyone willing to join this effort is welcome.

Thanks for the update Jan; great to see that there is some interest (BTW, I realized that I mix
the FCSE with DACR feature which allows to share an address space; limitations of 32 MB process
address space is bound to DACR ;-)).
We will then see if we can put some efforts on this topic. We keep you posted.

Daniel

#5 lore raw
Quoted 7 lines · ROSSIER Daniel
Quoted 4 lines

-----Original Message-----
From: Jan Kiszka [mailto:[email protected]]
Sent: vendredi 26 octobre 2007 10:27
There is already ongoing work toward FCSE for current Linux, which

could

Quoted 8 lines
Quoted 2 lines

then be used by Xenomai as well, see linux-arm-kernel and xenomai-core
[1] archives. I guess anyone willing to join this effort is welcome.

Thanks for the update Jan; great to see that there is some interest (BTW, I realized that I mix
the FCSE with DACR feature which allows to share an address space; limitations of 32 MB process
address space is bound to DACR ;-)).

No, this limitation is imposed by FCSE. You can use FCSE without domain access control which is for checking memory accesses.

Signature · 1 line
Sebastian
author
#6 lore raw
In reply to Gilles Chanteperdrix

Hi,

The 20us are just the ISR duration; the latency time is not included.

Thanks

Patrick

-----Message d'origine-----
De : Gilles Chanteperdrix [mailto:[email protected] Envoyé : jeudi, 25. octobre 2007 19:48
À : Patrick
Cc : [email protected]
Objet : Re: [Xenomai-help] Event flag from ISR

Quoted 15 lines · Patrick

Hi all,

I am using a RT event flag structure to start a task from an ISR.

The task waits on rt_event_wait and when the IRQ occurs the ISR executes rt_event_signal (the ISR code only clears the flag and calls rt_event_signal).

I'm using an oscilloscope to measure the length of the ISR and the first occurrence lasts about 20us and all the next occurrences last about 4us.

Quoted 6 lines

My question is why the first ISR is so long?

For information I use xenomai 2.4 rc4 on ARM pxa270 machine with 2.6.20 kernel.

Typical worst case interrupt latency on ARM is around 50 us, so 20 us is not that long. What you are observing is probably a cache effect. In this case, you should observe 20us after each user-space context switch since on ARM, cache is flushed at each user-space context switch.

Signature · 1 line
					    Gilles Chanteperdrix.