From: Arnout Vandecappelle <arnout@mind.be>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>,
xenomai@xenomai.org
Subject: Re: [Xenomai] Native skin rt_task_create/rt_task_shadow doesn't inherit affinity
Date: Wed, 17 Oct 2012 15:02:17 +0200 [thread overview]
Message-ID: <507EAC59.6000909@mind.be> (raw)
In-Reply-To: <507EA55E.6010506@xenomai.org>
On 17/10/12 14:32, Gilles Chanteperdrix wrote:
> On 10/17/2012 01:28 PM, Arnout Vandecappelle wrote:
>> Hoi,
>>
>> I noticed that when using the native skin, starting an application with
>> "taskset 2<my_app>" does not put the application on processor 2. Diving into
>> the code, it turns out that calling rt_task_shadow() throws away the thread's
>> cpuset,
>
> That is an issue.
With cpuset, I mean the Linux cpuset, i.e. current->cpus_allowed. There
may have been some misunderstanding about this.
>> and also rt_task_create() looks only at the mode parameter and ignores
>> the parent thread's affinity.
>
> That does not look like an issue. Why should a task inherit its parent's
> affinity.
I don't know if it should - it's not specified in the documentation. But
it is how posix threads behave.
Also, if the affinity is not inherited, there isn't much point of having
more than one processor in it, because nucleus will just fix the task to
the first cpu of the set (if I understand correctly).
>> Is this intentional? If yes, that means that using the native skin, there
>> is no way to set a task's affinity except explicitly specifying T_CPU when
>> the task is started, right?
>
> No, this looks like a different issue.
>
>>
>> Note, by the way, that calling sched_setaffinity _after_ the task has started
>> _will_ change the affinity (cfr. switchtest), but any calls _before_ the task
>> has started are ignored.
>
> Well, if the thread is not created, how sched_setaffinity change its
> affinity?
The (shadow) thread is created, but with a different cpuset than the
Linux thread. Or rather, the cpuset is changed by shadowing the thread.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
next prev parent reply other threads:[~2012-10-17 13:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 11:28 [Xenomai] Native skin rt_task_create/rt_task_shadow doesn't inherit affinity Arnout Vandecappelle
2012-10-17 12:32 ` Gilles Chanteperdrix
2012-10-17 13:02 ` Arnout Vandecappelle [this message]
2012-10-17 13:10 ` Gilles Chanteperdrix
2012-10-17 16:33 ` Arnout Vandecappelle
2012-10-17 19:59 ` Gilles Chanteperdrix
2012-10-17 22:02 ` Arnout Vandecappelle
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=507EAC59.6000909@mind.be \
--to=arnout@mind.be \
--cc=gilles.chanteperdrix@xenomai.org \
--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.