All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: "RAKOTOSALAMA, Nirilanto" <NIRILANTO.RAKOTOSALAMA@airbus.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] [Newbie question] threads and task CPU affinity
Date: Thu, 24 May 2007 09:53:12 +0200	[thread overview]
Message-ID: <46554468.70307@domain.hid> (raw)
In-Reply-To: <5C40CD1E4697424ABDE3AC57CF1B22C6032202C6@domain.hid>

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

RAKOTOSALAMA, Nirilanto wrote:
>>> Hello,
>>>
>>> I have some question about CPU affinity with Xenomai 2.3.1.
>>> (it is to see if  xenomai support developing for a cpu 
>> manager library is feasible)
>>
>> What will this library do? (/me just nosy)
> 
> In fact, there's simulation programs that run on many different systems (hard + soft),
> and to make this applications as portable as possible, they use libraries developed for every
> systems (dec alpha, pc, specific cards, linux, unix). And, I search if xenomai could be used
> with less re-implementation effort, so the more posix function are developed by xenomai, 
> the better it is, and easier it is (for me :p).
> So first step is developing this libraries xenomai support (e.g. timer, cpu).
> This cpu library should provides "simple" functions like : getting the number of cpu,
> setting/getting the cpu affinity for a process passing its pid, protect/un-protect cpu from running
> unwanted process.

OK, I see.

> 
>>> When using rt_task_create, CPU mask can be specified. 
>> However, when sched_setaffinity is called 
>>> to modify main program affinity, and after, rt_task_create 
>> is called without specifying CPU mask,
>>> did the child task inherits from the main program affinity ?
>> If you don't provide a target CPU (either on creation or via
>> /proc/xenomai/affinity), better consider the affinity as unspecified
>> (any possible CPU). The target CPU derives from Linux 
>> decision where to
>> put the thread non-RT boot code on, Xenomai just nails that decision
>> down until someone explicitly migrates.
>>
>>> Same question for Posix skin threads ?
>>>
>>> Can native task affinity be set other than when creating ? 
>> using sdhed_setaffinity ?
>>
>> /proc/xenomai/affinity (has global scope) or 
>> sched_setaffinity. Xenomai
>> shadow threads follow the migration that may took place while in
>> secondary mode, and sched_setaffinity comes with such a mode switch.
> 
> Thanks, If I have well understood, tasks or threads affinity can be set using /proc/xenomai/affinity
> but, I have read that /proc/xenomai/affinity does not exist in xenomai 2.3.1 and xenomai must be patched

Yes, it's an upcoming feature of 2.4.

> (I don't know how because I don't have nor SVN neither internet connection on my xenomai boxes).

There is a daily snapshot on gna.org: https://gna.org/svn/?group=xenomai

> So I can use sched_setaffinity, but it make switch to secondary mode. 
> Does'nt matter if only threads must be RT and sched_setaffinity is called during a non-rt init phase, does it ?

Yep.

> That means that affinity does'nt depend on running on xenomai or secondary mode ?

Sorry, doesn't parse for me right now.

> 
> BTW, is protecting a CPU with xenomai possible ? 
> Does xenomai use /dev/cpuset or an other device ?

Xenomai doesn't directly interact with cpuset -- but... if you force
some RT process into a certain CPU and you don't override this decision
on RT thread creation, Xenomai will follow as explained.

Jan


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

  reply	other threads:[~2007-05-24  7:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23  8:47 [Xenomai-help] [Newbie question] threads and task CPU affinity RAKOTOSALAMA, Nirilanto
2007-05-24  7:53 ` Jan Kiszka [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-01  8:36 RAKOTOSALAMA, Nirilanto
2007-05-31 15:48 RAKOTOSALAMA, Nirilanto
2007-05-31 15:48 RAKOTOSALAMA, Nirilanto
2007-05-31 13:08 RAKOTOSALAMA, Nirilanto
2007-05-31 13:29 ` Gilles Chanteperdrix
2007-05-31 13:32 ` Jan Kiszka
2007-05-31 14:18   ` Gilles Chanteperdrix
2007-05-31 14:28     ` Jan Kiszka
2007-05-31 14:36       ` Gilles Chanteperdrix
2007-05-31 13:36 ` Gilles Chanteperdrix
2007-05-31 14:28 ` Philippe Gerum
2007-05-24 10:12 RAKOTOSALAMA, Nirilanto
2007-05-24 12:07 ` Jan Kiszka
2007-05-24 12:28   ` Gilles Chanteperdrix
2007-05-22 14:51 RAKOTOSALAMA, Nirilanto
2007-05-22 16:59 ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46554468.70307@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=NIRILANTO.RAKOTOSALAMA@airbus.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.