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


Groups > linux.kernel > #1390752

[PATCH 18/32] perf/x86/intel/cqm: use pmu::event_terminate

From David Carrillo-Cisneros <davidcc@google.com>
Newsgroups linux.kernel
Subject [PATCH 18/32] perf/x86/intel/cqm: use pmu::event_terminate
Date 2016-04-29 07:00 +0200
Message-ID <rt8H0-8vJ-17@gated-at.bofh.it> (permalink)
References <rt8xj-8qy-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Utilized to detach a monr from a cgroup before the event's reference
to the cgroup is removed.

Reviewed-by: Stephane Eranian <eranian@google.com>
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
---
 arch/x86/events/intel/cqm.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/intel/cqm.c b/arch/x86/events/intel/cqm.c
index f000fd0..dcf7f4a 100644
--- a/arch/x86/events/intel/cqm.c
+++ b/arch/x86/events/intel/cqm.c
@@ -2391,7 +2391,7 @@ static int intel_cqm_event_add(struct perf_event *event, int mode)
 	return prmid_summary__is_istate(summary) ? -1 : 0;
 }
 
-static void intel_cqm_event_destroy(struct perf_event *event)
+static void intel_cqm_event_terminate(struct perf_event *event)
 {
 	struct perf_event *group_other = NULL;
 	struct monr *monr;
@@ -2438,6 +2438,17 @@ static void intel_cqm_event_destroy(struct perf_event *event)
 	if (monr__is_root(monr))
 		goto exit;
 
+	/* Handle cgroup event. */
+	if (event->cgrp) {
+		monr->mon_event_group = NULL;
+		if ((event->cgrp->css.flags & CSS_ONLINE) &&
+		    !cgrp_to_cqm_info(event->cgrp)->cont_monitoring)
+			__css_stop_monitoring(&monr__get_mon_cgrp(monr)->css);
+
+		goto exit;
+	}
+	WARN_ON_ONCE(!monr_is_event_type(monr));
+
 	/* Transition all pmonrs to (U)state. */
 	monr_hrchy_acquire_locks(flags, i);
 
@@ -2478,8 +2489,6 @@ static int intel_cqm_event_init(struct perf_event *event)
 	INIT_LIST_HEAD(&event->hw.cqm_event_groups_entry);
 	INIT_LIST_HEAD(&event->hw.cqm_event_group_entry);
 
-	event->destroy = intel_cqm_event_destroy;
-
 	mutex_lock(&cqm_mutex);
 
 
@@ -2595,6 +2604,7 @@ static struct pmu intel_cqm_pmu = {
 	.attr_groups	     = intel_cqm_attr_groups,
 	.task_ctx_nr	     = perf_sw_context,
 	.event_init	     = intel_cqm_event_init,
+	.event_terminate     = intel_cqm_event_terminate,
 	.add		     = intel_cqm_event_add,
 	.del		     = intel_cqm_event_stop,
 	.start		     = intel_cqm_event_start,
-- 
2.8.0.rc3.226.g39d4020

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


Thread

[PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 01/32] perf/x86/intel/cqm: temporarily remove MBM from CQM and cleanup David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 01/32] perf/x86/intel/cqm: temporarily remove MBM from  CQM and cleanup Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 22:30 +0200
  [PATCH 24/32] perf/x86/intel/cqm: use PERF_INACTIVE_*_READ_* flags in CQM David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch() scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook Peter Zijlstra <peterz@infradead.org> - 2016-04-29 11:00 +0200
      Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 20:50 +0200
        Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 22:30 +0200
          Re: [PATCH 25/32] sched: introduce the finish_arch_pre_lock_switch()  scheduler hook David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 23:00 +0200
  [PATCH 14/32] perf/x86/intel/cqm: add preallocation of anodes David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 32/32] perf/stat: revamp error handling for snapshot and per_pkg events David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 09/32] perf/x86/intel/cqm: add per-package RMIDs, data and locks David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
    Re: [PATCH 09/32] perf/x86/intel/cqm: add per-package RMIDs, data  and locks Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 23:00 +0200
  [PATCH 29/32] perf,perf/x86,perf/powerpc,perf/arm,perf/*: add int error return to pmu::read David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 06/32] x86/intel,cqm: add CONFIG_INTEL_RDT configuration flag and refactor PQR David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 06:50 +0200
  [PATCH 15/32] perf/core: add hooks to expose architecture specific features in perf_cgroup David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 18/32] perf/x86/intel/cqm: use pmu::event_terminate David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 16/32] perf/x86/intel/cqm: add cgroup support David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 17/32] perf/core: adding pmu::event_terminate David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 05/32] perf/core: remove unused pmu->count David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 04/32] perf/x86/intel/cqm: make read of RMIDs per package (Temporal) David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 11/32] perf/x86/intel/cqm: (I)state and limbo prmids David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 12/32] perf/x86/intel/cqm: add per-package RMID rotation David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 08/32] perf/x86/intel/cqm: prepare for next patches David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
    Re: [PATCH 08/32] perf/x86/intel/cqm: prepare for next patches Peter Zijlstra <peterz@infradead.org> - 2016-04-29 11:20 +0200
  [PATCH 07/32] perf/x86/intel/cqm: separate CQM PMU's attributes from x86 PMU David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 19/32] perf/core: introduce PMU event flag PERF_CGROUP_NO_RECURSION David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  [PATCH 10/32] perf/x86/intel/cqm: basic RMID hierarchy with per package rmids David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 07:00 +0200
  Re: [PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. Vikas Shivappa <vikas.shivappa@linux.intel.com> - 2016-04-29 23:10 +0200
    Re: [PATCH 00/32] 2nd Iteration of Cache QoS Monitoring support. David Carrillo-Cisneros <davidcc@google.com> - 2016-04-29 23:20 +0200

csiph-web