Merge tag 'perf_urgent_for_v6.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Borislav Petkov: - Make sure an AUX perf event is really disabled when it overruns * tag 'perf_urgent_for_v6.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/aux: Fix pending disable flow when the AUX ring buffer overruns
This commit is contained in:
@@ -7251,15 +7251,15 @@ static void __perf_pending_disable(struct perf_event *event)
|
||||
* CPU-A CPU-B
|
||||
*
|
||||
* perf_event_disable_inatomic()
|
||||
* @pending_disable = CPU-A;
|
||||
* @pending_disable = 1;
|
||||
* irq_work_queue();
|
||||
*
|
||||
* sched-out
|
||||
* @pending_disable = -1;
|
||||
* @pending_disable = 0;
|
||||
*
|
||||
* sched-in
|
||||
* perf_event_disable_inatomic()
|
||||
* @pending_disable = CPU-B;
|
||||
* @pending_disable = 1;
|
||||
* irq_work_queue(); // FAILS
|
||||
*
|
||||
* irq_work_run()
|
||||
|
||||
@@ -441,7 +441,7 @@ void *perf_aux_output_begin(struct perf_output_handle *handle,
|
||||
* store that will be enabled on successful return
|
||||
*/
|
||||
if (!handle->size) { /* A, matches D */
|
||||
event->pending_disable = smp_processor_id();
|
||||
perf_event_disable_inatomic(handle->event);
|
||||
perf_output_wakeup(handle);
|
||||
WRITE_ONCE(rb->aux_nest, 0);
|
||||
goto err_put;
|
||||
@@ -526,7 +526,7 @@ void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size)
|
||||
|
||||
if (wakeup) {
|
||||
if (handle->aux_flags & PERF_AUX_FLAG_TRUNCATED)
|
||||
handle->event->pending_disable = smp_processor_id();
|
||||
perf_event_disable_inatomic(handle->event);
|
||||
perf_output_wakeup(handle);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user