[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-641693094ee1568502280f95900f374b2226b51d@git.kernel.org>
Date: Thu, 20 Apr 2017 04:30:06 -0700
From: "tip-bot for Peter Zijlstra (Intel)" <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: peterz@...radead.org, mingo@...nel.org,
linux-kernel@...r.kernel.org, rostedt@...dmis.org,
tglx@...utronix.de, hpa@...or.com, bigeasy@...utronix.de
Subject: [tip:smp/hotplug] perf: Avoid cpu_hotplug_lock r-r recursion
Commit-ID: 641693094ee1568502280f95900f374b2226b51d
Gitweb: http://git.kernel.org/tip/641693094ee1568502280f95900f374b2226b51d
Author: Peter Zijlstra (Intel) <peterz@...radead.org>
AuthorDate: Tue, 18 Apr 2017 19:05:05 +0200
Committer: Thomas Gleixner <tglx@...utronix.de>
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) <peterz@...radead.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Sebastian Siewior <bigeasy@...utronix.de>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: jbaron@...mai.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
Powered by blists - more mailing lists