Fast Kernel Headers v2 Posted - Speeds Up Clang-Built Linux Kernel Build By ~88%
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.
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.