Efficient sequential consistency using conditional fences

Changhui Lin, Vijay Nagarajan, Rajiv Gupta

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract / Description of output

Among the various memory consistency models, the sequential consistency (SC) model, in which memory operations appear to take place in the order specified by the program, is the most intuitive and enables programmers to reason about their parallel programs the best. Nevertheless, processor designers often choose to support relaxed memory consistency models because the weaker ordering constraints imposed by such models allow for more instructions to be reordered and enable higher performance. Programs running on machines supporting weaker consistency models, can be transformed into ones in which SC is enforced. The compiler does this by computing a minimal set of memory access pairs whose ordering automatically guarantees SC. To ensure that these memory access pairs are not reordered, memory fences are inserted. Unfortunately, insertion of such memory fences can significantly slowdown the program.

We observe that the ordering of the minimal set of memory accesses that the compiler strives to enforce, is typically already enforced in the normal course of program execution. A study we conducted on programs with compiler inserted memory fences shows that only 8% of the executed instances of the memory fences are really necessary to ensure SC. Motivated by this study we propose the conditional fence mechanism (C-Fence) that utilizes compiler information to decide dynamically if there is a need to stall at each fence. Our experiments with SPLASH-2 benchmarks show that, with C-Fences, programs can be transformed to enforce SC incurring only 12% slowdown, as opposed to 43% slowdown using normal fence instructions. Our approach requires very little hardware support (<300 bytes of on-chip-storage) and it avoids the use of speculation and its associated costs.
Original languageEnglish
Title of host publicationProceedings of the 19th international conference on Parallel Architectures And Compilation Techniques (PACT '10)
Place of PublicationNew York, NY, USA
Number of pages12
ISBN (Print)978-1-4503-0178-7
Publication statusPublished - 2010

Keywords / Materials (for Non-textual outputs)

  • active table
  • associates
  • conditional fences
  • interprocessor delay
  • memory consistency
  • sequential consistency


Dive into the research topics of 'Efficient sequential consistency using conditional fences'. Together they form a unique fingerprint.

Cite this