perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K
The 'perf bench futex' testcase fails on systems with more than 1K CPUs. Testcase: perf bench futex all Failure snippet: <<>>Running futex/hash benchmark... perf: pthread_create: No such file or directory <<>> All the futex benchmarks (ie hash, lock-api, requeue, wake, wake-parallel), pthread_create is invoked in respective bench_futex_* function. Though the logs shows direct failure from pthread_create, strace logs showed that actual failure is from "sched_setaffinity" returning EINVAL (invalid argument). This happens because the default mask size in glibc is 1024. To overcome this 1024 CPUs mask size limitation of cpu_set_t, change the mask size using the CPU_*_S macros. Patch addresses this by fixing all the futex benchmarks to use CPU_ALLOC to allocate cpumask, CPU_ALLOC_SIZE for size, and CPU_SET_S to set the mask. Reported-by:Disha Goel <disgoel@linux.vnet.ibm.com> Reviewed-by:
Srikar Dronamraju <srikar@li...>
Showing
- tools/perf/bench/futex-hash.c 19 additions, 7 deletionstools/perf/bench/futex-hash.c
- tools/perf/bench/futex-lock-pi.c 16 additions, 5 deletionstools/perf/bench/futex-lock-pi.c
- tools/perf/bench/futex-requeue.c 16 additions, 5 deletionstools/perf/bench/futex-requeue.c
- tools/perf/bench/futex-wake-parallel.c 16 additions, 5 deletionstools/perf/bench/futex-wake-parallel.c
- tools/perf/bench/futex-wake.c 16 additions, 6 deletionstools/perf/bench/futex-wake.c
Please register or sign in to comment