From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
"Richard W.M. Jones" <rjones@redhat.com>
Subject: [PATCH 3/3 v2] ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of
Date: Tue, 07 Jun 2011 17:29:40 -0400 [thread overview]
Message-ID: <20110607213007.577456514@goodmis.org> (raw)
In-Reply-To: 20110607212937.662660421@goodmis.org
[-- Attachment #1: 0003-ftrace-Revert-8ab2b7efd-ftrace-Remove-unnecessary-di.patch irqs --]
[-- Type: text/plain, Size: 1537 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
Revert the commit that removed the disabling of interrupts around
the initial modifying of mcount callers to nops, and update the comment.
The original comment was outdated and stated that the interrupts were
being disabled to prevent kstop machine, which was required with the
old ftrace daemon, but was no longer the case.
What the comment failed to mention was that interrupts needed to be
disabled to keep interrupts from preempting the modifying of the code
and then executing the code that was partially modified.
Revert the commit and update the comment.
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/ftrace.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 204b3eb..908038f 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3330,6 +3330,7 @@ static int ftrace_process_locs(struct module *mod,
{
unsigned long *p;
unsigned long addr;
+ unsigned long flags;
mutex_lock(&ftrace_lock);
p = start;
@@ -3346,7 +3347,13 @@ static int ftrace_process_locs(struct module *mod,
ftrace_record_ip(addr);
}
+ /*
+ * Disable interrupts to prevent interrupts from executing
+ * code that is being modified.
+ */
+ local_irq_save(flags);
ftrace_update_code(mod);
+ local_irq_restore(flags);
mutex_unlock(&ftrace_lock);
return 0;
--
1.7.4.4
next prev parent reply other threads:[~2011-06-07 21:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-07 21:29 [PATCH 0/3 v2] [GIT PULL][v3.0] tracing: fixes Steven Rostedt
2011-06-07 21:29 ` [PATCH 1/3 v2] ftrace: Fix possible undefined return code Steven Rostedt
2011-06-07 21:29 ` [PATCH 2/3 v2] kprobes/trace: Fix kprobe selftest for gcc 4.6 Steven Rostedt
2011-06-08 3:45 ` Masami Hiramatsu
2011-06-07 21:29 ` Steven Rostedt [this message]
2011-06-07 21:38 ` [PATCH 3/3 v2] ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of Richard W.M. Jones
2011-06-07 21:42 ` Steven Rostedt
2011-06-08 14:08 ` [PATCH 0/3 v2] [GIT PULL][v3.0] tracing: fixes Ingo Molnar
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=20110607213007.577456514@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjones@redhat.com \
/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