HackerPapers

arXiv:1707.05923cs.PL

Weak Memory Models: Balancing Definitional Simplicity and Implementation Flexibility

Sizhuo Zhang, Muralidaran Vijayaraghavan, Arvind

Abstract

The memory model for RISC-V, a newly developed open source ISA, has not been finalized yet and thus, offers an opportunity to evaluate existing memory models. We believe RISC-V should not adopt the memory models of POWER or ARM, because their axiomatic and operational definitions are too complicated. We propose two new weak memory models: WMM and WMM-S, which balance definitional simplicity and implementation flexibility differently. Both allow all instruction reorderings except overtaking of loads by a store. We show that this restriction has little impact on performance and it considerably simplifies operational definitions. It also rules out the out-of-thin-air problem that plagues many definitions. WMM is simple (it is similar to the Alpha memory model), but it disallows behaviors arising due to shared store buffers and shared write-through caches (which are seen in POWER processors). WMM-S, on the other hand, is more complex and allows these behaviors. We give the operational definitions of both models using Instantaneous Instruction Execution (I2E), which has been used in the definitions of SC and TSO. We also show how both models can be implemented using conventional cache-coherent memory systems and out-of-order processors, and encompasses the behaviors of most known optimizations.

arXiv comments
Journal reference
Parallel Architectures and Compilation Techniques (PACT), 2017 26th International Conference on, pp. 288-302. IEEE, 2017
DOI
doi:10.1109/PACT.2017.29
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Nov 2017 to Nov 2022.

Comments linking this paper, per year.

Discussed in comments2 threads

    • > For better or for worse, modern CPU design is about doing things thread-unsafe by default. If the programmer recognizes a problem may occur, it is the responsibility of the programmer to put the memory barriers in the right place. This so much. I truly wish RISC-V had decided…

      namibjView on HNParent context

    • I wonder how the memory model in https://people.mpi-sws.org/~dreyer/papers/promising/paper.pd... compares to the WMM and WMM-S memory models given in https://arxiv.org/pdf/1707.05923.pdf ; and if there are other research memory models out there that should also be considered?

      bshanksView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.