-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Boot timer seems off #4429
Comments
What CPU type are you using? The Also, could you try to run your test with |
I'm on an |
Hi, can you try the same workaround as in #4099, i.e. use |
i've been looking at firecracker source in recent days and i saw this issue so thought i would investigate. i see same behaviour on ubuntu kernel 6 host/guest. if we look at the source, we can see the initial timestamp for boot_timer is recorded here: https://github.com/firecracker-microvm/firecracker/blob/v1.7.0/src/vmm/src/builder.rs#L233 this is before all the work is done to load kernel, initrd (optionally) from disk, configure any boot disk, setup the cpus and guest memory, start the guest kernel and attach devices etc. you can see the "kick devices" message is happening after all that work has been done when resume_vm is called here 00.036482 2024-02-07T14:14:16.726643784 [anonymous-instance:main] Artificially kick devices. https://github.com/firecracker-microvm/firecracker/blob/v1.7.0/src/vmm/src/builder.rs#L385 so the 8ms you are talking about is just the time to give the guest thread state machines a kick and start running i think? 🤔 imo, 78ms and 43 ms are the correct timings if what we want to measure includes all the setup and configuration of the vm to the time the port gets kicked in the guest. |
Thanks @billywhizz for your dive deep! @DavidVentura does the explanation provided by @billywhizz solve your concerns? |
Closing the issue since it seems the issue is resolved. Feel free to reopen if there are any followups. |
Boot timer calculations do not match my expectations
When running a minimal Linux kernel in firecracker, on x86_64, the measured boot time seems off.
To Reproduce
Run this program as
/init
(creates the /mem char dev)Use this config (though I don't think it's relevant):
Start firecracker with
Command output
Case 1, SMP kernel:
Case 2, no-SMP kernel:
Expected behaviour
In case 1, I'd expect the
Guest-boot-time
to be 33ms, as that's how much time elapsed between the startup time and the message being sent.If the measurement includes the VM creation time, then 78ms still doesn't make sense, as
ts
is measuring 70ms.Similarly for case 2, I'd expect 8ms for the
Guest-boot-time
and 32ms for the guest boot + VM creation, instead of 43ms.Environment
Additional context
I'm trying to measure boot times with more accuracy than using
ts
offsets, but the results don't seem to line up.I've not yet looked into the source code for possible reasons.
Checks
The text was updated successfully, but these errors were encountered: