summaryrefslogtreecommitdiffstats
path: root/man2/sched_setaffinity.2
diff options
context:
space:
mode:
Diffstat (limited to 'man2/sched_setaffinity.2')
-rw-r--r--man2/sched_setaffinity.272
1 files changed, 36 insertions, 36 deletions
diff --git a/man2/sched_setaffinity.2 b/man2/sched_setaffinity.2
index 7f87fabb1..aa083ffd0 100644
--- a/man2/sched_setaffinity.2
+++ b/man2/sched_setaffinity.2
@@ -49,7 +49,7 @@ A CPU affinity mask is represented by the
structure, a "CPU set", pointed to by
.IR mask .
A set of macros for manipulating CPU sets is described in
-.BR CPU_SET (3).
+.MR CPU_SET 3 .
.P
.BR sched_setaffinity ()
sets the CPU affinity mask of the thread whose ID is
@@ -112,7 +112,7 @@ and permitted to the thread according to any restrictions that
may be imposed by
.I cpuset
cgroups or the "cpuset" mechanism described in
-.BR cpuset (7).
+.MR cpuset 7 .
.TP
.B EINVAL
.RB ( sched_getaffinity ()
@@ -157,7 +157,7 @@ the intersection of the set specified in the
argument and the set of CPUs actually present on the system.
The system may further restrict the set of CPUs on which the thread
runs if the "cpuset" mechanism described in
-.BR cpuset (7)
+.MR cpuset 7
is being used.
These restrictions on the actual set of CPUs on which the thread
will run are silently imposed by the kernel.
@@ -166,7 +166,7 @@ There are various ways of determining the number of CPUs
available on the system, including: inspecting the contents of
.IR /proc/cpuinfo ;
using
-.BR sysconf (3)
+.MR sysconf 3
to obtain the values of the
.B _SC_NPROCESSORS_CONF
and
@@ -174,23 +174,23 @@ and
parameters; and inspecting the list of CPU directories under
.IR /sys/devices/system/cpu/ .
.P
-.BR sched (7)
+.MR sched 7
has a description of the Linux scheduling scheme.
.P
The affinity mask is a per-thread attribute that can be
adjusted independently for each of the threads in a thread group.
The value returned from a call to
-.BR gettid (2)
+.MR gettid 2
can be passed in the argument
.IR pid .
Specifying
.I pid
as 0 will set the attribute for the calling thread,
and passing the value returned from a call to
-.BR getpid (2)
+.MR getpid 2
will set the attribute for the main thread of the thread group.
(If you are using the POSIX threads API, then use
-.BR pthread_setaffinity_np (3)
+.MR pthread_setaffinity_np 3
instead of
.BR sched_setaffinity ().)
.P
@@ -202,7 +202,7 @@ Following the use of this boot option,
the only way to schedule processes onto the isolated CPUs is via
.BR sched_setaffinity ()
or the
-.BR cpuset (7)
+.MR cpuset 7
mechanism.
For further information, see the kernel source file
.IR Documentation/admin\-guide/kernel\-parameters.txt .
@@ -213,10 +213,10 @@ is the preferred mechanism of isolating CPUs
of all processes on the system).
.P
A child created via
-.BR fork (2)
+.MR fork 2
inherits its parent's CPU affinity mask.
The affinity mask is preserved across an
-.BR execve (2).
+.MR execve 2 .
.SS C library/kernel differences
This manual page describes the glibc interface for the CPU affinity calls.
The actual system call interface is slightly different, with the
@@ -270,7 +270,7 @@ When working on systems with large kernel CPU affinity masks,
one must dynamically allocate the
.I mask
argument (see
-.BR CPU_ALLOC (3)).
+.MR CPU_ALLOC 3 ).
Currently, the only way to do this is by probing for the size
of the required mask using
.BR sched_getaffinity ()
@@ -278,7 +278,7 @@ calls with increasing mask sizes (until the call does not fail with the error
.BR EINVAL ).
.P
Be aware that
-.BR CPU_ALLOC (3)
+.MR CPU_ALLOC 3
may allocate a slightly larger CPU set than requested
(because CPU sets are implemented as bit masks allocated in units of
.IR sizeof(long) ).
@@ -288,7 +288,7 @@ can set bits beyond the requested allocation size, because the kernel
sees a few additional bits.
Therefore, the caller should iterate over the bits in the returned set,
counting those which are set, and stop upon reaching the value returned by
-.BR CPU_COUNT (3)
+.MR CPU_COUNT 3
(rather than iterating over the number of bits
requested to be allocated).
.SH EXAMPLES
@@ -306,7 +306,7 @@ consumed when running the program will depend on intra-core caching effects
and whether the processes are using the same CPU.
.P
We first employ
-.BR lscpu (1)
+.MR lscpu 1
to determine that this (x86)
system has two cores, each with two CPUs:
.P
@@ -404,24 +404,24 @@ main(int argc, char *argv[])
.SH SEE ALSO
.ad l
.nh
-.BR lscpu (1),
-.BR nproc (1),
-.BR taskset (1),
-.BR clone (2),
-.BR getcpu (2),
-.BR getpriority (2),
-.BR gettid (2),
-.BR nice (2),
-.BR sched_get_priority_max (2),
-.BR sched_get_priority_min (2),
-.BR sched_getscheduler (2),
-.BR sched_setscheduler (2),
-.BR setpriority (2),
-.BR CPU_SET (3),
-.BR get_nprocs (3),
-.BR pthread_setaffinity_np (3),
-.BR sched_getcpu (3),
-.BR capabilities (7),
-.BR cpuset (7),
-.BR sched (7),
-.BR numactl (8)
+.MR lscpu 1 ,
+.MR nproc 1 ,
+.MR taskset 1 ,
+.MR clone 2 ,
+.MR getcpu 2 ,
+.MR getpriority 2 ,
+.MR gettid 2 ,
+.MR nice 2 ,
+.MR sched_get_priority_max 2 ,
+.MR sched_get_priority_min 2 ,
+.MR sched_getscheduler 2 ,
+.MR sched_setscheduler 2 ,
+.MR setpriority 2 ,
+.MR CPU_SET 3 ,
+.MR get_nprocs 3 ,
+.MR pthread_setaffinity_np 3 ,
+.MR sched_getcpu 3 ,
+.MR capabilities 7 ,
+.MR cpuset 7 ,
+.MR sched 7 ,
+.MR numactl 8