skip to main content
10.1145/2797022.2797030acmconferencesArticle/Chapter ViewAbstractPublication PagesapsysConference Proceedingsconference-collections
research-article

Rethinking Compiler Optimizations for the Linux Kernel: An Explorative Study

Authors Info & Claims
Published:27 July 2015Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. Free Software Foundation, Inc. Automatic feedback directed optimizer. https://gcc.gnu.org/wiki/AutoFDO,.Google ScholarGoogle Scholar
  5. Free Software Foundation, Inc. Link time optimization. https://gcc.gnu.org/wiki/LinkTimeOptimization,.Google ScholarGoogle Scholar
  6. Free Software Foundation, Inc. Options that control optimization. https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html,.Google ScholarGoogle Scholar
  7. Free Software Foundation, Inc. Infrastructure for profile driven optimizations. https://gcc.gnu.org/news/profiledriven.html,.Google ScholarGoogle Scholar
  8. T. Glek and J. Hubicka. Optimizing real world applications with GCC link time optimization. arXiv preprint arXiv:1010.2196, 2010.Google ScholarGoogle Scholar
  9. J. Hubicka. Linktime optimization in GCC, part 1 - brief history. http://hubicka.blogspot.ca/2014/04/linktime-optimization-in-gcc-1-brief.html.Google ScholarGoogle Scholar
  10. J. Hubicka. Profile driven optimisations in GCC. In GCC Summit Proceedings, pages 107--124, 2005.Google ScholarGoogle Scholar
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. Ringle. Add option to build with -O3. https://lkml.org/lkml/2014/3/4/1020.Google ScholarGoogle Scholar
  14. H. Tazaki. An introduction of library operating system for Linux. https://lkml.org/lkml/2015/3/24/254.Google ScholarGoogle Scholar
  15. The Linux Foundation. LLVMLinux project overview. http://llvm.linuxfoundation.org/index.php.Google ScholarGoogle Scholar
  16. 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 ScholarGoogle Scholar
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  1. Rethinking Compiler Optimizations for the Linux Kernel: An Explorative Study

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        APSys '15: Proceedings of the 6th Asia-Pacific Workshop on Systems
        July 2015
        152 pages
        ISBN:9781450335546
        DOI:10.1145/2797022

        Copyright © 2015 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 27 July 2015

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed limited

        Acceptance Rates

        APSys '15 Paper Acceptance Rate20of68submissions,29%Overall Acceptance Rate149of386submissions,39%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader