Affinity issues past 1024 cpus
Submitted by Nathan Zimmer
Link to original bug (#704034)
Description
On large systems, those with more the 1024 cpus affinity issues can arise. cpu_set_t is only capable of holding 1024 cpus.
My rough analysis seems to indicate the issue is limited to glibtop_get_proc_affinity_s.
The current way I have solved similar bugs is to use dynamic cpu_set_t and the CPU_S instead of CPU,
-
cpu_set_t cpu_mask;
-
cpu_set_t * cpu_mask;
-
cpu_mask = CPU_ALLOC(nrcpus);
-
mask_size = CPU_ALLOC_SIZE(nrcpus);
-
sched_getaffinity(pid, sizeof(cpu_mask), &cpu_mask);
-
sched_getaffinity(pid, mask_size, cpu_mask));
-
if(CPU_ISSET(check_cpu, &set)
-
if(CPU_ISSET_S(mask_size, check_cpu, &set)