[lkml]   [2011]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3/3 v2] ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of
From: Steven Rostedt <>

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 <>
Tested-by: Richard W.M. Jones <>
Signed-off-by: Steven Rostedt <>
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;

p = start;
@@ -3346,7 +3347,13 @@ static int ftrace_process_locs(struct module *mod,

+ /*
+ * Disable interrupts to prevent interrupts from executing
+ * code that is being modified.
+ */
+ local_irq_save(flags);
+ local_irq_restore(flags);

return 0;

 \ /
  Last update: 2011-06-07 23:33    [W:0.291 / U:1.412 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site