Linux compatible setaffinity.
Daniel Eischen
deischen at freebsd.org
Sat Jan 12 07:06:19 PST 2008
On Sat, 12 Jan 2008, Dag-Erling Smørgrav wrote:
> Daniel Eischen <deischen at freebsd.org> writes:
>> I favor the Solaris API which allows you to specify either a process
>> or a thread (LWP) and a processor set.
>
> Cf Kip. Regardless of which API we choose for FreeBSD applications, we
> should also implement the Linux API to simplify the porting of Linux
> applications.
This doesn't sound like a widely used Linux API for which someone
couldn't easily figure out how to translate cpu_setaffinity() into:
pset_bind(psetid_t pset, idtype_t idtype, id_t id,
psetid_t *opset);
where id is the process or thread id, and idtype is P_PID
or P_TID.
The linux compat ABI will want cpu_setaffinity() but that doesn't
mean we should provide it natively, when there is an API that
isn't as short-sighted as the Linux API.
Note that Solaris also has a set of command-line interfaces for
binding processors or threads to processors. We've used this
in the past, under Solaris 6 or 7 I think, but not under any
more recent releases.
--
DE
More information about the freebsd-arch
mailing list