Skip to main content
QUICK REVIEW

[Paper Review] Taming Weak Memory Models

Sizhuo Zhang, Arvind Arvind|arXiv (Cornell University)|Jun 17, 2016
Parallel Computing and Optimization TechniquesComputer Science44 references3 citations
TL;DR

This paper introduces WMM, a simplified weak memory model using the Instantaneous Instruction Execution (I²E) framework, which eliminates dependency enforcement via load-value speculation, making it both simpler and efficient. It further proposes WMM-D for precise data-dependency ordering and WMM-S to model non-atomic multi-copy stores from write-through caches, showing that write-back caches suffice for performance without complexity.

ABSTRACT

Speculative techniques in microarchitectures relax various dependencies in programs, which contributes to the complexity of (weak) memory models. We show using WMM, a new weak memory model, that the model becomes simpler if it includes load-value speculation and thus, does not enforce any dependency! However, in the absence of good value-prediction techniques, a programmer may end up paying a price for the extra fences. Thus, we also present WMM-D, which enforces the dependencies captured by the current microarchitectures. WMM-D is still much simpler than other existing models. We also show that non-atomic multi-copy stores arise as a result of sharing write-through caches. We think restricting microarchitectures to write-back caches (and thus simpler weak memory models) will not incur any performance penalty. Nevertheless, we present WMM-S, another extension to WMM, which could model the effects of non-atomic multi-copy stores. WMM, WMM-D, and WMM-S are all defined using Instantaneous Instruction Execution (I^2E), a new way of describing memory models without explicit reordering or speculative execution.

Motivation & Objective

  • Address the complexity and ambiguity in existing weak memory models like Power and ARM, which stem from non-atomic multi-copy stores and speculative execution.
  • Resolve the lack of precise, simple, and implementable memory model definitions that are compatible with high-level language semantics.
  • Develop a formal framework that enables clear, unambiguous, and efficient specification of memory models without relying on complex axioms or operational models.
  • Demonstrate that restricting microarchitectures to write-back caches eliminates the need for complex models of non-atomic stores, simplifying the memory model.
  • Provide a systematic mapping from high-level language primitives to memory instructions and fences, enabling efficient compilation and reasoning in concurrent programming.

Proposed method

  • Introduce the Instantaneous Instruction Execution (I²E) framework, modeling memory systems as monolithic multi-ported memory with atomic processors and configurable buffers to represent dependencies and speculation.
  • Define WMM as a weak memory model within I²E that removes dependency enforcement via load-value speculation, enabling simpler behavior without explicit reordering or speculative execution rules.
  • Extend WMM to WMM-D by enforcing data-dependency ordering through buffer constraints, preserving simplicity while capturing essential ordering semantics.
  • Develop WMM-S by extending WMM to model non-atomic multi-copy stores via store buffer copying and coherence ordering checks, simulating write-through cache behavior.
  • Use litmus tests to validate WMM, WMM-D, and WMM-S, demonstrating correct behavior for known patterns like WWC and IRIW.
  • Show that the Commit fence in WMM-S has cumulative global effects, analogous to Power’s sync and ARM’s dmb, by enforcing global ordering through store copy propagation and invalidation.

Experimental results

Research questions

  • RQ1What architectural features in microarchitectures cause the complexity seen in existing weak memory models like Power and ARM?
  • RQ2Why are existing formalizations of memory models like RC and RMO imprecise or overly restrictive, and how can they be corrected?
  • RQ3Can a memory model be both simple and efficient while supporting modern hardware optimizations and high-level language abstractions?
  • RQ4To what extent can write-back caches eliminate the need for complex models of non-atomic multi-copy stores?
  • RQ5How can a formal framework like I²E enable unambiguous, minimal, and extensible memory model definitions?

Key findings

  • Non-atomic multi-copy stores in Power and ARM arise from shared write-through caches, and restricting to write-back caches eliminates this complexity without performance penalty.
  • WMM, a weak memory model based on I²E with load-value speculation, simplifies the memory model by removing dependency enforcement, achieving a clean and precise definition.
  • WMM-D precisely captures data-dependency ordering while remaining simple and compatible with existing hardware, making it suitable for immediate adoption.
  • WMM-S models non-atomic multi-copy stores via store buffer copying and coherence checks, correctly reproducing behaviors seen in write-through cache systems.
  • The Commit fence in WMM-S has a cumulative global effect, similar to Power’s sync and ARM’s dmb, by ensuring all copies of a store are visible before subsequent operations.
  • Litmus tests confirm that WMM-S allows behaviors like WWC and IRIW that are forbidden in WMM, validating its ability to model real-world write-through cache effects.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.