projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d75f717
)
tracing: Use __this_cpu_inc/dec operation instead of __get_cpu_var
author
Shan Wei
<davidshan@tencent.com>
Mon, 19 Nov 2012 05:21:01 +0000
(13:21 +0800)
committer
Steven Rostedt
<rostedt@goodmis.org>
Sat, 26 Jan 2013 01:36:54 +0000
(20:36 -0500)
__this_cpu_inc_return() or __this_cpu_dec generates a single instruction,
which is faster than __get_cpu_var operation.
Link:
http://lkml.kernel.org/r/50A9C1BD.1060308@gmail.com
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/trace/trace.c
b/kernel/trace/trace.c
index ca9b7dfed8ef59ee2f19e067f657e3f68b3639a4..07888e15c6943a7bd233b85ea40ec49dbeeb5677 100644
(file)
--- a/
kernel/trace/trace.c
+++ b/
kernel/trace/trace.c
@@
-1344,7
+1344,7
@@
static void __ftrace_trace_stack(struct ring_buffer *buffer,
*/
preempt_disable_notrace();
- use_stack =
++__get_cpu_var
(ftrace_stack_reserve);
+ use_stack =
__this_cpu_inc_return
(ftrace_stack_reserve);
/*
* We don't need any atomic variables, just a barrier.
* If an interrupt comes in, we don't care, because it would
@@
-1398,7
+1398,7
@@
static void __ftrace_trace_stack(struct ring_buffer *buffer,
out:
/* Again, don't let gcc optimize things here */
barrier();
- __
get_cpu_var(ftrace_stack_reserve)--
;
+ __
this_cpu_dec(ftrace_stack_reserve)
;
preempt_enable_notrace();
}