提交 d262e6a9 编写于 作者: D Davidlohr Bueso 提交者: Arnaldo Carvalho de Melo

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: NDavidlohr Bueso <dbueso@suse.de>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lore.kernel.org/lkml/20210809043301.66002-6-dave@stgolabs.netSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 9f9a3ffe
......@@ -53,6 +53,7 @@ static const struct option options[] = {
OPT_BOOLEAN( 's', "silent", &params.silent, "Silent mode: do not display data/details"),
OPT_BOOLEAN( 'S', "shared", &params.fshared, "Use shared futexes instead of private ones"),
OPT_BOOLEAN( 'm', "mlockall", &params.mlockall, "Lock all current and future memory"),
OPT_BOOLEAN( 'B', "broadcast", &params.broadcast, "Requeue all threads at once"),
OPT_END()
};
......@@ -154,6 +155,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);
......
......@@ -18,6 +18,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册