From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753157AbcLFKN7 (ORCPT ); Tue, 6 Dec 2016 05:13:59 -0500 Received: from terminus.zytor.com ([198.137.202.10]:46146 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751686AbcLFKNb (ORCPT ); Tue, 6 Dec 2016 05:13:31 -0500 Date: Tue, 6 Dec 2016 02:12:22 -0800 From: tip-bot for David Carrillo-Cisneros Message-ID: Cc: fenghua.yu@intel.com, tglx@linutronix.de, mingo@kernel.org, torvalds@linux-foundation.org, acme@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, vincent.weaver@maine.edu, bp@suse.de, vegard.nossum@gmail.com, eranian@google.com, jolsa@redhat.com, pjt@google.com, kan.liang@intel.com, nilayvaish@gmail.com, mtosatti@redhat.com, vikas.shivappa@linux.intel.com, alexander.shishkin@linux.intel.com, ravi.v.shankar@intel.com, hpa@zytor.com, davidcc@google.com Reply-To: torvalds@linux-foundation.org, acme@redhat.com, peterz@infradead.org, tglx@linutronix.de, fenghua.yu@intel.com, mingo@kernel.org, jolsa@redhat.com, linux-kernel@vger.kernel.org, vincent.weaver@maine.edu, eranian@google.com, bp@suse.de, vegard.nossum@gmail.com, nilayvaish@gmail.com, kan.liang@intel.com, mtosatti@redhat.com, pjt@google.com, ravi.v.shankar@intel.com, hpa@zytor.com, davidcc@google.com, vikas.shivappa@linux.intel.com, alexander.shishkin@linux.intel.com In-Reply-To: <1480841177-27299-1-git-send-email-davidcc@google.com> References: <1480841177-27299-1-git-send-email-davidcc@google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf/core: Remove invalid warning from list_update_cgroup_even()t Git-Commit-ID: 8fc31ce8896fc3cea1d79688c8ff950ad4e73afe X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 8fc31ce8896fc3cea1d79688c8ff950ad4e73afe Gitweb: http://git.kernel.org/tip/8fc31ce8896fc3cea1d79688c8ff950ad4e73afe Author: David Carrillo-Cisneros AuthorDate: Sun, 4 Dec 2016 00:46:17 -0800 Committer: Ingo Molnar 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: Fenghua Yu Cc: Jiri Olsa Cc: Kan Liang Cc: Linus Torvalds Cc: Marcelo Tosatti Cc: Nilay Vaish Cc: Paul Turner Cc: Peter Zijlstra Cc: Ravi V Shankar Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vegard Nossum Cc: Vikas Shivappa Cc: Vince Weaver Link: http://lkml.kernel.org/r/1480841177-27299-1-git-send-email-davidcc@google.com Signed-off-by: Ingo Molnar --- 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 */