summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-26 11:46:32 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-26 11:46:32 -0700
commit2579d019ad591043634b02d038cadcabb5eb21f8 (patch)
tree7d90c578d89dba6b3413e7fea64adcf343ec28ac
parent2800348613953b5892c196e4bfab2ae5783a519e (diff)
parent2c534c0da0a68418693e10ce1c4146e085f39518 (diff)
downloadlinux-2579d019ad591043634b02d038cadcabb5eb21f8.tar.gz
linux-2579d019ad591043634b02d038cadcabb5eb21f8.tar.bz2
linux-2579d019ad591043634b02d038cadcabb5eb21f8.zip
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Thomas Gleixner: "A single fix for the intel cqm perf facility to prevent IPIs from interrupt context" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/cqm: Return cached counter value from IRQ context
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_cqm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel_cqm.c b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
index 188076161c1b..63eb68b73589 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_cqm.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_cqm.c
@@ -952,6 +952,14 @@ static u64 intel_cqm_event_count(struct perf_event *event)
return 0;
/*
+ * Getting up-to-date values requires an SMP IPI which is not
+ * possible if we're being called in interrupt context. Return
+ * the cached values instead.
+ */
+ if (unlikely(in_interrupt()))
+ goto out;
+
+ /*
* Notice that we don't perform the reading of an RMID
* atomically, because we can't hold a spin lock across the
* IPIs.