[PATCH v4 2/5] tracing: add trace_async_init boot parameter

Yaxiong Tian
2026-01-28T12:55:04Z

Some users prioritize faster kernel boot time. However, the tracing
subsystem, being a critical infrastructure, traditionally initializes
serially. To balance the need for deterministic timing in tracing
against the demand for quicker startup, the trace_async_init boot
parameter is introduced.

When users do not require strict timing determinism for trace
features—or do not use tracing at all during boot—they can add this
cmdline parameter to accelerate kernel startup.

Suggested-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
---
Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++
kernel/trace/trace.c | 9 +++++++++
kernel/trace/trace.h | 1 +
3 files changed, 18 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 6b3460701910..d46fdfbfa961 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -7851,6 +7851,14 @@ Kernel parameters
This option can also be set at run time via the sysctl
option: kernel/traceoff_on_warning

+ trace_async_init
+ [FTRACE] Enable this option when faster boot time is the
+ priority. It is beneficial in scenarios where users either
+ do not require a strict initialization order for certain
+ tracing features during boot, or do not use tracing at all
+ in the early boot phase. This can lead to measurable
+ improvements in kernel startup speed.
+
transparent_hugepage=
[KNL]
Format: [always|madvise|never]
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 01df88e77818..9d571841fc84 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1725,6 +1725,15 @@ static int __init set_tracing_thresh(char *str)
}
__setup("tracing_thresh=", set_tracing_thresh);

+bool trace_async_init __initdata;
+
+static int __init setup_trace_async_init(char *str)
+{
+ trace_async_init = true;
+ return 1;
+}
+__setup("trace_async_init", setup_trace_async_init);
+
unsigned long nsecs_to_usecs(unsigned long nsecs)
{
return nsecs / 1000;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 9e8d52503618..63ae83d7bd1c 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -769,6 +769,7 @@ extern cpumask_var_t __read_mostly tracing_buffer_mask;
extern unsigned long nsecs_to_usecs(unsigned long nsecs);

extern unsigned long tracing_thresh;
+extern bool trace_async_init __initdata;
extern struct workqueue_struct *trace_init_wq __initdata;

/* PID filtering */
--
2.25.1