Building A Full Linux Debug Kernel Optimized From 53GB To 25GB Heap Use
![LINUX KERNEL](/assets/categories/linuxkernel.webp)
When building a full debug Linux kernel build (allyesconfig) with CONFIG_DEBUG_INFO enabled, DWARF creates nearly 200 million relocations. Currently this big Linux kernel debug build can lead to objtool peak heap use hitting 53GB. But thanks to these optimizations coming with Linux 6.5, the peak heap use will drop to around 25GB.
For less intense scenarios, there are benefits too from these objtool optimizations. A distro-type kernel build with Indirect Branch Tracking (IBT) enabled will see objtool's peak heap use drop from 4.2GB to around 2.8GB.
Besides sharply lowering the peak heap use, these objtool optimizations lead to faster run-times too and in turn shorter kernel build times.
It's a nice set of objtool improvements by Josh Poimboeuf. These changes along with some debugging improvements and unwinder enhancements were sent out this morning as part of the objtool changes for the Linux 6.5 kernel.
8 Comments