Fast Kernel Headers v2 Posted - Speeds Up Clang-Built Linux Kernel Build By ~88%

Written by Michael Larabel in Linux Kernel on 8 January 2022 at 01:34 PM EST. 51 Comments
LINUX KERNEL
What may end up being one of the greatest Linux kernel features of 2022 is the recently published "Fast Kernel Headers" effort for cleaning up the kernel headers and dramatically speeding up Linux kernel builds both for absolute/clean and incremental builds. Fast Kernel Headers can cut the Linux kernel build time in half or greater and out this weekend are the v2 patches.

Last week Ingo Molnar sent out the initial Fast Kernel Headers work to cut the Linux kernel build time by 50~80%. The roughly 2,300 patches clean up the kernel's "dependency hell" and completely rework the header file hierarchy. Ingo was working on this patch series for more than one year and likely the single ever biggest "feature" to the Linux kernel.

This Saturday Ingo sent out the Kernel Headers v2 patches as an updated series. With the v2 patches the code has been re-based against Linux 5.16-rc8 upstream state and notably there is now support for building with the LLVM Clang compiler too rather than just GCC as was the case for the original patches. There are also bug fixes, header optimizations that can speed-up the RDMA subsystem build by an additional 9%, reducing linux/sched.h header usage, and various other fixes and code improvements.

With the LLVM Clang support, Ingo has measured this patch series to speed-up that kernel build process by 88%! The 88% improvement in build time when using Clang with this patch series is very impressive and slightly ahead of the benefits found with GCC or for CPU time was a 77% improvement.


The speed of Fast Kernel Headers... (Picture: AMD 2018 Italy event @ Ferrari)


See the v2 patches for those interested in this Fast Kernel Headers work. It will be very interesting to see what comes of this patch series and its hopeful mainlining in the not distant future for dramatically cutting down kernel build times.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week