diff --git a/man2/sched_setaffinity.2 b/man2/sched_setaffinity.2 index 8b5b96db2..151c9c8c7 100644 --- a/man2/sched_setaffinity.2 +++ b/man2/sched_setaffinity.2 @@ -241,7 +241,7 @@ system call returns the size (in bytes) of the .I cpumask_t data type that is used internally by the kernel to 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 .IR "unsigned long\ *" ) 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. .\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=15630 .\" 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); @@ -262,8 +263,10 @@ the error produced by the underlying system call for the case where the size specified in .I cpusetsize 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 -When working on systems with more than 1024 CPUs, +When working on systems with large kernel CPU affinity masks, one must dynamically allocate the .I mask argument.