Subject: Re: Syscalls to set CPU affinity
To: Mindaugas R. <>
From: Adam Hamsik <>
List: tech-kern
Date: 09/10/2007 10:41:50
Hash: SHA1

On Sep 10, 2007, at 6:24 AM, Mindaugas R. wrote:

> Joerg Sonnenberger <> wrote:
>> Which of this applies to processes and which to threads?
> With these calls in Solaris you can bind processes, threads, tasks,  
> projects
> and zones according to the idtype. In our case it would be only  
> process and
> threads. Please see pset_bind(2) and processor_bind(2) man pages.
>> I don't think external setting of thread affinity is a good idea,  
>> that
>> should be the job of the application that cares.
No. Because administrator knows better then app developer what  
workload he has on his machine and how to get maximum performance  
from his system.

> Can you explain "external setting"?

> Please note, that there would be a schedctl(8) (or kind of such  
> tool), where
> administrator could bind the set of CPUs for application(s). Why do  
> you think
> it is a bad idea?
Sound good.

IMHO good idea is dedicate one cpu for aplication. e.g. in dual-core  
machine i can dedicate second core for mysql, httpd, whatever. And  
only that application/thread can run on this core/CPU.

- -----------------------------------------
Adam Hamsik
icq: 249727910

Proud NetBSD user.

We program to have fun.
Even when we program for money, we want to have fun as well.
~ Yukihiro Matsumoto

Version: GnuPG v1.4.7 (Darwin)