From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 3/7] perf/bench-futex: Factor out futex_flag
Date: Mon, 9 Aug 2021 11:54:07 -0300 [thread overview]
Message-ID: <YRFBj3jGABt1zkQX@kernel.org> (raw)
In-Reply-To: <20210809043301.66002-4-dave@stgolabs.net>
Em Sun, Aug 08, 2021 at 09:32:57PM -0700, Davidlohr Bueso escreveu:
> This is common across all tests, move it into futex.h.
Wouldn't be better to have it defined in one place and then in futex.h
just have a 'extern int futex_flag;' declaration?
I applied the first two patches already.
- Arnaldo
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
> tools/perf/bench/futex-hash.c | 1 -
> tools/perf/bench/futex-lock-pi.c | 1 -
> tools/perf/bench/futex-requeue.c | 1 -
> tools/perf/bench/futex-wake-parallel.c | 1 -
> tools/perf/bench/futex-wake.c | 1 -
> tools/perf/bench/futex.h | 3 +++
> 6 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
> index ddca7558e559..b71a34204b79 100644
> --- a/tools/perf/bench/futex-hash.c
> +++ b/tools/perf/bench/futex-hash.c
> @@ -30,7 +30,6 @@
> #include <err.h>
>
> static bool done = false;
> -static int futex_flag = 0;
>
> struct timeval bench__start, bench__end, bench__runtime;
> static pthread_mutex_t thread_lock;
> diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
> index ce980df23bb0..bc208edf3de3 100644
> --- a/tools/perf/bench/futex-lock-pi.c
> +++ b/tools/perf/bench/futex-lock-pi.c
> @@ -32,7 +32,6 @@ struct worker {
> static u_int32_t global_futex = 0;
> static struct worker *worker;
> static bool done = false;
> -static int futex_flag = 0;
> static pthread_mutex_t thread_lock;
> static unsigned int threads_starting;
> static struct stats throughput_stats;
> diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
> index 66747bfe22cf..4001312122be 100644
> --- a/tools/perf/bench/futex-requeue.c
> +++ b/tools/perf/bench/futex-requeue.c
> @@ -36,7 +36,6 @@ static pthread_mutex_t thread_lock;
> static pthread_cond_t thread_parent, thread_worker;
> static struct stats requeuetime_stats, requeued_stats;
> static unsigned int threads_starting;
> -static int futex_flag = 0;
>
> static struct bench_futex_parameters params = {
> /*
> diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c
> index 958372ad159c..ea4fdea6e2f3 100644
> --- a/tools/perf/bench/futex-wake-parallel.c
> +++ b/tools/perf/bench/futex-wake-parallel.c
> @@ -53,7 +53,6 @@ static pthread_cond_t thread_parent, thread_worker;
> static pthread_barrier_t barrier;
> static struct stats waketime_stats, wakeup_stats;
> static unsigned int threads_starting;
> -static int futex_flag = 0;
>
> static struct bench_futex_parameters params;
>
> diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
> index 9ed4d65416f3..1cf651c8ee5c 100644
> --- a/tools/perf/bench/futex-wake.c
> +++ b/tools/perf/bench/futex-wake.c
> @@ -37,7 +37,6 @@ static pthread_mutex_t thread_lock;
> static pthread_cond_t thread_parent, thread_worker;
> static struct stats waketime_stats, wakeup_stats;
> static unsigned int threads_starting;
> -static int futex_flag = 0;
>
> static struct bench_futex_parameters params = {
> /*
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index 6f8b85b67348..f7cd22bbd677 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -13,6 +13,9 @@
> #include <sys/types.h>
> #include <linux/futex.h>
>
> +/* FUTEX_PRIVATE_FLAG or zero */
> +static int futex_flag = 0;
> +
> struct bench_futex_parameters {
> bool silent;
> bool fshared;
> --
> 2.26.2
>
--
- Arnaldo
next prev parent reply other threads:[~2021-08-09 14:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-09 4:32 [PATCH -tip v2 0/7] perf/bench-futex: Misc updates Davidlohr Bueso
2021-08-09 4:32 ` [PATCH 1/7] perf/bench-futex: Group test parameters cleanup Davidlohr Bueso
2021-08-09 4:32 ` [PATCH 2/7] perf/bench-futex: Remove bogus backslash from comment Davidlohr Bueso
2021-08-09 4:32 ` [PATCH 3/7] perf/bench-futex: Factor out futex_flag Davidlohr Bueso
2021-08-09 14:54 ` Arnaldo Carvalho de Melo [this message]
2021-08-09 16:30 ` Davidlohr Bueso
2021-08-09 4:32 ` [PATCH 4/7] perf/bench-futex: Add --mlockall parameter Davidlohr Bueso
2021-08-09 14:56 ` Arnaldo Carvalho de Melo
2021-08-09 16:11 ` Davidlohr Bueso
2021-08-09 4:32 ` [PATCH 5/7] perf/bench-futex, requeue: Add --broadcast option Davidlohr Bueso
2021-08-09 14:57 ` Arnaldo Carvalho de Melo
2021-08-09 4:33 ` [PATCH 6/7] perf/bench-futex, requeue: Robustify futex_wait() handling Davidlohr Bueso
2021-08-09 14:58 ` Arnaldo Carvalho de Melo
2021-08-09 4:33 ` [PATCH 7/7] perf/bench-futex, requeue: Add --pi parameter Davidlohr Bueso
2021-08-09 15:01 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YRFBj3jGABt1zkQX@kernel.org \
--to=acme@kernel.org \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).