Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262AbbBXD3q (ORCPT ); Mon, 23 Feb 2015 22:29:46 -0500 Received: from mail-qg0-f50.google.com ([209.85.192.50]:46535 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbbBXD3p (ORCPT ); Mon, 23 Feb 2015 22:29:45 -0500 From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Mon, 23 Feb 2015 22:33:05 -0500 (EST) To: Peter Zijlstra cc: Vince Weaver , linux-kernel@vger.kernel.org, Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , Steven Rostedt Subject: Re: perf: fuzzer gets CPU stuck in perf_callchain() In-Reply-To: <20150219170311.GH21418@twins.programming.kicks-ass.net> Message-ID: References: <20150219170311.GH21418@twins.programming.kicks-ass.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2558 Lines: 69 On Thu, 19 Feb 2015, Peter Zijlstra wrote: > On Thu, Feb 19, 2015 at 11:54:40AM -0500, Vince Weaver wrote: > > > [ 7938.802139] [] perf_tp_event+0xc4/0x210 > > [ 7938.861174] [] perf_trace_lock+0x12a/0x160 > > [ 7938.882197] [] lock_release+0x130/0x260 > > [ 7938.888754] [] _raw_spin_unlock_irqrestore+0x24/0x40 > > [ 7938.896510] [] do_send_sig_info+0x5d/0x80 > > [ 7938.903240] [] send_sigio_to_task+0x12f/0x1a0 > > [ 7938.923894] [] send_sigio+0xae/0x100 > > [ 7938.930132] [] kill_fasync+0x97/0xf0 > > [ 7938.942707] [] perf_event_wakeup+0xd4/0xf0 > > [ 7938.956367] [] perf_pending_event+0x33/0x60 > > [ 7938.963199] [] irq_work_run_list+0x4c/0x80 > > [ 7938.969932] [] irq_work_run+0x18/0x40 > > [ 7938.976212] [] smp_trace_irq_work_interrupt+0x3f/0xc0 > > [ 7938.983957] [] trace_irq_work_interrupt+0x6d/0x80 > > Ah, it looks like the never ending irq_work.. > > Could you try this? sorry for the delay. I managed to reproduce this problem again on 4.0-rc1, verified it was reproducible, then applied the patch below and I could no longer trigger the issue. Tested-by: Vince Weaver > > --- > kernel/events/core.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/kernel/events/core.c b/kernel/events/core.c > index f04daabfd1cf..088e81ae43cb 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry) > { > struct perf_event *event = container_of(entry, > struct perf_event, pending); > + int rctx; > + > + rctx = perf_swevent_get_recursion_context(); > + /* > + * If we 'fail' here, that's OK, it means recursion is already disabled > + * and we won't recurse 'further'. > + */ > > if (event->pending_disable) { > event->pending_disable = 0; > @@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry) > event->pending_wakeup = 0; > perf_event_wakeup(event); > } > + > + if (rctx >= 0) > + perf_swevent_put_recursion_context(rctx); > } > > /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/