summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds2015-07-26 20:46:32 +0200
committerLinus Torvalds2015-07-26 20:46:32 +0200
commit2579d019ad591043634b02d038cadcabb5eb21f8 (patch)
tree7d90c578d89dba6b3413e7fea64adcf343ec28ac
parentMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/ker... (diff)
parentperf/x86/intel/cqm: Return cached counter value from IRQ context (diff)
downloadkernel-qcow2-linux-2579d019ad591043634b02d038cadcabb5eb21f8.tar.gz
kernel-qcow2-linux-2579d019ad591043634b02d038cadcabb5eb21f8.tar.xz
kernel-qcow2-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.