]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing: Reuse logic from perf's get_recursion_context()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 15 Oct 2021 17:42:40 +0000 (13:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:56:21 +0000 (16:56 +0000)
commit48fef664d7e9bb3dcae9348efb3b8abf6c88ebec
tree9ae875b91e092b217a99a7179beefd39285d24bf
parent670b3e902f62191b9a36d1d246989be3e1b7291a
tracing: Reuse logic from perf's get_recursion_context()

[ Upstream commit 9b84fadc444de5456ab5f5487e2108311c724c3f ]

Instead of having branches that adds noise to the branch prediction, use
the addition logic to set the bit for the level of interrupt context that
the state is currently in. This copies the logic from perf's
get_recursion_context() function.

Link: https://lore.kernel.org/all/20211015161702.GF174703@worktop.programming.kicks-ass.net/
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Stable-dep-of: 87c3a5893e86 ("sched/core: Optimize in_task() and in_interrupt() a bit")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/trace_recursion.h
kernel/trace/ring_buffer.c