Howto implement a periodic real-time task?

View: New views
7 Messages — Rating Filter:   Alert me  

Howto implement a periodic real-time task?

by Andre Puschmann-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys,

I got a L4 real-time application that should run strictly periodic. In
each cycle I have to communicate with at least two other L4 threads in
different address spaces. The cycle period is in the order of 1000Hz to
5000Hz.
As described in [1] I tried to use the CPU reservation server but the
sample implementations did not work. Anyway, I figured out that even the
CPU reservation server depends on the kernel timer and thus the
granularity is 1ms (in PIT mode), which is too coarse for cycle periods
larger then 1000Hz.
Although I like the idea to use OS primitives to keep the application as
portable as possible (ARM port is a goal), I thought about implementing
the periodic execution with an extra timer decoupled from the scheduling
timer which generates an IRQ at each hit.
Any comment/suggestions/ideas about that? Any other experience with
periodic real-time tasks on L4?


Cheers,
Andre


[1] http://os.inf.tu-dresden.de/pipermail/l4-hackers/2009/004179.html

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Re: Howto implement a periodic real-time task?

by Udo A. Steinberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 21 Jul 2009 11:03:38 +0200 Andre Puschmann (AP) wrote:

AP> I got a L4 real-time application that should run strictly periodic. In
AP> each cycle I have to communicate with at least two other L4 threads in
AP> different address spaces. The cycle period is in the order of 1000Hz to
AP> 5000Hz. As described in [1] I tried to use the CPU reservation server
AP> but the sample implementations did not work. Anyway, I figured out that
AP> even the CPU reservation server depends on the kernel timer and thus the
AP> granularity is 1ms (in PIT mode), which is too coarse for cycle periods
AP> larger then 1000Hz. Although I like the idea to use OS primitives to
AP> keep the application as portable as possible (ARM port is a goal), I
AP> thought about implementing the periodic execution with an extra timer
AP> decoupled from the scheduling timer which generates an IRQ at each hit.
AP> Any comment/suggestions/ideas about that? Any other experience with
AP> periodic real-time tasks on L4?

Configure your L4/Fiasco kernel to use the APIC in one-shot mode for
scheduling. Then, in combination with absolute timeouts, your granularity
can be as low as 1µs.

        - Udo


_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

signature.asc (204 bytes) Download Attachment

Re: Howto implement a periodic real-time task?

by Sergio Ruocco-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andre Puschmann wrote:
> Any comment/suggestions/ideas about that? Any other experience with
> periodic real-time tasks on L4?

Hi Andre,

maybe they do not contain a plug-in solution to your problems, but I
wrote a couple of papers on real-time scheduling on top of L4
microkernels which could be useful as a starting point:

http://ertos.nicta.com.au/publications/papers/Ruocco_RTSS_06.abstract
http://www.hindawi.com/journals/es/2008/234710.abs.html

Please note that the journal paper discusses real-time scheduling on
general-purpouse L4 microkernels, specifically L4 Pistachio v0.4, and a
*now*-*obsolete* version of L4-embedded. The recent OKL4 v3.0 addressed
all the real-time scheduling issues discussed in the paper.

Comments and criticism on the papers are welcome!

        Sergio


--

Dr. Sergio Ruocco   Research Fellow    http://www.disco.unimib.it/ruocco
mailto:ruocco@... / sergio.ruocco@...      NOMADIS Lab
phone: +39-02-6448-7914               Mobile, embedded real-time systems
skype: 'sergioruocco'  Dip. di Informatica, Sistemistica e COmunicazione
Building U14, room 1003  Università degli Studi di Milano-Bicocca, Italy

W La ricerca http://video.google.com/videoplay?docid=-6518779854944519929

Your manuscript is both good and original; but the part that is good is
not original, and the part that is original is not good.
Samuel Johnson


_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Re: Howto implement a periodic real-time task?

by Andre Puschmann-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Udo,

Udo A. Steinberg wrote:
> Configure your L4/Fiasco kernel to use the APIC in one-shot mode for
> scheduling. Then, in combination with absolute timeouts, your granularity
> can be as low as 1µs.
I already built a kernel with APIC in one-shot-mode as timer tick source.
Just wrote a periodic sample task to test absolute timeouts as suggested.
I now want to put some load on the system as I did in native Linux with
tools like "hackbench" and "cache calibrator".
Any suggestions how to achieve this under L4? The same tools inside a
L4Linux environment?

Cheers,
Andre

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Re: Howto implement a periodic real-time task?

by Andre Puschmann-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sergio,

Sergio Ruocco wrote:

> http://ertos.nicta.com.au/publications/papers/Ruocco_RTSS_06.abstract
> http://www.hindawi.com/journals/es/2008/234710.abs.html
>
> Please note that the journal paper discusses real-time scheduling on
> general-purpouse L4 microkernels, specifically L4 Pistachio v0.4, and a
> *now*-*obsolete* version of L4-embedded. The recent OKL4 v3.0 addressed
> all the real-time scheduling issues discussed in the paper.
>
> Comments and criticism on the papers are welcome!
>  
I've read "Real-Time Programming and L4 Microkernels" and found it a
very good
introduction into that topic. It really helped me lot.
The latter one seems to be am extended version of that paper, right?
Anyway, thanks for the links.

Best regards,
Andre

_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

Re: Howto implement a periodic real-time task?

by Udo A. Steinberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 21 Jul 2009 18:00:42 +0200 Andre Puschmann (AP) wrote:

AP> I now want to put some load on the system as I did in native Linux with
AP> tools like "hackbench" and "cache calibrator". Any suggestions how to
AP> achieve this under L4? The same tools inside a L4Linux environment?

Write some programs that continuously do IPC across task boundaries. If you
want to trash the caches, memset contiguous regions of memory that are larger
than the sum of all your cache sizes. The "pingpong" program should give you
some ideas how to implement these kind of things.

Cheers,

        - Udo


_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers

signature.asc (204 bytes) Download Attachment

Re: Howto implement a periodic real-time task?

by Andre Puschmann-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Udo,

thanks so much for your reply and sorry for the delayed answer.
I will write a pure L4 based system trasher like you suggested.
However, as running a L4Lx next to the RT part of my system is a quite
common use
case, I will also benchmark this part.
As I wrote in my last mail, I used hackbench [1]  (among others) to
evaluate in legacy Linux system.
This is a quite evil tool that creates groups of tasks that communicate
with each other via sockets.
Running this tool under L4Lx really block any other task (even with
higher priority).
I am neither sure what exactly causes these interruption, nor how to
eliminate them.
Any experience with these kind of tools or any other advice is highly
appreciated?

Cheers,
Andre

[1] http://devresources.linux-foundation.org/craiger/hackbench/


Udo A. Steinberg wrote:

> On Tue, 21 Jul 2009 18:00:42 +0200 Andre Puschmann (AP) wrote:
>
> AP> I now want to put some load on the system as I did in native Linux with
> AP> tools like "hackbench" and "cache calibrator". Any suggestions how to
> AP> achieve this under L4? The same tools inside a L4Linux environment?
>
> Write some programs that continuously do IPC across task boundaries. If you
> want to trash the caches, memset contiguous regions of memory that are larger
> than the sum of all your cache sizes. The "pingpong" program should give you
> some ideas how to implement these kind of things.
>
> Cheers,
>
> - Udo
>  


_______________________________________________
l4-hackers mailing list
l4-hackers@...
http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers