Approaching A 10 Second Linux Kernel Build
The coffee window is closing. Going back many years with the time it's taken to compile the Linux kernel has been a well known opportunity for a coffee break or even eating a meal during the lengthy Linux kernel build process. Even when the Linux kernel was much smaller than it is today, with the hardware at the time it would often be a very time consuming process... Thus incredible to think that…
In a recent development, the Linux kernel build process has reached a remarkable milestone: a near-ten second build time on Linux x86_64. This is a significant improvement from previous years when compiling the kernel could consume a considerable amount of time, often even allowing for a coffee break or a meal. The Linux kernel has grown substantially over the years, with nearly 41 million lines of source code, but thanks to advancements in technology and software, the build process is now incredibly swift.
The progress in reducing kernel build times can be attributed to the work of Linux MM developer Lorenzo Stoakes, who has made a series of patches aimed at optimizing the build process. By addressing bottlenecks in the Kbuild code using AI and machine learning techniques, the build times have been consistently dropping. With the help of these patches, the latest Linux kernel build can now be completed in approximately 15 seconds, and even more impressive, around two minutes for an allmodconfig build with every possible kernel module.
These improvements are not solely dependent on having the latest or most powerful processors. In fact, a dual AMD EPYC 9754 server running GCC has seen defconfig build times drop from 28 seconds to 20 seconds. This server features AMD's Zen 4 processor, which boasts 64 cores, 128 threads per socket, a boost clock of up to 5.0GHz, and 256MB of L3 cache.
While higher core counts may not always be ideal for build servers, the AMD EPYC 9575F, with its 64 cores/128 threads, 5.0GHz boost clock, and 64MB L3 cache, remains a powerful option for compiling Linux kernel sources.
The advancements in kernel build times not only offer an alluring level of productivity but also highlight the ever-evolving nature of the Linux kernel and the hardware it runs on. With the ongoing work by developers like Lorenzo Stoakes, the future of Linux kernel builds looks extremely promising, with the potential for even faster build times as technology continues to advance.
Written by urgent.news from Phoronix's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.