From: Peter Zijlstra <peterz@infradead.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count
Date: Wed, 25 May 2016 19:59:47 +0200 [thread overview]
Message-ID: <20160525175947.GS3205@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160525131640.GG3192@twins.programming.kicks-ass.net>
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.
next prev parent reply other threads:[~2016-05-25 17:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 22:52 [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count Andy Lutomirski
2016-05-24 23:02 ` Steven Rostedt
2016-05-25 13:16 ` Peter Zijlstra
2016-05-25 13:36 ` Steven Rostedt
2016-05-25 17:59 ` Peter Zijlstra [this message]
2016-05-25 20:17 ` Andy Lutomirski
2016-05-25 13:20 ` Namhyung Kim
2016-05-25 20:18 ` Andy Lutomirski
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=20160525175947.GS3205@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--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