Linux 7.4 Disables LLVM Profi Usage To Avoid Performance Hit, Pathological Build Times

A change merged this week to the Linux 7.4 kernel and also set to be back-ported to stable kernel branches is to disable use of LLVM's Profi flow-based profile inference algorithm when leveraging AutoFDO. LLVM's Profi is a flow-based profile inference algorithm designed to address inaccuracies and other issues during profile guided optimizations (PGO) by the compiler. Profi has been in use by default since Clang 21 when the "-fprofile-sample-use" argument is passed. Unfortunately, this ended up causing problems for the Linux kernel builds that are built with LLVM/Clang and with AutoFDO being used for the automatic feedback directed optimizations. Profi has reported known issues with flow-sensitive discriminators that are used by the Linux kernel's AutoFDO. This can lead to the resulting binary being slower and in some cases "hit pathological compile times (30+ minutes or hangs) on certain kernel control-flow graphs." This patch goes ahead and disables Profi for the Linux kernel when building with AutoFDO. That patch in turn was merged via this week's Kbuild fixes pull request for Linux 7.4. "Disable LLVM's flow-based profile inference algorithm (Profi) for AutoFDO, which can degrade runtime performance and cause pathological compilation time issues." No performance numbers were noted on the patch for quantifying the impact, but this fix is worth mentioning if you build your Linux kernel with LLVM/Clang 21+ and tapping AutoFDO for trying to squeeze more performance out of your kernel build.

Original Source

Read the full article at Phoronix →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.