Linux 7.4 begins to incorporate Kbuild optimization patches to shorten kernel compilation time

📅 2026-10-22

Abstract:

The Linux 7.4 development version has incorporated a batch of Kbuild optimization changes to speed up single-threaded bottlenecks and repetitive work in the kernel compilation process. Kbuild is the build system of the Linux kernel, responsible for organizing configuration, compilation and linking steps; the relevant changes were proposed by Lorenzo Stoakes, an Arm engineer and long-time kernel developer.

image.webp

Optimizations that have been incorporated in this round include reducing the allocation overhead of the .modinfo section in the kernel image, accelerating kallsyms symbol table generation, skipping nm output sorting when the order is irrelevant, only generating the required relocation information in the final link stage, rewriting mksysmap in C language, and moving some compiler and linker capability tests into the Kconfig stage to cache results. In addition, if pigz is installed on the system, it will be used first to speed up gzip compression. The above adjustments reduce intermediate data processing, repeated probing and serialization steps respectively.

Early testing of the entire patch series shows that builds with all modules enabled are about 36% faster, incremental compilations are about 70% faster, and no-op builds without actual rebuilding are up to about 90% faster. Phoronix then tested the full set of v4 patches on a dual-socket AMD EPYC 9575F server and Ubuntu 26.04 LTS. The clean x86_64 defconfig kernel build was shortened from about 22 seconds to 15 to 17 seconds, and the allmodconfig build was reduced by more than 30 seconds. However, these numbers test the entire set of patches. Linux 7.4 currently incorporates only a batch of changes. The actual benefits need to wait for more patches to be incorporated before evaluating.

This optimization work also relies on AI tools. Stoakes said that he used a large language model to help locate construction bottlenecks and explore improvement solutions, but some of the code generated by the model was of poor quality; he personally reviewed and rewritten a large amount of code, and manually verified the build results, running kernels, and performance changes.

Related tags

Related articles

Comments

0/500
Captcha (click to refresh)
No comments yet