On my ARM64 platform, I observed that certain tracing module initializations run for up to 200ms—for example, init_kprobe_trace(). Analysis reveals the root cause: the execution flow eval_map_work_func() →trace_event_update_with_eval_map()→trace_event_update_all() is highly time-consuming. Although this flow is placed in eval_map_wq for asynchronous execution, it holds the trace_event_sem lock, causing other modules to be blocked either directly or indirectly.
To resolve this issue, I exported eval_map_wq and moved other initialization functions under the tracing subsystem that are related to this lock to run asynchronously on this workqueue. After this optimization, boot time is reduced by approximately 200ms. Yaxiong Tian (3): tracing: Export eval_map_wq for asynchronous use by other modules tracing/kprobes: Make setup_boot_kprobe_events() asynchronous blktrace: Make init_blk_tracer() asynchronous kernel/trace/blktrace.c | 23 ++++++++++++++++++++++- kernel/trace/trace.c | 2 +- kernel/trace/trace.h | 2 ++ kernel/trace/trace_kprobe.c | 14 +++++++++++++- 4 files changed, 38 insertions(+), 3 deletions(-) -- 2.25.1
