All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] RT Application on isolated core
@ 2008-06-04  9:08 M. Koehrer
  2008-06-04 21:57 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: M. Koehrer @ 2008-06-04  9:08 UTC (permalink / raw)
  To: xenomai

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 ################



-- 
Mathias Koehrer
mathias_koehrer@domain.hid


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Xenomai-help] RT Application on isolated core
  2008-06-04  9:08 [Xenomai-help] RT Application on isolated core M. Koehrer
@ 2008-06-04 21:57 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2008-06-04 21:57 UTC (permalink / raw)
  To: M. Koehrer; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

M. Koehrer wrote:
> 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-04 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04  9:08 [Xenomai-help] RT Application on isolated core M. Koehrer
2008-06-04 21:57 ` Jan Kiszka

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.