mirror of https://github.com/mkerrisk/man-pages
sched_setaffinity.2: Improvements after comments by Florian Weimer
Reported-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
dde6d764a3
commit
9dbfb3b839
|
@ -241,7 +241,7 @@ system call returns the size (in bytes) of the
|
||||||
.I cpumask_t
|
.I cpumask_t
|
||||||
data type that is used internally by the kernel to
|
data type that is used internally by the kernel to
|
||||||
represent the CPU set bit mask.
|
represent the CPU set bit mask.
|
||||||
.SS Handling systems with more than 1024 CPUs
|
.SS Handling systems with large CPU affinity masks
|
||||||
The underlying system calls (which represent CPU masks as bit masks of type
|
The underlying system calls (which represent CPU masks as bit masks of type
|
||||||
.IR "unsigned long\ *" )
|
.IR "unsigned long\ *" )
|
||||||
impose no restriction on the size of the CPU mask.
|
impose no restriction on the size of the CPU mask.
|
||||||
|
@ -251,7 +251,8 @@ data type used by glibc has a fixed size of 128 bytes,
|
||||||
meaning that the maximum CPU number that can be represented is 1023.
|
meaning that the maximum CPU number that can be represented is 1023.
|
||||||
.\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=15630
|
.\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=15630
|
||||||
.\" and https://sourceware.org/ml/libc-alpha/2013-07/msg00288.html
|
.\" and https://sourceware.org/ml/libc-alpha/2013-07/msg00288.html
|
||||||
If the system has more than 1024 CPUs, then calls of the form:
|
If the kernel CPU affinity mask is larger than 1024,
|
||||||
|
then calls of the form:
|
||||||
|
|
||||||
sched_getaffinity(pid, sizeof(cpu_set_t), &mask);
|
sched_getaffinity(pid, sizeof(cpu_set_t), &mask);
|
||||||
|
|
||||||
|
@ -262,8 +263,10 @@ the error produced by the underlying system call for the case where the
|
||||||
size specified in
|
size specified in
|
||||||
.I cpusetsize
|
.I cpusetsize
|
||||||
is smaller than the size of the affinity mask used by the kernel.
|
is smaller than the size of the affinity mask used by the kernel.
|
||||||
|
(Depending on the system CPU topology, the kernel affinity mask can
|
||||||
|
be substantially larger than the number of active CPUs in the system.)
|
||||||
.PP
|
.PP
|
||||||
When working on systems with more than 1024 CPUs,
|
When working on systems with large kernel CPU affinity masks,
|
||||||
one must dynamically allocate the
|
one must dynamically allocate the
|
||||||
.I mask
|
.I mask
|
||||||
argument.
|
argument.
|
||||||
|
|
Loading…
Reference in New Issue