forked from clearlinux-pkgs/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0135-initcall-only-print-non-zero-initcall-debug-to-speed.patch
39 lines (33 loc) · 1.39 KB
/
0135-initcall-only-print-non-zero-initcall-debug-to-speed.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 496f1bc8c53f359a2fe07204d3c5ffdba963994e Mon Sep 17 00:00:00 2001
From: Colin Ian King <[email protected]>
Date: Fri, 20 Jan 2023 11:16:42 +0000
Subject: [PATCH] initcall: only print non-zero initcall debug to speed up boot
Printing initcall timings that successfully return after 0 usecs
provides not much useful information and takes a small amount of time
to do so. Disable the initcall timings for these specific cases. On
an Alderlake i9-12900 this reduces kernel boot time by 0.67% (timed
up to the invocation of systemd starting) based on 10 boot measurements.
Signed-off-by: Colin Ian King <[email protected]>
---
init/main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/init/main.c b/init/main.c
index aa21add5f7c5..715d57f58895 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1254,10 +1254,13 @@ static __init_or_module void
trace_initcall_finish_cb(void *data, initcall_t fn, int ret)
{
ktime_t rettime, *calltime = data;
+ long long delta;
rettime = ktime_get();
- printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
- fn, ret, (unsigned long long)ktime_us_delta(rettime, *calltime));
+ delta = ktime_us_delta(rettime, *calltime);
+ if (ret || delta)
+ printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n",
+ fn, ret, (unsigned long long)ktime_us_delta(rettime, *calltime));
}
static ktime_t initcall_calltime;
--
2.39.1