From: Mark Rutland <mark.rutland@arm.com>
To: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
jolsa@kernel.org, irogers@google.com, bp@alien8.de,
adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [REGRESSION][BISECT] perf/core: Remove pmu linear searching code
Date: Mon, 5 Jun 2023 10:54:26 +0100 [thread overview]
Message-ID: <ZH2w0hIAEIpEXjk2@FVFF77S0Q05N> (raw)
In-Reply-To: <ecc69e40-f975-69e8-a372-6aafde66e0af@amd.com>
On Mon, Jun 05, 2023 at 03:04:45PM +0530, Ravi Bangoria wrote:
> On 05-Jun-23 12:40 PM, Mark Rutland wrote:
> > On Sun, Jun 04, 2023 at 01:38:10PM +0200, Krzysztof Kozlowski wrote:
> >> Hi,
> >>
> >> #regzbot introduced: 9551fbb64d09
> >>
> >> Bisect pointed to commit 9551fbb64d09 ("perf/core: Remove pmu linear
> >> searching code") as first one where all hardware events are gone from
> >> perf for ARMv7 Exynos5422 board.
> >
> > I think that commit 9551fbb64d09 is just wrong.
> >
> > The commit message asserts:
> >
> > Searching for the right pmu by iterating over all pmus is no longer
> > required since all pmus now *must* be present in the 'pmu_idr' list.
> > So, remove linear searching code.
> >
> > ... and while each PMU has *some* entry in the pmu_idr list, for its dynamic
> > type, that means that events with other types (e.g. PERF_TYPE_HARDWARE or
> > PERF_TYPE_RAW) will fail to find a PMU in the IDR whereas they'd previously
> > have been accepted by a PMU during the subsequent iteration over all PMUs.
>
> Not sure I follow.
>
> PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE are aliased to PERF_TYPE_RAW in
> perf_init_event(). And PERF_TYPE_RAW should be present in pmu_idr if it
> was registered using:
>
> perf_pmu_register(pmu, "name", PERF_TYPE_RAW);
As I said, the PMUs get registered with a dynamic type, and there's no
registration with PERF_TYPE_RAW. On arm/arm64 systems, *every* CPU PMU gets
registered with:
perf_pmu_register(pmu, name, -1);
... and *none* are registered with:
perf_pmu_register(pmu, name, PERF_TYPE_RAW)
... so those all get a dynamic IDR type, and nothing gets placed into the IDR
for PERF_TYPE_RAW, etc. We rely on the linear search to find a PMU that can
handle PERF_TYPE_RAW, etc.
I appreciate that's not ideal, but it's how it has worked for almost a decade
now, so we can't change the userspace-visible behaviour.
Thanks,
Mark.
next prev parent reply other threads:[~2023-06-05 9:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-04 11:38 [REGRESSION][BISECT] perf/core: Remove pmu linear searching code Krzysztof Kozlowski
2023-06-05 2:59 ` Ravi Bangoria
2023-06-05 6:16 ` Krzysztof Kozlowski
2023-06-05 3:26 ` Bagas Sanjaya
2023-06-05 7:10 ` Mark Rutland
2023-06-05 9:27 ` Peter Zijlstra
2023-06-05 9:34 ` Peter Zijlstra
2023-06-05 9:43 ` Ravi Bangoria
2023-06-05 10:14 ` Peter Zijlstra
2023-06-05 10:17 ` Krzysztof Kozlowski
2023-06-05 10:27 ` Mark Rutland
2023-06-06 8:18 ` [tip: perf/core] perf: Re-instate the linear PMU search tip-bot2 for Peter Zijlstra
2023-06-05 9:34 ` [REGRESSION][BISECT] perf/core: Remove pmu linear searching code Ravi Bangoria
2023-06-05 9:54 ` Mark Rutland [this message]
2023-06-05 10:03 ` Ravi Bangoria
2023-06-20 12:38 ` Linux regression tracking #update (Thorsten Leemhuis)
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=ZH2w0hIAEIpEXjk2@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=adrian.hunter@intel.com \
--cc=bp@alien8.de \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=regressions@lists.linux.dev \
/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