The eval_map_work_func() function, though queued in eval_map_wq, holds the trace_event_sem read-write lock for a long time during kernel boot. This causes blocking issues for other functions. Making eval_map_wq extern allows other modules to schedule their work asynchronously on this queue, preventing it from blocking the main boot thread. Signed-off-by: Yaxiong Tian --- kernel/trace/trace.c | 2 +- kernel/trace/trace.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index e18005807395..cb073d0c86a6 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -10774,7 +10774,7 @@ int tracing_init_dentry(void) extern struct trace_eval_map *__start_ftrace_eval_maps[]; extern struct trace_eval_map *__stop_ftrace_eval_maps[]; -static struct workqueue_struct *eval_map_wq __initdata; +struct workqueue_struct *eval_map_wq __initdata; static struct work_struct eval_map_work __initdata; static struct work_struct tracerfs_init_work __initdata; diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index de4e6713b84e..44aaabc46a7a 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h @@ -770,6 +770,8 @@ extern unsigned long nsecs_to_usecs(unsigned long nsecs); extern unsigned long tracing_thresh; +extern struct workqueue_struct *eval_map_wq __initdata; + /* PID filtering */ bool trace_find_filtered_pid(struct trace_pid_list *filtered_pids, -- 2.25.1