diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2024-09-02 10:14:24 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2024-09-04 18:22:56 +0200 |
| commit | 2ab9d830262c132ab5db2f571003d80850d56b2a (patch) | |
| tree | 0bd610077e7431521aa80a29feb6128934c88eea /kernel/events/ring_buffer.c | |
| parent | uprobes: Use kzalloc to allocate xol area (diff) | |
| download | linux-2ab9d830262c132ab5db2f571003d80850d56b2a.tar.gz linux-2ab9d830262c132ab5db2f571003d80850d56b2a.zip | |
perf/aux: Fix AUX buffer serialization
Ole reported that event->mmap_mutex is strictly insufficient to
serialize the AUX buffer, add a per RB mutex to fully serialize it.
Note that in the lock order comment the perf_event::mmap_mutex order
was already wrong, that is, it nesting under mmap_lock is not new with
this patch.
Fixes: 45bfb2e50471 ("perf: Add AUX area to ring buffer for raw data streams")
Reported-by: Ole <ole@binarygecko.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events/ring_buffer.c')
| -rw-r--r-- | kernel/events/ring_buffer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index 8cadf97bc290..4f46f688d0d4 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c @@ -337,6 +337,8 @@ ring_buffer_init(struct perf_buffer *rb, long watermark, int flags) */ if (!rb->nr_pages) rb->paused = 1; + + mutex_init(&rb->aux_mutex); } void perf_aux_output_flag(struct perf_output_handle *handle, u64 flags) |
