]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Optimize testing what context current is in
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Nov 2020 02:32:38 +0000 (21:32 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 6 Nov 2020 13:33:23 +0000 (08:33 -0500)
commit17a400f0dbf5dd5e7d953173380b6749defcc421
tree3b0401623f109b52d7c49a2e1c0f12a3eb96f9ae
parentff2513f3f3047a29ddf7b42126c2bdbc66cf098d
ftrace: Optimize testing what context current is in

The preempt_count() is not a simple location in memory, it could be part of
per_cpu code or more. Each access to preempt_count(), or one of its accessor
functions (like in_interrupt()) takes several cycles. By reading
preempt_count() once, and then doing tests to find the context against the
value return is slightly faster than using in_nmi() and in_interrupt().

Link: https://lkml.kernel.org/r/20201028115612.780796355@goodmis.org
Link: https://lkml.kernel.org/r/20201106023546.558881845@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
include/linux/trace_recursion.h