Link-Time Optimization To Speed Up The Linux Kernel

Written by Michael Larabel in Intel on 19 August 2012 at 12:11 PM EDT. 29 Comments
INTEL
An extensive set of patches have been published that allow the Linux kernel to be built with GCC's LTO (Link-Time Optimization) support for generating a faster Linux kernel binary but at the cost of much greater compile times.

GCC's Link-Time Optimization support that's new in the past few years allows for inlining of functions between different files and performing various compile-time optimizations across the binary as a whole, dropping dead code, and running other checks across the entire binary. LTO'ing the Linux kernel increases the compile time by two to four times and needs 4~9GB of memory to complete.

The Link-Time Optimization Support for the Linux kernel is being done by Andi Kleen at Intel. "We see speedups in various benchmarks, but also still a few minor regressions. There's still some outstanding tuning, both in compile time and allow gcc even better optimization. Also the kernel currently triggers some slow behaviour in gcc, which will hopefully improve in future gcc versions, allowing faster LTO builds."

Aside from needing dozens of patches to the Linux kernel, the LTO support requires GCC 4.7 along with a special Linux binutils. Right now these Linux kernel LTO patches are just under a "request for comments" state but will hopefully be merged for a future Linux kernel release. It will be interesting to see how LTO'ing the Linux kernel performs as soon as Phoronix benchmarks are complete.

More details on the Link-Time Optimization support for the Linux kernel can be found in this mailing list thread. Details on GCC LTO are also available from GNU.org.
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