Skip to content

Commit f3a519e

Browse files
virtuosoIngo Molnar
authored andcommitted
perf/aux: Fix AUX output stopping
Commit: 8a58dda ("perf/core: Fix exclusive events' grouping") allows CAP_EXCLUSIVE events to be grouped with other events. Since all of those also happen to be AUX events (which is not the case the other way around, because arch/s390), this changes the rules for stopping the output: the AUX event may not be on its PMU's context any more, if it's grouped with a HW event, in which case it will be on that HW event's context instead. If that's the case, munmap() of the AUX buffer can't find and stop the AUX event, potentially leaving the last reference with the atomic context, which will then end up freeing the AUX buffer. This will then trip warnings: Fix this by using the context's PMU context when looking for events to stop, instead of the event's PMU context. Signed-off-by: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5e6c3c7 commit f3a519e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/events/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6949,7 +6949,7 @@ static void __perf_event_output_stop(struct perf_event *event, void *data)
69496949
static int __perf_pmu_output_stop(void *info)
69506950
{
69516951
struct perf_event *event = info;
6952-
struct pmu *pmu = event->pmu;
6952+
struct pmu *pmu = event->ctx->pmu;
69536953
struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
69546954
struct remote_output ro = {
69556955
.rb = event->rb,

0 commit comments

Comments
 (0)