cairo-perf does not deal with cpus larger then 1024 well.
Submitted by Nathan Zimmer
Assigned to Chris Wilson @ickle
Description
The function check_cpu_affinity (void) can return incorrect results.
This function is attempting to confirm that the process is only running on a single cpu. On a large box it can report success where it should have failed.
For example if it has affinity with cpus 600, 1200 check_cpu_affinity will report it is ok when that true.
This issue is that CPU_SETSIZE on some distros is 1024, but the kernel is quite capable of handling 4096 cpus.
The code in question is here.
cpu_set_t affinity
for(i = 0, cpu_count = 0; i < CPU_SETSIZE; ++i) {
if (CPU_ISSET(i, &affinity))
++cpu_count;
}
Version: 1.12.14