Linux objtool Improvements Help Reduce RAM Usage & Build Time During Large Kernel Builds

Written by Michael Larabel in Linux Kernel on 9 February 2023 at 04:30 PM EST. 19 Comments
LINUX KERNEL
Upstream kernel developers have begun hitting RAM capacity issues when carrying out large Linux kernel builds with the likes of "allyesconfig" for enabling all possible modules/options. While 32GB of system RAM has been common for developer desktops in recent years, large Linux kernel builds and taking advantage of multiple compile jobs have begun to cross that threshold and leading to out-of-memory behavior. Fortunately, a set of patches to the kernel's objtool is taming the memory use to rein in kernel builds for such scenarios.

Prolific kernel developer Peter Zijlstra with Intel recently took to optimizing the memory use of objtool after "Boris [Petkov] complained he could no longer build allyesconfig on his 32G desktop machine without having [out of memory] terminate either objtool or chrome."

Linux objtool RAM optimization


Zijlstra sent out a new patch series to rein in its memory use. These patches were able to shrink the memory use during a "allyesconfig" kernel build by about 6G, thereby allowing the large kernel build to succeed again comfortably on systems with ~32GB of RAM.

It also turned out the Linux kernel Clang continuous integration (CI) also began recently hitting memory issues while these patches have also addressed those problems. In addition these objtool patches sped up the kernel build time by nearly one minute for the all "yes" configuration.

Hopefully these objtool patches will be ready for the upcoming Linux v6.3 merge window.
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