From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] ring-buffer: change WARN_ON from checking preempt_count to preemptible
Date: Fri, 8 May 2009 13:31:36 +0200 [thread overview]
Message-ID: <20090508113136.GK11596@elte.hu> (raw)
In-Reply-To: <alpine.DEB.2.00.0905080653110.28378@gandalf.stny.rr.com>
* Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
> On Thu, 7 May 2009, Andrew Morton wrote:
>
> > On Fri, 08 May 2009 00:32:54 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > From: Steven Rostedt <srostedt@redhat.com>
> > >
> > > There's a WARN_ON in the ring buffer code that makes sure preemption
> > > is disabled. It checks "!preempt_count()". But when CONFIG_PREEMPT is not
> > > enabled, preempt_count() is always zero, and this will trigger the warning.
> > >
> > > [ Impact: prevent false warning on non preemptible kernels ]
> > >
> > > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> > > ---
> > > kernel/trace/ring_buffer.c | 2 +-
> > > 1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> > > index 3ae5ccf..3611706 100644
> > > --- a/kernel/trace/ring_buffer.c
> > > +++ b/kernel/trace/ring_buffer.c
> > > @@ -1688,7 +1688,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer,
> > > * committed yet. Thus we can assume that preemption
> > > * is still disabled.
> > > */
> > > - RB_WARN_ON(buffer, !preempt_count());
> > > + RB_WARN_ON(buffer, preemptible());
> > >
> > > cpu = smp_processor_id();
> > > cpu_buffer = buffer->buffers[cpu];
> >
> > smp_processor_id() will warn too.
> >
>
> The difference is that RB_WARN_ON also disables the ring buffer.
Yes, it's a more robust form of warning, in this context.
Ingo
next prev parent reply other threads:[~2009-05-08 11:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-08 4:32 [PATCH 0/4] [GIT PULL] tracing/ring-buffer: updates for tip Steven Rostedt
2009-05-08 4:32 ` [PATCH 1/4] tracing: have menu default enabled when kernel debug is configured Steven Rostedt
2009-05-08 4:32 ` [PATCH 2/4] ring-buffer: only periodically call cond_resched to ring-buffer-benchmark Steven Rostedt
2009-05-08 4:32 ` [PATCH 3/4] ring-buffer: add total count in ring-buffer-benchmark Steven Rostedt
2009-05-08 4:52 ` Andrew Morton
2009-05-08 10:52 ` Steven Rostedt
2009-05-08 4:32 ` [PATCH 4/4] ring-buffer: change WARN_ON from checking preempt_count to preemptible Steven Rostedt
2009-05-08 4:54 ` Andrew Morton
2009-05-08 10:53 ` Steven Rostedt
2009-05-08 11:31 ` Ingo Molnar [this message]
2009-05-08 16:56 ` Andrew Morton
2009-05-08 17:23 ` Steven Rostedt
2009-05-08 11:30 ` [PATCH 0/4] [GIT PULL] tracing/ring-buffer: updates for tip Ingo Molnar
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=20090508113136.GK11596@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--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