freenode
Kernel & Low-Level

Kernel build series cuts allmodconfig times by up to 36%

Lorenzo Stoakes targets single-threaded kbuild, modpost, and objtool bottlenecks that dominate full, incremental, and no-op rebuilds.

A patch series from Lorenzo Stoakes aims to make Linux kernel builds substantially faster by attacking the single-threaded work that still dominates many rebuilds even on large machines.

On allmodconfig configurations, full builds improve by as much as 36 percent, incremental rebuilds by roughly 60 to 70 percent, and no-op rebuilds by up to about 90 percent, with gains reported across high-core x86 servers and an Apple M2 laptop. The work is based on v7.4-rc1 and was measured with both GCC and Clang.

Much of the remaining cost sits after parallel compilation finishes. Make still spends heavy single-threaded time parsing huge dependency lists when little has changed; the series replaces that path with a lighter C helper that only rechecks what is necessary. Module post-processing is another serial tail: section-mismatch checks are cached so the same lookups are not repeated, module descriptors are emitted as assembly instead of thousands of tiny C files that each pull in large header sets, and final module link jobs are batched to cut make overhead.

Objtool, which runs on the linked vmlinux image, also receives several speed-ups. It stops hashing DWARF debug relocations that are never looked up by destination, improves relocation and instruction lookup structures, and decodes instructions in parallel for large link-time runs, capped so extra threads do not add overhead.

A related change unblocks Rust-enabled builds. Rust crates no longer have to finish before the rest of the tree starts compiling; they can proceed alongside C objects, trimming the stall at the start of clean builds when CONFIG_RUST is set.

Taken together, the series shortens the serial phases that large developer and CI machines still hit on every kernel rebuild, without changing the objects that end up in the image.