Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756112AbZDGJYV (ORCPT ); Tue, 7 Apr 2009 05:24:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751930AbZDGJYG (ORCPT ); Tue, 7 Apr 2009 05:24:06 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:44496 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408AbZDGJYF (ORCPT ); Tue, 7 Apr 2009 05:24:05 -0400 Date: Tue, 7 Apr 2009 05:24:00 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Tom Zanussi cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Frederic Weisbecker , Steven Rostedt Subject: Re: [PATCH 4/4] tracing/filters: use ring_buffer_discard_commit for discarded events In-Reply-To: <1239083209.7220.42.camel@tropicana> Message-ID: References: <20090402052721.013878388@goodmis.org> <20090402053522.834546042@goodmis.org> <1238663187.6621.13.camel@bookworm> <1239083209.7220.42.camel@tropicana> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) 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: 1685 Lines: 52 On Tue, 7 Apr 2009, Tom Zanussi wrote: > > > The bug does not stick out in this patch set. Perhaps it is part of the > > original too? But something somewhere is calling the discard outside the > > reserve and commit. > > > > It doesn't stick out to me either - the funny thing is that it only > happens with CONFIG_PREEMPT_VOLUNTARY - with CONFIG_PREEMPT it's fine. > > In fact, with CONFIG_PREEMPT_VOLUNTARY, an RB_WARN_ON(!preempt_count()) > right after frace_preempt_disable() triggers immediately, which unless > I'm missing something, should never happen. Is there a bug in > PREEMPT_VOLUNTARY? > > Tom > > diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c > index 7a6209f..bac9ab7 100644 > --- a/kernel/trace/ring_buffer.c > +++ b/kernel/trace/ring_buffer.c > @@ -1494,6 +1494,8 @@ ring_buffer_lock_reserve(struct ring_buffer *buffer, unsigned long length) > /* If we are tracing schedule, we don't want to recurse */ > resched = ftrace_preempt_disable(); > > + RB_WARN_ON(buffer, !preempt_count()); Ug, I'm an idiot ;-) PREEMPT_VOLUNTARY will always have preempt_count return zero. We need a: RB_WARN_ON_PREEMPT(buffer); macro, so that we can define it to warn on CONFIG_PREEMPT but have it be a nop for all else. Note, I'm currently traveling so my response times will be limited. -- Steve > + > cpu = raw_smp_processor_id(); > > if (!cpumask_test_cpu(cpu, buffer->cpumask)) > > -- 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/