Re: [PATCH 2/6] Unified trace buffer

From: Steven Rostedt
Date: Tue Sep 30 2008 - 08:07:02 EST



On Tue, 30 Sep 2008, Ingo Molnar wrote:

>
> * Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > +void ring_buffer_lock(struct ring_buffer *buffer, unsigned long *flags)
> > +{
> > + struct ring_buffer_per_cpu *cpu_buffer;
> > + int cpu;
> > +
> > + local_irq_save(*flags);
> > +
> > + for_each_buffer_cpu(buffer, cpu) {
> > + cpu_buffer = buffer->buffers[cpu];
> > + spin_lock(&cpu_buffer->lock);
> > + }
> > +}
>
> hm, that's rather unintelligent and needs to be fixed.

hm, why? It is ordered locking based on the cpu value. This is exactly
what ftrace did as well. The unlock even goes backwards max_cpu to 0.

But version 2 of this code will drop both ring_buffer_lock and unlock, but
that will come later.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/