This disclosure relates generally to memory systems, and more specifically to systems, methods, and apparatus for page migration in memory systems.
In some embodiments, a heterogeneous memory system may use two or more types of memory, each of which may be adapted for a specific purpose. For example, a heterogeneous memory system may include nonvolatile memory which may retain data across power cycles. As another example, a heterogeneous memory system may include volatile memory which may be updated frequently without lifetime wear limitations.
The above information disclosed in this Background section is only for enhancement of understanding of the background of the invention and therefore it may contain information that does not constitute prior art.
A method for managing a memory system may include monitoring a page of a first memory of a first type, determining a usage of the page based on the monitoring, and migrating the page to a second memory of a second type based on the usage of the page. Monitoring the page may include monitoring a mapping of the page. Monitoring the mapping of the page may include monitoring a mapping of the page from a logical address to a physical address. Determining the usage of the page may include determining an update frequency of the page. Determining the usage of the page may include comparing the update frequency of the page to a threshold. Migrating the page may include sending an interrupt to a device driver. Migrating the page may include setting a write protection status for the page. Migrating the page may further include migrating the page, by a page fault handler, based on the write protection status. Migrating the page, by the page fault handler, may be based on writing the page. The first memory may include a device-attached memory. The device-attached memory may be exposed via a memory protocol. The memory protocol may include a coherent memory protocol. The method may further include storing usage information for the page in the device-attached memory. The page may be migrated by a host, and the method may further include updating, by the host, the usage information for the page based on migrating the page. The first memory may include a nonvolatile memory, and the second memory may include a volatile memory.
A device may include a memory, and a device controller configured to monitor a page of the memory, determine a usage of the page based on the monitoring, and send an indication based on the usage of the page. The device controller may be configured to monitor the page by monitoring a mapping of the page. The device controller may be configured to monitoring the mapping of the page by monitoring a logical address to physical address mapping of the page. The device controller may be configured to determine the usage of the page by determining an update frequency of the page. The device controller may be configured to determine the usage of the page by comparing the update frequency of the page to a threshold. The device controller may be configured to send an interrupt based on the usage of the page. The device may include a storage device, and the memory may include a nonvolatile memory. The memory may be exposed via a memory protocol. The memory protocol may include a coherent memory protocol. The device controller may be configured to store usage information for the page in the memory. The device controller may be configured to receive an update message, and update the usage information based on the update message.
A system may include a host processor, a first memory of a first type arranged to be accessed by the host processor, and a device interface configured to expose a second memory of a second type to the host processor, and migration logic configured to receive a migration message, and migrate a page of the second memory to the first memory based on the migration message. The migration logic may include a device driver configured to receive the migration message. The device driver may be configured to set a write protection status for the page based on the migration message. The device driver may be configured to set the write protection status in a page table entry for the page. The migration logic may include a page fault handler configured to migrate the page from the second memory to the first memory. The migration logic may be configured to send an update message through a device interface based on migrating the page from the second memory to the first memory.
The figures are not necessarily drawn to scale and elements of similar structures or functions may generally be represented by like reference numerals or portions thereof for illustrative purposes throughout the figures. The figures are only intended to facilitate the description of the various embodiments described herein. The figures do not describe every aspect of the teachings disclosed herein and do not limit the scope of the claims. To prevent the drawings from becoming obscured, not all of the components, connections, and the like may be shown, and not all of the components may have reference numbers. However, patterns of component configurations may be readily apparent from the drawings. The accompanying drawings, together with the specification, illustrate example embodiments of the present disclosure, and, together with the description, serve to explain the principles of the present disclosure.
In a heterogeneous memory system in accordance with example embodiments of the disclosure, a memory page may be migrated from a first type of memory (e.g., nonvolatile memory) to a second type of memory (e.g., volatile memory) based on determining a usage pattern for the memory page. For example, usage patterns of one or more pages of the nonvolatile memory may be monitored to identify pages that may be accessed more frequently than other pages. Pages that are determined to be accessed frequently (which may be referred to as hot pages) may be migrated from nonvolatile memory to volatile memory, for example, to reduce page writes (which may increase the lifetime of the nonvolatile memory), to improve system performance (e.g., by balancing loads), and/or the like.
In some embodiments, the first type of memory (e.g., nonvolatile memory) may be implemented as device-attached memory at a storage device such as a solid state drive (SSD). The usage patterns of one or more pages of the device-attached memory may be monitored at the SSD, for example, by monitoring changes in logical-to-physical (L2P) mappings of the memory pages. A specific page may be determined to be a hot page, for example, if the L2P mappings of the specific page are updated more frequently than a threshold level that may be determined, for example, based on an average of some or all pages of the SSD. The SSD may initiate a migration of one or more hot pages, for example, by issuing an interrupt to a device driver at a host.
In some embodiments, a hot page may be migrated from the first type of memory to the second type of memory using a page fault handler. For example, a device driver for a storage device having the device-attached memory may set a write protect status for one or more pages of the first type of memory that have been determined to be hot pages. A subsequent write to one of the write protected pages may cause the page fault handler to migrate the accessed page from the first type of memory to the second type of memory. In some embodiments, a write protect status may be set for a hot page, for example, by setting a write protection bit in a page table entry pointing to the hot page.
In some embodiments, information for monitoring the usage patterns of one or more pages of the device-attached memory may be stored in the device-attached memory. For example, a portion of the device-attached memory may be reserved for a write count or other metric that may be used to determine the usage pattern. The reserved portion may be accessible by the device and/or the host. For example, the device may update a write count for each page when an L2P mapping for the page changes. The host may reset the write count for a page when the page is deallocated and therefore may no longer be used by an application and/or a process at the host.
The device 104 may include a device memory 108. The device 104 may be implemented, for example, as a storage device such as a solid state drive (SSD) in which the device memory 108 may be implemented with nonvolatile memory (NVM) such as NAND flash memory. In other embodiments, however, any other type of device 104 and/or device memory 108 may be used.
The host 102 and device 104 may communicate through any type of interconnect 112 such as Compute Express Link (CXL). The host 102 may access the device memory 108 through the interconnect 112 using any type of protocol. In the embodiment illustrated in
The configuration of components illustrated in
The memory scheme illustrated in
In some embodiments, some or all of the first type of memory 208 may be implemented as device-attached memory, while some or all of the second type of memory 210 may be implemented as system memory. The device-attached memory may be exposed to the host 202 through an interconnect and/or protocol such as the CXL and/or CXL.mem. In some embodiments, the use of a coherent memory protocol such as CXL.mem may enable the device-attached memory to appear as system memory to the host 202. The first type of memory 208 and the second type of memory 210 may be mapped to one or more processes 216 running on the host 202 through a mapping scheme 218.
In the configuration illustrated in
Moreover, because the first type of memory 208 may be implemented as device-attached memory rather than system memory, the host 202 may not have access to information that may affect the lifetime and/or performance of the first type of memory 208. For example, if the device-attached memory 208 is implemented with nonvolatile memory in a solid state drive (SSD), frequent page updates may increase the number of invalid pages which may trigger frequent garbage collection. This, in turn, may reduce the lifetime of the nonvolatile memory. Moreover, frequent page updates may degrade system performance, for example, by increasing tail latency that may occur when an application, after issuing multiple access requests to the device-attached memory 208, may wait for the longest latency request to complete.
Depending on the implementation details, the memory scheme illustrated in
For purposes of illustration, some embodiments may be described in the context of device-attached memory. However, the principles relating to hot page migration may be applied in any memory context in which a hot page may be migrated from a first type of memory to a second type of memory. For example, the principles may be applied to an embodiment in which the second type of memory may be implemented as system memory rather than device-attached memory. Moreover, the principles may be applied to any types of memory having different characteristics that may benefit from migrating one or more pages from one type of memory to another type of memory based on monitoring and determining a usage pattern of the memory.
For purposes of illustration, some embodiments may be described in the context of CXL interfaces and/or protocols. However, embodiments may also be implemented with any other interfaces and/or protocols including cache coherent and/or memory semantic interfaces and/or protocols such as Gen-Z, Coherent Accelerator Processor Interface (CAPI), Cache Coherent Interconnect for Accelerators (CCIX), and/or the like. Other examples of suitable interfaces and/or protocols may include Peripheral Component Interconnect Express (PCIe), Nonvolatile Memory Express (NVMe), NVMe-over-fabric (NVMe-oF), Ethernet, Transmission Control Protocol/Internet Protocol (TCP/IP), remote direct memory access (RDMA), RDMA over Converged Ethernet (ROCE), FibreChannel, InfiniBand, Serial ATA (SATA), Small Computer Systems Interface (SCSI), Serial Attached SCSI (SAS), iWARP, and/or the like, or combination thereof.
The device-attached memory 408 and system memory 410 may be mapped to a process virtual memory 434 using a paging scheme 436 with one or more page tables 438 that may provide a mapping to the device-attached memory 408 and system memory 410. In the example illustrated in
Referring again to
Based on monitoring the L2P mapping 442, the monitor logic 420 may determine that one or more pages 422 of the device-attached memory 408 are hot pages that may be accessed relatively frequently by one or more processes using the process virtual memory 434. Based on this determination, the monitor logic 420 may send a migration signal 424 to the paging scheme 436 that may trigger a migration of the one or more hot pages 422 from the device-attached memory 408 to the system memory 410.
The one or more hot pages 422 may initially be mapped with an original mapping 444 prior to migration. Based on receiving the migration signal 424, the paging scheme 436 may modify the mapping 440 to migrate the one or more hot pages 422 to new locations 428 in the system memory 410 (as shown by arrow 430) using a new mapping 446 after the migration.
The device-attached memory 508 and system memory 510 may be mapped to a first process virtual memory 534 and a second process virtual memory 535 using a paging scheme 536 with page tables 538 and 539 that may provide a mapping to the device-attached memory 508 and system memory 510. The process virtual memories 534 and 535 may be used, for example, by a first process (Process A) and a second process (Process B), respectively, running on a host such as any of the hosts illustrated in
Referring again to
The SSD 532 may include a flash translation layer (FTL) 548 that may map LBAs 550 to PBAs 552 of the one or more flash memory devices 554. The FTL 548 may include monitor logic 520 that may monitor the LBA-to-PBA mappings 556 to determine one or more usage patterns of one or more pages 522 of the device-attached memory 508. For example, the first time a page 522 associated with a specific LBA 550C is written to by a process using one of the process virtual memories 534 and 535, the FTL may map the LBA 550C to a first PBA 552B. The next time the page 522 is written to, the FTL may change the mapping so LBA 550C is mapped to a second PBA 552C. The next time the page 522 is written to, the FTL may again change the mapping so LBA 550C is mapped to a third PBA 552n.
Thus, the monitor logic 520 may determine that one or more pages 522 of the device-attached memory 508 may be hot pages that are frequently accessed. In some embodiments, the monitor logic 520 may monitor some or all of the LBA-to-PBA mappings 556 to establish an average number of mapping updates per page or other metric to determine a usage pattern for pages of the device-attached memory 508. The monitor logic 520 may use the average or other metric as a threshold to which it may compare individual monitored pages. The monitor logic 520 may determine that a specific page is a hot page if the number of LBA-to-PBA mappings 556 for that specific page exceeds the threshold (for example, on a total cumulative basis, during a rolling time window, and/or the like).
When the monitor logic 520 determines that one or more pages 522 of the device-attached memory 508 are hot pages, the monitor logic 520 may trigger a migration by sending a migration message 524 to a device driver 558 for the SSD 532, for example, at a host on which Process A and/or Process B may be running. In the example illustrated in
Based on receiving the interrupt 524, the device driver 558 may begin a process to use a page fault handler 560 to migrate one or more hot pages 522 from the device-attached memory 508 to the system memory 510. In some embodiments, the page fault handler 560 may be implemented as system software (e.g., as a component of an operating system kernel) that may be called when a page fault occurs. Page faults may occur for various reasons. Therefore, based on receiving the interrupt 524, the driver 558 may set a protection bit for a hot page to cause a page fault when an application attempts to access the page.
In some embodiments, a page fault handler 560 may be used to swap pages between system memory 510 and a storage device. For example, if one of Process A or Process B attempts to access a requested page of system memory 510 that has been moved to the storage device, it may generate a page fault. Based on the page fault, the page fault handler 560 may retrieve the requested page from the storage device and swap it into the system memory 510 to make it available to the requesting process.
The embodiment illustrated in
In this example, the device driver 558 may set a write protection status (for example, using a write protection bit) for each hot page 522 in the device-attached memory 508 detected by the monitor logic 520. The write protection status may be set in each of the page tables 538 and 539 as in the page table as shown by arrows 559. This may set a software trap that may be activated when a process attempts to write to one or more of the hot pages 522 that have been write protected. Based on a write attempt to one of the write protected pages 522, the page fault handler may migrate the one or more hot pages 522 from the device-attached memory 508 to one or more new locations 528 in the system memory 510, for example, by moving the page data from the device-attached memory 508 to the system memory 510 as shown by arrow 530 and replacing the original mapping 544 with a new mapping as shown by the dashed lines 546.
In some embodiments, the memory scheme illustrated in
A memory allocator 666, which may be located, for example, at a host, may reset the write count for a page as shown by arrow 668, for example, by sending an update message, when a page is deallocated and therefore may no longer be used by an application and/or a process at the host.
In embodiments in which the device 804 may be implemented as a storage device, the storage device may be based on any type of storage media including magnetic media, solid state media, optical media, and/or the like. For example, in some embodiments, the device 804 may be implemented as an SSD based on NAND flash memory, persistent memory such as cross-gridded nonvolatile memory, memory with bulk resistance change, phase change memory (PCM) and/or the like, and/or any combination thereof. Such a storage device may be implemented in any form factor such as 3.5 inch, 2.5 inch, 1.8 inch, M.2, Enterprise and Data Center SSD Form Factor (EDSFF), NF1, and/or the like, using any connector configuration such as Serial ATA (SATA), Small Computer System Interface (SCSI), Serial Attached SCSI (SAS), U.2, and/or the like. Such a storage device may be implemented entirely or partially with, and/or used in connection with, a server chassis, server rack, dataroom, datacenter, edge datacenter, mobile edge datacenter, and/or any combinations thereof, and/or the like.
Any of the functionality described herein, including any of the host functionality, device functionally, and/or the like described in
The embodiment illustrated in
Some embodiments disclosed above have been described in the context of various implementation details, but the principles of this disclosure are not limited to these or any other specific details. For example, some functionality has been described as being implemented by certain components, but in other embodiments, the functionality may be distributed between different systems and components in different locations and having various user interfaces. Certain embodiments have been described as having specific processes, operations, etc., but these terms also encompass embodiments in which a specific process, operation, etc. may be implemented with multiple processes, operations, etc., or in which multiple processes, operations, etc. may be integrated into a single process, step, etc. A reference to a component or element may refer to only a portion of the component or element. For example, a reference to an integrated circuit may refer to all or only a portion of the integrated circuit, and a reference to a block may refer to the entire block or one or more subblocks. The use of terms such as “first” and “second” in this disclosure and the claims may only be for purposes of distinguishing the things they modify and may not indicate any spatial or temporal order unless apparent otherwise from context. In some embodiments, a reference to a thing may refer to at least a portion of the thing, for example, “based on” may refer to “based at least in part on,” and/or the like. A reference to a first element may not imply the existence of a second element. The principles disclosed herein have independent utility and may be embodied individually, and not every embodiment may utilize every principle. However, the principles may also be embodied in various combinations, some of which may amplify the benefits of the individual principles in a synergistic manner.
The various details and embodiments described above may be combined to produce additional embodiments according to the inventive principles of this patent disclosure. Since the inventive principles of this patent disclosure may be modified in arrangement and detail without departing from the inventive concepts, such changes and modifications are considered to fall within the scope of the following claims.
This application claims priority to, and the benefit of, U.S. Provisional Patent Application Ser. No. 63/195,708 titled “Systems, Methods, and Devices for Page Migration in Memory Systems” filed Jun. 1, 2021 which is incorporated by reference.
Number | Date | Country | |
---|---|---|---|
63195708 | Jun 2021 | US |