All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] /proc/xenomai/affinity and T_CPU(n) in rt_task_create
@ 2007-12-19 15:15 M. Koehrer
  2007-12-19 15:59 ` [Xenomai-help] [RTnet-users] " Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: M. Koehrer @ 2007-12-19 15:15 UTC (permalink / raw)
  To: rtnet-users, xenomai

Hi everybody,

I am currently evaluating the latest Xenomai release 2.4.0 on a Dual Core Pentium 4 using
the 2.6.23 kernel and also the latest rtnet 0.9.10-rc1.
I have one question concerning the relation of the /proc/xenomai/affinity entry and the parameter
T_CPU(n) I pass with rt_task_create (native API).
If I set /proc/xenomai/affinity to 1 (which means to run all real time tasks on CPU 0). I am not allowed
to pass T_CPU(1) with rt_task_create. rt_task_start returns with a -EINVAL.

Background for my question is:
rtnet uses a internal system task For this task I cannot pass the CPU I want to run this CPU on.
My idea is now to set /proc/xenomai/affinity to 1 which means (in my mind) that all tasks that do
not have specified explicitly a task number (T_CPU(n)) will run on the CPU(s) specified by /proc/xenomai/affinity.
All those tasks that specify T_CPU explicitly will run on the specified CPU, no matter what value 
/proc/xenomai/affinity is.
However, this seems not to work.

I want to run rtnet on CPU 0 and my own code on CPU 1. For this I write 1 to /proc/xenomai/affinity and 
pass T_CPU(1) with all my calls to rt_task_create. However, these tasks return with -EINVAL.
I debugged into Xenomai and found out that is caused in xnpod_start_thread() at the condition
if (xnarch_cpus_empty(thread->affinity)) ...

When I write 3 to /proc/xenomai/affinity my tasks start fine, however I have now no control of the
CPU placement of the rtnet system task.


Any hints on that are highly welcome.

 
Regards

Mathias


-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT FÜR ALLE NEUEINSTEIGER
Jetzt bei Arcor: günstig und schnell mit DSL - das All-Inclusive-Paket
für clevere Doppel-Sparer, nur  29,95 Euro  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2


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

* Re: [Xenomai-help] [RTnet-users] /proc/xenomai/affinity and T_CPU(n) in rt_task_create
  2007-12-19 15:15 [Xenomai-help] /proc/xenomai/affinity and T_CPU(n) in rt_task_create M. Koehrer
@ 2007-12-19 15:59 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2007-12-19 15:59 UTC (permalink / raw)
  To: M. Koehrer; +Cc: xenomai, rtnet-users

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

M. Koehrer wrote:
> Hi everybody,
> 
> I am currently evaluating the latest Xenomai release 2.4.0 on a Dual Core Pentium 4 using
> the 2.6.23 kernel and also the latest rtnet 0.9.10-rc1.
> I have one question concerning the relation of the /proc/xenomai/affinity entry and the parameter
> T_CPU(n) I pass with rt_task_create (native API).
> If I set /proc/xenomai/affinity to 1 (which means to run all real time tasks on CPU 0). I am not allowed
> to pass T_CPU(1) with rt_task_create. rt_task_start returns with a -EINVAL.
> 
> Background for my question is:
> rtnet uses a internal system task For this task I cannot pass the CPU I want to run this CPU on.
> My idea is now to set /proc/xenomai/affinity to 1 which means (in my mind) that all tasks that do
> not have specified explicitly a task number (T_CPU(n)) will run on the CPU(s) specified by /proc/xenomai/affinity.
> All those tasks that specify T_CPU explicitly will run on the specified CPU, no matter what value 
> /proc/xenomai/affinity is.
> However, this seems not to work.

Yes, the development version used to have this behaviour. But it didn't
work out for skins like POSIX where there is no clear
I-don't-care-about-affinity state on thread creation. So we switched to
unconditional enforcement before the final release (don't have the
thread at hand, but you can find it in the xenomai-core archive). Sorry
for the inconvenience, but it was unavoidable.

> 
> I want to run rtnet on CPU 0 and my own code on CPU 1. For this I write 1 to /proc/xenomai/affinity and 
> pass T_CPU(1) with all my calls to rt_task_create. However, these tasks return with -EINVAL.
> I debugged into Xenomai and found out that is caused in xnpod_start_thread() at the condition
> if (xnarch_cpus_empty(thread->affinity)) ...
> 
> When I write 3 to /proc/xenomai/affinity my tasks start fine, however I have now no control of the
> CPU placement of the rtnet system task.
> 
> 
> Any hints on that are highly welcome.

Suggested procedure:
1. set global affinity for RTnet and start up the stack
2. set global affinity for your application (or open it) and start that
   one up

Or do you have any tricky dependencies that work against this approach?

Jan


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

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

end of thread, other threads:[~2007-12-19 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 15:15 [Xenomai-help] /proc/xenomai/affinity and T_CPU(n) in rt_task_create M. Koehrer
2007-12-19 15:59 ` [Xenomai-help] [RTnet-users] " 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.