Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1489964
| From | Alexander Shishkin <alexander.shishkin@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH 6/6] perf: Disable IRQs in address filter sync path |
| Date | 2016-09-23 13:40 +0200 |
| Message-ID | <skwZH-31N-19@gated-at.bofh.it> (permalink) |
| References | <skwQ1-2Yn-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
If PMU callbacks are executed in hardirq context, the address filter
sync code needs to disable interrupts when taking its spinlock to be
consistent with the rest of its users. This may happen if the PMU is
used in AUX sampling.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
kernel/events/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index f6582df1c9..047c495c94 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2568,16 +2568,17 @@ static int perf_event_stop(struct perf_event *event, int restart)
void perf_event_addr_filters_sync(struct perf_event *event)
{
struct perf_addr_filters_head *ifh = perf_event_addr_filters(event);
+ unsigned long flags;
if (!has_addr_filter(event))
return;
- raw_spin_lock(&ifh->lock);
+ raw_spin_lock_irqsave(&ifh->lock, flags);
if (event->addr_filters_gen != event->hw.addr_filters_gen) {
event->pmu->addr_filters_sync(event);
event->hw.addr_filters_gen = event->addr_filters_gen;
}
- raw_spin_unlock(&ifh->lock);
+ raw_spin_unlock_irqrestore(&ifh->lock, flags);
}
EXPORT_SYMBOL_GPL(perf_event_addr_filters_sync);
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/6] perf: Add AUX data sampling Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:30 +0200
[RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:30 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Peter Zijlstra <peterz@infradead.org> - 2016-09-23 14:20 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 16:40 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Peter Zijlstra <peterz@infradead.org> - 2016-09-23 17:30 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 18:00 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Andi Kleen <ak@linux.intel.com> - 2016-09-23 19:30 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Peter Zijlstra <peterz@infradead.org> - 2016-09-23 22:30 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-26 10:30 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Peter Zijlstra <peterz@infradead.org> - 2016-09-26 11:10 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-26 14:50 +0200
Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-26 18:20 +0200
[RFC PATCH 2/6] perf: Add api to (de-)allocate AUX buffers for kernel counters Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:40 +0200
[RFC PATCH 3/6] perf: Add a helper for looking up pmus by type Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:40 +0200
[RFC PATCH 4/6] perf: Add infrastructure for using AUX data in perf samples Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:40 +0200
[RFC PATCH 5/6] perf: Disable PMU around address filter adjustment Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:40 +0200
[RFC PATCH 6/6] perf: Disable IRQs in address filter sync path Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-23 13:40 +0200
Re: [RFC PATCH 6/6] perf: Disable IRQs in address filter sync path Alexander Shishkin <alexander.shishkin@linux.intel.com> - 2016-09-26 18:30 +0200
Re: [RFC PATCH 6/6] perf: Disable IRQs in address filter sync path Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-10-04 18:50 +0200
Re: [RFC PATCH 0/6] perf: Add AUX data sampling Peter Zijlstra <peterz@infradead.org> - 2016-09-23 13:50 +0200
Re: [RFC PATCH 0/6] perf: Add AUX data sampling Andi Kleen <ak@linux.intel.com> - 2016-09-23 19:20 +0200
Re: [RFC PATCH 0/6] perf: Add AUX data sampling Peter Zijlstra <peterz@infradead.org> - 2016-09-23 22:40 +0200
Re: [RFC PATCH 0/6] perf: Add AUX data sampling Andi Kleen <ak@linux.intel.com> - 2016-09-24 00:40 +0200
csiph-web