Live data from Hacker News

A NetBSD/amd64 guest can now boot in 18ms

old.reddit.com

31–34 of 34 posts

Re: A NetBSD/amd64 guest can now boot in 18ms

#31
post #6
post #5

Earlier quoted context omitted.

"I think the fastest I got the FreeBSD kernel booting in Firecracker was 21 ms. NetBSD is now at 18 ms... I need to go back and address some more of the issues I noticed but didn't get around to fixing. Anyone know what the current record for Linux is? Last I heard was ~50 ms." - @cperciva at https://twitter.com/cperciva/status/1747270461095043532

> “I need to go back and address some more of the issues I noticed but didn't get around to fixing.” I wonder if this is related to what Netflix found as a regression. Starting at slide #18 below https://people.freebsd.org/~gallatin/talks/OpenFest2023.pdf

The bug Netflix tripped over was something I introduced while shaving off milliseconds, yes.

The "other issues I didn't get around to fixing" are things like precomputing lookup tables (we can wait and do them on demand, or not at all if they turn out to never get used) and an O(n^2) issue registering names of sysctls.

Re: A NetBSD/amd64 guest can now boot in 18ms

#32
post #10

I'm curious as to why this isn't 0ms for a VM. The entire state of the system can be known ahead of time. Why does the kernel need to do any kind of dynamic initialization? Why aren't all data structures and variables statically assigned to proper values for the given VM. So at VM start up time it simply enters the main dispatch loop.

Wouldn't that mess with RNGs?

maybe one could use hardware RNGs? not sure if OSes can be made to not cache/buffer entropy, or be forced to reset RNGs?

EDIT: at least linux seems to be capable of doing that: https://www.systutorials.com/docs/linux/man/9-crypto_rng_res...

Re: A NetBSD/amd64 guest can now boot in 18ms

#33

[in mice]

With 1 CPU and 128 MB of RAM. Sure, it's a small system, but it's enough to be useful for some purposes -- more useful than medical discoveries in mice, at least.

And in a VM, not bare metal.

"Boot" isn't even a sensible concept in a VM, IMHO, you could just toss an image into RAM. There's no hardware to initialize, the caches are probably already warm, etc.

Re: A NetBSD/amd64 guest can now boot in 18ms

#34

Earlier quoted context omitted.

With 1 CPU and 128 MB of RAM. Sure, it's a small system, but it's enough to be useful for some purposes -- more useful than medical discoveries in mice, at least.

And in a VM, not bare metal. "Boot" isn't even a sensible concept in a VM, IMHO, you could just toss an image into RAM. There's no hardware to initialize, the caches are probably already warm, etc.

You do need to shake hands with the virtio devices; that's a bit easier than most hardware, but it's not trivial.

The "take a snapshot after you finish booting and resume that" approach can work (Lambda does it) but it only works if you have the same type and number of CPUs, the same amount of RAM, the same filesystem on disk, and even the same MAC addresses on your network interfaces. So it's not like FreeBSD can ship useful "pre-booted" images.

Post reply on HN