From: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-kernel@vger.kernel.org, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com,
Andreas Larsson <andreas@gaisler.com>
Subject: Re: [BUG] spinlock recursion when enabling function tracer on 32-bit
Date: Mon, 20 Jan 2025 15:41:47 +0100 [thread overview]
Message-ID: <150fa7ce-eec6-4452-8552-da70cba84a04@gaisler.com> (raw)
In-Reply-To: <20241220100558.10b48f0f@gandalf.local.home>
On 2024-12-20 16:05, Steven Rostedt wrote:
>
> Can you try this patch on top of the last one?
>
Hi Steven,
I just wanted to check if you saw my last reply to this thread.
I've tested both patches, and they work (tested on sparc32 and riscv32).
Let me know if you need more input.
Best regards,
// Ludwig
>
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 7e257e855dd1..a9fe54b79ce5 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -4398,8 +4398,13 @@ rb_reserve_next_event(struct trace_buffer *buffer,
> int nr_loops = 0;
> int add_ts_default;
>
> - /* ring buffer does cmpxchg, make sure it is safe in NMI context */
> - if (!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) &&
> + /*
> + * ring buffer does cmpxchg as well as atomic64 operations
> + * (which some archs use locking for atomic64), make sure this
> + * is safe in NMI context
> + */
> + if ((!IS_ENABLED(CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG) ||
> + IS_ENABLED(CONFIG_GENERIC_ATOMIC64)) &&
> (unlikely(in_nmi()))) {
> return NULL;
> }
next prev parent reply other threads:[~2025-01-20 14:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-18 14:57 [BUG] spinlock recursion when enabling function tracer on 32-bit Ludwig Rydberg
2024-12-18 16:01 ` Steven Rostedt
2024-12-18 21:05 ` Ludwig Rydberg
2024-12-18 21:35 ` Steven Rostedt
2024-12-20 13:55 ` Ludwig Rydberg
2024-12-20 15:05 ` Steven Rostedt
2024-12-21 0:06 ` Ludwig Rydberg
2025-01-20 14:41 ` Ludwig Rydberg [this message]
2025-01-20 22:37 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=150fa7ce-eec6-4452-8552-da70cba84a04@gaisler.com \
--to=ludwig.rydberg@gaisler.com \
--cc=andreas@gaisler.com \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.