Memory devices are used to store data. For example, data centers may use memory devices to store large amounts of data. The performance of the data centers may rely heavily on the performance of these memory devices. One particular type of memory, byte-addressable non-volatile memory, may allow users to quickly access data and allow the data to remain on the memory device after power is removed from the memory device.
The accompanying drawings illustrate various examples of the principles described herein and are a part of the specification. The illustrated examples do not limit the scope of the claims.
Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
As described above, data centers, among other entities, may process large amounts of data and may use memory systems to store the data. Byte-addressable non-volatile memory may be used because it exhibits properties of volatile and non-volatile memory. For example, byte addressable non-volatile memory may exhibit speeds comparable to volatile memory and may also have the ability to retain the data after power is removed from the system comparable to non-volatile memory. Using byte-addressable non-volatile memory, an application may store user-defined data structures in non-volatile memory, process large amounts of data with low latency and high bandwidth and allow large and complex data structures to be readily accessed. However, updating non-volatile memory may corrupt the data in the non-volatile memory due to failures, memory leaks, or application bugs.
Accordingly, persistent memory may be used to preserve the data. High performance persistent memory may be beneficial in that it allows large and complex data structures to be readily accessible when a program starts or after a system or program reboot. Such access may improve system performance, especially in data centers that include large scale in-memory data structures. Some persistent memory is versioned which may preserve the integrity of data in the face of system crashes due to power outages and kernel panics, among other causes. While many high performance persistent memory systems may be beneficial, there are many complications that make persistent memory slow, inefficient, and hard to design for.
For example, current methods rely on complex mechanisms for establishing persistence in memory. These mechanisms may be very complicated and may impose high performance costs and may have considerable overhead in terms of performance and power consumption. More specifically, multi-versioned data structures may use a copy-on-write approach to store updates in a temporary data buffer which may include changes to operating systems, runtime engines, or combinations thereof to manage the metadata. The systems and methods described herein may be beneficial in that they may be implemented with few modifications to existing operating systems, processor architectures, and memory architectures.
Accordingly, the present disclosure describes systems and methods for mapping virtual memory pages to physical memory pages. As will be described below, in non-volatile memory, a set of shadow or secondary physical memory pages may be established that are linked to a first or original physical memory page. When a transaction that includes a number of updates is requested to be made to the data in the original physical memory page, the transaction may be performed to the data in the shadow physical memory page. When all updates in the transaction have been made, the shadow physical memory page may be designated as the page having the latest version of the data. In other words, from a programmer's perspective, each memory update is performed to a physical memory page corresponding to a virtual memory page. However, the updates are actually directed to different locations on a physical memory device (e.g., the original physical memory page or the shadow physical memory page) depending on a trigger by the hardware, which trigger is based on which of the original page or the shadow page has the latest version of the data.
The present disclosure describes a method for mapping virtual memory pages to physical memory pages. The method may include receiving a mapping of a virtual memory page to multiple physical memory pages. The method may also include detecting a request for a transaction to be performed on data contained in the multiple physical memory pages. The transaction may include a number of data updates. The method may also include determining which of the multiple physical memory pages contains a latest version of the data. The method may further include updating a physical memory page by performing the transaction within a physical memory page of the multiple physical memory pages that does not contain the latest version of the data. The method may further include updating an indication of which of the multiple physical memory pages contains the latest version of the data.
The present disclosure describes a system for mapping virtual memory pages to physical memory pages. The system may include a processor. The system may also include memory communicatively coupled to the processor. The system may also include a version controller. The version controller may include a page descriptor module to receive a mapping of a virtual memory page to multiple physical memory pages. The version controller may include a version indicator table to indicate which of the multiple physical memory pages contains a latest version of data represented by the virtual memory page. The version controller may include a request buffer to perform a number of updates on one of the multiple physical memory pages. The version controller may also include a table update module to update the version indicator table after one of the multiple physical memory pages has been updated.
The present disclosure describes a computer program product for mapping virtual memory pages to physical memory pages. The computer program product includes a computer readable storage medium including computer usable program code embodied therewith. The computer usable program code includes computer usable program code to, when executed by a processor, detect a number of updates to be performed on data contained in multiple physical memory pages, identify a master page of the multiple physical memory pages, in which the master page contains the latest version of the data, and perform the data updates on a shadow page, in which a shadow page is a page of the multiple physical memory pages that does not contain the latest version of the data, and update an indication of which of the multiple physical memory pages contains the latest version of the data.
As used in the present specification and in the appended claims, the term “persistent memory” may include memory that is atomic, consistent, isolated, and durable.
Further, as used in the present specification and in the appended claims, the term “atomic,” “atomically,” “atomicity,” or similar terms may refer to a transaction where all the operations occur, or none of the operations occur. For example, an atomic update transaction may be a transaction where all updates that make up the transaction are performed, or none of the updates are performed. As will be described below, atomicity may be provided by the version controller.
Still further, as used in the present specification and in the appended claims, the term “consistent,” “consistency,” or similar terms may refer to a transaction that operates between a number of defined operable states and ensures that data is valid in each state. For example, update operations performed out of order where one of the updates has been performed and another has not been performed may lead to inconsistent memory. Consistency may be provided by an operating system.
Still further, as used in the present specification and in the appended claims, the term “isolation” may refer to a property of memory that a transaction does not affect concurrent transactions. Isolation may be provided by an operating system.
Still further, as used in the present specification and in the appended claims, the term “durable,” “durability,” or similar terms may refer to a property of memory wherein data is retained in a state even after a power loss, crash or error. For example, updates may be installed in non-volatile memory. As will be described below, durability may be provided by the versioned memory system described below which may include non-volatile memory.
Still further, as used in the present specification and in the appended claims, the term “latest version of the data” may refer to a version of the data that corresponds to a current transaction. For example, data may exist in a tenth version. However, a current transaction may treat the fifth version as the latest version of the data.
Even further, as used in the present specification and in the appended claims, the term “a number of” or similar language may include any positive number including 1 to infinity; zero not being a number, but the absence of a number.
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present systems and methods. It will be apparent, however, to one skilled in the art that the present apparatus, systems, and methods may be practiced without these specific details. Reference in the specification to “an example” or similar language means that a particular feature, structure, or characteristic described is included in at least that one example, but not necessarily in other examples.
Turning now to the figures,
Further, the system (100) may be utilized within a single computing device. In this data processing scenario, a single computing device may utilize the hierarchical dictionary and other associated methods described herein to scan, store, and/or transmit compressed versions of single or multi-page documents.
To achieve its desired functionality, the system (100) comprises various hardware components. Among these hardware components may be a number of processors (101), a number of network adapters (104), and a number of peripheral device adapters (105). These hardware components may be interconnected through the use of a number of busses and/or network connections. In one example, the number of busses that interconnect one or more of these devices may be represented by the reference numeral (108). In other words, the reference numeral (108) may designate a connection and may not indicate a particular number of connections. For example, memory (106, 107) may be connected to one or more other elements of the system (100) and may use a bus distinct from a bus used by the peripheral device adapters (105) to communicate with other elements of the system (100).
The processor (101) may include the hardware architecture to retrieve executable code and execute the executable code. The executable code may, when executed by the processor (101), cause the processor (101) to implement at least the functionality of establishing atomicity and durability using a versioned memory design, according to the methods of the present specification described herein. In the course of executing code, the processor (101) may receive input from and provide output to a number of the remaining hardware units.
The system (100) may store data such as executable program code that is executed by the processor (101) or other processing device. As will be discussed, the system (100) may specifically store a number of applications that the processor (101) executes to implement at least the functionality described herein.
The system (100) may include various types of memory modules, including volatile memory (106) and non-volatile memory (107). In some examples, the non-volatile memory (107) may be byte-addressable non-volatile memory (107). In other examples, the systems and methods described herein may be implemented with other types of durable memory and storage devices such as hard disk drives (HDD) and solid state drives (SSD). An example of volatile memory (106) may include Dynamic Random Access Memory (DRAM) in a dual in-line memory module (DIMM). An example of non-volatile memory (107) may include Read Only Memory (ROM), and Hard Disk Drive (HDD) memory. Similarly, the non-volatile memory (107) may be dual in-line memory modules (DIMMs). Many other types of memory may also be utilized, and the present specification contemplates the use of many varying type(s) of memory in the system (100) as may suit a particular application of the principles described herein. In certain examples, different types of memory in the system (100) may be used for different data storage needs.
Generally, the system (100) may comprise a computer readable medium, a computer readable storage medium, or a non-transitory computer readable medium, among others. For example, the system (100) may include an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium may include, for example, the following: an electrical connection having a number of wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In another example, a computer readable storage medium may be any non-transitory medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The hardware adapters (105) in the system (100) enable the processor (101) to interface with various other hardware elements, external and internal to the system (100). For example, peripheral device adapters (105) may provide an interface to input/output devices, such as, for example, display device (109) or access other external devices such as an external storage device (110). The display device (109) may be provided to allow a user to interact with and implement the functionality of the system (100). The peripheral device adapters (105) may also create an interface between the processor (101) and a printer, the display device (109), or other media output device. The network adapter (104) may provide an interface to other computing devices within, for example, a network, thereby enabling the transmission of data between the system (100) and other devices located within the network.
The processor (101) may include a number of memory controllers (102) that control the memory (106, 107) of the system (100). The processor (101) may include a memory controller (102) for individual instances of memory (106, 107). For example a first memory controller (102) may control the volatile memory (106) and a second memory controller (102) may control the non-volatile memory (107).
In some examples, the memory controller (102) may include a version controller (103) that manages the updating of physical memory pages. For example, the version controller (103) may receive a mapping of a virtual memory page to multiple physical memory pages such as a master physical memory page and a shadow memory page. The version controller (103) may also indicate which of the multiple physical memory pages contains the latest version of the data, via a version indicator table for example. In other words, the version controller (103) may indicate which of the multiple physical memory pages contains a version of the data that corresponds to a transaction currently being performed. The version controller (103) may update the version indicator table to reflect changes in which of the multiple physical memory pages contains the latest version of the data. The version controller (103) may also include a request buffer that performs updates on the data contained in the multiple physical memory pages. More detail concerning the functionality of the version controller (103) is given below in connection with at least
As indicated in
An example of receiving (block 201) a mapping is given as follows. In this example, an operating system may generate a mapping from a virtual memory location to the data location in multiple physical memory pages. More specifically, the version controller (
The version controller (
The transaction may be an atomic transaction. As described above, an atomic transaction may refer to a transaction where all the operations are performed, or none of the operations are performed. Accordingly, an atomic transaction request may be completed when all the updates that make up the transaction are completed. By comparison, an atomic transaction may fail if less than all of the updates that make up the transaction are completed.
The version controller (
The version controller (
As described above, the transaction may be an atomic transaction such that the transaction is not completed until all the data updates in the transaction are completed. Accordingly, once all the data updates are completed, the atomic transaction may be committed and the version controller (
The version controller (
Performing a transaction on a physical memory page that does not contain the latest version of the data may be beneficial in that a version of the data is maintained such that if the update fails due to power failure, kernel panic, or a crash, among other failures, the system (
In one example, multiple virtual memory pages, or blocks pertaining to multiple virtual memory pages may be grouped together and mapped to one physical memory page. An example is given as follows. In this example, an application may request a transaction for blocks of memory in two virtual memory pages. More specifically, an application may request an update to a first block of a first virtual memory page and an update to a first block of a second virtual memory page. Performing the transaction on multiple physical memory pages may be inefficient as part of the data of a multiple physical memory page that may be updated. In this example, an operating system may generate a mapping of the multiple virtual memory pages to a single physical memory page. For example, a first portion of the single physical memory page may correspond to the first block of the first virtual memory page, and a second portion of the single physical memory page may correspond to the first block of the second virtual memory page. Mapping multiple virtual memory pages to a single physical memory page may be beneficial in that the amount of memory space for maintaining multiple versions of data can be reduced when applications make sparse persistent changes on large data structures.
When mapping multiple virtual memory pages to a single physical memory page, multi-versioning the single physical memory page may also be performed to maintain the shadow (315) physical memory page properties. In this example, the single physical memory page may be a group of physical memory segments. For example, a first physical memory segment may act as a main page for the multiple virtual pages, and a second physical memory segment may be a shadow page of the group of virtual pages.
Each of the master physical memory pages (314) and the shadow physical memory pages (315) may contain different versions of the data. For example, the master physical memory pages (314) may contain original data and the shadow physical memory pages (315) may contain the original data plus an update. Storing different versions of the data in different locations in physical memory may be beneficial in that if an update being performed on data in the shadow physical memory pages (315) fails, the system (
An example of a mapping from a virtual memory page to multiple physical memory pages and the performance of a transaction are given as follows. In this example, the version controller (303) may receive a mapping function (311). For example, as described above, an operating system may allocate space on a physical memory system for data represented in the virtual memory page to be stored. In other words, the version controller (303) may receive an indication of multiple sets of pages that may be allocated for physical storage of the data. Using this information, the version controller (303) may maintain a record of which of the physical memory pages (314, 315) contain the latest version of the data.
The version controller (303) may also receive a request (312) to perform a transaction. For example, the version controller (303) may receive a request (312) to perform a number of updates to data stored in the physical memory pages (314, 315). Based on the request (312) and the mapping function (311), the version controller may identify which of the master physical memory pages (314) and the shadow physical memory pages (315) contain the latest version of the data. The version controller (303) may then perform a transaction (313) on the physical memory page that does not contain the latest version of the data. While
In generating and sending the mapping, an operating system may rely on a virtual memory manager to generate the physical memory pages (
After initializing (block 404) the number of shadow physical memory pages (
The version controller (
In another example, the version controller (
The version controller (
The version controller (
In some examples, one or more of the steps may be repeated for various updates or transactions. For example, after performing (block 408) the transaction, a subsequent request for a transaction may be detected (block 405). In this example, the version controller (
As described above, the transaction (
If the number of updates that are included in a transaction have not been completed, indicating that the transaction has failed (block 409, decision YES), the version controller (
By comparison, if the number of updates that are included in a transaction have been completed, the transaction may be successful (block 409, decision NO). In this example, the transaction may be committed, and the version indicator table may be updated (block 411). In other words, the version controller (
While
The version controller (503) also may include a version indicator table (518) that indicates which of the multiple physical memory pages (
The version controller (503) also may include an address calculator (517) that computes the true physical address of the data. The address calculator (517) may receive the request for a transaction to be performed on data. The address calculator (517) may compute the true physical address of the data based on the mapping functions (511) in the page descriptors (516) and the memory address in the request (512).
The memory request scheduler (519) may schedule transactions (513) to be performed on a physical memory page (
As described earlier, after a transaction (
While
Methods and systems for establishing atomic and durable memory using a versioned memory design may (1) provide atomicity and durability without explicitly writing multi-versioning procedures; (2) facilitate simple and intuitive interfaces that may support various applications and memory updates; (3) eliminate redundant writes to temporary data buffers and central processing unit (CPU) cache; (4) scale and implement atop existing servicer and data center designs; (5) alleviate bandwidth pressure of the memory bus; and (6) enable persistent memory without over-committing memory resources and capabilities.
The preceding description has been presented to illustrate and describe examples of the principles described. This description is not intended to be exhaustive or to limit these principles to any precise form disclosed. Many modifications and variations are possible in light of the above teaching.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2013/067239 | 10/29/2013 | WO | 00 |