From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944843AbdDTLdR (ORCPT ); Thu, 20 Apr 2017 07:33:17 -0400 Received: from terminus.zytor.com ([65.50.211.136]:50047 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S944931AbdDTLce (ORCPT ); Thu, 20 Apr 2017 07:32:34 -0400 Date: Thu, 20 Apr 2017 04:30:06 -0700 From: "tip-bot for Peter Zijlstra (Intel)" Message-ID: Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, tglx@linutronix.de, hpa@zytor.com, bigeasy@linutronix.de Reply-To: tglx@linutronix.de, bigeasy@linutronix.de, hpa@zytor.com, mingo@kernel.org, peterz@infradead.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org In-Reply-To: <20170418103422.687248115@infradead.org> References: <20170418103422.687248115@infradead.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:smp/hotplug] perf: Avoid cpu_hotplug_lock r-r recursion Git-Commit-ID: 641693094ee1568502280f95900f374b2226b51d 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: 641693094ee1568502280f95900f374b2226b51d Gitweb: http://git.kernel.org/tip/641693094ee1568502280f95900f374b2226b51d Author: Peter Zijlstra (Intel) AuthorDate: Tue, 18 Apr 2017 19:05:05 +0200 Committer: Thomas Gleixner CommitDate: Thu, 20 Apr 2017 13:08:57 +0200 perf: Avoid cpu_hotplug_lock r-r recursion There are two call-sites where using static_key results in recursing on the cpu_hotplug_lock. Use the hotplug locked version of static_key_slow_inc(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Cc: Sebastian Siewior Cc: Steven Rostedt Cc: jbaron@akamai.com Link: http://lkml.kernel.org/r/20170418103422.687248115@infradead.org --- kernel/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 634dd95..8aa3063 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7653,7 +7653,7 @@ static int perf_swevent_init(struct perf_event *event) if (err) return err; - static_key_slow_inc(&perf_swevent_enabled[event_id]); + static_key_slow_inc_cpuslocked(&perf_swevent_enabled[event_id]); event->destroy = sw_perf_event_destroy; } @@ -9160,7 +9160,7 @@ static void account_event(struct perf_event *event) mutex_lock(&perf_sched_mutex); if (!atomic_read(&perf_sched_count)) { - static_branch_enable(&perf_sched_events); + static_key_slow_inc_cpuslocked(&perf_sched_events.key); /* * Guarantee that all CPUs observe they key change and * call the perf scheduling hooks before proceeding to