[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160923112726.5890-7-alexander.shishkin@linux.intel.com>
Date: Fri, 23 Sep 2016 14:27:26 +0300
From: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
vince@...ter.net, eranian@...gle.com,
Arnaldo Carvalho de Melo <acme@...radead.org>,
tglx@...utronix.de, ak@...ux.intel.com,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: [RFC PATCH 6/6] perf: Disable IRQs in address filter sync path
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@...ux.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
Powered by blists - more mailing lists