skip to main content
research-article

Frightening Small Children and Disconcerting Grown-ups: Concurrency in the Linux Kernel

Published:19 March 2018Publication History
Skip Abstract Section

Abstract

Concurrency in the Linux kernel can be a contentious topic. The Linux kernel mailing list features numerous discussions related to consistency models, including those of the more than 30 CPU architectures supported by the kernel and that of the kernel itself. How are Linux programs supposed to behave? Do they behave correctly on exotic hardware? A formal model can help address such questions. Better yet, an executable model allows programmers to experiment with the model to develop their intuition. Thus we offer a model written in the cat language, making it not only formal, but also executable by the herd simulator. We tested our model against hardware and refined it in consultation with maintainers. Finally, we formalised the fundamental law of the Read-Copy-Update synchronisation mechanism, and proved that one of its implementations satisfies this law.

References

  1. Jade Alglave, Mark Batty, Alastair F. Donaldson, Ganesh Gopalakrishnan, Jeroen Ketema, Daniel Poetzl, Tyler Sorensen, and John Wickerson. 2015. GPU Concurrency: Weak Behaviours and Programming Assumptions ASPLOS 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Jade Alglave, Patrick Cousot, and Luc Maranget. 2016. Syntax and semantics of the weak consistency model specification language textsfcat. CoRR Vol. abs/1608.07531 (2016). http://arxiv.org/abs/1608.07531Google ScholarGoogle Scholar
  3. Jade Alglave, Daniel Kroening, and Michael Tautschnig. 2013. Partial Orders for Efficient Bounded Model Checking of Concurrent Software Computer Aided Verification (CAV) (LNCS), Vol. Vol. 8044. Springer, 141--157.Google ScholarGoogle Scholar
  4. Jade Alglave and Luc Maranget. 2011--2017. The textsfdiy7 tool suite. http://diy.inria.fr/. (2011--2017).Google ScholarGoogle Scholar
  5. Jade Alglave and Luc Maranget. 2015. Towards a formalisation of the HSA memory model in the textsfcat language. http://www.hsafoundation.com/?ddownload=5381. (2015).Google ScholarGoogle Scholar
  6. Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2017 a. A formal model of Linux-kernel memory ordering -- companion webpage. http://diy.inria.fr/linux/. (2017). {Online; accessed 25-December-2017}.Google ScholarGoogle Scholar
  7. Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2017 b. A formal kernel memory-ordering model (part 1). (14 April. 2017). https://lwn.net/Articles/718628/Google ScholarGoogle Scholar
  8. Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan Stern. 2017 c. A formal kernel memory-ordering model (part 2). (20 April. 2017). https://lwn.net/Articles/720550/Google ScholarGoogle Scholar
  9. Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2010. Fences in Weak Memory Models. In Computer Aided Verification, 22nd International Conference, CAV 2010, Edinburgh, UK, July 15--19, 2010. Proceedings. 258--272. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jade Alglave, Luc Maranget, Susmit Sarkar, and Peter Sewell. 2012. Fences in weak memory models (extended version). Formal Methods in System Design Vol. 40, 2 (2012), 170--205. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory. ACM Trans. Program. Lang. Syst. Vol. 36, 2, Article bibinfoarticleno7 (July. 2014), bibinfonumpages7:1--7:74 pages.bibinfoyear2012. Re: Memory corruption due to word sharing. https://gcc.gnu.org/ml/gcc/2012-02/msg00013.html. (2012). Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Linus Torvalds. 2015. Re: {PATCH 4/4} locking: Introduce smp_cond_acquire(). http://lkml.kernel.org/r/CA+55aFyXu5iFJfdm7o-RKUm_9a850iSzeM+whmtUAotkY0EvTw@mail.gmail.com. (2015).Google ScholarGoogle Scholar
  13. Linus Torvalds. 2016 a. Re: {RFC}{PATCH} mips: Fix arch_spin_unlock(). https://lkml.org/lkml/2016/2/2/80. (2016).Google ScholarGoogle Scholar
  14. Linus Torvalds. 2016 b. Re: {v3,11/41} mips: reuse asm-generic/barrier.h. https://marc.info/?l=linux-kernel&m=145384764324700&w=2. (26 January. 2016).Google ScholarGoogle Scholar
  15. Linus Torvalds. 2017 a. Linux Kernel v4.12 (Fearless Coyote). https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.12.tar.xz. (2 July. 2017).Google ScholarGoogle Scholar
  16. Linus Torvalds. 2017 b. Re: {GIT PULL rcu/next} RCU commits for 4.13. https://lkml.org/lkml/2017/6/27/1052. (2017).Google ScholarGoogle Scholar
  17. Srivatsa Vaddagiri. 2005. {PATCH} Fix RCU race in access of nohz_cpu_mask. http://lkml.iu.edu/hypermail/linux/kernel/0512.0/0976.html. (5 December. 2005).Google ScholarGoogle Scholar
  18. Leonid Yegoshin. 2016 a. Re: (v3,11/41) mips: reuse asm-generic/barrier.h. https://marc.info/?l=linux-kernel&m=145263153305591&w=2. (12 January. 2016).Google ScholarGoogle Scholar
  19. Leonid Yegoshin. 2016 b. Re: {v3,11/41} mips: reuse asm-generic/barrier.h. https://marc.info/?l=linux-kernel&m=145280444229608&w=2. (14 January. 2016).Google ScholarGoogle Scholar
  20. Leonid Yegoshin. 2016 c. Re: {v3,11/41} mips: reuse asm-generic/barrier.h. https://marc.info/?l=linux-kernel&m=145280241129008&w=2. (14 January. 2016).Google ScholarGoogle Scholar
  21. Peter Zijlstra. 2013 a. Re: Does Itanium permit speculative stores? https://marc.info/?l=linux-kernel&m=138428080207125. (12 November. 2013).Google ScholarGoogle Scholar
  22. Peter Zijlstra. 2013 b. Re: {PATCH v6 4/5} MCS Lock: Barrier corrections. https://marc.info/?l=linux-mm&m=138514629508662&w=2. (2013).Google ScholarGoogle Scholar
  23. Peter Zijlstra. 2016. {tip:perf/urgent} perf/core: Fix sys_perf_event_open() vs. hotplug. https://www.spinics.net/lists/kernel/msg2421883.html. (14 January. 2016).Google ScholarGoogle Scholar

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

Full Access

  • Published in

    cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 53, Issue 2
    ASPLOS '18
    February 2018
    809 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/3296957
    Issue’s Table of Contents
    • cover image ACM Conferences
      ASPLOS '18: Proceedings of the Twenty-Third International Conference on Architectural Support for Programming Languages and Operating Systems
      March 2018
      827 pages
      ISBN:9781450349116
      DOI:10.1145/3173162

    Copyright © 2018 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 the author(s) 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: 19 March 2018

    Check for updates

    Qualifiers

    • research-article

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader