[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180124113629.GS2228@hirez.programming.kicks-ass.net>
Date: Wed, 24 Jan 2018 12:36:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: hpa@...or.com, mingo@...nel.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, rostedt@...dmis.org,
torvalds@...ux-foundation.org
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/urgent] perf/core: Fix lock inversion between
perf,trace,cpuhp
On Wed, Jan 24, 2018 at 02:39:16AM -0800, tip-bot for Peter Zijlstra wrote:
> Commit-ID: 25695067c32e34047b5490436a90af507fda1c2e
> Gitweb: https://git.kernel.org/tip/25695067c32e34047b5490436a90af507fda1c2e
> Author: Peter Zijlstra <peterz@...radead.org>
> AuthorDate: Tue, 9 Jan 2018 13:10:30 +0100
> Committer: Ingo Molnar <mingo@...nel.org>
> CommitDate: Wed, 24 Jan 2018 10:07:23 +0100
>
> perf/core: Fix lock inversion between perf,trace,cpuhp
>
> Lockdep gifted us with noticing the following race:
>
> perf_trace_init()
> perf_trace_event_init()
> perf_trace_event_reg()
> tp_event->class->reg() := tracepoint_probe_register
> trace_point_add_func()
>
> perf_event_init_cpu()
>
> perf_event_task_disable()
> mutex_lock(¤t->perf_event_mutex)
>
> do_exit()
> task_work_run()
> __fput()
> perf_release()
> perf_event_release_kernel()
> free_event()
> _free_event()
> event->destroy() := perf_trace_destroy
>
You seem to have lost part of the Changelog, mine looks like:
perf_trace_init()
#0 mutex_lock(&event_mutex)
perf_trace_event_init()
perf_trace_event_reg()
tp_event->class->reg() := tracepoint_probe_register
#1 mutex_lock(&tracepoints_mutex)
trace_point_add_func()
#2 static_key_enable()
#2 do_cpu_up()
perf_event_init_cpu()
#3 mutex_lock(&pmus_lock)
#4 mutex_lock(&ctx->mutex)
perf_event_task_disable()
mutex_lock(¤t->perf_event_mutex)
#4 ctx = perf_event_ctx_lock()
#5 perf_event_for_each_child()
do_exit()
task_work_run()
__fput()
perf_release()
perf_event_release_kernel()
#4 mutex_lock(&ctx->mutex)
#5 mutex_lock(&event->child_mutex)
free_event()
_free_event()
event->destroy() := perf_trace_destroy
#0 mutex_lock(&event_mutex);
Which shows an actual deadlock.
Powered by blists - more mailing lists