Skip to contentSkip to conversation

How to chose between xenomai and preempt RT

Xenomai-help Adrien LECOINTRE 4 participants 6 messages Jun 1, 2009 – Jun 3, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I've been testing for a while, Xenomai and Linux preempt RT latencies under different loads and I couldn't find any big differences. Latencies are almost the same. So my question is, do you know any case where Xenomai is really better than a simple preempt RT?
Or which specification in a real time application should make me chose Xenomai instead of preempt RT?

Thanks

#1 lore raw
Quoted 5 lines · Adrien LECOINTRE

Hi,

I've been testing for a while, Xenomai and Linux preempt RT latencies under different loads and I couldn't find any big differences. Latencies are almost the same. So my question is, do you know any case where Xenomai is really better than a simple preempt RT?
Or which specification in a real time application should make me chose Xenomai instead of preempt RT?

I suspect your loads are not sufficiently exercising your system.

To answer your question, though, it all depends on your requirements, whether you need hard or soft realtime. In other words, is it ok to miss your deadline every so often? If so, CONFIG_PREEMPT would be fine for you. If you can't miss any deadlines, use Xenomai.

Of course, just by choosing to use Xenomai, you don't get hard realtime.
You still need to design your system and software correctly.

As time marches on, the CONFIG_PREEMPT is getting closer to hard realtime, especially with the interrupt threading, but I don't think that time is now.

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#2 lore raw
Quoted 18 lines · Jeff Angielski
Quoted 9 lines · Adrien LECOINTRE

Hi,

I've been testing for a while, Xenomai and Linux preempt RT latencies under different loads and I couldn't find any big differences. Latencies are almost the same.
So my question is, do you know any case where Xenomai is really better than a simple preempt RT?
Or which specification in a real time application should make me chose Xenomai instead of preempt RT?

I suspect your loads are not sufficiently exercising your system.

To answer your question, though, it all depends on your requirements, whether you need hard or soft realtime. In other words, is it ok to miss your deadline every so often? If so, CONFIG_PREEMPT would be fine for you. If you can't miss any deadlines, use Xenomai.

Quoted 6 lines

Of course, just by choosing to use Xenomai, you don't get hard realtime.
You still need to design your system and software correctly.

As time marches on, the CONFIG_PREEMPT is getting closer to hard realtime, especially with the interrupt threading, but I don't think that time is now.

threaded interrupts are no silver bullet, they are essentially replacing interrupt latencies with kernel-space scheduling latencies; on x86, this may not make that much of a difference, but on low-end platform it does.

See also:
https://mail.gna.org/public/xenomai-help/2008-05/msg00043.html
https://mail.gna.org/public/xenomai-help/2009-06/msg00005.html

Signature · 1 line
					    Gilles.
#5 lore raw
In reply to Jeff Angielski
Quoted 11 lines · Jeff Angielski
Quoted 9 lines · Adrien LECOINTRE

Hi,

I've been testing for a while, Xenomai and Linux preempt RT latencies under different loads and I couldn't find any big differences. Latencies are almost the same.
So my question is, do you know any case where Xenomai is really better than a simple preempt RT?
Or which specification in a real time application should make me chose Xenomai instead of preempt RT?

Quoted 1 line

I suspect your loads are not sufficiently exercising your system.

I may. But the question is also if the test is sufficiently close to the final RT use case. One may think that running cyclictest alone gives the full picture of -rt's determinism, but it only stresses one simple use case of the kernel.

Quoted 6 lines

To answer your question, though, it all depends on your requirements, whether you need hard or soft realtime. In other words, is it ok to miss your deadline every so often? If so, CONFIG_PREEMPT would be fine for you. If you can't miss any deadlines, use Xenomai.

Quoted 7 lines

Of course, just by choosing to use Xenomai, you don't get hard realtime.
You still need to design your system and software correctly.

As time marches on, the CONFIG_PREEMPT is getting closer to hard realtime, especially with the interrupt threading, but I don't think that time is now.

Theoretically, -rt/CONFIG_PREEMPT_RT can provide this already - if you do not hit implementation problems with the particular use case, or the application uses services which do not provide real-time qualities on -rt.

Jan

#3 lore raw
In reply to Gilles Chanteperdrix
Quoted 10 lines · Gilles Chanteperdrix
Quoted 2 lines

As time marches on, the CONFIG_PREEMPT is getting closer to hard realtime, especially with the interrupt threading, but I don't think that time is now.

threaded interrupts are no silver bullet, they are essentially replacing interrupt latencies with kernel-space scheduling latencies; on x86, this may not make that much of a difference, but on low-end platform it does.

See also:
https://mail.gna.org/public/xenomai-help/2008-05/msg00043.html
https://mail.gna.org/public/xenomai-help/2009-06/msg00005.html

I meant to write PREEMPT_RT is getting closer to hard realtime. Sorry for the confusion.

As for the interrupt threads, the advantage is not in the latency, it is in the ability to control the scheduling of the handlers. In theory, you can schedule your handler the have the highest priority handler.

I totally agree on the different real life performance on the low end platforms vs the x86 desktops.

In the end, I think this is a good discussion to have [and keep up to date] since it bring out the fundamental design choices of doing realtime using Linux.

Signature · 3 lines
Jeff Angielski
The PTR Group
www.theptrgroup.com
#4 lore raw
Quoted 12 lines · Jeff Angielski
Quoted 10 lines · Gilles Chanteperdrix
Quoted 3 lines

As time marches on, the CONFIG_PREEMPT is getting closer to hard realtime, especially with the interrupt threading, but I don't think that time is now.

threaded interrupts are no silver bullet, they are essentially replacing interrupt latencies with kernel-space scheduling latencies; on x86, this may not make that much of a difference, but on low-end platform it does.

See also:
https://mail.gna.org/public/xenomai-help/2008-05/msg00043.html
https://mail.gna.org/public/xenomai-help/2009-06/msg00005.html

Quoted 6 lines

I meant to write PREEMPT_RT is getting closer to hard realtime. Sorry for the confusion.

As for the interrupt threads, the advantage is not in the latency, it is in the ability to control the scheduling of the handlers. In theory, you can schedule your handler the have the highest priority handler.

The real advantage or the threaded interrupts is that the part of the kernel-space code that need to protect from a particular interrupt remains preemptible by other interrupts. The interrupt handler themselves were already preemptible, if they did not use the IRQF_DISABLED flag.

Note that the same effect could be obtained by disabling only the particular interrupt at PIC level, but this would have mean a lot more of code changes than what threaded interrupts need. But probably a lot less run-time overhead.

Signature · 1 line
					    Gilles.