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/internal.h | |
| parent | e240b0fde52f33670d1336697c22d90a4fe33c84 (diff) | |
| download | linux-next-2ab9d830262c132ab5db2f571003d80850d56b2a.tar.gz linux-next-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/internal.h')
| -rw-r--r-- | kernel/events/internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 451514442a1b..e072d995d670 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h @@ -40,6 +40,7 @@ struct perf_buffer { struct user_struct *mmap_user; /* AUX area */ + struct mutex aux_mutex; long aux_head; unsigned int aux_nest; long aux_wakeup; /* last aux_watermark boundary crossed by aux_head */ |
