From: Steven Rostedt <rostedt@goodmis.org>
To: sunliming <sunliming@linux.dev>
Cc: mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
sunliming <sunliming@kylinos.cn>
Subject: Re: [PATCH] tracing: kprobe-event: Return directly when dyn_event_list is empty
Date: Sun, 25 Jan 2026 23:21:39 -0500 [thread overview]
Message-ID: <20260125232139.0e971011@robin> (raw)
In-Reply-To: <01b1d5a3-8be0-4d9a-45d4-4da7c3edf746@linux.dev>
On Mon, 26 Jan 2026 10:56:59 +0800
sunliming <sunliming@linux.dev> wrote:
> During kernel boot, the setup_boot_kprobe_events() function causes
> significant delays, increasing overall startup time.
>
> The root cause is a lock contention chain: its child function
>
> enable_boot_kprobe_events() requires the event_mutex, which is already
>
> held by early_event_add_tracer(). early_event_add_tracer() itself is
> blocked
Ah, early_event_add_tracer() is called by the work function that sets
up tracers (and the event directories within them).
>
> waiting for the trace_event_sem read-write lock, which is held for an
> extended
>
> period by trace_event_update_all(). trace_event_update_all() is
> runing in
>
> eval_map_work_func() in eval_map_wq.
>
> On my ARM64 platform machine, the latency can reach around 200ms:
>
> [ 0.268848] trace_kprobe: try_get_event_mutex
> kernel/trace/tracekprobe.c,1902,enable_boot_kprobe_events
> [ 0.268849] try down_write
> kernel/trace/traceevents.c,4114,early_event_add_tracer
> [ 0.482382] done up_write
> kernel/trace/trace_events.c,3074,trace_event_eval_update
> [ 0.482386] done down_write
> kernel/trace/trace_events.c,4116,early_event_add_tracer
> [ 0.482868] done up_write
> kernel/trace/trace_events.c,4119,early_event_add_tracer
> [ 0.482877] trace_kprobe: enable_boot_kprobe_events geted eventmutex
> [ 0.482879] trace_kprobe: enable_bootk_probe_events release eventmutex
I take it that you are aware of this work, as it comes from someone
with the same email domain as you have.
https://lore.kernel.org/all/20260122032051.386331-1-tianyaxiong@kylinos.cn/
That is moving the kprobe setup into the same work function.
-- Steve
next prev parent reply other threads:[~2026-01-26 4:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 1:36 [PATCH] tracing: kprobe-event: Return directly when dyn_event_list is empty sunliming
2026-01-24 17:02 ` Steven Rostedt
[not found] ` <01b1d5a3-8be0-4d9a-45d4-4da7c3edf746@linux.dev>
2026-01-26 4:21 ` Steven Rostedt [this message]
[not found] ` <78dbbd83-8de3-2031-6db7-036d0d8c11c5@linux.dev>
2026-01-26 14:38 ` 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=20260125232139.0e971011@robin \
--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=sunliming@kylinos.cn \
--cc=sunliming@linux.dev \
/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