All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] tools/perf: Fix perf bench numa, futex and epoll to work with machines having #CPUs > 1K
@ 2022-04-01 18:58 ` Athira Rajeev
  0 siblings, 0 replies; 19+ messages in thread
From: Athira Rajeev @ 2022-04-01 18:58 UTC (permalink / raw)
  To: acme, jolsa, disgoel
  Cc: mpe, linux-perf-users, linuxppc-dev, maddy, rnsastry, kjain

The perf benchmark for collections: numa, futex and epoll
hits failure in system configuration with CPU's more than 1024.
These benchmarks uses "sched_getaffinity" and "sched_setaffinity"
in the code to work with affinity.

Example snippet from numa benchmark:
<<>>
perf: bench/numa.c:302: bind_to_node: Assertion `!(ret)' failed.
Aborted (core dumped)
<<>>

bind_to_node function uses "sched_getaffinity" to save the cpumask.
This fails with EINVAL because the default mask size in glibc is 1024.

Similarly in futex and epoll benchmark, uses sched_setaffinity during
pthread_create with affinity. And since it returns EINVAL in such system
configuration, benchmark doesn't run.

To overcome this 1024 CPUs mask size limitation of cpu_set_t,
change the mask size using the CPU_*_S macros ie, use CPU_ALLOC to
allocate cpumask, CPU_ALLOC_SIZE for size, CPU_SET_S to set mask bit.

Fix all the relevant places in the code to use mask size which is large
enough to represent number of possible CPU's in the system.

Fix parse_setup_cpu_list function in numa bench to check if input CPU
is online before binding task to that CPU. This is to fix failures where,
though CPU number is within max CPU, it could happen that CPU is offline.
Here, sched_setaffinity will result in failure when using cpumask having
that cpu bit set in the mask.

Patch 1 and Patch 2 address fix for perf bench futex and perf bench
epoll benchmark. Patch 3 and Patch 4 address fix in perf bench numa
benchmark

Athira Rajeev (4):
  tools/perf: Fix perf bench futex to correct usage of affinity for
    machines with #CPUs > 1K
  tools/perf: Fix perf bench epoll to correct usage of affinity for
    machines with #CPUs > 1K
  tools/perf: Fix perf numa bench to fix usage of affinity for machines
    with #CPUs > 1K
  tools/perf: Fix perf bench numa testcase to check if CPU used to bind
    task is online

 tools/perf/bench/epoll-ctl.c           |  25 ++++--
 tools/perf/bench/epoll-wait.c          |  25 ++++--
 tools/perf/bench/futex-hash.c          |  26 ++++--
 tools/perf/bench/futex-lock-pi.c       |  21 +++--
 tools/perf/bench/futex-requeue.c       |  21 +++--
 tools/perf/bench/futex-wake-parallel.c |  21 +++--
 tools/perf/bench/futex-wake.c          |  22 +++--
 tools/perf/bench/numa.c                | 117 ++++++++++++++++++-------
 tools/perf/util/header.c               |  43 +++++++++
 tools/perf/util/header.h               |   1 +
 10 files changed, 252 insertions(+), 70 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-04-07  0:56 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-01 18:58 [PATCH 0/4] tools/perf: Fix perf bench numa, futex and epoll to work with machines having #CPUs > 1K Athira Rajeev
2022-04-01 18:58 ` Athira Rajeev
2022-04-01 18:58 ` [PATCH 1/4] tools/perf: Fix perf bench futex to correct usage of affinity for machines with " Athira Rajeev
2022-04-01 18:58   ` Athira Rajeev
2022-04-01 18:58 ` [PATCH 2/4] tools/perf: Fix perf bench epoll " Athira Rajeev
2022-04-01 18:58   ` Athira Rajeev
2022-04-05 17:56   ` Ian Rogers
2022-04-05 17:56     ` Ian Rogers
2022-04-06  7:47     ` Athira Rajeev
2022-04-06  7:47       ` Athira Rajeev
2022-04-01 18:58 ` [PATCH 3/4] tools/perf: Fix perf numa bench to fix " Athira Rajeev
2022-04-01 18:58   ` Athira Rajeev
2022-04-05 17:52   ` Ian Rogers
2022-04-05 17:52     ` Ian Rogers
2022-04-06  7:15     ` Athira Rajeev
2022-04-06  7:15       ` Athira Rajeev
2022-04-01 18:58 ` [PATCH 4/4] tools/perf: Fix perf bench numa testcase to check if CPU used to bind task is online Athira Rajeev
2022-04-01 18:58   ` Athira Rajeev
2022-04-06  7:33 ` [PATCH 0/4] tools/perf: Fix perf bench numa, futex and epoll to work with machines having #CPUs > 1K Disha Goel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.