RT Application on isolated core
Hi!
I am doing some experiments on a Core2Duo CPU and I have some question on it. My setup is the following:
I have Xenomai 2.3.3 and kernel 2.6.20.4, SMP enabled.
I start the kernel with the option isolcpus=1 which works as all linux tasks run on CPU 0 (i.e. core 0).
Now, I start a very small Xenomai (native skin) application with on real time task on CPU 1 (core 1).
This application realizes an endless loop that does some dummy math operations (to burn CPU power...).
I am connected remotely to the PC (via telnet, no X available).
When I start the real time application I can work on a second telnet session for a while. However, after a couple of seconds, the PC seems to freeze as I am no longer able to work via telnet. I have to reset the PC to continue.
My question is now: What is happening here? This real time application is the only one to run on CPU 1, however there still seems to be a dependency to CPU 0.
When I place a rt_task_sleep() within the loop, everything is fine.
Thanks for all ideas on this.
Regards
Mathias
########## Start of Demo Application ################ #include <stdio.h>
#include <sys/mman.h>
#include <native/task.h>
#include <math.h>
RT_TASK task_desc;
volatile double d;
void mytask(void *cookie)
{
int i;
for (i=0; i< 10000; i++)
{
int j;
for (j=0; j<10000000; j++)
{
d = d + 1.32 * j * sin(j+123.2 + i * 121.2);
}
// Uncomment this to avoid freeze:
// rt_task_sleep(10000);
}
}
int main(void)
{
mlockall(MCL_CURRENT|MCL_FUTURE);
rt_task_spawn(&task_desc, "mytask", 0, 81, T_JOINABLE | T_FPU | T_CPU(1), &mytask, NULL);
rt_task_join(&task_desc);
printf("End\n");
return 0;
}########## End of Demo Application ################
Signature · 5 lines
Mathias Koehrer [email protected] Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 60 Pay TV Sender, einen elektronischen Programmführer mit Movie Star Bewertungen von TV Movie. Außerdem, aktuelle Filmhits und spannende Dokus in der Arcor-Videothek. Infos unter www.arcor.de/tv
Quoted 11 lines · M. Koehrer
Hi!
I am doing some experiments on a Core2Duo CPU and I have some question on it. My setup is the following:
I have Xenomai 2.3.3 and kernel 2.6.20.4, SMP enabled.
I start the kernel with the option isolcpus=1 which works as all linux tasks run on CPU 0 (i.e. core 0).
Now, I start a very small Xenomai (native skin) application with on real time task on CPU 1 (core 1).
This application realizes an endless loop that does some dummy math operations (to burn CPU power...).
Won't work as there is no such thing as perfect CPU isolation with Linux, at least so far. Please see related discussion and patches on LKML.
There is currently a thread running regarding the removal of isolcpus - cpusets are supposed to be used now. But more needs to be done, I'm just lacking references to the postings (somewhere in February). Google should help.
Jan