All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] CPU affinity on a per thread basis
@ 2008-06-15 22:40 Rob Gubler
  2008-06-15 23:04 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Gubler @ 2008-06-15 22:40 UTC (permalink / raw)
  To: xenomai

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

Hello,

I am using Xenomai 2.4.  I'd like to explicitly control which CPU a
particular thread executes on.  The Xenomai POSIX skin documentation says to
achieve this with
pthread_attr_setaffinity_np(...)<%28http://www.xenomai.org/documentation/trunk/html/api/group__posix__threadattr.html#gc79718c596b9cb0fdff961eede1f5995%29>my
thread needs to be created in the kernel space. I just want to verify
that this can not be accomplished in a user space thread?

I found a post<https://mail.gna.org/public/xenomai-help/2007-05/msg00300.html>a
year or so ago about this that mentions CPU affinity using
sched_setaffinity(...).  My understanding though is that this particular
call sets the affinity for the entire process/task and doesn't allow thread
specific CPU affinity control.  Is this true?

Lastly, is it possible to limit the Linux kernel to run on only a single CPU
to free all other CPUs for Xenomai specific tasks?

Thanks,

Rob

[-- Attachment #2: Type: text/html, Size: 1027 bytes --]

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

* Re: [Xenomai-help] CPU affinity on a per thread basis
  2008-06-15 22:40 [Xenomai-help] CPU affinity on a per thread basis Rob Gubler
@ 2008-06-15 23:04 ` Gilles Chanteperdrix
  2008-06-15 23:10   ` Rob Gubler
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2008-06-15 23:04 UTC (permalink / raw)
  To: Rob Gubler; +Cc: xenomai

Rob Gubler wrote:
 > Hello,
 > 
 > I am using Xenomai 2.4.  I'd like to explicitly control which CPU a
 > particular thread executes on.  The Xenomai POSIX skin documentation says to
 > achieve this with
 > pthread_attr_setaffinity_np(...)<%28http://www.xenomai.org/documentation/trunk/html/api/group__posix__threadattr.html#gc79718c596b9cb0fdff961eede1f5995%29>my
 > thread needs to be created in the kernel space. I just want to verify
 > that this can not be accomplished in a user space thread?
 > 
 > I found a post<https://mail.gna.org/public/xenomai-help/2007-05/msg00300.html>a
 > year or so ago about this that mentions CPU affinity using
 > sched_setaffinity(...).  My understanding though is that this particular
 > call sets the affinity for the entire process/task and doesn't allow thread
 > specific CPU affinity control.  Is this true?

The posix skin documentation only documents the kernel-space service,
because there is no special need to implement these services in
kernel-space: the libc already implements both
pthread_attr_setaffinity_np and pthread_setaffinity_np

 > 
 > Lastly, is it possible to limit the Linux kernel to run on only a single CPU
 > to free all other CPUs for Xenomai specific tasks?

This has been discussed recently on the mailing-list. I think the
conclusion was that you can not free completely free a cpu from linux
activity.

-- 


					    Gilles.


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

* Re: [Xenomai-help] CPU affinity on a per thread basis
  2008-06-15 23:04 ` Gilles Chanteperdrix
@ 2008-06-15 23:10   ` Rob Gubler
  2008-06-15 23:15     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Gubler @ 2008-06-15 23:10 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

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

On Sun, Jun 15, 2008 at 4:04 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:

> Rob Gubler wrote:
>  > Hello,
>  >
>  > I am using Xenomai 2.4.  I'd like to explicitly control which CPU a
>  > particular thread executes on.  The Xenomai POSIX skin documentation
> says to
>  > achieve this with
>  > pthread_attr_setaffinity_np(...)<%28
> http://www.xenomai.org/documentation/trunk/html/api/group__posix__threadattr.html#gc79718c596b9cb0fdff961eede1f5995%29
> >my
>  > thread needs to be created in the kernel space. I just want to verify
>  > that this can not be accomplished in a user space thread?
>  >
>  > I found a post<
> https://mail.gna.org/public/xenomai-help/2007-05/msg00300.html>a
>  > year or so ago about this that mentions CPU affinity using
>  > sched_setaffinity(...).  My understanding though is that this particular
>  > call sets the affinity for the entire process/task and doesn't allow
> thread
>  > specific CPU affinity control.  Is this true?
>
> The posix skin documentation only documents the kernel-space service,
> because there is no special need to implement these services in
> kernel-space: the libc already implements both
> pthread_attr_setaffinity_np and pthread_setaffinity_np
>


Thanks Gilles.  Did you mean:  "The posix skin documentation only documents
the kernel-space service, because there is no special need to implement
these services in **user-space** ..."  ??

-Rob

[-- Attachment #2: Type: text/html, Size: 2241 bytes --]

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

* Re: [Xenomai-help] CPU affinity on a per thread basis
  2008-06-15 23:10   ` Rob Gubler
@ 2008-06-15 23:15     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2008-06-15 23:15 UTC (permalink / raw)
  To: Rob Gubler; +Cc: xenomai

Rob Gubler wrote:
 > On Sun, Jun 15, 2008 at 4:04 PM, Gilles Chanteperdrix <
 > gilles.chanteperdrix@xenomai.org> wrote:
 > 
 > > Rob Gubler wrote:
 > >  > Hello,
 > >  >
 > >  > I am using Xenomai 2.4.  I'd like to explicitly control which CPU a
 > >  > particular thread executes on.  The Xenomai POSIX skin documentation
 > > says to
 > >  > achieve this with
 > >  > pthread_attr_setaffinity_np(...)<%28
 > > http://www.xenomai.org/documentation/trunk/html/api/group__posix__threadattr.html#gc79718c596b9cb0fdff961eede1f5995%29
 > > >my
 > >  > thread needs to be created in the kernel space. I just want to verify
 > >  > that this can not be accomplished in a user space thread?
 > >  >
 > >  > I found a post<
 > > https://mail.gna.org/public/xenomai-help/2007-05/msg00300.html>a
 > >  > year or so ago about this that mentions CPU affinity using
 > >  > sched_setaffinity(...).  My understanding though is that this particular
 > >  > call sets the affinity for the entire process/task and doesn't allow
 > > thread
 > >  > specific CPU affinity control.  Is this true?
 > >
 > > The posix skin documentation only documents the kernel-space service,
 > > because there is no special need to implement these services in
 > > kernel-space: the libc already implements both
 > > pthread_attr_setaffinity_np and pthread_setaffinity_np
 > >
 > 
 > 
 > Thanks Gilles.  Did you mean:  "The posix skin documentation only documents
 > the kernel-space service, because there is no special need to implement
 > these services in **user-space** ..."  ??

Yes, in user-space, because they already exist there.

-- 


					    Gilles.


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

end of thread, other threads:[~2008-06-15 23:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-15 22:40 [Xenomai-help] CPU affinity on a per thread basis Rob Gubler
2008-06-15 23:04 ` Gilles Chanteperdrix
2008-06-15 23:10   ` Rob Gubler
2008-06-15 23:15     ` Gilles Chanteperdrix

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.