Thread (25 messages) 25 messages, 4 authors, 2025-06-27

Re: [PATCH v11 06/14] unwind_user/deferred: Add deferred unwinding interface

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2025-06-26 16:48:35
Also in: bpf, lkml

On Wed, 25 Jun 2025 18:56:06 -0400
Steven Rostedt [off-list ref] wrote:
 static __always_inline void unwind_reset_info(void)
 {
-	if (unlikely(current->unwind_info.cache))
+	/* Exit out early if this was never used */
+	if (likely(!current->unwind_info.timestamp))
+		return;
I found that this breaks the use of perf using the unwind_user_faultable()
directly and not relying on the deferred infrastructure (which it does when
it traces a single task and also needs to remove the separate in_nmi()
code). Because this still requires the nr_entries to be set to zero.

The clearing of the nr_entries has to be separate from the timestamp. To
prevent unneeded writes after the cache is allocated, should we check the
nr_entries is set before writing zero?

	if (current->unwind_info.cache && current->unwind_info.cache->nr_entries)
  		current->unwind_info.cache->nr_entries = 0;

?

-- Steve
+
+	if (current->unwind_info.cache)
 		current->unwind_info.cache->nr_entries = 0;
+	current->unwind_info.timestamp = 0;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help