Rethinking Compiler Optimizations for the Linux Kernel: An Explorative Study

Pengfei Yuan,Yao Guo,Xiangqun Chen
DOI: https://doi.org/10.1145/2797022.2797030
2015-01-01
Abstract:Performance of the operating system kernel is critical to many applications running on it. Although many efforts have been spent on improving Linux kernel performance, there is not enough attention on GCC, the compiler used to build Linux. As a result, the vanilla Linux kernel is typically compiled using the same -O2 option as most user programs. This paper investigates how different configurations of GCC may affect the performance of the Linux kernel. We have compared a number of compiler variations from different aspects on the Linux kernel, including switching simple options, using different GCC versions, controlling specific optimizations, as well as performing profile-guided optimization. We present detailed analysis on the experimental results and discuss potential compiler optimizations to further improve kernel performance. As the current GCC is far from optimal for compiling the Linux kernel, a future compiler for the kernel should include specialized optimizations, while more advanced compiler optimizations should also be incorporated to improve kernel performance.
What problem does this paper attempt to address?