skip to main content

Making weak memory models fair

Published:15 October 2021Publication History
Skip Abstract Section

Abstract

Liveness properties, such as termination, of even the simplest shared-memory concurrent programs under sequential consistency typically require some fairness assumptions about the scheduler. Under weak memory models, we observe that the standard notions of thread fairness are insufficient, and an additional fairness property, which we call memory fairness, is needed. In this paper, we propose a uniform definition for memory fairness that can be integrated into any declarative memory model enforcing acyclicity of the union of the program order and the reads-from relation. For the well-known models, SC, x86-TSO, RA, and StrongCOH, that have equivalent operational and declarative presentations, we show that our declarative memory fairness condition is equivalent to an intuitive model-specific operational notion of memory fairness, which requires the memory system to fairly execute its internal propagation steps. Our fairness condition preserves the correctness of local transformations and the compilation scheme from RC11 to x86-TSO, and also enables the first formal proofs of termination of mutual exclusion lock implementations under declarative weak memory models.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

This is a recording of the talk presenting the "Making Weak Memory Models Fair" paper at OOPSLA'21.

References

  1. Jade Alglave, Luc Maranget, Paul E. McKenney, Andrea Parri, and Alan S. Stern. 2018. Frightening Small Children and Disconcerting Grown-ups: Concurrency in the Linux Kernel. In ASPLOS 2018. ACM, 405–418. https://doi.org/10.1145/3173162.3177156 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Jade Alglave, Luc Maranget, and Michael Tautschnig. 2014. Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory. ACM Trans. Program. Lang. Syst., 36, 2 (2014), Article 7, July, 74 pages. issn:0164-0925 https://doi.org/10.1145/2627752 Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Mark Batty, Kayvan Memarian, Scott Owens, Susmit Sarkar, and Peter Sewell. 2012. Clarifying and Compiling C/C++ Concurrency: From C++11 to POWER. In POPL. ACM, New York, NY, USA. 509–520. isbn:9781450310833 https://doi.org/10.1145/2103656.2103717 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Mark Batty, Scott Owens, Susmit Sarkar, Peter Sewell, and Tjark Weber. 2011. Mathematizing C++ Concurrency. In POPL. ACM, New York, NY, USA. 55–66. isbn:9781450304900 https://doi.org/10.1145/1926385.1926394 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. John Bender and Jens Palsberg. 2019. A Formalization of Java’s Concurrent Access Modes. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 142, Oct., 28 pages. https://doi.org/10.1145/3360568 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Ahmed Bouajjani, Egor Derevenetc, and Roland Meyer. 2013. Checking and Enforcing Robustness Against TSO. In ESOP. Springer-Verlag, Berlin, Heidelberg. 533–553. isbn:978-3-642-37035-9 https://doi.org/10.1007/978-3-642-37036-6_29 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Ahmed Bouajjani, Constantin Enea, and Jad Hamza. 2014. Verifying Eventual Consistency of Optimistic Replication Systems. In POPL. ACM, New York, NY, USA. 285–296. isbn:9781450325448 https://doi.org/10.1145/2535838.2535877 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Ahmed Bouajjani, Constantin Enea, Suha Orhun Mutluergil, and Serdar Tasiran. 2018. Reasoning About TSO Programs Using Reduction and Abstraction. In CAV. Springer International Publishing, Cham. 336–353. isbn:978-3-319-96142-2 https://doi.org/10.1007/978-3-319-96142-2_21 Google ScholarGoogle Scholar
  9. Ahmed Bouajjani, Roland Meyer, and Eike Möhlmann. 2011. Deciding Robustness against Total Store Ordering. In ICALP. Springer Berlin Heidelberg, Berlin, Heidelberg. 428–440. isbn:978-3-642-22012-8 https://doi.org/10.1007/978-3-642-22012-8_34 Google ScholarGoogle ScholarCross RefCross Ref
  10. Andrea Cerone, Giovanni Bernardi, and Alexey Gotsman. 2015. A Framework for Transactional Consistency Models with Atomic Visibility. In CONCUR. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 58–71. isbn:978-3-939897-91-0 issn:1868-8969 https://doi.org/10.4230/LIPIcs.CONCUR.2015.58 Google ScholarGoogle ScholarCross RefCross Ref
  11. Milind Chabbi, Michael Fagan, and John Mellor-Crummey. 2015. High Performance Locks for Multi-Level NUMA Systems. In PPoPP. ACM, New York, NY, USA. 215–226. isbn:9781450332057 https://doi.org/10.1145/2688500.2688503 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Soham Chakraborty and Viktor Vafeiadis. 2019. Grounding thin-air reads with event structures. Proc. ACM Program. Lang., 3, POPL (2019), 70:1–70:28. https://doi.org/10.1145/3290383 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Egor Derevenetc and Roland Meyer. 2014. Robustness against Power is PSpace-complete. In ICALP. Springer, Berlin, Heidelberg. 158–170. isbn:978-3-662-43951-7 https://doi.org/10.1007/978-3-662-43951-7_14 Google ScholarGoogle ScholarCross RefCross Ref
  14. Stephen Dolan, KC Sivaramakrishnan, and Anil Madhavapeddy. 2018. Bounding Data Races in Space and Time. In PLDI. ACM, New York, NY, USA. 242–255. isbn:9781450356985 https://doi.org/10.1145/3192366.3192421 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Shaked Flur, Kathryn E. Gray, Christopher Pulte, Susmit Sarkar, Ali Sezgin, Luc Maranget, Will Deacon, and Peter Sewell. 2016. Modelling the ARMv8 Architecture, Operationally: Concurrency and ISA. In POPL. ACM, New York, NY, USA. 608–621. isbn:9781450335492 https://doi.org/10.1145/2837614.2837615 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Nissim Francez. 1986. Fairness. Springer. isbn:978-3-540-96235-9 https://doi.org/10.1007/978-1-4612-4886-6 Google ScholarGoogle ScholarCross RefCross Ref
  17. Alexey Gotsman and Sebastian Burckhardt. 2017. Consistency Models with Global Operation Sequencing and their Composition. In DISC. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 23:1–23:16. isbn:978-3-95977-053-8 issn:1868-8969 https://doi.org/10.4230/LIPIcs.DISC.2017.23 Google ScholarGoogle ScholarCross RefCross Ref
  18. Radha Jagadeesan, Alan Jeffrey, and James Riely. 2020. Pomsets with preconditions: A simple model of relaxed memory. Proc. ACM Program. Lang., 4, OOPSLA (2020), 194:1–194:30. https://doi.org/10.1145/3428262 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Jan-Oliver Kaiser, Hoang-Hai Dang, Derek Dreyer, Ori Lahav, and Viktor Vafeiadis. 2017. Strong Logic for Weak Memory: Reasoning About Release-Acquire Consistency in Iris. In ECOOP. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany. 17:1–17:29. isbn:978-3-95977-035-4 issn:1868-8969 https://doi.org/10.4230/LIPIcs.ECOOP.2017.17 Google ScholarGoogle Scholar
  20. Jeehoon Kang, Chung-Kil Hur, Ori Lahav, Viktor Vafeiadis, and Derek Dreyer. 2017. A Promising Semantics for Relaxed-Memory Concurrency. In POPL. ACM, New York, NY, USA. 175–189. isbn:9781450346603 https://doi.org/10.1145/3009837.3009850 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Michalis Kokologiannakis, Ori Lahav, Konstantinos Sagonas, and Viktor Vafeiadis. 2017. Effective Stateless Model Checking for C/C++ Concurrency. Proc. ACM Program. Lang., 2, POPL (2017), Article 17, Dec., 32 pages. issn:2475-1421 https://doi.org/10.1145/3158105 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Michalis Kokologiannakis, Azalea Raad, and Viktor Vafeiadis. 2019. Model Checking for Weakly Consistent Libraries. In PLDI 2019. ACM, New York, NY, USA. 96–110. isbn:9781450367127 https://doi.org/10.1145/3314221.3314609 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Michalis Kokologiannakis and Viktor Vafeiadis. 2021. GenMC: A Model Checker for Weak Memory Models. In CAV 2021 (LNCS, Vol. 12759). Springer, 427–440. https://doi.org/10.1007/978-3-030-81685-8_20 Google ScholarGoogle ScholarCross RefCross Ref
  24. Ori Lahav, Nick Giannarakis, and Viktor Vafeiadis. 2016. Taming Release-Acquire Consistency. In POPL. ACM, New York, NY, USA. 649–662. isbn:9781450335492 https://doi.org/10.1145/2837614.2837643 Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ori Lahav and Roy Margalit. 2019. Robustness Against Release/Acquire Semantics. In PLDI. ACM, New York, NY, USA. 126–141. isbn:978-1-4503-6712-7 https://doi.org/10.1145/3314221.3314604 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Ori Lahav, Egor Namakonov, Jonas Oberhauser, Anton Podkopaev, and Viktor Vafeiadis. 2021. Making Weak Memory Models Fair. Full paper version with appendices. arxiv:2012.01067.Google ScholarGoogle Scholar
  27. Ori Lahav, Egor Namakonov, Jonas Oberhauser, Anton Podkopaev, and Viktor Vafeiadis. 2021. Making Weak Memory Models Fair: OOPSLA 2021 artifact. https://doi.org/10.5281/zenodo.5496483 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Ori Lahav, Viktor Vafeiadis, Jeehoon Kang, Chung-Kil Hur, and Derek Dreyer. 2017. Repairing Sequential Consistency in C/C++11. In PLDI. ACM, New York, NY, USA. 618–632. isbn:9781450349888 https://doi.org/10.1145/3062341.3062352 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Leslie Lamport. 1977. Proving the Correctness of Multiprocess Programs. IEEE Trans. Software Eng., 3, 2 (1977), 125–143. https://doi.org/10.1109/TSE.1977.229904 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Leslie Lamport. 1979. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Computers, 28, 9 (1979), 690–691. https://doi.org/10.1109/TC.1979.1675439 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. D. Lehmann, A. Pnueli, and J. Stavi. 1981. Impartiality, Justice and Fairness: The Ethics of Concurrent Termination. In ICALP. Springer Berlin Heidelberg, Berlin, Heidelberg. 264–277. isbn:978-3-540-38745-9 https://doi.org/10.1007/3-540-10843-2_22 Google ScholarGoogle ScholarCross RefCross Ref
  32. Jeremy Manson, William Pugh, and Sarita V. Adve. 2005. The Java Memory Model. In POPL 2005. ACM, New York. 378–391. https://doi.org/10.1145/1040305.1040336 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Roy Margalit and Ori Lahav. 2021. Verifying Observational Robustness against a C11-Style Memory Model. Proc. ACM Program. Lang., 5, POPL (2021), Article 4, Jan., 33 pages. https://doi.org/10.1145/3434285 Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. John M. Mellor-Crummey and Michael L. Scott. 1991. Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors. ACM Trans. Comput. Syst., 9, 1 (1991), Feb., 21–65. issn:0734-2071 https://doi.org/10.1145/103727.103729 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Jonas Oberhauser. 2018. Store Buffer Reduction in the Presence of Mixed-Size Accesses and Misalignment. In VSTTE 2018 (LNCS, Vol. 11294). Springer, 322–344. https://doi.org/10.1007/978-3-030-03592-1_19 Google ScholarGoogle ScholarCross RefCross Ref
  36. Jonas Oberhauser, Rafael Lourenco de Lima Chehab, Diogo Behrens, Ming Fu, Antonio Paolillo, Lilith Oberhauser, Koustubha Bhat, Yuzhong Wen, Haibo Chen, Jaeho Kim, and Viktor Vafeiadis. 2021. VSync: Push-Button Verification and Optimization for Synchronization Primitives on Weak Memory Models. In ASPLOS. ACM, New York, NY, USA. 530–545. isbn:9781450383172 https://doi.org/10.1145/3445814.3446748 Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Jonas Oberhauser, Lilith Oberhauser, Antonio Paolillo, Diogo Behrens, Ming Fu, and Viktor Vafeiadis. 2021. Verifying and Optimizing the HMCS Lock for Arm Servers. In NETYS 2021. 16 pages. https://people.mpi-sws.org/~viktor/papers/netys2021-hmcs.pdfGoogle ScholarGoogle Scholar
  38. Scott Owens, Susmit Sarkar, and Peter Sewell. 2009. A Better x86 Memory Model: x86-TSO. In TPHOLs 2009 (LNCS, Vol. 5674). Springer, 391–407. https://doi.org/10.1007/978-3-642-03359-9_27 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. David Michael Ritchie Park. 1979. On the Semantics of Fair Parallelism. In Abstract Software Specifications 1979, Dines Bjørner (Ed.) (LNCS, Vol. 86). Springer, 504–526. https://doi.org/10.1007/3-540-10007-5_47 Google ScholarGoogle ScholarCross RefCross Ref
  40. Anton Podkopaev, Ori Lahav, and Viktor Vafeiadis. 2019. Bridging the Gap between Programming Languages and Hardware Weak Memory Models. Proc. ACM Program. Lang., 3, POPL (2019), Article 69, Jan., 31 pages. https://doi.org/10.1145/3290382 Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Christopher Pulte, Shaked Flur, Will Deacon, Jon French, Susmit Sarkar, and Peter Sewell. 2017. Simplifying ARM Concurrency: Multicopy-Atomic Axiomatic and Operational Models for ARMv8. Proc. ACM Program. Lang., 2, POPL (2017), Article 19, Dec., 29 pages. https://doi.org/10.1145/3158107 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Peter Sewell, Susmit Sarkar, Scott Owens, Francesco Zappa Nardelli, and Magnus O. Myreen. 2010. x86-TSO: A Rigorous and Usable Programmer’s Model for x86 Multiprocessors. Commun. ACM, 53, 7 (2010), 89–97. https://doi.org/10.1145/1785414.1785443 Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Viktor Vafeiadis, Thibaut Balabonski, Soham Chakraborty, Robin Morisset, and Francesco Zappa Nardelli. 2015. Common Compiler Optimisations Are Invalid in the C11 Memory Model and What We Can Do about It. In POPL. ACM, New York, NY, USA. 209–220. isbn:9781450333009 https://doi.org/10.1145/2676726.2676995 Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Conrad Watt, Christopher Pulte, Anton Podkopaev, Guillaume Barbier, Stephen Dolan, Shaked Flur, Jean Pichon-Pharabod, and Shu-yu Guo. 2020. Repairing and Mechanising the JavaScript Relaxed Memory Model. In PLDI. ACM, New York, NY, USA. 346–361. isbn:9781450376136 https://doi.org/10.1145/3385412.3385973 Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Conrad Watt, Andreas Rossberg, and Jean Pichon-Pharabod. 2019. Weakening WebAssembly. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 133, Oct., 28 pages. https://doi.org/10.1145/3360559 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Making weak memory models fair

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!