Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399596

[PATCH v2 04/32] perf/x86/intel/cqm: add constants for CQM

From David Carrillo-Cisneros <davidcc@google.com>
Newsgroups linux.kernel
Subject [PATCH v2 04/32] perf/x86/intel/cqm: add constants for CQM
Date 2016-05-12 01:20 +0200
Message-ID <rxLA5-1qt-5@gated-at.bofh.it> (permalink)
References <rxLqq-1mv-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add initial constants and comments.

Reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
 arch/x86/events/intel/cqm.c | 20 ++++++++++++++++++++
 arch/x86/events/intel/cqm.h | 31 +++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 arch/x86/events/intel/cqm.h

diff --git a/arch/x86/events/intel/cqm.c b/arch/x86/events/intel/cqm.c
index e69de29..0c4f3fe 100644
--- a/arch/x86/events/intel/cqm.c
+++ b/arch/x86/events/intel/cqm.c
@@ -0,0 +1,20 @@
+/*
+ * Intel Cache Quality-of-Service Monitoring (CQM) support.
+ *
+ * Based very, very heavily on work by Peter Zijlstra.
+ */
+
+#include <linux/slab.h>
+#include <asm/cpu_device_id.h>
+#include "cqm.h"
+#include "../perf_event.h"
+
+#define MSR_IA32_QM_CTR		0x0c8e
+#define MSR_IA32_QM_EVTSEL	0x0c8d
+
+#define RMID_VAL_ERROR		(1ULL << 63)
+#define RMID_VAL_UNAVAIL	(1ULL << 62)
+
+#define QOS_L3_OCCUP_EVENT_ID	(1 << 0)
+
+#define QOS_EVENT_MASK		QOS_L3_OCCUP_EVENT_ID
diff --git a/arch/x86/events/intel/cqm.h b/arch/x86/events/intel/cqm.h
new file mode 100644
index 0000000..bb906c7
--- /dev/null
+++ b/arch/x86/events/intel/cqm.h
@@ -0,0 +1,31 @@
+/*
+ * Intel Cache Quality-of-Service Monitoring (CQM) support.
+ *
+ * A Resource Manager ID (RMID) is a u32 value that, when programmed in a
+ * logical CPU, will allow the LLC cache to associate the changes in occupancy
+ * generated by that cpu (cache lines allocations - deallocations) to the RMID.
+ * If a RMID has been assigned to a thread T long enough for all cache lines
+ * used by T to be allocated, then the occupancy reported by the hardware
+ * equals the total cache occupancy for T.
+ *
+ * Groups of threads that are to be monitored together (such as cgroups
+ * or processes) can shared a RMID.
+ *
+ * This driver implements a tree hierarchy of Monitored Resources (monr). Each
+ * monr is a cgroup, a process or a thread that needs one single RMID.
+ *
+ * Since the number of RMIDs is relatively small to the number of potential
+ * monitored elements, RMIDs must be "rotated" among all monitored elements.
+ */
+
+#include <linux/perf_event.h>
+#include <asm/pqr_common.h>
+#include <asm/topology.h>
+
+/*
+ * Time between execution of rotation logic. The frequency of execution does
+ * not affect the rate at which RMIDs are recycled, except by the delay by the
+ * delay updating the prmid's and their pools.
+ * The rotation period is stored in pmu->hrtimer_interval_ms.
+ */
+#define CQM_DEFAULT_ROTATION_PERIOD 1200	/* ms */
-- 
2.8.0.rc3.226.g39d4020

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/32] 2nd Iteration of Cache QoS Monitoring support. David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:10 +0200
  [PATCH v2 16/32] perf/x86/intel/cqm: add cgroup support David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:10 +0200
  [PATCH v2 11/32] perf/x86/intel/cqm: add per-package RMID rotation David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:10 +0200
    Re: [PATCH v2 11/32] perf/x86/intel/cqm: add per-package RMID  rotation Thomas Gleixner <tglx@linutronix.de> - 2016-05-18 23:40 +0200
      Re: [PATCH v2 11/32] perf/x86/intel/cqm: add per-package RMID rotation David Carrillo-Cisneros <davidcc@google.com> - 2016-05-24 23:10 +0200
  [PATCH v2 07/32] perf/x86/intel/cqm: add helpers for per-package locking David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:20 +0200
    Re: [PATCH v2 07/32] perf/x86/intel/cqm: add helpers for per-package  locking Thomas Gleixner <tglx@linutronix.de> - 2016-05-18 19:40 +0200
      Re: [PATCH v2 07/32] perf/x86/intel/cqm: add helpers for per-package  locking Thomas Gleixner <tglx@linutronix.de> - 2016-05-18 21:20 +0200
  [PATCH v2 04/32] perf/x86/intel/cqm: add constants for CQM David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:20 +0200
  [PATCH v2 02/32] perf/x86/intel/cqm: software cache for MSR_IA32_PQR_ASSOC David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:20 +0200
  [PATCH v2 03/32] x86/intel,cqm: add CONFIG_INTEL_RDT configuration flag David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:20 +0200
    Re: [PATCH v2 03/32] x86/intel,cqm: add CONFIG_INTEL_RDT configuration  flag Thomas Gleixner <tglx@linutronix.de> - 2016-05-18 19:40 +0200
  [PATCH v2 06/32] perf/x86/intel/cqm: add per-package RMIDs, data and locks David Carrillo-Cisneros <davidcc@google.com> - 2016-05-12 01:20 +0200
    Re: [PATCH v2 06/32] perf/x86/intel/cqm: add per-package RMIDs, data  and locks Thomas Gleixner <tglx@linutronix.de> - 2016-05-18 18:20 +0200

csiph-web