|
NAMEcpuset , cpuset_getid ,
cpuset_setid —
manage CPU affinity sets
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <sys/param.h>
#include <sys/cpuset.h>
int
int
int
DESCRIPTIONThecpuset family of system calls allow applications to
control sets of processors and memory domains and assign processes and threads
to these sets. Processor sets contain lists of CPUs and domains that members
may run on and exist only as long as some process is a member of the set. All
processes in the system have an assigned set. The default set for all
processes in the system is the set numbered 1. Threads belong to the same set
as the process which contains them, however, they may further restrict their
set with the anonymous per-thread mask to bind to a specific CPU or subset of
CPUs and memory domains.
Sets are referenced by a number of type cpuset_id_t. Each thread has a root set, an assigned set, and an anonymous mask. Only the root and assigned sets are numbered. The root set is the set of all CPUs and memory domains available in the system or in the system partition the thread is running in. The assigned set is a subset of the root set and is administratively assignable on a per-process basis. Many processes and threads may be members of a numbered set. The anonymous set is a further thread-specific refinement on the assigned set. It is intended that administrators will manipulate numbered sets using cpuset(1) while application developers will manipulate anonymous sets using cpuset_setaffinity(2) and cpuset_setdomain(2). To select the correct set a value of type cpulevel_t is used. The following values for level are supported:
The which argument determines how the value of id is interpreted and is of type cpuwhich_t. The which argument may have the following values:
An id of '-1' may be used with a
which of A level argument of
The actual contents of the sets may be retrieved or manipulated using cpuset_getaffinity(2), cpuset_setaffinity(2), cpuset_getdomain(2), and cpuset_setdomain(2). See those manual pages for more detail. RETURN VALUESUpon successful completion, the value 0 is returned; otherwise the value -1 is returned and the global variable errno is set to indicate the error.ERRORSThe following error codes may be set in errno:
SEE ALSOcpuset(1), cpuset_getaffinity(2), cpuset_getdomain(2), cpuset_setaffinity(2), cpuset_setdomain(2), pthread_affinity_np(3), pthread_attr_affinity_np(3), cpuset(9)HISTORYThecpuset family of system calls first appeared in
FreeBSD 7.1.
AUTHORSJeffrey Roberson <jeff@FreeBSD.org>
Visit the GSP FreeBSD Man Page Interface. |