[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-8fc31ce8896fc3cea1d79688c8ff950ad4e73afe@git.kernel.org>
Date: Tue, 6 Dec 2016 02:12:22 -0800
From: tip-bot for David Carrillo-Cisneros <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: fenghua.yu@...el.com, tglx@...utronix.de, mingo@...nel.org,
torvalds@...ux-foundation.org, acme@...hat.com,
peterz@...radead.org, linux-kernel@...r.kernel.org,
vincent.weaver@...ne.edu, bp@...e.de, vegard.nossum@...il.com,
eranian@...gle.com, jolsa@...hat.com, pjt@...gle.com,
kan.liang@...el.com, nilayvaish@...il.com, mtosatti@...hat.com,
vikas.shivappa@...ux.intel.com, alexander.shishkin@...ux.intel.com,
ravi.v.shankar@...el.com, hpa@...or.com, davidcc@...gle.com
Subject: [tip:perf/urgent] perf/core: Remove invalid warning from
list_update_cgroup_even()t
Commit-ID: 8fc31ce8896fc3cea1d79688c8ff950ad4e73afe
Gitweb: http://git.kernel.org/tip/8fc31ce8896fc3cea1d79688c8ff950ad4e73afe
Author: David Carrillo-Cisneros <davidcc@...gle.com>
AuthorDate: Sun, 4 Dec 2016 00:46:17 -0800
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 6 Dec 2016 09:44:29 +0100
perf/core: Remove invalid warning from list_update_cgroup_even()t
The warning introduced in commit:
864c2357ca89 ("perf/core: Do not set cpuctx->cgrp for unscheduled cgroups")
assumed that a cgroup switch always precedes list_del_event. This is
not the case. Remove warning.
Make sure that cpuctx->cgrp is NULL until a cgroup event is sched in
or ctx->nr_cgroups == 0.
Signed-off-by: David Carrillo-Cisneros <davidcc@...gle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Kan Liang <kan.liang@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Cc: Nilay Vaish <nilayvaish@...il.com>
Cc: Paul Turner <pjt@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ravi V Shankar <ravi.v.shankar@...el.com>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vegard Nossum <vegard.nossum@...il.com>
Cc: Vikas Shivappa <vikas.shivappa@...ux.intel.com>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Link: http://lkml.kernel.org/r/1480841177-27299-1-git-send-email-davidcc@google.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 6ee1feb..02c8421 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -903,17 +903,14 @@ list_update_cgroup_event(struct perf_event *event,
*/
cpuctx = __get_cpu_context(ctx);
- /* Only set/clear cpuctx->cgrp if current task uses event->cgrp. */
- if (perf_cgroup_from_task(current, ctx) != event->cgrp) {
- /*
- * We are removing the last cpu event in this context.
- * If that event is not active in this cpu, cpuctx->cgrp
- * should've been cleared by perf_cgroup_switch.
- */
- WARN_ON_ONCE(!add && cpuctx->cgrp);
- return;
- }
- cpuctx->cgrp = add ? event->cgrp : NULL;
+ /*
+ * cpuctx->cgrp is NULL until a cgroup event is sched in or
+ * ctx->nr_cgroup == 0 .
+ */
+ if (add && perf_cgroup_from_task(current, ctx) == event->cgrp)
+ cpuctx->cgrp = event->cgrp;
+ else if (!add)
+ cpuctx->cgrp = NULL;
}
#else /* !CONFIG_CGROUP_PERF */
Powered by blists - more mailing lists