From: Robin Murphy <robin.murphy@arm.com>
To: Will Deacon <will@kernel.org>,
"JiaLong.Yang" <jialong.yang@shingroup.cn>
Cc: Mark Rutland <mark.rutland@arm.com>,
shenghui.qu@shingroup.cn, ke.zhao@shingroup.cn,
zhijie.ren@shingroup.cn, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf/arm_smmuv3: Omit the two judgements which done in framework
Date: Fri, 9 Feb 2024 16:32:00 +0000 [thread overview]
Message-ID: <a455e5db-676a-4cf8-8669-8a10e900361c@arm.com> (raw)
In-Reply-To: <20240209160905.GA24565@willie-the-truck>
On 2024-02-09 4:09 pm, Will Deacon wrote:
> On Thu, Dec 21, 2023 at 05:38:01PM +0800, JiaLong.Yang wrote:
>> 'event->attr.type != event->pmu->type' has been done in
>> core.c::perf_init_event() ,core.c::perf_event_modify_attr(), etc.
>>
>> This PMU is an uncore one. The core framework has disallowed
>> uncore-task events. So the judgement to event->cpu < 0 is no mean.
>
> It would be great to refer to the changes which added those checks to
> the perf core code. From reading the code myself, I can't convince myself
> that perf_try_init_event() won't call into the driver.
>
>>
>> The two judgements have been done in kernel/events/core.c
>>
>> Signed-off-by: JiaLong.Yang <jialong.yang@shingroup.cn>
>> ---
>> drivers/perf/arm_smmuv3_pmu.c | 8 --------
>> 1 file changed, 8 deletions(-)
>
> It looks like _many_ perf drivers have these checks, so if they really
> aren't needed, we can clean this up bveyond SMMU. However, as I said
> above, I'm not quite convinced we can drop them.
Right, I think the logic prevents events with a specific PMU type being
offered to other PMUs, but as far as I'm aware doesn't apply the other
way round to stop generic events (PERF_TYPE_HARDWARE etc.) being offered
to all PMUs, so it's those that system PMUs need to reject.
It's been on my wishlist for a long time to have a capability flag to
say "I don't handle generic events, please only ever give me events of
my exact type" so we *can* truly factor this into the core.
Thanks,
Robin.
next prev parent reply other threads:[~2024-02-09 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 9:38 JiaLong.Yang
2024-02-09 16:09 ` Will Deacon
2024-02-09 16:32 ` Robin Murphy [this message]
2024-02-19 6:37 ` Yang Jialong 杨佳龙
2024-02-26 18:57 ` Robin Murphy
2024-02-27 2:38 ` Yang Jialong 杨佳龙
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=a455e5db-676a-4cf8-8669-8a10e900361c@arm.com \
--to=robin.murphy@arm.com \
--cc=jialong.yang@shingroup.cn \
--cc=ke.zhao@shingroup.cn \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=shenghui.qu@shingroup.cn \
--cc=will@kernel.org \
--cc=zhijie.ren@shingroup.cn \
/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
all inboxes | Powered by JetHome®