Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My contribution: FreeBSD 13.1 boots significantly faster than FreeBSD 13.0; in EC2 it's over a 2x speedup.

I'll be talking about this at BSDCan in a few weeks. (Virtual conference, so it's not too late to sign up!)



Thank you for what you do.


Awesome, how did you do that?

We use plenty of short-lived FreeBSD agents for our (AWS-hosted) CI builds, so a 2x speed up would be very welcome!


Identifying slow pieces of boot: https://github.com/freebsd/freebsd-src/search?q=TSENTER , etc: https://github.com/freebsd/freebsd-src/blob/main/sys/sys/tsl... , and then eliminating low hanging fruit (many, but not all of his recent commits): https://freshbsd.org/freebsd/src/branch/main?merge=false&aut...


As loeg says, profiling and then working my way through the list of places we're spending a lot of time.

I'd love to hear more about how you're using FreeBSD/EC2; can you send me an email?


Boot Loader Changes

This section covers the boot loader, boot menu, and other boot-related changes.

Boot Loader Changes

UEFI boot is improved for amd64. The loader detects whether the loaded kernel can handle the in-place staging area (non-copying mode). The default is copy_staging auto. Auto-detection can be overridden, for example: with copy_staging enable, the loader will unconditionally copy the staging area to 2M, regardless of kernel capabilities. Also, the code to grow the staging area is more robust; for growth to occur, it’s no longer necessary to hand-tune and recompile the loader. (Sponsored by The FreeBSD Foundation)

boot1 and loader have been fixed on powerpc64le. 8a62b07bce7

Other Boot Changes

Performance improvements have been made to loader(8), nvme(4), random(4), rtsold(8), and x86 clock calibration, which collectively yield a significant speedup in system boot time. Configuration changes on the EC2 platform provide additional benefits, resulting in 13.1-RELEASE booting over twice as fast as 13.0-RELEASE. (Sponsored by https://www.patreon.com/cperciva)

EC2 images are now built by default to boot using UEFI instead of legacy BIOS. Note that UEFI is not supported by Xen-based EC2 instances or by "bare metal" EC2 instances. 65f22ccf8247 (Sponsored by https://www.patreon.com/cperciva)

Support was added for recording EC2 AMI Ids in the AWS Systems Manager Parameter Store. FreeBSD will be using the public prefix /aws/service/freebsd, resulting in parameter names which look like /aws/service/freebsd/amd64/base/ufs/13.1/RELEASE. 242d1c32e42c (Sponsored by https://www.patreon.com/cperciva)


Also, for IPv6 users:

> The -i flag is now added to rtsol(8) and rtsold(8) by default in /etc/defaults/rc.conf. a0fc5094bf4c

> ...

> The -i option has been added to rtsol(8) and rtsold(8) to disable the random delay between zero and one seconds, speeding up the boot process. 8056b73ea163


I think I prompted you to look into this a few years ago:

https://news.ycombinator.com/item?id=26051254#26051847

Anyways, thanks for all of your work :)


As I said in that thread, I started working on this in 2017 (indeed, the tslog profiling I encouraged you to try was my first step).


Nice work, you are a champ. Anything fun and new planned with tarsnap by any chance?


Lots of things planned. Unfortunately my schedule got rather derailed after a very demanding baby arrived last year -- in a sense the FreeBSD work is thanks to her since I couldn't focus enough to do tricky tarsnap coding. Now that she's over a year old and the FreeBSD boot speedup work is mostly wrapping up I'm hoping to get back to more tarsnap coding soon.


Congratulations! I had no idea you had a kid. You have good dad energy! This is great to hear. Don't send her to college at age 9.


Planning on waiting until she's 12. (I did start teaching her differential calculus before we left the hospital though.)


Ahh, good, good, you're going to make her wait until she's finished all the exercises in Spivak's Calculus. I approve.


Congrats on the kiddo.


Thanks! She's bright and alert and well ahead of her milestones (crawling at 2 months, independently walking at 11 months, and confidently running around at 13 months) -- but along with the energy comes only wanting 10 hours of sleep per day (including her afternoon nap) which sadly makes for two rather sleep deprived parents. :-/


Congrats! Crawling at 2 months! My 10 month old is just learning to crawl. I blame his giant head.


To be fair, that was just commando crawling and it took her five minutes to get a few feet. But she was doing a "traditional crawl" at five months (and charging full speed for the door to the basement stairs if we ever made the mistake of leaving it open).


Gotta love those FOMO babies!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: