From: Steven Rostedt <rostedt@goodmis.org>
To: Michael Wu <michael@allwinnertech.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH v3] tracing: Fix race between update_event_fields and event_define_fields
Date: Fri, 31 Jul 2026 09:22:35 -0400 [thread overview]
Message-ID: <20260731092235.4edd9dbd@gandalf.local.home> (raw)
In-Reply-To: <95efe185-35dd-18be-f08c-af4d0965b013@allwinnertech.com>
On Fri, 31 Jul 2026 11:41:02 +0800
Michael Wu <michael@allwinnertech.com> wrote:
> An alternative of placing mutex_lock inside update_event_fields() was
> considered but rejected -- it would invert the established lock
> ordering (trace_event_sem -> event_mutex) and risk ABBA deadlock.
>
> Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event
> types as well")
> Cc: stable@vger.kernel.org
> Signed-off-by: Michael Wu <michael@allwinnertech.com>
> ---
> kernel/trace/trace_events.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 956692856fa8..9632788da5af 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -3566,6 +3566,7 @@ void trace_event_update_all(struct trace_eval_map
> **map, int len)
> int last_i;
> int i;
>
> + mutex_lock(&event_mutex);
> down_write(&trace_event_sem);
> list_for_each_entry_safe(call, p, &ftrace_events, list) {
> /* events are usually grouped together with systems */
> @@ -3604,6 +3605,7 @@ void trace_event_update_all(struct trace_eval_map
> **map, int len)
> cond_resched();
> }
> up_write(&trace_event_sem);
> + mutex_unlock(&event_mutex);
> }
>
> static bool event_in_systems(struct trace_event_call *call,
You need to fix your email client to not mangle the output. It replaced
tabs with spaces and wrapped text, making it so I can not apply the patch.
-- Steve
prev parent reply other threads:[~2026-07-31 13:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-31 3:41 [PATCH v3] tracing: Fix race between update_event_fields and event_define_fields Michael Wu
2026-07-31 13:22 ` Steven Rostedt [this message]
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=20260731092235.4edd9dbd@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=michael@allwinnertech.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox