From WikiChip
Editing snia/npm

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
 
{{title|NVM Programming Model (NPM) - SNIA}}
 
{{title|NVM Programming Model (NPM) - SNIA}}
 
The '''NVM Programming Model''' ('''NPM''') is a set of specifications developed by the [[SNIA]] NVM Programming Technical Working Group that defines recommanded behavior between various user space and kernel components supporting [[storage-class memory]].
 
The '''NVM Programming Model''' ('''NPM''') is a set of specifications developed by the [[SNIA]] NVM Programming Technical Working Group that defines recommanded behavior between various user space and kernel components supporting [[storage-class memory]].
 
== Motivations ==
 
[[Persistent memory]] differs from standard [[DRAM]] in a great number of ways. Unlike traditional [[volatile memory]] which receives an anonymous region of memory, regions of persistent memory are owned by certain applications - much like files on the hard drive. There is a need to keep track of which application has access to which region of the persistent memory which can remain beyond the lifetime of the program's execution. With the commercialization of new [[storage-class memory]], it becomes necessary to formally define the semantics of working with persistent memory regions. The NVM Programming Model (NPM) addresses this by defining the formal semantics for working with such devices. The Storage Networking Industry Association (SNIA) Technical Working Group (TWG) is the group heading the specification of the persistent memory programming model.
 
 
== Overview ==
 
NPM defines the semantics for a [[persistent memory-aware file system]]. The model uses the same standard file semantics the industry has been using for 30-some years and apply it to persistent memory, providing it with the necessary facilities for managing permissions, as well as reading and writing block storage.
 
 
{| class="wikitable"
 
! colspan="2" | Basic File APIs
 
|-
 
| Windows || Linux
 
|-
 
| <code>OpenFile()</code>/<code>Createfile()</code><br><code>ReadFile()</code>/<code>WriteFile()</code>
 
| <code>open()</code><br><code>read()/write()</code>
 
|}
 
 
Additionally, there is also support for mapping memory regions to applications, providing an even more efficient way of accessing persistent memory storage. This feature is also known as {{snia|direct access}} or {{snia|DAX}} (note the term is used by both [[Linux]] and [[Windows]]). Memory-mapping a file can only be done once the file has already been created/opened, thereby already undergone the necessary permission checks. Memory-mapping a persistent file is done using the same function calls that already exist on both Windows and Linux. From the software point of view, the storage new becomes byte-addressable storage.
 
 
{| class="wikitable"
 
! colspan="2" | [[Memory-mapped file]] APIs
 
|-
 
| Windows || Linux
 
|-
 
| <code>CreateFileMapping()</code><br><code>MapViewOfFile()</code>
 
| <code>mmap()</code>
 
|}
 
[[File:snia npm dax.png|thumb|right|DAX allows direct byte-level access to the NVDIMM.]]
 
Traditional file I/O operates on [[block storage]]. Reading a single byte from a file involves reading an entire block (typically around 4 KiB in size). Likewise, flushing the data back to persistence, the full block has to be written out. With a [[persistent memory-aware file system]], although the API remains the same, the operating system is aware of the persistent memory device and allows for direct byte-level access with the [[NVDIMM]] instead of block-level accesses.
 
 
The quickest way to do this is by simply calling <code>MapViewOfFile()</code>/<code>mmap()</code> which will provide the program with direct load/store accesses. No context switching or interrupts are needed for those accesses. It's worth noting that a small caveat to this is that the system is not required to write the modifications back immediately. 
 
 
To ease software support as well as to reduce code overhead required to take advantage of the persistent memory, NPM introduced the optional support for ''Optimized Flush'', an ability for software to flush persistence directly from userspace, without intervening the kernel. Companies such as [[Intel]] support this through the introduction of new flushing instructions (e.g., see [[x86]]'s {{x86|persistent memory extensions}}).
 
 
{| class="wikitable"
 
! colspan="2" | Flushing APIs
 
|-
 
| Windows || Linux
 
|-
 
| <code>FlushViewOfFile()</code><br><code>FlushFileBuffers()</code>
 
| <code>msync()</code><br><code>fsync()</code>
 
|}
 
 
== Libraries ==
 
* Intel's [https://pmem.io/pmdk/ Persistent Memory Development Kit] (PMDK)
 
  
 
== Documents ==
 
== Documents ==
 
* [https://www.snia.org/sites/default/files/NVMProgrammingModel_v1.pdf NVM Programming Model (NPM), Version 1. 2013.]
 
* [https://www.snia.org/sites/default/files/NVMProgrammingModel_v1.pdf NVM Programming Model (NPM), Version 1. 2013.]
 
== See also ==
 
* x86's {{x86|Persistent Memory Extensions}}
 

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)