Skip to contentSkip to conversation

rcu: Do not trace rcu_is_watching() functions

PATCH In review Steven Rostedt 2 participants 2 messages Nov 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Do not trace rcu_is_watching() functions

Paul,

As I added the rcu_is_watching() to the ftrace code to prevent perf from tracing functions where RCU is not watching, I noticed that the rcu_is_watching() functions can themselves be traced. I would say this is a helper function and not something that we need to trace, as it can cause a slowdown in function tracing (any recursion is detected, so it only affects performance).

I marked the functions with notrace. You can take this patch and push it for 3.13 or I can take it if you give me an "Acked-by". As it only affects performance and does not crash the code it's not a must have in my tree.

If you take it, I can write up a better change log too.

-- Steve

kernel/rcutiny.c +1 -1
index 0fa061d..590c8a8 100644
@@ -179,7 +179,7 @@ EXPORT_SYMBOL_GPL(rcu_irq_enter);
 /*
  * Test whether RCU thinks that the current CPU is idle.
  */
-bool __rcu_is_watching(void)
+bool notrace __rcu_is_watching(void)
 {
 	return rcu_dynticks_nesting;
 }
kernel/rcutree.c +2 -2
index 981d0c1..499bb2b 100644
@@ -662,7 +662,7 @@ void rcu_nmi_exit(void)
  * rcu_is_watching(), the caller of __rcu_is_watching() must have at
  * least disabled preemption.
  */
-bool __rcu_is_watching(void)
+bool notrace __rcu_is_watching(void)
 {
 	return atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1;
 }
@@ -673,7 +673,7 @@ bool __rcu_is_watching(void)
  * If the current CPU is in its idle loop and is neither in an interrupt
  * or NMI handler, return true.
  */
-bool rcu_is_watching(void)
+bool notrace rcu_is_watching(void)
 {
 	int ret;
 
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Steven Rostedt

Paul,

As I added the rcu_is_watching() to the ftrace code to prevent perf from tracing functions where RCU is not watching, I noticed that the rcu_is_watching() functions can themselves be traced. I would say this is a helper function and not something that we need to trace, as it can cause a slowdown in function tracing (any recursion is detected, so it only affects performance).

I marked the functions with notrace. You can take this patch and push it for 3.13 or I can take it if you give me an "Acked-by". As it only affects performance and does not crash the code it's not a must have in my tree.

Quoted 5 lines

If you take it, I can write up a better change log too.

-- Steve

Given an improved commit log:

Quoted 36 lines
kernel/rcutiny.c +1 -1
index 0fa061d..590c8a8 100644
@@ -179,7 +179,7 @@ EXPORT_SYMBOL_GPL(rcu_irq_enter);
 /*
  * Test whether RCU thinks that the current CPU is idle.
  */
-bool __rcu_is_watching(void)
+bool notrace __rcu_is_watching(void)
 {
 	return rcu_dynticks_nesting;
 }
kernel/rcutree.c +2 -2
index 981d0c1..499bb2b 100644
@@ -662,7 +662,7 @@ void rcu_nmi_exit(void)
  * rcu_is_watching(), the caller of __rcu_is_watching() must have at
  * least disabled preemption.
  */
-bool __rcu_is_watching(void)
+bool notrace __rcu_is_watching(void)
 {
 	return atomic_read(this_cpu_ptr(&rcu_dynticks.dynticks)) & 0x1;
 }
@@ -673,7 +673,7 @@ bool __rcu_is_watching(void)
  * If the current CPU is in its idle loop and is neither in an interrupt
  * or NMI handler, return true.
  */
-bool rcu_is_watching(void)
+bool notrace rcu_is_watching(void)
 {
 	int ret;