From: Mark Rutland <mark.rutland@arm.com>
To: Yury Norov <yury.norov@gmail.com>, Will Deacon <will@kernel.org>
Cc: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Peter Zijlstra" <peterz@infradead.org>,
"David Laight" <David.Laight@aculab.com>,
"Joe Perches" <joe@perches.com>,
"Dennis Zhou" <dennis@kernel.org>,
"Emil Renner Berthing" <kernel@esmil.dk>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Alexey Klimov" <aklimov@redhat.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 33/49] perf: replace bitmap_weight with bitmap_weight_eq for ThunderX2
Date: Fri, 11 Feb 2022 10:30:37 +0000 [thread overview]
Message-ID: <YgY6zb7FT/lifZfd@FVFF77S0Q05N> (raw)
In-Reply-To: <20220210224933.379149-34-yury.norov@gmail.com>
On Thu, Feb 10, 2022 at 02:49:17PM -0800, Yury Norov wrote:
> tx2_uncore_event_start() calls bitmap_weight() to compare the weight
> of bitmap with a given number. We can do it more efficiently with
> bitmap_weight_eq because conditional bitmap_weight may stop traversing
> the bitmap earlier, as soon as condition is (or can't be) met.
>
> Signed-off-by: Yury Norov <yury.norov@gmail.com>
Given the max counters value is either 4 or 8 I doubt this should matter, but
for consistenct this is fine, so:
Acked-by: Mark Rutland <mark.rutland@arm.com>
I now see bitmap_weight_eq() is introduced within this series, so I assume you
need to queue that and its users together, and will want to take the prior
drivers/perf/ bit together with that.
Thanks,
Mark.
> ---
> drivers/perf/thunderx2_pmu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/perf/thunderx2_pmu.c b/drivers/perf/thunderx2_pmu.c
> index 1edb9c03704f..97d5b39778fa 100644
> --- a/drivers/perf/thunderx2_pmu.c
> +++ b/drivers/perf/thunderx2_pmu.c
> @@ -623,8 +623,8 @@ static void tx2_uncore_event_start(struct perf_event *event, int flags)
> return;
>
> /* Start timer for first event */
> - if (bitmap_weight(tx2_pmu->active_counters,
> - tx2_pmu->max_counters) == 1) {
> + if (bitmap_weight_eq(tx2_pmu->active_counters,
> + tx2_pmu->max_counters, 1)) {
> hrtimer_start(&tx2_pmu->hrtimer,
> ns_to_ktime(tx2_pmu->hrtimer_interval),
> HRTIMER_MODE_REL_PINNED);
> --
> 2.32.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-11 10:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220210224933.379149-1-yury.norov@gmail.com>
2022-02-10 22:48 ` [PATCH 12/49] perf: replace bitmap_weight with bitmap_empty where appropriate Yury Norov
2022-02-11 10:25 ` Mark Rutland
2022-02-11 17:59 ` Yury Norov
2022-02-11 17:27 ` Christophe JAILLET
2022-02-11 23:23 ` Yury Norov
2022-02-10 22:49 ` [PATCH 17/49] cpufreq: replace cpumask_weight with cpumask_empty " Yury Norov
2022-02-11 4:30 ` Viresh Kumar
2022-02-11 5:17 ` Yury Norov
2022-02-10 22:49 ` [PATCH 33/49] perf: replace bitmap_weight with bitmap_weight_eq for ThunderX2 Yury Norov
2022-02-11 10:30 ` Mark Rutland [this message]
2022-02-10 22:49 ` [PATCH 40/49] firmware: pcsi: replace cpumask_weight with cpumask_weight_eq Yury Norov
2022-02-11 9:45 ` Sudeep Holla
2022-02-11 10:32 ` Mark Rutland
2022-02-10 22:49 ` [PATCH 43/49] soc/qman: replace cpumask_weight with cpumask_weight_lt Yury Norov
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=YgY6zb7FT/lifZfd@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=David.Laight@aculab.com \
--cc=aklimov@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dennis@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=kernel@esmil.dk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
--cc=yury.norov@gmail.com \
/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