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

From
Steven Rostedt <rostedt@goodmis.org>
Date
2025-06-24 22:36:23
Also in
bpf, lkml
Reply to
Peter Zijlstra, 2025-06-18
On Wed, 18 Jun 2025 20:46:20 +0200
Peter Zijlstra [off-list ref] wrote:
quoted
 static __always_inline void unwind_exit_to_user_mode(void)
 {
 	if (unlikely(current->unwind_info.cache))
 		current->unwind_info.cache->nr_entries = 0;
+	current->unwind_info.timestamp = 0;  
Surely clearing that timestamp is only relevant when there is a cache
around? Better to not add this unconditional write to the exit path.
quoted
 }
Note, the timestamp could be there if the cache failed to allocate, and
we would still want to clear the timestamp. I did turn this into:

static __always_inline void unwind_reset_info(void)
{
	/* Exit out early if this was never used */
	if (likely(!current->unwind_info.timestamp))
		return;

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

For this patch, but later patches will give us the bitmask to check.

-- Steve
Thread (79 messages) 79 messages, 6 authors, last reply 2025-06-24
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