[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210809043301.66002-6-dave@stgolabs.net>
Date: Sun, 8 Aug 2021 21:32:59 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: acme@...nel.org
Cc: mingo@...hat.com, peterz@...radead.org, tglx@...utronix.de,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
dave@...olabs.net, Davidlohr Bueso <dbueso@...e.de>
Subject: [PATCH 5/7] perf/bench-futex, requeue: Add --broadcast option
Such that all threads are requeued to uaddr2 in a single
futex_cmp_requeue(), unlike the default, which is 1.
Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
---
tools/perf/bench/futex-requeue.c | 4 ++++
tools/perf/bench/futex.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
index 88cb7e2a6729..80f40ee92b53 100644
--- a/tools/perf/bench/futex-requeue.c
+++ b/tools/perf/bench/futex-requeue.c
@@ -52,6 +52,7 @@ static const struct option options[] = {
OPT_BOOLEAN( 's', "silent", ¶ms.silent, "Silent mode: do not display data/details"),
OPT_BOOLEAN( 'S', "shared", ¶ms.fshared, "Use shared futexes instead of private ones"),
OPT_BOOLEAN( 'm', "mlockall", ¶ms.mlockall, "Lock all current and future memory"),
+ OPT_BOOLEAN( 'B', "broadcast", ¶ms.broadcast, "Requeue all threads at once"),
OPT_END()
};
@@ -153,6 +154,9 @@ int bench_futex_requeue(int argc, const char **argv)
if (params.nrequeue > params.nthreads)
params.nrequeue = params.nthreads;
+ if (params.broadcast)
+ params.nrequeue = params.nthreads;
+
printf("Run summary [PID %d]: Requeuing %d threads (from [%s] %p to %p), "
"%d at a time.\n\n", getpid(), params.nthreads,
params.fshared ? "shared":"private", &futex1, &futex2, params.nrequeue);
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index 1c8fa469993f..36f158650edf 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -21,6 +21,7 @@ struct bench_futex_parameters {
bool fshared;
bool mlockall;
bool multi; /* lock-pi */
+ bool broadcast; /* requeue */
unsigned int runtime; /* seconds*/
unsigned int nthreads;
unsigned int nfutexes;
--
2.26.2
Powered by blists - more mailing lists