Access Official Technical PDF

Share Summary:LinkedInEmail

Persistent memory performance depends on more than the speed of the memory itself. When non-volatile memory (NVMM) is connected to the processor’s memory bus, applications can access persistent data with far less latency than conventional block storage. But that speed changes the balance of the storage stack: system calls, file-system journaling, allocation, and synchronization can become significant bottlenecks. For industrial data platforms and other data-intensive applications, the practical lesson is to examine the full path from application to persistent media—not just the storage device.

A study of NVMM-aware file systems and five database and key-value applications found that relatively small software changes could deliver substantial benefits. Its findings also highlight a useful migration strategy: first remove avoidable overhead in existing file operations, then consider more extensive changes to data structures or the operating system.

Why persistent memory changes the storage stack

Traditional file systems were designed around block devices, where storage access is slow enough that software overhead can be less visible. NVMM is directly addressable and supports fine-grained access, so the operating system’s work on each operation matters more. An application may gain little from low-latency media if every small update still triggers costly kernel activity or block-oriented bookkeeping.

Direct access (DAX) is one way to reduce that overhead. With DAX-mmap, an application maps a file into its address space and accesses its contents using ordinary loads and stores. This bypasses the page cache and avoids copying file data through it. Applications can also persist mapped updates by flushing affected cache lines and using memory barriers, rather than relying on page-oriented synchronization calls such as msync.

That approach does require care. Applications must correctly manage persistence and ordering, and mapped-memory programming can introduce recovery, concurrency, and allocation challenges. DAX changes how data is accessed; it does not automatically make every update crash-consistent.

Improve persistent memory performance with FLEX

One practical technique examined in the study is FiLe Emulation with DAX (FLEX). Rather than sending performance-critical reads and writes through the usual file-system calls, an application maps a file and performs suitable operations in user space. For writes, it can store data directly into the mapped region and flush the relevant cache lines when persistence is required. Reads can use memory-copy operations. If a file must grow, the application can allocate space in advance and extend its mapping.

This can be a smaller step than rebuilding an application around custom crash-consistent data structures. FLEX was applied to logging paths in SQLite, RocksDB, and Kyoto Cabinet, among others. Across the tested workloads, the technique reduced overhead associated with kernel transitions and file allocation. In the study’s microbenchmark, benefits were especially pronounced for small writes; results varied with the access pattern and allocation behavior.

FLEX is not a drop-in replacement for POSIX file operations in every application. Its operations do not provide the same atomicity guarantees, and shared file-descriptor semantics differ. Before adopting it, engineers should verify what the application assumes about write atomicity, synchronization, and recovery. Where those assumptions are compatible, user-space file operations offer an incremental optimization path without requiring a wholesale change to application logic.

Reduce journaling and allocation overhead

File-system metadata can become another source of delay. Adapted file systems, such as ext4-DAX and xfs-DAX in the evaluated environment, support DAX for file data but retain block-oriented journaling mechanisms for metadata. Those mechanisms can write more data than a small metadata change requires and may serialize concurrent work. A file allocation or directory operation can therefore cost more than the application’s data update suggests.

Several application-level practices can help avoid unnecessary work:

  • Preallocate file space when the workload’s growth pattern is predictable. This can reduce repeated allocation overhead, especially for log files.
  • Review logging modes and file lifecycle operations. Repeatedly creating, deleting, or truncating files may add metadata work.
  • Use cache-line flushing for mapped data where appropriate, rather than issuing frequent page-oriented synchronization calls.
  • Measure before redesigning data structures. A persistent in-memory structure may reduce logging, but it can require substantially more engineering effort than optimizing existing file operations.

The study also explored DAX-aware journaling for ext4, using finer-grained metadata logging and per-CPU journal areas. This reduced journaling overhead in tested workloads, although it did not eliminate all differences between adapted and native NVMM file systems. The broader point is that a storage stack designed around blocks may retain costs even when the underlying medium is byte-addressable.

Plan for file-system scalability and NUMA

Low-latency storage can expose concurrency limits that were less visible with slower devices. In the evaluated systems, Linux file-system and virtual file system (VFS) locking affected concurrent file reads, writes, and directory operations. Fine-grained synchronization and per-CPU structures improved scalability in some cases, while shared-directory operations remained constrained by kernel locking.

NUMA placement is equally important. In a multi-socket server, memory access latency depends in part on the relationship between a processor and the memory it accesses. NVMM file-system performance can suffer when application threads run on one NUMA node while their file data and metadata reside on another. The study’s NOVA changes let applications query and express a preferred NUMA node for a file. Coordinating that placement with CPU affinity improved results in the evaluated file-system, RocksDB, and MongoDB workloads.

For system integrators and operations teams, this makes workload placement part of storage design. Consider which threads access which files, where the persistent memory is attached, and whether the operating system and file system offer controls to align data and compute. A fast medium cannot compensate for consistently remote access or a serialized software path.

Make optimization a measured migration

Persistent memory performance is shaped by application behavior, file-system design, kernel interfaces, and memory topology. Begin by identifying the dominant costs in the real workload: small writes, log allocation, synchronization calls, metadata updates, lock contention, or remote NUMA access. Then apply the least disruptive remedy that addresses the bottleneck.

For many legacy applications, DAX-based user-space file operations, cache-line persistence, and preallocation can be practical first steps. More ambitious changes—such as custom persistent data structures, redesigned journaling, or file-system scalability work—may be justified when measurement shows that simpler changes are insufficient. The central engineering principle is to match the software stack to persistent memory’s fine-grained access model while preserving the consistency guarantees the application actually requires.

Access Official Technical PDF

About The Author