NVM编程模型

几十年来,传统的储存模型几乎没有什么变化。如下图所示,操作系统负责与储存介质交互,对用户程序提供open/closeread/write等基本API。

除了这样直接访问,Windows和Linux均支持内存映射,这在旧的编程模型中可能并不常用,但它却是NVM编程模型的核心。

在调用内存映射后,文件会出现在应用的地址空间中,应用可以直接加载或储存文件内容,这为NVM编程提供了极大优势。

持久性编程模型支持字节级访问插入内存总线的非易失性介质,此处通过常用的行业术语 NVDIMM 表示,它的全称是非易失性双列直插式内存模块。映射设置完成后,应用可以利用MMU完成虚拟到物理内存的直接访问。将这些直接映射配置到持久性内存的能力被称作直接访问 (DAX) 特性。普通文件系统和持久性内存感知型文件系统的不同之处在于对该特性的支持。

The persistent memory programming model allows byte-level access to non-volatile media plugged into the memory bus, shown here by the common industry term NVDIMM, which is short for non-volatile dual in-line memory module. You can see that once the mappings are set up, the application has direct access, provided by the MMU’s virtual-to-physical mappings. The ability to configure these direct mappings to persistent memory is a feature known as direct access (DAX). Support for this feature is what differentiates a normal file system from a persistent memory-aware file system. DAX is supported today by both Windows and Linux.


参考文档: