Linux compatible setaffinity.

Jeff Roberson jroberson at chesapeake.net
Sat Jan 12 21:44:07 PST 2008


On Sat, 12 Jan 2008, Daniel Eischen wrote:

> On Sat, 12 Jan 2008, Jeff Roberson wrote:
>
>> Now, there is one problem with the linux api that I want to discuss before 
>> I commit it.  The current patch always works on curthread.  However, the 
>> api allows for setting the binding of a pid.  I believe, although I'm not 
>> certain, that pids and tids in linux are in the same number space.  It's 
>> not clear to me whether you can set an affinity for an entire process and 
>> have it effect an individual thread or whether you set it on a thread by 
>> thread basis.  When supplying a non-curproc pid do you bind all threads in 
>> the target process?
>> 
>> Are our tids and pids in the same number space?  And are they available to 
>> application programmers?  I haven't followed that very carefully.
>
> I believe marcel made tids and pids disjoint so that any pid is
> never equal to any tid.  But regardless, I don't think we want
> to rely on that.  I would prefer the Solaris approach of specifying
> what we want (pid, tid, jail id, etc) as an argument in the API
> so there is no confusion.

Yes, I would prefer that as well I believe.  So I'll add an extra 
parameter and in the linux code we'll use whatever their default is.  Of 
course the initial implementation will still only support curthread but 
I plan on finishing the rest before 8.0 is done.

Jeff

>
> -- 
> DE
>


More information about the freebsd-arch mailing list