From: Robin Murphy <robin.murphy@arm.com>
To: will@kernel.org, mark.rutland@arm.com, peterz@infradead.org,
mingo@redhat.com, acme@kernel.org, namhyung@kernel.org
Cc: alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
james.clark@linaro.org, linux-arm-kernel@lists.infradead.org,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] perf: Generic hotplug/cpumask for system PMUs
Date: Tue, 28 Jul 2026 13:03:50 +0100 [thread overview]
Message-ID: <54c60aa5-6fd7-44fd-9a9c-2d7e658e8c7f@arm.com> (raw)
In-Reply-To: <d85ac6d5f5f6383be5b882b6694052eac8062ced.1784911757.git.robin.murphy@arm.com>
On 24/07/2026 6:48 pm, Robin Murphy wrote:
[...]
> @@ -12918,6 +12943,17 @@ int perf_pmu_register(struct pmu *_pmu, const char *name, int type)
> INIT_LIST_HEAD(&pmu->events);
> spin_lock_init(&pmu->events_lock);
>
> + /*
> + * Finally, if appropriate give the PMU a chance to pick an initial CPU
> + * affinity for its cpumask, or initialise any general per-CPU state.
> + * Note that we're serialised against perf_event_{init,exit}_cpu()
> + * themselves here by virtue of pmus_lock.
> + */
> + if (pmu->init_cpu) {
> + for_each_online_cpu(cpu)
Having thought about it, while the drivers I want to convert should all
be fine with a potential double-init, I guess it is true that an
outgoing CPU in between CPUHP_AP_PERF_ONLINE and CPUHP_TEARDOWN_CPU
would still be in cpu_online_mask with interrupts enabled, and thus
potentially able to be picked by the driver callback, and thus end up
inaccessible unless and until that CPU comes back again. So indeed for
true race elimination this probably should use perf_online_mask. I'll
save spamming a v3 until I get some feedback that the overall idea is
worth pursuing at all, though.
(But I shall continue to ignore the rest of the twaddle from word-salad
models which apparently can't differentiate "initialise" from "allocate"...)
Thanks,
Robin.
> + smp_call_function_single(cpu, perf_scope_init_cpu, pmu, 1);
> + }
> +
> /*
> * Now that the PMU is complete, make it visible to perf_try_init_event().
> */
next prev parent reply other threads:[~2026-07-28 12:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 17:48 [PATCH v2 0/2] " Robin Murphy
2026-07-24 17:48 ` [PATCH v2 1/2] " Robin Murphy
2026-07-28 12:03 ` Robin Murphy [this message]
2026-07-24 17:48 ` [PATCH v2 2/2] perf/arm-cmn: Switch to generic cpumask Robin Murphy
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=54c60aa5-6fd7-44fd-9a9c-2d7e658e8c7f@arm.com \
--to=robin.murphy@arm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--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=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--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
all inboxes | Powered by JetHome®