mirror of https://github.com/mkerrisk/man-pages
sched_setaffinity.2: Add note on system-imposed restrictions on CPUs actually used
After Loic Domaigne's suggestion for pthread_setaffinity_np(3), add similar text to this page noting that the system silently limits the set of CPUs on which the process actually runs to the set of CPUs physically present and the limits imposed by cpuset(7). Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> Reported-by: Loic Domaigne <tech@domaigne.com> Acked-by: Bert Wesarg <bert.wesarg@googlemail.com>
This commit is contained in:
parent
553e8b962e
commit
9c7cf1820f
|
@ -32,7 +32,7 @@
|
|||
.\" 2008-11-12, mtk, removed CPU_*() macro descriptions to a
|
||||
.\" separate CPU_SET(3) page.
|
||||
.\"
|
||||
.TH SCHED_SETAFFINITY 2 2008-11-13 "Linux" "Linux Programmer's Manual"
|
||||
.TH SCHED_SETAFFINITY 2 2008-11-14 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
sched_setaffinity, sched_getaffinity \- \
|
||||
set and get a process's CPU affinity mask
|
||||
|
@ -122,7 +122,10 @@ A supplied memory address was invalid.
|
|||
.B EINVAL
|
||||
The affinity bit mask
|
||||
.I mask
|
||||
contains no processors that are physically on the system.
|
||||
contains no processors that are currently physically on the system
|
||||
and permitted to the process according to any restrictions that
|
||||
may be imposed by the "cpuset" mechanism described in
|
||||
.BR cpuset (7).
|
||||
.TP
|
||||
.B EINVAL
|
||||
.RB ( sched_getaffinity ()
|
||||
|
@ -157,6 +160,19 @@ argument was removed, but was then restored in glibc 2.3.4, with type
|
|||
.SH "CONFORMING TO"
|
||||
These system calls are Linux-specific.
|
||||
.SH "NOTES"
|
||||
After a call to
|
||||
.BR sched_setaffinity (),
|
||||
the set of CPUs on which the process will actually run is
|
||||
the intersection of the set specified in the
|
||||
.I mask
|
||||
argument and the set of CPUs actually present on the system.
|
||||
The system may further restrict the set of CPUs on which the process
|
||||
runs if the "cpuset" mechanism described in
|
||||
.BR cpuset (7)
|
||||
is being used.
|
||||
These restrictions on the actual set of CPUs on which the process
|
||||
will run are silently imposed by the kernel.
|
||||
|
||||
.BR sched_setscheduler (2)
|
||||
has a description of the Linux scheduling scheme.
|
||||
.PP
|
||||
|
|
Loading…
Reference in New Issue