lkml.org 
[lkml]   [2018]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 2/6] perf: Disable IRQs in address filter sync path
Date
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 or the PMI is delivered as a regular interrupt.

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 0f5cd1b08dbd..e1fce335a42a 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2601,16 +2601,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.17.1
\
 
 \ /
  Last update: 2018-06-12 09:53    [W:0.037 / U:25.016 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site