[PATCH 3/5] ftrace: do not trace nmi callers in RCU

From: Steven Rostedt
Date: Tue Jul 29 2008 - 21:44:25 EST


The dynamic ftrace code performs run time modification of the code text
section. This is not safe to do unless all other CPUS are halted. Because
there is no good way to halt NMIs while doing the modification, we must
make sure that the NMIs will not execute code that will be modified.

This patch adds notrace annotation to functions called by NMIs in RCU.

Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
CC: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
---
kernel/rcupreempt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-tip.git/kernel/rcupreempt.c
===================================================================
--- linux-tip.git.orig/kernel/rcupreempt.c 2008-07-29 20:12:05.000000000 -0400
+++ linux-tip.git/kernel/rcupreempt.c 2008-07-29 20:13:52.000000000 -0400
@@ -240,7 +240,7 @@ long rcu_batches_completed(void)
}
EXPORT_SYMBOL_GPL(rcu_batches_completed);

-void __rcu_read_lock(void)
+notrace void __rcu_read_lock(void)
{
int idx;
struct task_struct *t = current;
@@ -306,7 +306,7 @@ void __rcu_read_lock(void)
}
EXPORT_SYMBOL_GPL(__rcu_read_lock);

-void __rcu_read_unlock(void)
+notrace void __rcu_read_unlock(void)
{
int idx;
struct task_struct *t = current;
@@ -448,7 +448,7 @@ static DEFINE_PER_CPU(int, rcu_update_fl
* rcu_dyntick_sched.dynticks to let the RCU handling know that the
* CPU is active.
*/
-void rcu_irq_enter(void)
+notrace void rcu_irq_enter(void)
{
int cpu = smp_processor_id();
struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);
@@ -518,7 +518,7 @@ void rcu_irq_enter(void)
* rcu_dyntick_sched.dynticks to put let the RCU handling be
* aware that the CPU is going back to idle with no ticks.
*/
-void rcu_irq_exit(void)
+notrace void rcu_irq_exit(void)
{
int cpu = smp_processor_id();
struct rcu_dyntick_sched *rdssp = &per_cpu(rcu_dyntick_sched, cpu);

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/