Persistent Memory I/O Primitives

Alexander van Renen, Lukas Vogel, Viktor Leis, Thomas Neumann, Alfons Kemper

This paper, published shortly after the release of Intel’s Optane DC Persistent Memory, provides a foundational look at how to actually build software for this new tier of the memory hierarchy.

TL;DR

Persistent Memory (PMem) promises the speed of RAM with the durability of a hard drive, but it comes with unique performance "quirks" like 256-byte internal block sizes. This paper benchmarks real Optane hardware to derive design guidelines and introduces a novel "Zero" logging algorithm that doubles the throughput of standard transactional logging.

What Problem Does This Paper Address?

For decades, computer architecture has been defined by a massive gap: DRAM is fast but volatile and expensive, while SSDs/HDDs are persistent and cheap but painfully slow. Persistent Memory (specifically Intel Optane) aims to bridge this gap.

However, PMem isn't just "fast storage" or "big RAM." It is byte-addressable but has different latency and bandwidth characteristics than DRAM. Naively treating PMem like a faster SSD or a larger pool of RAM leads to sub-optimal performance. The authors tackle the challenge of identifying the physical properties of PMem and designing "I/O primitives"—the basic building blocks of databases, like logging and page flushing—that are specifically tuned for this new hardware.

Methods

The authors conducted their research on a real two-socket system equipped with 1.5 TB of Optane PMMs. Their approach was two-fold:

  1. Micro-benchmarking: They measured raw bandwidth and latency, varying access granularity (how much data is read/written at once) and thread counts.
  2. Primitive Design: They developed and compared several algorithms for two critical database tasks:
  3. Page Flushing: Moving data from volatile DRAM to persistent PMem. They compared standard Copy-on-Write (CoW) against a new Micro Log approach that only records modified cache lines.
  4. Transactional Logging: They introduced "Zero" logging, a novel technique that uses the popcnt (population count) instruction to verify data integrity. This allows them to achieve failure atomicity with only a single "persistency barrier" (a flush and a fence), whereas traditional methods require two.

Datasets

The evaluation primarily uses:

  • Synthetic Micro-benchmarks: Designed to stress-test bandwidth and latency.
  • YCSB (Yahoo! Cloud Serving Benchmark): A standard industry benchmark for data management systems, used here to validate their primitives within a prototype storage engine called HyMem.

Key Insights and Ideas

  • The 256-byte Internal Block: While the CPU talks to PMem in 64-byte cache lines, the hardware internally manages 256-byte blocks. If you don't write in multiples of 256 bytes (4 cache lines), you trigger "write amplification," significantly hurting throughput.
  • The "Persistency Barrier" Tax: Data isn't "safe" on PMem until it's pushed out of the CPU cache using instructions like clwb (cache line write back) followed by an sfence. These barriers are expensive. The "aha moment" of the paper is that reducing the number of these barriers is more important than almost any other optimization.
  • Anti-Scaling: Unlike DRAM, where more threads often mean more speed, PMem bandwidth can actually decrease if too many threads compete for the memory controller. Peak performance was often found at 7–11 threads, far below the core count of modern servers.
  • Zero Logging: By pre-zeroing the log file and using a bit-count (checksum) stored alongside the data, the system can tell if a write was successful after a crash without needing a second "commit" write.

Key Results

  • Logging Speedup: The "Zero" logging technique achieved 2 million transactions per second, roughly 2x faster than the state-of-the-art "Header" logging used in Intel’s own PMDK library.
  • Latency Gap: PMem read latency is approximately 391ns, which is about 3.2x slower than DRAM (~121ns) but still orders of magnitude faster than the fastest NVMe SSDs.
  • Write Bandwidth: PMem write bandwidth is significantly lower than DRAM (maxing out around 6.8 GB/s vs 80 GB/s in their tests). This confirms that PMem should be used as a supplement to, not a replacement for, DRAM.
  • Micro-logging Efficiency: For page flushing, the Micro Log approach outperformed Copy-on-Write as long as fewer than 112 cache lines (out of 256 in a 16KB page) were modified.

Limitations and Future Work

  • Instruction Support: At the time of writing, the authors noted that the clwb instruction wasn't fully optimized in their "Cascade Lake" CPUs, forcing them to use flush_opt as a proxy.
  • Pre-zeroing Overhead: The "Zero" logging technique relies on the log file being zeroed out beforehand. While this is common in databases (like PostgreSQL), it adds a background maintenance cost not fully explored here.
  • Hybrid Models: The results suggest that a "hybrid" storage engine that dynamically chooses between Micro-logging and CoW based on the "dirtiness" of a page would be ideal, but the paper stops short of implementing this dynamic logic.

Summary updated

BibTeX
@inproceedings{renen2019persistent,
  author = {Alexander van Renen and Lukas Vogel and Viktor Leis and Thomas Neumann and Alfons Kemper},
  title = {{Persistent Memory I/O Primitives}},
  booktitle = {DaMoN},
  year = {2019},
  url = {https://openreview.net/forum?id=5aQexYx7kn},
}

Loading related content...

Figure