* [Xenomai] Kernel space task VS User space task latency
@ 2013-04-10 19:45 Marco Guerri
2013-04-10 19:58 ` Gilles Chanteperdrix
0 siblings, 1 reply; 2+ messages in thread
From: Marco Guerri @ 2013-04-10 19:45 UTC (permalink / raw)
To: xenomai
Hi everyone,
I was wondering if there is anyone who can help me clarify some very
basic doubts I have regarding Xenomai internals.
I am working with Xenomai 2.6.2.1 on a 2.6.31 kernel on an i.MX35
processor (thus, ARM arch).
Using the latency test program, I get the following results for User
space and Kernel space tasks.
*** IDLE ***
User space --> Mean: ~7us
Kernel space --> Mean: ~4us
*** HEAVY LOAD (dohell) ***
User space --> Mean: ~34us
Kernel space --> Mean: ~18us
Could you give me some hints on how to explain this great difference,
expecially with the system under load?
What are the factors that could worsen the latency in IDLE conditions?
What are the factors that can explain a value of latency doubled in case
of a system under load?
Thank you a lot for any suggestion.
Regards,
Marco
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai] Kernel space task VS User space task latency
2013-04-10 19:45 [Xenomai] Kernel space task VS User space task latency Marco Guerri
@ 2013-04-10 19:58 ` Gilles Chanteperdrix
0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2013-04-10 19:58 UTC (permalink / raw)
To: Marco Guerri; +Cc: xenomai
On 04/10/2013 09:45 PM, Marco Guerri wrote:
> Hi everyone,
>
> I was wondering if there is anyone who can help me clarify some very
> basic doubts I have regarding Xenomai internals.
> I am working with Xenomai 2.6.2.1 on a 2.6.31 kernel on an i.MX35
> processor (thus, ARM arch).
>
> Using the latency test program, I get the following results for User
> space and Kernel space tasks.
>
> *** IDLE ***
> User space --> Mean: ~7us
> Kernel space --> Mean: ~4us
>
> *** HEAVY LOAD (dohell) ***
> User space --> Mean: ~34us
> Kernel space --> Mean: ~18us
>
> Could you give me some hints on how to explain this great difference,
> expecially with the system under load?
> What are the factors that could worsen the latency in IDLE conditions?
> What are the factors that can explain a value of latency doubled in case
> of a system under load?
These results are completely expected. The code executed between the
time an interrupt happens and a kernel thread is woken up is simply
shorter than the code executed between the time an interrupt happens and
a user-space thread is woken up. On a loaded system, the difference in
time is even greater due to cache effects.
The latency in idle conditions is meaningless. The average latency is
meaningless.
Now the choice between kernel-space and user-space:
- should not be an all-or-nothing choice, you can do some performance
critical things in kernel-space by writing a driver using the RTDM skin,
and have it communicate with user-space tasks which should remain the
master;
- should not be governed by latencies measurement only (especially not
measurement on an idle system and measurement of average values),
programming in kernel-space is hard, takes time, and some habit, it
better be worth it.
--
Gilles.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-10 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 19:45 [Xenomai] Kernel space task VS User space task latency Marco Guerri
2013-04-10 19:58 ` Gilles Chanteperdrix
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.