Link-Time Optimization To Speed Up The Linux Kernel

Posted by Michael Larabel on August 19, 2012

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.

Discuss this article in our forums, IRC channel, or email the author. You can also follow our content via RSS and on social networks like Facebook, Identi.ca, and Twitter (@Phoronix and @MichaelLarabel). Subscribe to Phoronix Premium to view our content without advertisements, view entire articles on a single page, and experience other benefits.
Latest Hardware Reviews
  1. Sumo Lounge Emperor
  2. Gallium3D Continues Improving OpenGL For Older Radeon GPUs
  3. 15-Way Open vs. Closed Source NVIDIA/AMD Linux GPU Comparison
  4. Nouveau vs. NVIDIA Linux Comparison Shows Shortcomings
Latest Software Articles
  1. The Cost Of Ubuntu Disk Encryption
  2. Btrfs vs. EXT4 vs. XFS vs. F2FS On Linux 3.10
  3. AMD Radeon R600 GPU LLVM 3.3 Back-End Testing
  4. F2FS File-System Shows Regressions On Linux 3.10
Latest Linux News
  1. QEMU 1.5 Supports VGA Passthrough, Better USB 3.0
  2. Handbrake 0.9.9 Supports OpenCL Offloading
  3. Freedreno Gallium3D Now Banging The Adreno A3XX
  4. Jolla Announces Their First Phone
  5. Mageia 3 Released, Still Using Legacy GRUB
  6. NetBSD 6.1 Brings In More Features
  7. Using Six Monitors With AMD's Open-Source Linux Driver
  8. Benchmarking The Intel P-State, CPUfreq Changes
  9. FreeBSD Still Working On Next-Gen Package Manager
  10. DNF Still Advancing As Experimental Yum For Fedora
  11. Logitech Begins Supporting Linux Users
Latest Forum Talk
  1. Mageia 3 Released, Still Using Legacy GRUB
  2. Jolla Announces Their First Phone
  3. Ubuntu To Look At Replacing Firefox With Chromium
  4. What Would You Like To See Next?
  5. QEMU 1.5 Supports VGA Passthrough, Better USB 3.0
  6. FreeBSD Still Working On Next-Gen Package Manager
  1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Motherboards
  5. Peripherals
  6. Processors
  7. Software
  8. Operating Systems
  9. All Articles
  1. Linux Benchmarking
  2. OpenBenchmarking.org
  3. Phoronix Test Suite