Re: [RFC][PATCH 0/5] perf/tracing/cpuhotplug: Fix locking order

From: Paul E. McKenney
Date: Sat May 13 2017 - 09:40:12 EST


On Fri, May 12, 2017 at 05:34:48PM -0400, Steven Rostedt wrote:
> On Fri, 12 May 2017 21:49:56 +0200

[ . . . ]

> This means that text_mutex, which was taken by the alternative code, no
> longer is taken in cpu hotplug code. That means there's no longer a
> deadlock scenario, as we don't have anyplace(*) that grabs
> get_online_cpus() and takes the text_mutex. Removing that will
> simplify things tremendously!
>
> (*) with one exception: perf.
>
> Currently perf does a get_online_cpu() at a high level. Will it be
> possible to move that down, such that we don't have it taken when we do
> any software events?

Can perf get rid of get_online_cpus(), perhaps using the mutexes acquired
by perf_event_init_cpu() or by perf_event_exit_cpu()?

Thanx, Paul