[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160525175947.GS3205@twins.programming.kicks-ass.net>
Date: Wed, 25 May 2016 19:59:47 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Andy Lutomirski <luto@...nel.org>
Cc: linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [PATCH] tracing: Choose static tp_printk buffer by explicit
nesting count
On Wed, May 25, 2016 at 03:16:40PM +0200, Peter Zijlstra wrote:
> On Tue, May 24, 2016 at 03:52:28PM -0700, Andy Lutomirski wrote:
> > + struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
> >
> > + if (!buffer || buffer->nesting >= 4)
> > return NULL;
>
> This is buggy fwiw; you need to unconditionally increment
> buffer->nesting to match the unconditional decrement.
>
> Otherwise 5 'increments' and 5 decrements will land you at -1.
Urgh, never mind me; if you don't dec when returning NULL this should
work out fine.
My head really aint working right today.
Powered by blists - more mailing lists