[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250626124855.116ef37d@gandalf.local.home>
Date: Thu, 26 Jun 2025 12:48:55 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
bpf@...r.kernel.org, x86@...nel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.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>, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v11 06/14] unwind_user/deferred: Add deferred unwinding
interface
On Wed, 25 Jun 2025 18:56:06 -0400
Steven Rostedt <rostedt@...dmis.org> 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;
> }
Powered by blists - more mailing lists