Linux compatible setaffinity.
Robert Watson
rwatson at FreeBSD.org
Sat Jan 12 10:34:07 PST 2008
On Fri, 11 Jan 2008, Andrew Gallatin wrote:
> I'm somewhat surprised that this has not hit the tree yet. What happened?
> Wasn't the consensus that it was a good thing?
I think Jeff just got busy with other stuff.
> FWIW, I was too busy to reply at the time, but I agree that the Apple
> interface is nice. However, sometimes one needs a hard CPU binding
> interface like this one, and I don't see any reason to defer adding this
> interface in favor of the Apple one, since they are somewhat orthogonal.
> I'd be strongly in favor of having a hard CPU binding interface.
The Apple API is nice in terms of capabilities, but we wouldn't be able to use
it directly as it Mach-esque (as I understand it). Of course, Jeff's
implementation of the Linux API doesn't actually fully implement the API (it
doesn't support constraining the CPU set vs. binding to one CPU, and the patch
as-provided didn't support querying the binding). I agree I'd like to see if
in the tree, if only because it would let me eliminate local hacks I have that
do the same thing, but we should think about other interfaces that are more
expressive in the longer term.
For example, one thing I like about the Apple interface is the ability to
specify general strategies for affinity rather than specific affinities --
"these threads like to be together, but they don't mind where that is".
Likewise, the Solaris facility to be able to change a CPU set and have all the
things pinned to it follow the centrally-administered set is a nice match for
our concept of Jail. Finally, if we do want it to work well with Jail, and we
want Jails to be able to be pinned to sets of CPUs, we also need a nested
concept of how to handle affinity, in the event that the set of CPUs a Jail is
running on changes, in which case perhaps you want relative numbering within
the jail, or some other similar notion.
Sounds like a nice whiteboard session at the BSDCan developer summit...
Robert N M Watson
Computer Laboratory
University of Cambridge
More information about the freebsd-arch
mailing list