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.
- A. Belay, G. Prekas, A. Klimovic, S. Grossman, C. Kozyrakis, and E. Bugnion. IX: A protected dataplane operating system for high throughput and low latency. In 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14), pages 49--65, Broomfield, CO, Oct. 2014. ISBN 978-1-931971-16-4. Google ScholarDigital Library
- S. Boyd-Wickizer, A. T. Clements, Y. Mao, A. Pesterev, M. F. Kaashoek, R. Morris, and N. Zeldovich. An analysis of Linux scalability to many cores. In Proceedings of the 9th USENIX Conference on Operating Systems Design and Implementation, OSDI'10, pages 1--8, 2010. Google ScholarDigital Library
- D. Chen, N. Vachharajani, R. Hundt, X. Li, S. Eranian, W. Chen, and W. Zheng. Taming hardware event samples for precise and versatile feedback directed optimizations. Computers, IEEE Transactions on, 62(2):376--389, Feb 2013. ISSN 0018-9340. Google ScholarDigital Library
- Free Software Foundation, Inc. Automatic feedback directed optimizer. https://gcc.gnu.org/wiki/AutoFDO,.Google Scholar
- Free Software Foundation, Inc. Link time optimization. https://gcc.gnu.org/wiki/LinkTimeOptimization,.Google Scholar
- Free Software Foundation, Inc. Options that control optimization. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html,.Google Scholar
- Free Software Foundation, Inc. Infrastructure for profile driven optimizations. https://gcc.gnu.org/news/profiledriven.html,.Google Scholar
- T. Glek and J. Hubicka. Optimizing real world applications with GCC link time optimization. arXiv preprint arXiv:1010.2196, 2010.Google Scholar
- J. Hubicka. Linktime optimization in GCC, part 1 - brief history. http://hubicka.blogspot.ca/2014/04/linktime-optimization-in-gcc-1-brief.html.Google Scholar
- J. Hubicka. Profile driven optimisations in GCC. In GCC Summit Proceedings, pages 107--124, 2005.Google Scholar
- R. E. Kessler and M. D. Hill. Page placement algorithms for large real-indexed caches. ACM Trans. Comput. Syst., 10(4): 338--359, Nov. 1992. ISSN 0734-2071.. Google ScholarDigital Library
- S. Peter, J. Li, I. Zhang, D. R. K. Ports, D. Woos, A. Krishnamurthy, T. Anderson, and T. Roscoe. Arrakis: The operating system is the control plane. In 11th USENIX Symposium on Operating Systems Design and Implementation (OSDI 14), pages 1--16, Broomfield, CO, Oct. 2014. ISBN 978-1-931971-16-4. Google ScholarDigital Library
- J. Ringle. Add option to build with -O3. https://lkml.org/lkml/2014/3/4/1020.Google Scholar
- H. Tazaki. An introduction of library operating system for Linux. https://lkml.org/lkml/2015/3/24/254.Google Scholar
- The Linux Foundation. LLVMLinux project overview. http://llvm.linuxfoundation.org/index.php.Google Scholar
- L. Torvalds. Give up on pushing CC_OPTIMIZE_FOR_SIZE. https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=281dc5c5ec0f.Google Scholar
- P. Yuan, Y. Guo, and X. Chen. Experiences in profile-guided operating system kernel optimization. In Proceedings of the 5th Asia-Pacific Workshop on Systems, APSys '14, 2014. Google ScholarDigital Library
- X. Zhang, S. Dwarkadas, and K. Shen. Towards practical page coloring-based multicore cache management. In Proceedings of the 4th ACM European Conference on Computer Systems, EuroSys '09, pages 89--102, 2009. ISBN 978-1-60558-482-9. Google ScholarDigital Library
- Rethinking Compiler Optimizations for the Linux Kernel: An Explorative Study
Recommendations
Communicating between the kernel and user-space in Linux using Netlink sockets
When developing Linux kernel features, it is a good practice to expose the necessary details to user-space to enable extensibility. This allows the development of new features and sophisticated configurations from user-space. Generally, software ...
A detailed performance analysis of UDP/IP, TCP/IP, and M-VIA network protocols using Linux/SimOS
This paper presents a performance study of UDP/IP, TCP/IP, and M-VIA using Linux/SimOS. Linux/SimOS is a Linux operating system port to a complete machine simulator SimOS. A complete machine simulator includes all the system components, such as CPU, ...
Comments