Persistent Memory Transactions

Virendra J. Marathe, Achin Mishra, Amee Trivedi, Yihe Huang, Faisal Zaghloul, Sanidhya Kashyap, Margo I. Seltzer, Tim Harris, Steve Byan, Bill Bridge, Dave DicearXiv 2018 · OpenReview

Abstract

This paper presents a comprehensive analysis of performance trade-offs between implementation choices for transaction runtime systems on persistent memory. We compare three implementations of transaction runtimes: undo logging, redo logging, and copy-on-write. We also present a memory allocator that plugs into these runtimes. Our microbenchmark-based evaluation focuses on understanding the interplay between various factors that contribute to performance differences between the three runtimes—read/write access patterns of workloads, size of the persistence domain (portion of the memory hierarchy where the data is effectively persistent), cache locality, and transaction runtime bookkeeping overheads. No single runtime emerges as a clear winner. We confirm our analysis in more realistic settings of three "real-world" applications: a key-value store, a SQLite port, and a persistified version of memcached.

Introduction

The arrival of byte-addressable persistent memory (PM) promises near-DRAM speeds with data retention. However, programming for PM is difficult because CPU caches remain volatile. Developers must manually orchestrate cache flushes and "persist barriers" to ensure data consistency. Persistent transactions abstract this complexity by guaranteeing failure-atomicity. This paper systematically compares three implementation strategies—undo logging, redo logging, and copy-on-write (COW)—across varying hardware persistence domains and workloads.

Methods and Taxonomy

The authors define a taxonomy of persistence domains (PDOM) to classify hardware safety during power failure:

  • PDOM-0: Only PM DIMMs are persistent; requires slow flushes and barriers.
  • PDOM-1: PM DIMMs and memory controller buffers are persistent.
  • PDOM-2: The entire memory hierarchy, including CPU caches, is persistent; barriers are effectively free.
Persistence domains (PDOM) defining different hardware persistence boundaries.

Three optimized transaction runtimes were implemented:

  1. Undo Logging: Modifies data in-place after logging old data. Optimized with checksums to reduce barriers.
  2. Redo Logging: Writes new data to a log, applying it to memory only at commit. Uses bitmaps and hash tables for "read-after-write" lookups.
  3. Copy-on-Write (COW): Clones objects upon modification and swaps pointers at commit.

Evaluation used Intel's Software Emulation Platform with synthetic microbenchmarks (Array, Array-RAW) and real-world applications (SQLite/TPC-C, Memcached/Mutilate).

Key Results and Discussion

Microbenchmark analysis revealed that COW is consistently unviable, performing 2X to 50X slower than alternatives due to poor cache locality and indirection overhead.

Microbenchmark results comparing COW, Undo, and Redo logging across different PDOMs and write percentages.

The choice between Undo and Redo logging depends heavily on the hardware and workload:

  • Hardware Impact: In PDOM-0, where barriers are slow, redo logging often wins for coarse-grained writes by batching barriers. In PDOM-2, undo logging wins due to its superior read performance.
  • Workload Patterns: While redo logging was expected to dominate Memcached, undo logging outperformed it by 1–10% because Memcached transactions contain high frequencies (25-30%) of read-after-write operations, which penalize redo log lookups.
  • Memory Allocation: A "Lazy Persist" allocator improved latency by up to 100% in PDOM-0 by deferring barriers until commit.

Conclusion

No single transaction runtime is universally optimal. Performance is highly sensitive to the read/write mix and the specific hardware persistence domain. Future systems may require adaptive runtimes that switch strategies dynamically or hardware-software co-design to mitigate specific bottlenecks like redo log lookup overhead.

Summary updated

Abstract

This paper presents a comprehensive analysis of performance trade offs between implementation choices for transaction runtime systems on persistent memory. We compare three implementations of transaction runtimes: undo logging, redo logging, and copy-on-write. We also present a memory allocator that plugs into these runtimes. Our microbenchmark based evaluation focuses on understanding the interplay between various factors that contribute to performance differences between the three runtimes -- read/write access patterns of workloads, size of the persistence domain (portion of the memory hierarchy where the data is effectively persistent), cache locality, and transaction runtime bookkeeping overheads. No single runtime emerges as a clear winner. We confirm our analysis in more realistic settings of three "real world" applications we developed with our transactional API: (i) a key-value store we implemented from scratch, (ii) a SQLite port, and (iii) a persistified version of memcached, a popular key-value store. These findings are not only consistent with our microbenchmark analysis, but also provide additional interesting insights into other factors (e.g. effects of multithreading and synchronization) that affect application performance.
BibTeX
@misc{marathe2018persistent,
  author = {Virendra J. Marathe and Achin Mishra and Amee Trivedi and Yihe Huang and Faisal Zaghloul and Sanidhya Kashyap and Margo I. Seltzer and Tim Harris and Steve Byan and Bill Bridge and Dave Dice},
  title = {{Persistent Memory Transactions}},
  year = {2018},
  eprint = {1804.00701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1804.00701},
}
Figure