[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250624183616.5b0a3ddc@batman.local.home>
Date: Tue, 24 Jun 2025 18:36:16 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
bpf@...r.kernel.org, x86@...nel.org, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...nel.org>, Ingo Molnar <mingo@...nel.org>, Jiri
Olsa <jolsa@...nel.org>, Namhyung Kim <namhyung@...nel.org>, Thomas
Gleixner <tglx@...utronix.de>, Andrii Nakryiko <andrii@...nel.org>, Indu
Bhagat <indu.bhagat@...cle.com>, "Jose E. Marchesi" <jemarch@....org>, Beau
Belgrave <beaub@...ux.microsoft.com>, Jens Remus <jremus@...ux.ibm.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, Andrew Morton
<akpm@...ux-foundation.org>
Subject: Re: [PATCH v10 06/14] unwind_user/deferred: Add deferred unwinding
interface
On Wed, 18 Jun 2025 20:46:20 +0200
Peter Zijlstra <peterz@...radead.org> wrote:
> > 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.
>
> > }
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
Powered by blists - more mailing lists