[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0902061446390.22636@gandalf.stny.rr.com>
Date: Fri, 6 Feb 2009 14:49:02 -0500 (EST)
From: Steven Rostedt <rostedt@...dmis.org>
To: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH v2 1/7] ring-buffer: add NMI protection for spinlocks
On Fri, 6 Feb 2009, Mathieu Desnoyers wrote:
> >
> > commit_page = cpu_buffer->commit_page;
> > /* we just need to protect against interrupts */
> > @@ -995,7 +1026,19 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
> > struct buffer_page *next_page = tail_page;
> >
> > local_irq_save(flags);
> > - __raw_spin_lock(&cpu_buffer->lock);
> > + /*
> > + * NMIs can happen after we take the lock.
> > + * If we are in an NMI, only take the lock
> > + * if it is not already taken. Otherwise
> > + * simply fail.
> > + */
> > + if (unlikely(__get_cpu_var(rb_in_nmi))) {
> > + if (!__raw_spin_trylock(&cpu_buffer->lock))
> > + goto out_unlock;
>
> Hi Steven,
>
> You're not silently discarding an event, aren't you ? ;)
>
> Please keep at least a count of "events_lost" so it can be reported
> later by a printk().
I could add a counter here, but it is not a silent discard. The tracer
would receive a "NULL" pointer in this case. Then the tracer can do what
it wants with this information. The ring buffer will never discard data
(otherwise it is a bug) without letting the tracer know that it did so.
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists