Re: Perf hotplug lockup in v4.9-rc8

2017-01-11 Thread Peter Zijlstra
On Wed, Jan 11, 2017 at 05:03:58PM +0100, Peter Zijlstra wrote: > > In any case, I'll try and write a proper Changelog for this... This is what I came up with, most of it should look familiar, its copy/pasted bits from this thread. --- Subject: perf: Fix sys_perf_event_open() vs hotplug From: Pe

Re: Perf hotplug lockup in v4.9-rc8

2017-01-11 Thread Mark Rutland
On Wed, Jan 11, 2017 at 05:03:58PM +0100, Peter Zijlstra wrote: > On Wed, Jan 11, 2017 at 02:59:20PM +, Mark Rutland wrote: > > On Fri, Dec 09, 2016 at 02:59:00PM +0100, Peter Zijlstra wrote: > > > + * If we get a false negative, things are complicated. If we are after > > > + * perf_event_c

Re: Perf hotplug lockup in v4.9-rc8

2017-01-11 Thread Peter Zijlstra
On Wed, Jan 11, 2017 at 02:59:20PM +, Mark Rutland wrote: > Hi Peter, > > Sorry for the delay; this fell into my backlog over the holiday. > > On Fri, Dec 09, 2016 at 02:59:00PM +0100, Peter Zijlstra wrote: > > So while I went back and forth trying to make that less ugly, I figured > > there

Re: Perf hotplug lockup in v4.9-rc8

2017-01-11 Thread Mark Rutland
Hi Peter, Sorry for the delay; this fell into my backlog over the holiday. On Fri, Dec 09, 2016 at 02:59:00PM +0100, Peter Zijlstra wrote: > So while I went back and forth trying to make that less ugly, I figured > there was another problem. > > Imagine the cpu_function_call() hitting the 'right

Re: Perf hotplug lockup in v4.9-rc8

2016-12-22 Thread Paul E. McKenney
On Thu, Dec 22, 2016 at 03:00:10PM +0100, Peter Zijlstra wrote: > On Thu, Dec 22, 2016 at 09:45:09AM +0100, Peter Zijlstra wrote: > > On Mon, Dec 12, 2016 at 01:42:28PM +0100, Peter Zijlstra wrote: > > > > > What are you trying to order here? > > > > > > I suppose something like this: > > > > >

Re: Perf hotplug lockup in v4.9-rc8

2016-12-22 Thread Peter Zijlstra
On Thu, Dec 22, 2016 at 09:45:09AM +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 01:42:28PM +0100, Peter Zijlstra wrote: > > > What are you trying to order here? > > > > I suppose something like this: > > > > > > CPU0CPU1CPU2 > > > > (current ==

Re: Perf hotplug lockup in v4.9-rc8

2016-12-22 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 01:42:28PM +0100, Peter Zijlstra wrote: > On Mon, Dec 12, 2016 at 11:46:40AM +, Will Deacon wrote: > > > @@ -2331,13 +2330,36 @@ perf_install_in_context(struct perf_event_context > > > *ctx, > > > /* > > >* Installing events is tricky because we cannot rely on ctx

Re: Perf hotplug lockup in v4.9-rc8

2016-12-12 Thread Peter Zijlstra
On Mon, Dec 12, 2016 at 11:46:40AM +, Will Deacon wrote: > > @@ -2331,13 +2330,36 @@ perf_install_in_context(struct perf_event_context > > *ctx, > > /* > > * Installing events is tricky because we cannot rely on ctx->is_active > > * to be set in case this is the nr_events 0 -> 1

Re: Perf hotplug lockup in v4.9-rc8

2016-12-12 Thread Will Deacon
On Fri, Dec 09, 2016 at 02:59:00PM +0100, Peter Zijlstra wrote: > On Wed, Dec 07, 2016 at 07:34:55PM +0100, Peter Zijlstra wrote: > > > @@ -2352,6 +2357,28 @@ perf_install_in_context(struct perf_event_context > > *ctx, > > return; > > } > > raw_spin_unlock_irq(&ctx->lock); > >

Re: Perf hotplug lockup in v4.9-rc8

2016-12-09 Thread Peter Zijlstra
On Wed, Dec 07, 2016 at 07:34:55PM +0100, Peter Zijlstra wrote: > @@ -2352,6 +2357,28 @@ perf_install_in_context(struct perf_event_context *ctx, > return; > } > raw_spin_unlock_irq(&ctx->lock); > + > + raw_spin_lock_irq(&task->pi_lock); > + if (!(task->state == TA

Re: Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Mark Rutland
On Wed, Dec 07, 2016 at 07:34:55PM +0100, Peter Zijlstra wrote: > On Wed, Dec 07, 2016 at 05:53:47PM +, Mark Rutland wrote: > > On Wed, Dec 07, 2016 at 01:52:17PM +, Mark Rutland wrote: > > > Hi all > > > > > > Jeremy noticed a kernel lockup on arm64 when the perf tool was used in > > > pa

Re: Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Peter Zijlstra
On Wed, Dec 07, 2016 at 05:53:47PM +, Mark Rutland wrote: > On Wed, Dec 07, 2016 at 01:52:17PM +, Mark Rutland wrote: > > Hi all > > > > Jeremy noticed a kernel lockup on arm64 when the perf tool was used in > > parallel with hotplug, which I've reproduced on arm64 and x86(-64) with > > v4

Re: Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Mark Rutland
On Wed, Dec 07, 2016 at 01:52:17PM +, Mark Rutland wrote: > Hi all > > Jeremy noticed a kernel lockup on arm64 when the perf tool was used in > parallel with hotplug, which I've reproduced on arm64 and x86(-64) with > v4.9-rc8. In both cases I'm using defconfig; I've tried enabling lockdep > b

Re: Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Mark Rutland
On Wed, Dec 07, 2016 at 02:30:58PM +, Mark Rutland wrote: > On Wed, Dec 07, 2016 at 01:52:17PM +, Mark Rutland wrote: > > Hi all > > > > Jeremy noticed a kernel lockup on arm64 when the perf tool was used in > > parallel with hotplug, which I've reproduced on arm64 and x86(-64) with > > v4

Re: Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Mark Rutland
On Wed, Dec 07, 2016 at 01:52:17PM +, Mark Rutland wrote: > Hi all > > Jeremy noticed a kernel lockup on arm64 when the perf tool was used in > parallel with hotplug, which I've reproduced on arm64 and x86(-64) with > v4.9-rc8. In both cases I'm using defconfig; I've tried enabling lockdep > b

Perf hotplug lockup in v4.9-rc8

2016-12-07 Thread Mark Rutland
Hi all Jeremy noticed a kernel lockup on arm64 when the perf tool was used in parallel with hotplug, which I've reproduced on arm64 and x86(-64) with v4.9-rc8. In both cases I'm using defconfig; I've tried enabling lockdep but it was silent for arm64 and x86. I haven't yet tested earlier kernels