Problems with rt_task_create and rt_task_join
A message that is not in the archive (sent off-list or not yet received): 22536578.91295887083468.JavaMail.SYSTEM@PC-MRINALDI
----- Messaggio originale -----
Da: "Gilles Chanteperdrix" <[email protected]>
A: "Michel Rinaldi" <[email protected]>
Cc: [email protected]
Inviato: Lunedì, 24 gennaio 2011 15:27:51 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: Re: [Xenomai-help] Problems with rt_task_create and rt_task_join
.....
Quoted 5 lines
You explanations are hard to follow and understand, and what is more, ambiguous. Send us a piece of code which allows us to reproduce this issue. Trying to make it as simple as possible. For instance seeing if registering the interrupt causes any difference (if it does not make any difference, then remove it, you get the idea).
My code is really big and complex to reduce, I'll try to simplify it in next days.
Quoted 3 lines
As usual, we do not know what version of Xenomai, Adeos, Linux, etc... you are using. See:
http://www.xenomai.org/index.php/Request_for_information
I post them into firts mail of this thread, anyway they are:
- Linux system with kernel 2.6.35.7
- Xenomai 2.5.5.2
- Adeos ipipe patch 2.7-04
GCC is on version 4.4.3.
.....
Quoted 3 lines
That is bad. One more question: what happens when you run the "latency" test, do you get strange results? Also, I see that you have the SMI workaround enabled, does it detect your chipset?
Yes, as system log says, Xenomai detect SMI motherboard and disable them. I run the latency test: without other loads onto system, I observe values like these:
RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 6.680| 7.157| 12.187| 0| 0| 6.680| 12.187 RTD| 6.277| 6.980| 10.519| 0| 0| 6.277| 12.187 RTD| 1.175| 7.122| 9.315| 0| 0| 1.175| 12.187 RTD| 1.578| 7.112| 9.382| 0| 0| 1.175| 12.187 RTD| 1.635| 7.133| 10.307| 0| 0| 1.175| 12.187
also after long runnings.
But if I launch application contained into attached main_app.c file (that represents my simplified application) what I observe into latency test is:
RTD| 1.635| 7.133| 10.307| 0| 0| 1.175| 12.187 RTD| 1.591| 20.101| 129847.817| 1298| 0| 1.175| 129847.817 RTD| 1.860| 7.133| 12.814| 1298| 0| 1.175| 129847.817
Then, if I CTRL+C my app:
RTD| 2.091| 7.468| 15.687| 1298| 0| 1.175| 129847.817 RTD| 1.861| 8.397| 8157.893| 1379| 0| 1.175| 129847.817 RTD| 6.282| 7.287| 15.007| 1379| 0| 1.175| 129847.817
In concomitance with first very high latency, I observe into dmesg the clocksource switch message.
In one case I observed an extremely bigger value for lat max: in facts, system freezed for about 2 seconds.
RTD| 2.091| 7.468| 11.687| 0| 0| 1.133| 20.817 RTD| 1.436| 254.870|-1819173.554| 24758| 0| 1.133|-1819173.554 RTD| 1.768| 7.287| 12.007| 24758| 0| 1.133|-1819173.554
I also observed that during same latency test the first application start generates the longest time in comparison to other starts.
To run, my app needs kernel module contained into attached timer_module.c file, that signals a semaphore used by app every 1 ms. I don't observe some strange variations in latency test values when inserting or removing this kernel module.
Thank you very much for your help, Gilles.
Regards
Mauro
Quoted 44 lines · Michel Rinaldi
----- Messaggio originale -----
Da: "Gilles Chanteperdrix" <[email protected]>
A: "Michel Rinaldi" <[email protected]>
Cc: [email protected]
Inviato: Lunedì, 24 gennaio 2011 15:27:51 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: Re: [Xenomai-help] Problems withrt_task_createandrt_task_join.....
Quoted 5 lines
You explanations are hard to follow and understand, and what is more, ambiguous. Send us a piece of code which allows us to reproduce this issue. Trying to make it as simple as possible. For instance seeing if registering the interrupt causes any difference (if it does not make any difference, then remove it, you get the idea).
My code is really big and complex to reduce, I'll try to simplify it in next days.
Quoted 3 lines
As usual, we do not know what version of Xenomai, Adeos, Linux, etc... you are using. See:
http://www.xenomai.org/index.php/Request_for_informationI post them into firts mail of this thread, anyway they are:
- Linux system with kernel 2.6.35.7
- Xenomai 2.5.5.2
- Adeos ipipe patch 2.7-04
GCC is on version 4.4.3......
Quoted 3 lines
That is bad. One more question: what happens when you run the "latency" test, do you get strange results? Also, I see that you have the SMI workaround enabled, does it detect your chipset?
Yes, as system log says, Xenomai detect SMI motherboard and disable them. I run the latency test: without other loads onto system, I observe values like these:
RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 6.680| 7.157| 12.187| 0| 0| 6.680| 12.187 RTD| 6.277| 6.980| 10.519| 0| 0| 6.277| 12.187 RTD| 1.175| 7.122| 9.315| 0| 0| 1.175| 12.187 RTD| 1.578| 7.112| 9.382| 0| 0| 1.175| 12.187 RTD| 1.635| 7.133| 10.307| 0| 0| 1.175| 12.187
Quoted 4 lines
also after long runnings.
But if I launch application contained into attached
main_app.cfile (that represents my simplified application) what I observe into latency test is:
What you observe when you launch your application is irrelevant. The latency test only makes sense if the the latency test is the only one running with high priority. So, what you should run is some non-realtime load.
Also, your application creates a thread with priority 99 using all the CPU. This is absolutely not what Xenomai is made for. No wonder the system stops working correctly when you do that.
Signature · 1 line
Gilles.
Quoted 47 lines · Gilles Chanteperdrix
Quoted 41 lines · Michel Rinaldi
----- Messaggio originale -----
Da: "Gilles Chanteperdrix" <[email protected]>
A: "Michel Rinaldi" <[email protected]>
Cc: [email protected]
Inviato: Lunedì, 24 gennaio 2011 15:27:51 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: Re: [Xenomai-help] Problems withrt_task_createandrt_task_join.....
Quoted 5 lines
You explanations are hard to follow and understand, and what is more, ambiguous. Send us a piece of code which allows us to reproduce this issue. Trying to make it as simple as possible. For instance seeing if registering the interrupt causes any difference (if it does not make any difference, then remove it, you get the idea).
My code is really big and complex to reduce, I'll try to simplify it in next days.
Quoted 3 lines
As usual, we do not know what version of Xenomai, Adeos, Linux, etc... you are using. See:
http://www.xenomai.org/index.php/Request_for_informationI post them into firts mail of this thread, anyway they are:
- Linux system with kernel 2.6.35.7
- Xenomai 2.5.5.2
- Adeos ipipe patch 2.7-04
GCC is on version 4.4.3......
Quoted 3 lines
That is bad. One more question: what happens when you run the "latency" test, do you get strange results? Also, I see that you have the SMI workaround enabled, does it detect your chipset?
Yes, as system log says, Xenomai detect SMI motherboard and disable them. I run the latency test: without other loads onto system, I observe values like these:
RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 6.680| 7.157| 12.187| 0| 0| 6.680| 12.187 RTD| 6.277| 6.980| 10.519| 0| 0| 6.277| 12.187 RTD| 1.175| 7.122| 9.315| 0| 0| 1.175| 12.187 RTD| 1.578| 7.112| 9.382| 0| 0| 1.175| 12.187 RTD| 1.635| 7.133| 10.307| 0| 0| 1.175| 12.187Quoted 4 lines
also after long runnings.
But if I launch application contained into attached
main_app.cfile (that represents my simplified application) what I observe into latency test is:
Quoted 8 lines
What you observe when you launch your application is irrelevant. The latency test only makes sense if the the latency test is the only one running with high priority. So, what you should run is some non-realtime load.
Also, your application creates a thread with priority 99 using all the CPU. This is absolutely not what Xenomai is made for. No wonder the system stops working correctly when you do that.
Ok. Sorry, the rt_sem_p is actually waiting for the semaphore. So, for it to take a long time, the kernel module would have to post it all the time. In the kernel module, you should check rtdm_task_wait_period return value.
Anyway, what I said still stands: if we suspect the application of being the culprit, we should try and run a system without this application first. That is, only latency and some non real-time load.
Signature · 1 line
Gilles.