Re: [PATCH v3] printk: fix zero-valued printk timestamps in early boot

From: Steven Rostedt

Date: Tue Mar 31 2026 - 20:06:15 EST


On Wed, 01 Apr 2026 01:36:26 +0200
Thomas Gleixner <tglx@xxxxxxxxxx> wrote:

> On Tue, Mar 31 2026 at 11:10, Thomas Gleixner wrote:
> > So the real good question is whether the extra information of how long
> > that earliest init takes is really relevant to the goal of optimizing
> > boot time. The expensive part of the boot process definitely comes after
> > that.
>
> That actually made me curious and so I hacked up the kernel with the
> patch below to compensate for the difference between:
>
> x86_64_start_reservations()
>
> i.e. the C entry point of the kernel and the actual earliest
> point (ASM entry code aside) where the kernel can take a
> timestamp, which is modulo the sanity checks in the PoC the same
> thing, right?
>
> and
>
> tsc_early_init()
>
> where the upstream kernel enables TSC sched clock today with all
> sanity checks and enumeration in place.
>
> Here is the result on a bare metal 256 CPU machine:
>
> [ 0.000000] Linux version 7.0.0-rc3-dirty ...
>
> ....
>
> [ 0.000000] tsc: Detected 2100.000 MHz processor
> [ 0.012482] e820: update [mem 0x00000000-0x00000fff] System RAM ==> device reserved
>
> That's ~12ms of time which is not accounted for in the overall boot time
> until the machine reaches the init process:
>
> [ 12.289141] Run /init as init process

12 seconds! Holly crap, that would fail every Chromebook requirement we
have. In most cases, we shoot for a 3 second boot up and 8 second max.
That's from hitting the power button to login screen. FYI, 30ms is
considered a really long time.

We spend a lot of time looking at every thing that slows down the boot
process, and yes we do a lot of tricks in user space as well (see
ureadahead[1]).

I'm sure there's various devices that have issues between the kernel C
starting point and where timing begins. When I was looking into boot times,
I did find that the biggest issue with boot up was the initcalls. They are
all serial. If one sleeps, it causes everything to back up. I would love to
have initcalls have more parallelism, but there's a lot of code that
depends on things running in serial :-(

Point being, I'm sure Tim is worried about devices that require fast boot
up times. Not machines with 256 CPUs.

I haven't needed to look at what is happening before time stamps are
running, as we track that time via the firmware timestamps. I'm just
pointing out that the machine you used in this example isn't the target of
the work that is looking into fast bootup times.

-- Steve

[1] https://github.com/rostedt/ureadahead