From: Will Deacon <will@kernel.org>
To: Haris Okanovic <harisokn@amazon.com>
Cc: robin.murphy@arm.com, mark.rutland@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
peterz@infradead.org
Subject: Re: [PATCH v2 0/2] perf/arm-cmn: Allow userspace to select the PMU's CPU
Date: Fri, 27 Nov 2026 18:42:24 +0000 [thread overview]
Message-ID: <awnPEAxJyvdRmBFA@willie-the-truck> (raw)
In-Reply-To: <20260930231127.3094040-1-harisokn@amazon.com>
On Wed, Sep 30, 2026 at 06:11:25PM -0500, Haris Okanovic wrote:
> arm_cmn_probe() picks the CPU that owns the PMU and nothing but the CPU
> hotplug callbacks ever revisits it, so in practice all of the PMU's
> recurring work stays on the first CPU local to the interconnect's NUMA
> node. Patch 2 makes the existing 'cpumask' attribute writable so it can
> be moved, which helps on systems that confine background kernel work to
> a chosen set of housekeeping CPUs.
>
> I made the existing 'cpumask' attribute writable rather than
> adding a new one. Every other implementation of that file is read-only,
> so I am happy to switch to a separate attribute if you would prefer to
> keep 'cpumask' uniformly read-only across PMUs.
>
> Patch 1 is new in v2. Robin pointed out that perf_event_open() can latch
> cmn->cpu and then install the event after a migration has already moved
> the PMU, leaving it on a CPU which no longer owns the PMU's shared state.
> The window already exists via arm_cmn_pmu_online_cpu(), so patch 1 stands
> on its own; a writable cpumask just makes it reachable on demand.
Hmm. Not sure about this. It feels to me as though, if we want interfaces
beyond CPU hotplug to control the affinity of system/uncore PMUs, then
that should probably be something managed and understood by the core
perf code rather than hacked onto one of the many PMU drivers by quietly
changing the semantics of the established debugfs interface.
Aha, you did that over at:
https://lore.kernel.org/r/20261013185603.1347265-1-harisokn@amazon.com
do you plan to respin that?
Otherwise, if over-loading CPU 0 is the problem, I suppose we could hack
the probe routine to pick an arbitrary CPU, similar to
cpumask_any_distribute().
Will
prev parent reply other threads:[~2026-11-27 18:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 23:11 [PATCH v2 0/2] perf/arm-cmn: Allow userspace to select the PMU's CPU Haris Okanovic
2026-09-30 23:11 ` [PATCH v2 1/2] perf/arm-cmn: Don't schedule events on a CPU which no longer owns the PMU Haris Okanovic
2026-09-30 23:11 ` [PATCH v2 2/2] perf/arm-cmn: Allow userspace to select the PMU's CPU Haris Okanovic
2026-11-27 18:42 ` Will Deacon [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=awnPEAxJyvdRmBFA@willie-the-truck \
--to=will@kernel.org \
--cc=harisokn@amazon.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=peterz@infradead.org \
--cc=robin.murphy@arm.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