All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>,
	mingo@kernel.org, linux-kernel@vger.kernel.org,
	eranian@gmail.com, mark.rutland@arm.com,
	torvalds@linux-foundation.org, tglx@linutronix.de
Subject: Re: [RFC][PATCH 2/3] perf: Add a bit of paranoia
Date: Wed, 4 Feb 2015 15:51:36 +0100	[thread overview]
Message-ID: <20150204145136.GB31111@krava.brq.redhat.com> (raw)
In-Reply-To: <20150202173232.GG24151@twins.programming.kicks-ass.net>

On Mon, Feb 02, 2015 at 06:32:32PM +0100, Peter Zijlstra wrote:
> On Mon, Feb 02, 2015 at 04:42:40PM +0100, Peter Zijlstra wrote:
> > On Mon, Feb 02, 2015 at 01:33:14AM -0500, Vince Weaver wrote:
> > > [407484.309136] ------------[ cut here ]------------
> 
> > > [407484.588602]  <<EOE>>  <IRQ>  [<ffffffff8115c28c>] perf_prepare_sample+0x2ec/0x3c0
> > > [407484.597358]  [<ffffffff8115c46e>] __perf_event_overflow+0x10e/0x270
> > > [407484.604708]  [<ffffffff8115c439>] ? __perf_event_overflow+0xd9/0x270
> > > [407484.612215]  [<ffffffff8115c924>] ? perf_tp_event+0xc4/0x210
> > > [407484.619000]  [<ffffffff8115cfe2>] ? __perf_sw_event+0x72/0x1f0
> > > [407484.625937]  [<ffffffff8115c799>] ? perf_swevent_overflow+0xa9/0xe0
> > > [407484.633287]  [<ffffffff8115c799>] perf_swevent_overflow+0xa9/0xe0
> > > [407484.640467]  [<ffffffff8115c837>] perf_swevent_event+0x67/0x90
> > > [407484.647343]  [<ffffffff8115c924>] perf_tp_event+0xc4/0x210
> > > [407484.653923]  [<ffffffff810b6fa9>] ? lock_acquire+0x119/0x130
> > > [407484.660606]  [<ffffffff810b3cf6>] ? perf_trace_lock_acquire+0x146/0x180
> > > [407484.668332]  [<ffffffff810b594f>] ? __lock_acquire.isra.31+0x3af/0xfe0
> > > [407484.675962]  [<ffffffff810b3cf6>] perf_trace_lock_acquire+0x146/0x180
> > > [407484.683490]  [<ffffffff810b6fa9>] ? lock_acquire+0x119/0x130
> > > [407484.690211]  [<ffffffff810b6fa9>] lock_acquire+0x119/0x130
> > > [407484.696750]  [<ffffffff8115b7f5>] ? perf_event_wakeup+0x5/0xf0
> > > [407484.703640]  [<ffffffff811f50ef>] ? kill_fasync+0xf/0xf0
> > > [407484.710008]  [<ffffffff8115b828>] perf_event_wakeup+0x38/0xf0
> > > [407484.716798]  [<ffffffff8115b7f5>] ? perf_event_wakeup+0x5/0xf0
> > > [407484.723696]  [<ffffffff8115b913>] perf_pending_event+0x33/0x60
> > > [407484.730570]  [<ffffffff8114cc7c>] irq_work_run_list+0x4c/0x80
> > > [407484.737392]  [<ffffffff8114ccc8>] irq_work_run+0x18/0x40
> > > [407484.743765]  [<ffffffff8101955f>] smp_trace_irq_work_interrupt+0x3f/0xc0
> > > [407484.751579]  [<ffffffff816c01fd>] trace_irq_work_interrupt+0x6d/0x80
> 
> > > [407484.799195] ---[ end trace 55752a03ec8ab979 ]---
> > 
> > That looks like tail recursive fun! An irq work that raises and irq work
> > ad infinitum. Lemme see if I can squash that.. didn't we have something
> > like this before... /me goes look.
> 
> 
> Does this make it go away?
> 
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -4413,6 +4413,8 @@ static void perf_pending_event(struct ir
>  	struct perf_event *event = container_of(entry,
>  			struct perf_event, pending);
>  
> +	int rctx = perf_swevent_get_recursion_context();
> +

hum, you should check the rctx

	if (rctx == -1)
		return;

also this recursion is bound to swevent_htable, should we rather add
separate ctx data for irq_work to limit the clashing with SW events?

jirka

>  	if (event->pending_disable) {
>  		event->pending_disable = 0;
>  		__perf_event_disable(event);
> @@ -4422,6 +4424,8 @@ static void perf_pending_event(struct ir
>  		event->pending_wakeup = 0;
>  		perf_event_wakeup(event);
>  	}
> +
> +	perf_swevent_put_recursion_context(rctx);
>  }
>  
>  /*

  reply	other threads:[~2015-02-04 14:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23 12:51 [RFC][PATCH 0/3] perf fixes Peter Zijlstra
2015-01-23 12:52 ` [RFC][PATCH 1/3] perf: Tighten (and fix) the grouping condition Peter Zijlstra
2015-01-23 15:02   ` Mark Rutland
2015-01-23 15:07     ` Peter Zijlstra
2015-01-23 15:22       ` Mark Rutland
2015-02-04 12:59         ` Peter Zijlstra
2015-01-28 14:30   ` [tip:perf/urgent] " tip-bot for Peter Zijlstra
2015-01-23 12:52 ` [RFC][PATCH 2/3] perf: Add a bit of paranoia Peter Zijlstra
2015-01-26 16:26   ` Peter Zijlstra
2015-01-27 21:28     ` Vince Weaver
2015-01-29  2:16       ` Vince Weaver
2015-01-29  7:51         ` Jiri Olsa
2015-01-29 13:44           ` Peter Zijlstra
2015-02-04 14:39             ` [tip:perf/core] perf: Fix put_event() ctx lock tip-bot for Peter Zijlstra
2015-01-29 14:47     ` [RFC][PATCH 2/3] perf: Add a bit of paranoia Peter Zijlstra
2015-02-02  6:33       ` Vince Weaver
2015-02-02 15:42         ` Peter Zijlstra
2015-02-02 17:32           ` Peter Zijlstra
2015-02-04 14:51             ` Jiri Olsa [this message]
2015-02-04 16:33               ` Peter Zijlstra
2015-02-04 16:43                 ` Peter Zijlstra
2015-02-04 14:39     ` [tip:perf/core] perf: Fix move_group() order tip-bot for Peter Zijlstra (Intel)
2015-02-04 14:39   ` [tip:perf/core] perf: Add a bit of paranoia tip-bot for Peter Zijlstra
2015-01-23 12:52 ` [RFC][PATCH 3/3] perf: Fix event->ctx locking Peter Zijlstra
2015-02-04 14:39   ` [tip:perf/core] " tip-bot for Peter Zijlstra
2015-01-26 14:30 ` [RFC][PATCH 0/3] perf fixes Vince Weaver
2015-01-26 18:03   ` Vince Weaver
2015-01-26 18:34     ` Jiri Olsa
2015-01-26 18:52       ` Vince Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150204145136.GB31111@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=eranian@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.weaver@maine.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.