public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Miller <davem@davemloft.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev@ozlabs.org, Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 2/2] ftrace: fix unlocking of hash
Date: Sat, 06 Sep 2008 01:06:04 -0400	[thread overview]
Message-ID: <20080906050906.111265558@goodmis.org> (raw)
In-Reply-To: 20080906050602.409299112@goodmis.org

[-- Attachment #1: ftrace-ppc-dynamic-fix.patch --]
[-- Type: text/plain, Size: 1315 bytes --]

This must be brown paper bag week for Steven Rostedt!

While working on ftrace for PPC, I discovered that the hash locking done
when CONFIG_FTRACE_MCOUNT_RECORD is not set, is totally incorrect.

With a cut and paste error, I had the hash lock macro to lock for both
hash_lock _and_ hash_unlock!

This bug did not affect x86 since this bug was introduced when
CONFIG_FTRACE_MCOUNT_RECORD was added to x86.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
 kernel/trace/ftrace.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-tip.git/kernel/trace/ftrace.c
===================================================================
--- linux-tip.git.orig/kernel/trace/ftrace.c	2008-09-05 21:53:46.000000000 -0700
+++ linux-tip.git/kernel/trace/ftrace.c	2008-09-05 21:57:57.000000000 -0700
@@ -170,7 +170,8 @@ static int __unregister_ftrace_function(
  */
 static DEFINE_SPINLOCK(ftrace_hash_lock);
 #define ftrace_hash_lock(flags)	  spin_lock_irqsave(&ftrace_hash_lock, flags)
-#define ftrace_hash_unlock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags)
+#define ftrace_hash_unlock(flags) \
+			spin_unlock_irqrestore(&ftrace_hash_lock, flags)
 #else
 /* This is protected via the ftrace_lock with MCOUNT_RECORD. */
 #define ftrace_hash_lock(flags)   do { (void)(flags); } while (0)

-- 

  parent reply	other threads:[~2008-09-06  5:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-06  5:06 [PATCH 0/2] ftrace: fixes for PPC Steven Rostedt
2008-09-06  5:06 ` [PATCH 1/2] ftrace: use ftrace_release for all dynamic ftrace functions Steven Rostedt
2008-09-06  5:06 ` Steven Rostedt [this message]
2008-09-06 12:03 ` [PATCH 0/2] ftrace: fixes for PPC Ingo Molnar
2008-10-16 18:14   ` Josh Boyer
2008-10-16 18:22     ` Steven Rostedt
2008-10-16 18:35       ` Josh Boyer
2008-10-16 18:42         ` Steven Rostedt
2008-10-16 18:45         ` Steven Rostedt
2008-10-16 19:01           ` Josh Boyer
2008-10-20 16:30             ` Steven Rostedt
2008-10-20 17:08               ` Josh Boyer
2008-10-20 17:28                 ` Steven Rostedt
2008-10-20 17:42                 ` Frédéric Weisbecker
2008-10-20 17:53                   ` Steven Rostedt
2008-10-20 21:47                     ` Frédéric Weisbecker
2008-10-17  0:48     ` [PATCH] ftrace: powerpc: remove startup functions from tracing Steven Rostedt
2008-10-17  0:50       ` Benjamin Herrenschmidt
2008-10-17  1:04         ` Steven Rostedt
2008-10-17  5:37     ` [PATCH 0/2] ftrace: fixes for PPC Chris Friesen

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=20080906050906.111265558@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    /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