Reconciling Event Structures with Modern Multiprocessors

Weakestmo is a recently proposed memory consistency model that uses event structures to resolve the infamous "out-of-thin-air" problem. Although it has been shown to have important benefits over other memory models, its established compilation schemes are suboptimal in that they add more fences than necessary. In this paper, we prove the correctness in Coq of the intended compilation schemes for Weakestmo to a range of hardware memory models (x86, POWER, ARMv7, ARMv8, RISC-V). Our proof is the first that establishes correctness of compilation of an event-structure-based model that forbids "thin-air" behaviors, as well as the first mechanized compilation proof of a weak memory model supporting sequentially consistent accesses to such a range of hardware platforms. Our compilation proof goes via the recent Intermediate Memory Model (IMM), which we suitably extend with sequentially consistent accesses.

[1]  Shaked Flur,et al.  Simplifying ARM concurrency: multicopy-atomic axiomatic and operational models for ARMv8 , 2017, Proc. ACM Program. Lang..

[2]  Yunsup Lee,et al.  The RISC-V Instruction Set Manual , 2014 .

[3]  Suresh Jagannathan,et al.  CompCertTSO: A Verified Compiler for Relaxed-Memory Concurrency , 2013, JACM.

[4]  Viktor Vafeiadis,et al.  Common Compiler Optimisations are Invalid in the C11 Memory Model and what we can do about it , 2015, POPL.

[5]  Viktor Vafeiadis,et al.  Grounding thin-air reads with event structures , 2019, Proc. ACM Program. Lang..

[6]  Ali Sezgin,et al.  Modelling the ARMv8 architecture, operationally: concurrency and ISA , 2016, POPL.

[7]  Peter Sewell,et al.  A concurrency semantics for relaxed atomics that permits optimisation and avoids thin-air executions , 2016, POPL.

[8]  James Riely,et al.  On Thin Air Reads Towards an Event Structures Model of Relaxed Memory , 2016, 2016 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[9]  Peter Sewell,et al.  A Better x86 Memory Model: x86-TSO , 2009, TPHOLs.

[10]  Jeehoon Kang,et al.  A promising semantics for relaxed-memory concurrency , 2017, POPL.

[11]  Anil Madhavapeddy,et al.  Bounding data races in space and time , 2018, PLDI.

[12]  Peter Sewell,et al.  Mathematizing C++ concurrency , 2011, POPL '11.

[13]  LahavOri,et al.  Bridging the gap between programming languages and hardware weak memory models , 2019 .

[14]  Anton Podkopaev,et al.  Operational Aspects of C/C++ Concurrency , 2016, ArXiv.

[15]  Hans-Juergen Boehm,et al.  Outlawing ghosts: avoiding out-of-thin-air results , 2014, MSPC@PLDI.

[16]  Jeehoon Kang,et al.  Repairing sequential consistency in C/C++11 , 2017, PLDI.

[17]  Jens Palsberg,et al.  A formalization of Java’s concurrent access modes , 2019, Proc. ACM Program. Lang..

[18]  Anton Podkopaev,et al.  Bridging the gap between programming languages and hardware weak memory models , 2018, Proc. ACM Program. Lang..

[19]  Jeremy Manson,et al.  The Java memory model , 2005, POPL '05.

[20]  Ori Lahav,et al.  Explaining Relaxed Memory Models with Program Transformations , 2016, FM.

[21]  John Wickerson,et al.  Overhauling SC atomics in C11 and OpenCL , 2016, POPL.

[22]  Jeehoon Kang,et al.  Promising-ARM/RISC-V: a simpler and faster operational concurrency model , 2019, PLDI.