Linux compatible setaffinity.

Jeff Roberson jroberson at chesapeake.net
Thu Feb 21 03:57:31 UTC 2008


On Thu, 21 Feb 2008, David Xu wrote:

> Robert Watson wrote:
>> 
>> On Wed, 20 Feb 2008, Jeff Roberson wrote:
>> 
>>>> So perhaps this means a slightly more complex API, but not much more 
>>>> complex. How about:
>>>> 
>>>> int cpuaffinity_get(scope, id, length, mask)
>>>> int cpuaffinity_getmax(scope, id, length, mask)
>>>> int cpuaffinity_set(scope, id, length, mask)
>>>> int cpuaffinity_setmax(scope, id, length, mask)
>>>> 
>
> Are these features only for jail or something else which don't care CPU
> L2 cache sharing between cores ? since program still can not figure out
> L2 sharing information, no way to optimize its thread's cpu arrangement.

These are all for binding to specific cpu sets.  Potentially with some 
support for creating something like solaris psets.   This is when you have 
some static information about what processors to use.

I think a cache aware solution will be the next process.  I have a patch 
which allows the kernel scheduler to understand the cache hierarchies in 
the system.  This information could be exported to userland if that would 
be useful.

>
> Regards,
> David Xu
>


More information about the freebsd-arch mailing list