[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1461905018-86355-19-git-send-email-davidcc@google.com>
Date: Thu, 28 Apr 2016 21:43:24 -0700
From: David Carrillo-Cisneros <davidcc@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>
Cc: Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
Matt Fleming <matt.fleming@...el.com>,
Tony Luck <tony.luck@...el.com>,
Stephane Eranian <eranian@...gle.com>,
Paul Turner <pjt@...gle.com>,
David Carrillo-Cisneros <davidcc@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 18/32] perf/x86/intel/cqm: use pmu::event_terminate
Utilized to detach a monr from a cgroup before the event's reference
to the cgroup is removed.
Reviewed-by: Stephane Eranian <eranian@...gle.com>
Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.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
Powered by blists - more mailing lists