linux-stable/tools/perf/bench
Athira Rajeev c9c2a427dd 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@linux.vnet.ibm.com>
Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Tested-by: Disha Goel <disgoel@linux.vnet.ibm.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nageswara R Sastry <rnsastry@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Link: https://lore.kernel.org/r/20220406175113.87881-2-atrajeev@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-04-09 12:34:29 -03:00
..
bench.h perf bench: Add benchmark for evlist open/close operations 2021-08-10 11:32:37 -03:00
Build perf bench: Add benchmark for evlist open/close operations 2021-08-10 11:32:37 -03:00
epoll-ctl.c perf bench: Fix NULL check against wrong variable 2022-03-12 10:49:13 -03:00
epoll-wait.c perf cpumap: Migrate to libperf cpumap api 2022-01-22 17:08:42 -03:00
evlist-open-close.c perf evlist: Rename cpus to user_requested_cpus 2022-04-01 16:19:35 -03:00
find-bit-bench.c tools: rename bitmap_alloc() to bitmap_zalloc() 2021-09-08 11:50:27 -07:00
futex-hash.c perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K 2022-04-09 12:34:29 -03:00
futex-lock-pi.c perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K 2022-04-09 12:34:29 -03:00
futex-requeue.c perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K 2022-04-09 12:34:29 -03:00
futex-wake-parallel.c perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K 2022-04-09 12:34:29 -03:00
futex-wake.c perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K 2022-04-09 12:34:29 -03:00
futex.h Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t" 2021-11-01 11:42:54 -03:00
inject-buildid.c perf bench inject-buildid: Handle writen() errors 2021-08-30 10:06:37 -03:00
kallsyms-parse.c perf bench: Add kallsyms parsing 2020-05-05 16:35:32 -03:00
mem-functions.c perf bench mem: Always memset source before memcpy 2020-08-13 09:34:26 -03:00
mem-memcpy-arch.h
mem-memcpy-x86-64-asm-def.h
mem-memcpy-x86-64-asm.S tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' 2020-11-12 17:55:41 -03:00
mem-memset-arch.h
mem-memset-x86-64-asm-def.h
mem-memset-x86-64-asm.S tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' 2020-11-12 17:55:41 -03:00
numa.c perf tools: Fix various typos in comments 2021-03-23 17:13:43 -03:00
sched-messaging.c Revert "perf bench: Fix two memory leaks detected with ASan" 2021-12-06 21:57:52 -03:00
sched-pipe.c perf tools: Cast (struct timeval).tv_sec when printing 2021-03-06 16:54:24 -03:00
synthesize.c perf tools: Allow controlling synthesizing PERF_RECORD_ metadata events during record 2021-09-17 08:44:19 -03:00
syscall.c perf tools: Cast (struct timeval).tv_sec when printing 2021-03-06 16:54:24 -03:00