From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: lucas.demarchi@intel.com, linux-kernel@vger.kernel.org,
willy@infradead.org, acme@kernel.org, namhyung@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, Ravi Bangoria <ravi.bangoria@amd.com>
Subject: Re: [PATCH 00/19] perf: Make perf_pmu_unregister() usable
Date: Sat, 1 Mar 2025 21:00:21 +0100 [thread overview]
Message-ID: <Z8NnVdo8wB-YcrAs@gmail.com> (raw)
In-Reply-To: <20241104133909.669111662@infradead.org>
* Peter Zijlstra <peterz@infradead.org> wrote:
> Hi,
>
> Lucas convinced me that perf_pmu_unregister() is a trainwreck; after
> considering a few options I was like, how hard could it be..
>
> So find here a few patches that clean things up in preparation and then a final
> patch that makes unregistering a PMU work by introducing a new event state
> (REVOKED) and ensuring that any event in such a state will never get to using
> it's PMU methods ever again.
So it looks like this series first got lost in the usual end-of-year
fog of holidays, then it has become somewhat bitrotten due to other
perf changes interacting and creating conflicts. I cannot find these
patches in queue.git anymore, other than the somewhat stale 4+ months
old perf/pmu-unregister branch from October 2024.
Which I found a bit sad, because these cleanups to the control flow and
error handling of these key perf primitives was a substantial reduction
of our years long technical debt in this area.
So to move things forward I dusted off most of these patches, reviewed
the logic, resolved the conflicts, folded in the fix to pmu_dev_alloc()
that Ravi found (and upgraded his 'looks OK' reply into Acked-by tags),
added/extended changelogs, did some testing due diligence and sorted
them into their appropriate -next branches:
#
# tip:[locking/core]
#
# After 10 years of this lockdep debug check hidden behind
# CONFIG_DEBUG_ATOMIC_SLEEP=y I definitely wasn't brave enough to stick
# this into an urgent branch. Sue me.
#
a1b65f3f7c6f ("lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock")
#
# tip:[perf/urgent]
#
# These look like obvious fixes that can be accelerated to -rc6
#
003659fec9f6 ("perf/core: Fix perf_pmu_register() vs. perf_init_event()")
2565e42539b1 ("perf/core: Fix pmus_lock vs. pmus_srcu ordering")
#
# tip:[perf/core]
#
# These are most of the remaining patches from this series, except for 15/19
# which I was unsure about and 19/19 which is still under discussion:
#
02be310c2d24 ("perf/core: Simplify the perf_event_alloc() error path
e6b17cfd528d ("perf/core: Simplify the perf_pmu_register() error path")
742d5df92842 ("perf/core: Simplify perf_pmu_register()")
9954ea69de5c ("perf/core: Simplify perf_init_event()")
ebfe83832e39 ("perf/core: Simplify perf_event_alloc()")
46cc0835d258 ("perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count")
a57411b14ea0 ("perf/core: Add this_cpc() helper")
8e140c656746 ("perf/core: Introduce perf_free_addr_filters()")
26700b1359a1 ("perf/bpf: Robustify perf_event_free_bpf_prog()")
7503c90c0df8 ("perf/core: Simplify the perf_mmap() control flow")
8c7446add31e ("perf/core: Further simplify perf_mmap()")
6cbfc06a8590 ("perf/core: Remove retry loop from perf_mmap()")
244b28f87ba4 ("perf/core: Lift event->mmap_mutex in perf_mmap()")
As to 'testing due diligence', that's overselling it really, it was
mostly just some quick build/boot and functionality test combined
with perf test runs, ie. very light testing. Caveat emptor, but of
course the end result is perfect if we disregard any new bugs.
Thanks,
Ingo
next prev parent reply other threads:[~2025-03-01 20:00 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 13:39 [PATCH 00/19] perf: Make perf_pmu_unregister() usable Peter Zijlstra
2024-11-04 13:39 ` [PATCH 01/19] lockdep: Fix might_fault() Peter Zijlstra
2025-03-01 20:06 ` [tip: locking/core] lockdep/mm: Fix might_fault() lockdep check of current->mm->mmap_lock tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 02/19] perf: Fix pmus_lock vs pmus_srcu ordering Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Fix pmus_lock vs. " tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 03/19] perf: Fix perf_pmu_register() vs perf_init_event() Peter Zijlstra
2024-11-04 15:36 ` Uros Bizjak
2024-11-05 12:01 ` Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Fix perf_pmu_register() vs. perf_init_event() tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 04/19] perf: Simplify perf_event_alloc() error path Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Simplify the " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2025-03-06 7:57 ` [PATCH 04/19] perf: Simplify " Lai, Yi
2025-03-06 9:24 ` Ingo Molnar
2025-03-07 3:16 ` Lai, Yi
2025-03-07 11:33 ` Ingo Molnar
2024-11-04 13:39 ` [PATCH 05/19] perf: Simplify perf_pmu_register() " Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Simplify the " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 06/19] perf: Simplify perf_pmu_register() Peter Zijlstra
2024-11-20 13:06 ` Ravi Bangoria
2024-11-20 14:46 ` Peter Zijlstra
2024-11-20 15:53 ` Ravi Bangoria
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2025-03-25 19:47 ` [PATCH 06/19] perf: " Sidhartha Kumar
2024-11-04 13:39 ` [PATCH 07/19] perf: Simplify perf_init_event() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 08/19] perf: Simplify perf_event_alloc() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 09/19] perf: Merge pmu_disable_count into cpu_pmu_context Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Merge struct pmu::pmu_disable_count into struct perf_cpu_pmu_context::pmu_disable_count tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 10/19] perf: Add this_cpc() helper Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 11/19] perf: Detach perf_cpu_pmu_context and pmu lifetimes Peter Zijlstra
2025-03-03 12:29 ` [tip: perf/core] perf/core: Detach 'struct perf_cpu_pmu_context' and 'struct pmu' lifetimes tip-bot2 for Peter Zijlstra
2025-03-04 8:56 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 12/19] perf: Introduce perf_free_addr_filters() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 13/19] perf: Robustify perf_event_free_bpf_prog() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/bpf: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 14/19] perf: Simplify perf_mmap() control flow Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: Simplify the " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 15/19] perf: Fix perf_mmap() failure path Peter Zijlstra
2025-03-01 19:17 ` Ingo Molnar
2025-03-03 12:38 ` Lorenzo Stoakes
2025-03-04 8:46 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:56 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 16/19] perf: Further simplify perf_mmap() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:57 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 17/19] perf: Remove retry loop from perf_mmap() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:56 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 18/19] perf: Lift event->mmap_mutex in perf_mmap() Peter Zijlstra
2025-03-01 20:07 ` [tip: perf/core] perf/core: " tip-bot2 for Peter Zijlstra
2025-03-04 8:56 ` tip-bot2 for Peter Zijlstra
2024-11-04 13:39 ` [PATCH 19/19] perf: Make perf_pmu_unregister() useable Peter Zijlstra
2024-11-05 15:08 ` Liang, Kan
2024-11-05 15:16 ` Peter Zijlstra
2024-11-05 15:25 ` Liang, Kan
2024-11-25 4:10 ` Ravi Bangoria
2024-12-17 9:12 ` Peter Zijlstra
2024-12-17 11:52 ` Peter Zijlstra
2024-12-19 9:33 ` Ravi Bangoria
2024-12-19 10:56 ` Ravi Bangoria
2025-01-03 4:24 ` Ravi Bangoria
2025-01-17 0:03 ` Peter Zijlstra
2025-01-17 5:20 ` Ravi Bangoria
2025-01-17 8:36 ` Peter Zijlstra
2025-01-17 13:04 ` Peter Zijlstra
2025-01-17 21:04 ` Peter Zijlstra
2025-01-20 11:15 ` Ravi Bangoria
2025-01-03 4:29 ` Ravi Bangoria
2024-12-16 18:02 ` [PATCH 00/19] perf: Make perf_pmu_unregister() usable Lucas De Marchi
2025-03-01 20:00 ` Ingo Molnar [this message]
2025-03-03 3:25 ` Ravi Bangoria
2025-03-03 9:16 ` Peter Zijlstra
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=Z8NnVdo8wB-YcrAs@gmail.com \
--to=mingo@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=mark.rutland@arm.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=willy@infradead.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