lkml.org 
[lkml]   [2017]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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@infradead.org>
AuthorDate: Tue, 18 Apr 2017 19:05:05 +0200
Committer: Thomas Gleixner <tglx@linutronix.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@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
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
\
 
 \ /
  Last update: 2017-04-20 13:34    [W:0.124 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site