Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933421AbdDFJQY (ORCPT ); Thu, 6 Apr 2017 05:16:24 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:52344 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932304AbdDFJQK (ORCPT ); Thu, 6 Apr 2017 05:16:10 -0400 Date: Thu, 6 Apr 2017 11:16:04 +0200 From: Peter Zijlstra To: Rabin Vincent Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, Rabin Vincent Subject: Re: [PATCH] MIPS: perf: fix deadlock Message-ID: <20170406091604.37poma56ptmcn7de@hirez.programming.kicks-ass.net> References: <1491398048-20083-1-git-send-email-rabin.vincent@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491398048-20083-1-git-send-email-rabin.vincent@axis.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1155 Lines: 40 On Wed, Apr 05, 2017 at 03:14:08PM +0200, Rabin Vincent wrote: That lock is disgusting... but yes patch looks about right. I'll leave it to the MIPS people though. > --- > arch/mips/kernel/perf_event_mipsxx.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c > index 8c35b31..9452b02 100644 > --- a/arch/mips/kernel/perf_event_mipsxx.c > +++ b/arch/mips/kernel/perf_event_mipsxx.c > @@ -1446,6 +1446,11 @@ static int mipsxx_pmu_handle_shared_irq(void) > HANDLE_COUNTER(0) > } > > +#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS > + read_unlock(&pmuint_rwlock); > +#endif > + resume_local_counters(); > + > /* > * Do all the work for the pending perf events. We can do this > * in here because the performance counter interrupt is a regular > @@ -1454,10 +1459,6 @@ static int mipsxx_pmu_handle_shared_irq(void) > if (handled == IRQ_HANDLED) > irq_work_run(); > > -#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS > - read_unlock(&pmuint_rwlock); > -#endif > - resume_local_counters(); > return handled; > } > > -- > 2.7.0 >