From: Leo Yan <leo.yan@arm.com>
To: Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: arm_spe: Relax period restriction
Date: Tue, 27 May 2025 14:06:50 +0100 [thread overview]
Message-ID: <20250527130650.GH2566836@e132581.arm.com> (raw)
In-Reply-To: <20250527121827.3919495-1-leo.yan@arm.com>
Hi all,
On Tue, May 27, 2025 at 01:18:27PM +0100, Leo Yan wrote:
[...]
> @@ -309,15 +309,22 @@ static u64 arm_spe_event_to_pmscr(struct perf_event *event)
> static void arm_spe_event_sanitise_period(struct perf_event *event)
> {
> struct arm_spe_pmu *spe_pmu = to_spe_pmu(event->pmu);
> + struct device *dev = &spe_pmu->pdev->dev;
> u64 period = event->hw.sample_period;
> u64 max_period = PMSIRR_EL1_INTERVAL_MASK;
>
> - if (period < spe_pmu->min_period)
> - period = spe_pmu->min_period;
> - else if (period > max_period)
> + if (period < spe_pmu->min_period) {
> + /* Period must set to a non-zero value */
> + if (!period)
> + period = 1;
I read the document again and found the interval granluarity is 256
(8-bit). So the change above is incorrect.
I will send a new patch. Sorry for inconvenience.
Thanks,
Leo
> +
> + dev_warn_ratelimited(dev, "Period %llu < %u (recommended minimum interval).\n",
> + period, spe_pmu->min_period);
> + } else if (period > max_period) {
> period = max_period;
> - else
> + } else {
> period &= max_period;
> + }
>
> event->hw.sample_period = period;
> }
> --
> 2.34.1
>
prev parent reply other threads:[~2025-05-27 13:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 12:18 [PATCH] perf: arm_spe: Relax period restriction Leo Yan
2025-05-27 13:06 ` Leo Yan [this message]
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=20250527130650.GH2566836@e132581.arm.com \
--to=leo.yan@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/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