This invention generally relates to data storage techniques for a solid state drive (SSD).
SSDs typically include non-volatile flash-based memory, such as NAND flash memory devices, a volatile memory buffer, such as DRAM and/or SRAM, and a memory controller communicatively coupled to the non-volatile flash-based memory and the volatile memory buffer. The NAND flash memory devices are subdivided into distinct areas for storing user data, which is received from an external host device via a host interface on the SSD, and system data, which is generated internally by the memory controller. User data and system data are stored in different formats, and certain parts of the system data are written less frequently than user data. Therefore user data and system data must be handled differently. Two different algorithms are used by the memory controller to write user data and system data. Processes for data management, including garbage collection, error correction, and wear leveling, are also performed using two different algorithms for user data and system data.
The need for parallel and duplicative algorithms for writing and processing user data and system data presents a number of issues. The use of two different algorithms slows down the SSD development process because each algorithm must be independently developed, debugged, and deployed. The use of two different algorithms also slows the performance of the SSD because the memory controller must differentiate between user data and system data when implementing processes for data management.
There is, therefore, an unmet demand for data storage techniques for SSDs that allow a single algorithm to be used for processing both user and system data.
In one embodiment, an SSD includes a memory controller, one or more NAND flash memory devices communicatively coupled to the memory controller, and a host interface communicatively coupled to the memory controller. In one embodiment, the memory controller is configured to write both a user data received via the host interface and a system data generated by the memory controller to one or more blocks of the NAND flash memory devices such that the one or more blocks contain both user data and system data.
In one embodiment, the memory controller is further configured to divide the system data into one or more segments having a uniform size. The memory controller is further configured to append a header to each segment of system data before writing the system data to the one or more blocks of the NAND flash memory devices. In one embodiment, the header includes at least one of a logical address associated with a segment of user or system data, a time stamp, and a valid bitmap status.
In one embodiment, the NAND flash memory devices are configured to store user data and system data in one or more segments, each segment of user data and each segment of system data having a physical address location on the NAND flash memory devices and a logical address comprising a namespace identifier indicating a namespace and a logical block within the namespace. In one embodiment, the memory controller is further configured to assign a namespace identifier to each segment of system data.
In one embodiment, the system data includes at least one of a bad sector list, a debug log, and firmware. In another embodiment, the system data includes a user logical-to-physical (User L2P) table translating logical addresses of one or more segments of user data to physical address locations. In one embodiment, the User L2P table includes a first map translating the namespace identifier of each of the one or more logical address to a starting segment of user data on the one or more NAND flash memory devices, and a second map translating the logical block of each of the one or more logical address to a segment of user data on the one or more NAND flash memory devices.
In one embodiment, the memory controller is further configured to write a system logical-to-physical (System L2P) table translating logical addresses of one or more segments of system data to one or more physical address locations of the segments of system data on the NAND flash memory devices. In one embodiment, the System L2P table includes a first map translating the namespace identifier of each of the one or more logical addresses to a starting segment of system data on the one or more NAND flash memory devices, and a second map translating the logical block of each of the one or more logical addresses to a segment of system data on the one or more NAND flash memory devices.
In one embodiment, the one or more NAND devices includes a reserved area. In one embodiment, the memory controller is further configured to write the System L2P to the reserved area when the SSD experiences a power loss or other failure event.
In one embodiment, a method of writing user data and system data to one or more NAND flash memory devices communicatively coupled to a memory controller within an SSD includes receiving the user data via a host interface communicatively coupled to the memory controller. The method further includes generating the system data with the memory controller. The method further includes writing both the user data and the system data to one or more blocks of the NAND flash memory devices such that the one or more blocks contain both user data and system data.
In one embodiment, the method further includes dividing the system data into one or more segments having a uniform size. The method further includes appending a header to each segment of system data before writing the system data to the one or more blocks of the NAND flash memory devices. In one embodiment, the header includes at least one of a logical address associated with a segment of user or system data, a timestamp, and a valid bitmap status.
In one embodiment, the method further includes writing the user data and system data in one or more segments, each segment of user data and each segment of system data having a physical address location on the NAND flash memory devices and a logical address comprising a namespace identifier indicating a namespace and a logical block within the namespace. The method further includes assigning a namespace identifier to each segment of system data before writing both the user data and the system data to one or more blocks of the NAND flash memory devices such that the one or more blocks contain both user data and system data.
In one embodiment, the system data includes at least one of a bad sector list, a debug log, and firmware. In another embodiment, the system data includes a User L2P table translating logical addresses of one or more segments of user data to physical address locations. In one embodiment, the User L2P table includes a first map translating the namespace identifier of each of the one or more logical addresses to a starting segment of user data on the one or more NAND flash memory devices, and a second map translating the logical block of each of the one or more logical addresses to a segment of user data on the one or more NAND flash memory devices.
In one embodiment, the method further includes writing to the NAND flash memory devices a System L2P table translating logical addresses of one or more segments of system data to one or more physical address locations of the segments of system data on the NAND flash memory devices. In one embodiment, the System L2P table includes a first map translating the namespace identifier of each of the one or more logical addresses to a starting segment of system data on the one or more NAND flash memory devices, and a second map translating the logical block of each of the one or more logical addresses to a segment of system data on the one or more NAND flash memory devices.
In another embodiment, the method further includes writing the System L2P to a reserved area on the NAND flash memory devices when the SSD experiences a power loss or other failure event.
The SSD 100 includes a memory controller 102 in communication with a DRAM 108, an SRAM 109, and an array of NAND flash memory devices 104a-f. The memory controller 102 manages the writing, reading, and erasing of data stored on the NAND flash memory devices 104a-f of the SSD 100, and facilitates communication with the host device over the host interface 106. The memory controller 102 receives user data from a host device via the host interface 106. The memory controller 102 also internally generates system data. In one embodiment, the firmware of the memory controller 102 implements various data management processes on the data stored on the NAND flash memory devices 104a-f, including garbage collection, error correction, and wear leveling. The memory controller 102 may use DRAM 108 and SRAM 109 as buffers for storing data, for performing error correction parity encoding, and the like.
The NAND flash memory devices 104a-f are arranged in two channels 103 and 105 in communication with the memory controller 102. While six NAND flash memory devices 104a-f are shown in the SSD 100 in
The NAND flash memory devices 104a-f include one or more blended data blocks storing a combination of user data and system data in the same format. In one embodiment, the NAND flash memory devices 104a-f also include a reserved area to which the memory controller 102 does not write data during regular operation of the SSD 100. The reserved area of the NAND flash memory devices 104a-f is used to store critical data structures when the SSD 100 experiences a power loss or other failure, as described below in connection with
The memory controller generates system data 212. In one embodiment, the system data 212 includes a User L2P table 212a which translates the logical addresses of user data to the physical address locations of the user data in the NAND flash memory. The User L2P table 212a includes a first map and a second map. The first map translates the namespace identifier of each of the logical addresses of user data to the physical address location of the starting segment of the namespace. The second map translates the logical block of each of the logical addresses of user data to the physical address location of the logical block in the NAND flash memory. The memory controller uses the User L2P table 212a to perform data management processes on the user data, including garbage collection, error correction, and wear leveling.
In one embodiment, the system data 212 also includes a physical-to-logical (P2L) table (not shown). The P2L table is the reverse mapping of the User L2P table and translates the physical address locations of the user data in the NAND flash memory to the logical addresses of the user data. The P2L table includes a map that translates one or more physical address locations in the NAND flash memory to a logical address associated with a user or system data stored in the physical address location.
In one embodiment, the system data 212 includes a bad sector list 212b, a record of the physical address locations on the NAND flash memory that may be permanently damaged or otherwise unwriteable. In one embodiment, the system data 212 includes a debug log 212c, a record of actions performed by the SSD and errors that occurred during operation of the SSD for debugging purposes. In one embodiment, the system data includes firmware for the memory controller (not pictured).
To make the system data 212 look like user data 210a-d when it is stored on the blended data block 216, the memory controller divides the system data 212 into one or more equal-sized segments of system data 213a-c. Each segment of system data 213a-c contains 4 KiB, the same size as the segments of user data 210a-d. While three 4 KiB segments of system data 213a-c are shown on the blended data block 216 in
The memory controller also structures each segment of system data 213a-c to look like a segment of user data by appending a header (not shown) to the segment of system data before writing it to the blended data block 216. The appending of the header to the segment of system data 213a-c is shown and described in connection with
After the memory controller has altered the system data 212 to look like user data 210a-d by dividing the system data 212 into equal-sized segments and appending a header to each segment of system data 213a-c, the segments of system data 213a-c are written to the blended data block 216, where the segments of system data 213a-c are blended with the user data 210a-d. In this manner, the memory controller does not need to set aside a distinct area on the NAND flash memory for system data storage because the system data 213a-c is stored in the same format as user data 210a-d on a blended data block containing both user and system data.
In another embodiment, the memory controller generates a System L2P table (not shown), which is the complement to the User L2P table 212a. The memory controller generates a logical address for each segment of system data 213a-c stored in the NAND flash memory for internal use, as described below in connection with
The System L2P table may be stored in a distinct area of the NAND flash memory. The System L2P table is very small in relation to the size of the system data. For example, in one embodiment, the system data 213a-c comprises approximately 800 mebibytes (800 MiB), while the System L2P table is approximately 800 KiB or 1/1024th of the size of the system data 213a-c. The memory controller uses the System L2P table to perform data management processes on the system data 213a-c, including garbage collection, error correction, and wear leveling, and to read the User L2P table on the NAND flash memory for performing the same date management processes on the user data 210a-d.
In one embodiment, the System L2P table and the User L2P table can be a unified L2P table. As explained in greater detail below, once system data is written to the NAND flash memory, data management can be performed on the data on the NAND flash memory without distinction as to system or user data.
In another embodiment, when the SSD experiences a power loss or other failure, the memory controller is configured to rewrite the System L2P table to the reserved area of the NAND flash memory. The reserved area of the NAND flash memory ordinarily does not store data, as discussed above in connection with
In another embodiment, the header 320 includes a timestamp. In another embodiment, the header 320 includes a valid bitmap status. The information included in the header 320 is not limited to the information shown in
The segment of user data is further divided into five subdivisions known as sectors 322, Sector 0 through Sector 4. While five sectors 322 are shown within the segment of user data in
In one embodiment, each logical address includes a namespace identifier and a logical block within that namespace as described above in connection with
In another embodiment, the header 321 includes a timestamp. In another embodiment, the header 321 includes a valid bitmap status. The information contained in the header 321 is not limited to the information shown in
The segment of system data on the NAND flash memory device is further divided into five subdivisions known as sectors 330, sector A to sector E. While five sectors 330 are shown within the segment of system data in
Because the user data 434 and system data 436 are stored together in the blended data block 432 on the NAND flash memory device, and the system data 436 has been divided into segments and appended with a header 420 to look like user data 434, the memory controller can use the same algorithms to implement data management processes on the user data 434 and system data 436. The memory controller does not distinguish between user data 434 and system data 436 when running these algorithms.
In one embodiment, the memory controller implements wear leveling on one or more blended data blocks 432 of user data 434 and system data 436 stored in the NAND flash memory. When a blended data block 432 is rewritten, both the user data 434 and the system data 436 on the blended data block 432 are rewritten to a new physical location. Therefore, all of the one or more blended data blocks 432 are maintained at a similar number of P/E cycles at any given time. Because each blended data block 432 is at a similar number of P/E cycles, the memory controller does not need to use a different wear leveling algorithm for certain data blocks that are at a lower number of P/E cycles. The memory controller implements a single algorithm for wear leveling of all of the one or more blended data blocks 432 in the NAND flash memory.
Other objects, advantages and embodiments of the various aspects of the present invention will be apparent to those who are skilled in the field of the invention and are within the scope of the description and the accompanying Figures. For example, but without limitation, structural or functional elements might be rearranged, or method steps reordered, consistent with the present invention. Similarly, principles according to the present invention could be applied to other examples, which, even if not specifically described here in detail, would nevertheless be within the scope of the present invention.