Linux Will Be Able To Boot 0.035 Seconds Faster With One Line Kernel Patch (phoronix.com) 44
Michael Larabel reports via Phoronix: Intel Linux engineer Colin Ian King discovered that if aligning the slab in the ACPI code via the "SLAB_HWCACHE_ALIGN" flag will offer a measurable improvement in memory performance and reducing the kernel boot time.
Colin explained with this one line kernel patch: "Enabling SLAB_HWCACHE_ALIGN for the ACPI object caches improves boot speed in the ACPICA core for object allocation and free'ing especially in the AML parsing and execution phases in boot. Testing with 100 boots shows an average boot saving in acpi_init of ~35000 usecs compared to the unaligned version. Most of the ACPI objects being allocated and free'd are of very short life times in the critical paths for parsing and execution, so the extra memory used for alignment isn't too onerous."
Colin explained with this one line kernel patch: "Enabling SLAB_HWCACHE_ALIGN for the ACPI object caches improves boot speed in the ACPICA core for object allocation and free'ing especially in the AML parsing and execution phases in boot. Testing with 100 boots shows an average boot saving in acpi_init of ~35000 usecs compared to the unaligned version. Most of the ACPI objects being allocated and free'd are of very short life times in the critical paths for parsing and execution, so the extra memory used for alignment isn't too onerous."
Finally ready for Desktop! (Score:5, Funny)
Re: (Score:2)
Exactly. This 0.035 second improvement will surely move Linux from 4.45 to 4.453%.
What will I do with the extra time (Score:1)
Re: (Score:1)
Drat! Beat me to it!
free'd ? (Score:2)
freed is a word, it doesn't need an apostrophe.
But without the apostrophe... Re:free'd ? (Score:1)
... it would be yet another thing for systemd to assimilate.
When you've been absorbed into systemd, does that mean you've been system'd?
Re: (Score:2)
freed is a word, it doesn't need an apostrophe.
So is freeing, no need for "free'ing".
[Though I get they're writing these like with "free()" but it's unnecessary.]
Re: (Score:3)
And by typing that extra apostrophe, they negated three boots worth of time savings.
35 ms (Score:2)
Re: (Score:3)
I assume on demand cloud instances boot more often than that, but I have no concept of the scale.
35ms seems pretty irrelevant even on 3 seconds (1%).
Just great ... (Score:2)
Linux Will Be Able To Boot 0.035 Seconds Faster ...
So I can sleep later, but will have to swap out my regular alarm clock for an atomic clock -- with an alarm -- to stay on schedule. :-)
#CesiumClockNightstand
Massive savings (Score:2)
Now if only Windows and Mac would boot 10 s faster.
Re:Massive savings (Score:4, Insightful)
Real linux users never reboot their computers.
Re: Massive savings (Score:2)
Re: (Score:2)
Real linux users never reboot their computers.
No, idiots never reboot their Linux computers. The rest of us know that rebooting computers is a good idea, applying kernel security updates, ensuring the boot process is functioning, etc.
Re: (Score:2)
You might be the idiot if you don't know how to apply security patches and manage memory leaks without rebooting your computer (typical from WindowsLand concept) . I am only half kidding. I do reboot once in a while even if it trashes my uptime stats. /s
Re: (Score:2)
Pathetic how some idiotic assholes still have to push that lie.
Re: Massive savings (Score:2)
Re: (Score:2)
However the humorous element is only detectable to those with with the perceptual apparatus to perceive its presence.
News for nerds (Score:2)
Re: (Score:1)
Now we don't have to wait quite so long to see bad UI's! [ducking head...]
Unluckily, reading that article took more time... (Score:2)
Re: (Score:2)
What were you thinking? Who reads articles around here???
I guess this is important to nerds (Score:2)
Why is this important? (Score:5, Insightful)
So to start off, I'm more of a FreeBSD user than a Linux user, but they both share a lot of commonalities.
Recently, a lot of patches also landed in FreeBSD to improve boot times, to the point that it can boot faster than Linux in one particular situation, and I'm guessing its the reason why Linux has this patch.
Lambda functions on AWS or similar cloud services!
These are virtual machines with ultra-lean kernels. They boot in a fraction of a second thanks to patches like this. So something like a 35ms reduction in boot time is MASSIVE in the Lambda world, because that means you can have a service go from entirely offline to serving customer requests that much quicker.
Where is this important? Think like a service where you upload an image on social media. They can spin up an instance, process the image, make all the cropping/resizing alterations needed, extract metadata like file hash and EXIF data, push the files to storage such as S3, and then shut back down again.
In this world, milliseconds matter. So its really cool to always see that extra little bit get shaved off!
Re: (Score:2, Interesting)
I was about to point out that its likely AWS is just using containers..... but apparently not?
This is a surprise to me. I'd have implemented lambda as a big ball of pre spun-up docker containers and just switching in contents via mounts. But apparently this is really quick so.... huh.
Re: (Score:2)
Yeah, I had assumed the same until seeing all the posts about what was doing on in FreeBSD and comparing it to Linux
For reference, the FreeBSD dev shared a lot of numbers during their development.
At one point, they shared a benchmark of a 25ms boot time for FreeBSD compared to ~75-80ms boot time for Linux. So yeah, shaving a few ms off is massive!
https://www.theregister.com/20... [theregister.com]
(for reference, these numbers were a year ago, Aug 2023)
Re: (Score:2)
Re: (Score:2)
ACPI is how you send a soft shutdown command for example, rather than a hard power-off. This is true of both physical machines and virtual machines.
What's the boot time of the linux kernel now? (Score:2)
Re: (Score:1)
Stripped down (but still systemd) Linux from Scratch boots to CLI in literally about 1s on my crappy old desktop (from SATA SSD).
For my more typical distro setups most of time seems to be spent waiting for the network and for the non-boot data HDDs to spin up. Maybe 4-6s from boot loader to GUI display manager logon screen, again booting from SATA SSD. If you boot from an nvme SSD and don't wait for any HDDs or the network you can probably get than down to less than 2s.
Re: (Score:3)
My desktop boots fairly slowly because I have a stupid number of devices attached (something like 10 disk drives and a ton of USB devices) so Linux takes maybe 15-20 seconds to boot. However, the BIOS takes about that much time before it finally gets around to starting GRUB.
I have a laptop that boots much more quickly. Maybe 5-6s from the Linux kernel starting to a graphical login.
Amateurs optimize things without need (Score:2)
It is sad to see that type of engineering malpractice with Linux.
Weird clickbait. It worked. (Score:2)
I read the article just because I thought for sure that I just didn't get it, and I must be missing a nuance.
Re: (Score:2)
Rutherford-level engineering (Score:2)
He would be proud
in the margin of error? (Score:2)
in the margin of error?