In some cases, a system may maintain an indirection table to facilitate the use of a non-volatile memory as a storage device. For example, an indirection table might be used to facilitate the use of a NAND storage element and, in particular, an appropriate recovery of a memory state of the NAND storage element after a power loss event.
In order to recover an appropriate memory state of the non-volatile memory (e.g., after a power loss event), the system may need to re-create the indirection table. This process, however, can take a considerable amount of time. For example, it might take several minutes to recreate an indirection table associated with a 10 Gigabyte (GB) NAND storage element. Moreover, periodically saving the entire indirection table, such as an 8 Megabyte (MB) indirection table, may degrade the performance of the system and/or result in Quality of Service (QOS) and other issues associated with the non-volatile memory.
In some cases, the system may maintain an indirection table 125 (e.g., in the volatile memory) to facilitate the use of a non-volatile memory 110 as a storage device. For example, the indirection table 125 may represent a mapping of logical addresses to physical addresses in connection with sized portions 115 of the non-volatile memory 110. In order to recover an appropriate memory state of the non-volatile memory 110 (e.g., after a power loss event), the system 100 may need to re-create the indirection table 125. This process, however, can take a considerable amount of time.
By way of example only, some embodiments herein are associated with systems and methods associated with NAND management software (including firmware) that use the indirection table 125 to recover an appropriate state after a “power loss event” (e.g., an unexpected power loss or crash). Note that some embodiments are described in connection with a NAND page level indirection system. In this case, a NAND erase block may contain physical NAND pages that are to be erased together.
After a power loss event, the system 100 may reads metadata for each indirection table entry sized portion of a NAND memory (e.g., a NAND page or a NAND erase block) to recover the state of the indirection table 125. While this process may be relatively quick for erase block indirection systems (e.g., a NAND thumb drive), it might take several minutes to recover an indirection system for implementations that use page-level indirection systems and/or large NAND capacities. Recovering the indirection table 125 may be slow, for example, because of a need to read every NAND page on a NAND device.
According to some embodiments, a runtime component may be provided to log delta information. Moreover, some embodiments include power fail recovery code that uses saved delta information after a power loss event. Both of these components may, for example, use a data structure referred to herein as a “delta checkpoint,” which might include a record (e.g., in the last page of an erase block) of the indirection system updates for the NAND pages in that erase block.
By way of example,
The metadata 230 for the checkpoint page may include a unique signature (e.g., a special logical address) that identifies the page as a delta checkpoint page. Note that, according to some embodiments, the signature may be omitted if a strict write ordering policy is observer (e.g., to ensure that only delta checkpoint data is to be written to the pages scanned). Moreover, according to some embodiments, a sequence number is included in the metadata for the checkpoint page to help determine an order which the erase blocks were written.
At 302, an indirection table associated with sized portions of a non-volatile memory is maintained. The indirection table may, for example, include a mapping of logical-to-physical addresses. According to some embodiments, the non-volatile memory comprises a NAND memory and the sized portions are pages of the NAND memory.
At 304, delta information may be stored in the non-volatile memory. The delta information may be, for example, associated with updates to the indirection table in connection with a plurality of the sized portions of the non-volatile memory. For example, when the non-volatile memory is a NAND memory and the sized portions are pages that include user data and metadata, the plurality of pages might represent an erase block.
According to some embodiments, the delta information is a delta checkpoint page that includes (i) data for the delta checkpoint page and (ii) metadata for the delta checkpoint page. For example, the data for the delta checkpoint page may indicate a logical address for each page in the erase block. The data for the delta checkpoint page may further include, according to some embodiments, a bitmask of erased blocks. The metadata for the delta checkpoint page may include, for example, a logical address identifying the page as a delta checkpoint page along with a master sequence number.
By way of example, during run time a next erase block to be written to may be selected. Because of NAND properties, an erase block may need to be erased before it can be written and the pages within the erase block might need to be written in order (e.g., first page 0, then page 1, then page 2). When the new erase block is selected, a delta checkpoint entry may be initialized in system memory, such as Dynamic Random Access Memory (DRAM) or Static Random Access Memory (SRAM), to track the logical address for all writes to that particular erase block. As each physical page is written in the erase block, the logical address for the physical page may be saved into the volatile delta checkpoint for the corresponding physical page. After all 63 pages of user data have been written, the volatile delta checkpoint data may be written to the last physical page of the erase block, including a sequence number in the atomic metadata that is greater than or equal to the largest sequence number in the user data portion of the erase block (e.g., page 62).
If no power loss event is detected at 306, the process may continue to maintain the indirection table at 302 (periodically storing delta information as appropriate).
When a power loss event is detected at 306, the system may begin a recovery process. In particular, the delta information may be read from the non-volatile memory and the indirection may be re-created (e.g., based at least in part on delta information) at 308. The memory state associated with the non-volatile may then be recovered at 310 in accordance with the re-created indirection table.
Thus, after a power loss event (e.g., an unexpected power loss), the indirection table may be recovered. Note that the data stored in the last page of an erase block (that erase block's delta-checkpoint) may contain the elements of the metadata stored in all the pages of that erase block that are needed to recover the indirection table. Thus, the read of the delta checkpoint may eliminate the need to read all the pages' metadata in the erase block. In the example of
After the appropriate data is read, the system may rebuild the indirection table based on the delta information:
Finally, the re-creation of the indirection table may be completed based on the “atomic” metadata associated with recent changes to the non-volatile memory:
Note that after a power failure, NAND management software might be unable to detect whether or not an erase block is erased. As a result, the system may re-erase potentially already-erased erase blocks. Such an approach may increase latency time associated with a re-boot/recovery process. To reduce latency, an erased erase block bitmask may be included with every delta checkpoint reflecting which NAND erase blocks are actually erased. During the power fail recovery process, the system may then update a “master” bitmask with the data found in the delta checkpoint (e.g., in a way similar to way a sequence number is handled). When finished, the “master” bitmask may reflect which erase blocks are actually erased (and do not need to be erased again).
According to some embodiments, it may be desirable to write to multiple erase blocks at one time and/or to relax write ordering rules. Note that the example described with respect to
Thus, embodiments described herein may provide systems and methods to reduce power fail recovery time. Such approaches may, for example, avoid the need for multi-minute recovery times that could be associated with a 16 GB NAND device after an unexpected power loss. For example, such recovery times might be reduced to less than five seconds for a similar non-volatile memory device. Moreover, embodiments described herein may reduce runtime latency for each checkpoint event because the delta checkpoint may only contain a relatively small amount of data (e.g., less than a single NAND page). Because the delta checkpoint is relatively small, the system may be able write the information in a few hundred microseconds (e.g., causing only a minor impact to latency and QOS metrics).
The following illustrates various additional embodiments. These do not constitute a definition of all possible embodiments, and those skilled in the art will understand that many other embodiments are possible. Further, although the following embodiments are briefly described for clarity, those skilled in the art will understand how to make any changes, if necessary, to the above description to accommodate these and other embodiments and applications.
For example, although some embodiments have been described with respect to NAND memory, note that embodiments may be associated with any other type of memory. Moreover, other elements of data and/or metadata may be provided instead of, or in addition to, those described herein.
In addition, note that the concept of an erase block can, according to any of the embodiments described herein, span multiple erase blocks. For example,
The several embodiments described herein are solely for the purpose of illustration. Persons skilled in the art will recognize from this description other embodiments may be practiced with modifications and alterations limited only by the claims.
The present application is a continuation of co-pending U.S. patent application Ser. No. 12/345,997 entitled “DELTA CHECKPOINTS FOR A NON-VOLATILE MEMORY INDIRECTION TABLE” filed Dec. 30, 2008. The entire contents of that application are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 12345997 | Dec 2008 | US |
Child | 13084890 | US |