Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Operating Systems Linux

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."

This discussion has been archived. No new comments can be posted.

Linux Will Be Able To Boot 0.035 Seconds Faster With One Line Kernel Patch

Comments Filter:
  • by zshXx ( 7123425 ) on Friday August 09, 2024 @04:26PM (#64693450)
    This is the year of linux on desktop.
  • Spend it bagging Windoze ðYðYðY
  • freed is a word, it doesn't need an apostrophe.

  • by PPH ( 736903 )

    ... times twice a year. No more free time for me. Oh well. Idle hands are the devil's workshop.

    • by AvitarX ( 172628 )

      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%).

  • 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

  • Multiply 35 ms by the number of times the 10s linux users on the planet boot up their computer a year, and you'll get an extra 5 s or so.

    Now if only Windows and Mac would boot 10 s faster.
  • 0.035 seconds saved on boot time. News for nerds, indeed.
  • ... than I can ever hope to save in total by shaving off 0.035s from every time I boot Linux. Which luckily is seldom, as Linux is beautifully stable. Now please can someone teach Denon engineers to make the boot-sequence of their AV receivers 30 seconds shorter?
  • But no desktop user of Linux will even care. I'm a desktop user. IMHO. YMMV.
  • by darkain ( 749283 ) on Friday August 09, 2024 @06:14PM (#64693638) Homepage

    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)

      by sg_oneill ( 159032 )

      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.

      • by darkain ( 749283 )

        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)

    • Yes, but why would a VM be using ACPI in the first place?
      • by darkain ( 749283 )

        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?
    • by Anonymous Coward

      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.

      • by dskoll ( 99328 )

        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.

  • It is sad to see that type of engineering malpractice with Linux.

  • I read the article just because I thought for sure that I just didn't get it, and I must be missing a nuance.

    • by bjb ( 3050 )
      I thought I was reading a headline that was along the lines of "Linux providers hate when you do this one simple trick to boost your startup time!"
  • He would be proud

  • in the margin of error?

It is better to live rich than to die rich. -- Samuel Johnson

Working...