Re: [PATCH v6 1/2] ftrace: disable preemption when recursion locked

From
Steven Rostedt <rostedt@goodmis.org>
Date
2021-10-27 02:56:03
Also in
linux-riscv, live-patching, lkml
Reply to
王贇, 2021-10-27
On Wed, 27 Oct 2021 10:34:13 +0800
王贇 [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+/*
+ * Preemption will be enabled (if it was previously enabled).
+ */
 static __always_inline void trace_clear_recursion(int bit)
 {
+	WARN_ON_ONCE(bit < 0);
Can you send a v7 without the WARN_ON.

This is an extremely hot path, and this will cause noticeable overhead.

If something were to call this with bit < 0, then it would crash and
burn rather quickly.

-- Steve

quoted hunk ↗ jump to hunk
+
+	preempt_enable_notrace();
 	barrier();
 	trace_recursion_clear(bit);
 }
Thread (5 messages) 5 messages, 2 authors, last reply 2021-10-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help