mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
	Hiroyuki KAMEZAWA <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH] tracing: Fix preempt count leak
Date: Mon, 20 Dec 2010 20:33:59 -0500	[thread overview]
Message-ID: <1292895239.22905.67.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <4D0FFB1A.7070407@cn.fujitsu.com>

On Tue, 2010-12-21 at 08:55 +0800, Li Zefan wrote:
> Any comment?

oops, this was buried in my email. I'll look at it tomorrow.

-- Steve

> 
> 15:47, Li Zefan wrote:
> > While running my ftrace stress test, this showed up:
> > 
> > BUG: sleeping function called from invalid context at mm/mmap.c:233
> > ...
> > note: cat[3293] exited with preempt_count 1
> > 
> > The bug was introduced by commit 91e86e560d0b3ce4c5fc64fd2bbb99f856a30a4e
> > ("tracing: Fix recursive user stack trace")
> > 
> > Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
> > ---
> >  kernel/trace/trace.c |    6 ++----
> >  1 files changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index c380612..5767457 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -1313,12 +1313,10 @@ ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc)
> >  
> >  	__this_cpu_inc(user_stack_count);
> >  
> > -
> > -
> >  	event = trace_buffer_lock_reserve(buffer, TRACE_USER_STACK,
> >  					  sizeof(*entry), flags, pc);
> >  	if (!event)
> > -		return;
> > +		goto out_drop_count;
> >  	entry	= ring_buffer_event_data(event);
> >  
> >  	entry->tgid		= current->tgid;
> > @@ -1333,8 +1331,8 @@ ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc)
> >  	if (!filter_check_discard(call, entry, buffer, event))
> >  		ring_buffer_unlock_commit(buffer, event);
> >  
> > + out_drop_count:
> >  	__this_cpu_dec(user_stack_count);
> > -
> >   out:
> >  	preempt_enable();
> >  }



  reply	other threads:[~2010-12-21  1:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  7:47 Li Zefan
2010-12-21  0:55 ` Li Zefan
2010-12-21  1:33   ` Steven Rostedt [this message]
2011-01-09 21:11 ` [tip:perf/urgent] " tip-bot for Li Zefan

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=1292895239.22905.67.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    /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