public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	"H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: [PATCH] x86: Use preempt_disable_notrace() in cycles_2_ns()
Date: Tue, 4 Feb 2014 20:45:56 +0100	[thread overview]
Message-ID: <20140204194556.GE5002@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <20140204141315.2a968a72@gandalf.local.home>

On Tue, Feb 04, 2014 at 02:13:15PM -0500, Steven Rostedt wrote:
> When debug preempt is enabled, preempt_disable() can be traced by
> function and function graph tracing.
> 
> There's a place in the function graph tracer that calls trace_clock()
> which eventually calls cycles_2_ns() outside of the recursion
> protection. When cycles_2_ns() calls preempt_disable() it gets traced
> and the graph tracer will go into a recursive loop causing a crash or
> worse, a triple fault.
> 
> Simple fix is to use preempt_disable_notrace() in cycles_2_ns, which
> makes sense because the preempt_disable() tracing may use that code
> too, and it tracing it, even with recursion protection is rather
> pointless.
> 
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Indeed, thanks!

  reply	other threads:[~2014-02-04 19:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 19:13 [PATCH] x86: Use preempt_disable_notrace() in cycles_2_ns() Steven Rostedt
2014-02-04 19:45 ` Peter Zijlstra [this message]
2014-02-04 20:22 ` Thomas Gleixner
2014-02-10 13:28 ` [tip:x86/urgent] " tip-bot for Steven Rostedt

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=20140204194556.GE5002@laptop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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