mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Oleg Nesterov <oleg@redhat.com>,
	fweisbec@gmail.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tracing - putting cond_resched into tace_pipe loop
Date: Mon, 14 Mar 2011 16:07:46 +0100	[thread overview]
Message-ID: <20110314150746.GA4453@jolsa.brq.redhat.com> (raw)
In-Reply-To: <1300112926.9910.100.camel@gandalf.stny.rr.com>

On Mon, Mar 14, 2011 at 10:28:46AM -0400, Steven Rostedt wrote:
> On Mon, 2011-03-14 at 15:18 +0100, Jiri Olsa wrote:
> 
> 
> > > I'm not sure that this needs the signal_pending() or the break, or even
> > > the cond_resched(). Perhaps the first patch fixes the bug. But that
> > > while loop does not block, and it should just spin enough to fill a
> > > page. If it is not filling the page then that's a bug.
> > 
> > well, if there are no "event lost" messages and the flags are set
> > to the "bin or raw" and you trace events only, then the page
> > is not be filled.
> > 
> > But as there'll be allways lost events, the page will be populated
> > and it will get out of the loop.
> 
> There's two loops, I'm talking about the inner one, which will break out
> when there are no events left to process.
> 
> The "waitagain" calls into tracing_wait_pipe which has the
> signal_pending() attribute. It should also block, or return -EAGAIN if
> the caller is not blocking.
> 
> > 
> > > 
> > > Jiri,
> > > 
> > > Can you reproduce the bug with just he first patch? Actually, I can
> > > reproduce it on vanilla, I'll apply your first patch and see if that
> > > fixes things. If not, then we need to find out why and fix those.
> > 
> > The first patch fixies the 'lost evets' trace, so the loop is escaped
> > when the page is full.
> > (I was going to send some change for first patch WARN_ON -> WARN_ONCE)
> 
> Yes, I was going to recommend doing that too.
> 
> > 
> > I think in case there are no 'lost events' and we have the conditions
> > I describe, we need the cond_resched call.
> 
> No we don't.

ok, probably I'm missing something, but here's the path that dont produce
any data and will keeps us in the inner loop:
(assuming events only, disabled context info and no event lost)

while (trace_find_next_entry_inc(iter) != NULL)
..
	print_trace_line(iter);
		...
		if (trace_flags & TRACE_ITER_BIN)
	                return print_bin_fmt(iter);
			...
			print_bin_fmt
				return event ?event->funcs->binary(iter, 0, event) : TRACE_TYPE_HANDLED;

...


now, "event->funcs->binary" is trace_nop_print, which is defined as:

	enum print_line_t trace_nop_print(struct trace_iterator *iter, int
	flags,
					  struct trace_event *event)
	{
		return TRACE_TYPE_HANDLED;
	}


So we get back the the while loop with no data added and with
TRACE_TYPE_HANDLED return code, which will keep us in the loop.

Not sure this is bug or feature :)

jirka

> 
> As for non preempt kernels, honestly, I don't care about latencies. If
> you are worried about latencies, don't run a non preempt kernel. I do
> care if it goes into an infinite loop, or never processes signals, which
> would be a bug. But long running times in the kernel on a non preempt
> kernel. Well, that's just part of the game.
> 
> -- Steve
> 
> > 
> > I'll send new patch version shortly.
> > 
> > thanks,
> > jirka
> > > 
> > > -- Steve
> > > 
> > > 
> 
> 

  reply	other threads:[~2011-03-14 15:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-12 22:59 [PATCH 0/2] tracing - avoid soft lockup in trace_pipe Jiri Olsa
2011-03-12 22:59 ` [PATCH 1/2] tracing - trace lost events properly Jiri Olsa
2011-03-12 22:59 ` [PATCH 2/2] tracing - putting cond_resched into tace_pipe loop Jiri Olsa
2011-03-13 14:58   ` Oleg Nesterov
2011-03-14 14:07     ` Steven Rostedt
2011-03-14 14:18       ` Jiri Olsa
2011-03-14 14:28         ` Steven Rostedt
2011-03-14 15:07           ` Jiri Olsa [this message]
2011-03-14 15:20             ` Steven Rostedt
2011-03-14 18:06               ` [PATCHv2] tracing - avoid soft lockup in trace_pipe Jiri Olsa
2011-03-21 12:10                 ` Jiri Olsa
2011-03-25  2:23                   ` Steven Rostedt
2011-03-25  3:14                     ` Steven Rostedt
2011-03-25 11:05                       ` [PATCHv3] " Jiri Olsa
2011-03-25 15:46                         ` Steven Rostedt
2011-03-25 15:49                         ` Steven Rostedt
2011-03-25 15:53                           ` Jiri Olsa
2011-04-27 15:22                         ` [tip:perf/core] tracing: Avoid " tip-bot for Jiri Olsa

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=20110314150746.GA4453@jolsa.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome