HOST-CONTROLLED FLASH TRANSLATION LAYER SNAPSHOT
A flash translation layer (FTL) map stored in the non-volatile portion of a solid-state drive is updated when a firmware flag indicates the contents of this FTL map are not consistent with the contents of an FTL map stored in a volatile memory device of the SSD (e.g., the drive DRAM). Given this flag indication, the solid-state drive may copy the contents of the FTL map stored in the drive DRAM to the non-volatile portion of the SSD under various circumstances, including when a host command to flush the updated data structure is received, when a link state between the data storage device and the host changes, when a power connection to the data storage device is broken, or upon receiving a host command to go into a sleep state or a lower power state.
1 . A data storage device comprising:
a non-volatile solid-state storage device;
a volatile solid-state memory device configured to store a data structure that maps logical block addresses stored in the data storage device to respective physical memory locations in the non-volatile solid-state storage device; and
a controller configured to: (i) upon updating the data structure, determine whether a host command to flush the updated data structure has been received, and (ii) if the host command to flush the updated data structure has been received, copy the contents of the updated data structure into the non-volatile solid-state device.
2 . The data storage device of claim 1 , wherein the controller is further configured to, upon updating the data structure, update a flag to indicate that the contents of the data structure are not consistent with the contents of a corresponding data structure stored in the non-volatile solid-state device.
3 . The data storage device of claim 1 , wherein the physical memory locations respectively store data associated with a respective logical block address stored in the data storage device.
4 . The data storage device of claim 1 , wherein the controller is further configured to, upon updating the data structure:
determine whether a link state between the data storage device and a host has changed, and
if the link state between the data storage device and the host has changed, copy the contents of the updated data structure into the non-volatile solid-state device.
5 . The data storage device of claim 4 , wherein the link state between the data storage device and the host is broken.
6 . The data storage device of claim 1 , wherein the controller is further configured to, upon updating the data structure:
receive a host command to go into a sleep state or a lower power state, and
upon receiving the host command to go into the sleep state or the lower power state, copy the contents of the updated data structure into the non-volatile solid-state device.
7 . The data storage device of claim 1 , wherein the controller is further configured to, upon updating the data structure:
determine whether a power connection to the data storage device has been broken, and if the power connection has been broken, copy the contents of the updated data structure into the non-volatile solid-state device.
8 . The data storage device of claim 1 , wherein the host command to flush the updated data structure is included in a field of a system interface command.
9 . The data storage device of claim 8 , wherein the system interface command comprises one of a SATA flush cache command, a SATA standby immediate command, a SAS synchronize cache command, an NVMe flush command, or an NVMe shutdown notification command.
10 . The data storage device of claim 1 , wherein the controller is further configured to, prior to updating the data structure, receive a host command to disable copying the contents of the updated data structure into the non-volatile solid-state device after one of a predetermined time interval or a predetermined number of write commands have been received from the host.
11 . The data storage device of claim 1 , wherein the controller is further configured to, after copying the contents of the updated data structure into the non-volatile solid-state device, update the flag to indicate the contents of the data structure are consistent with the contents of a corresponding data structure stored in the non-volatile solid-state device.
12 . The data storage device of claim 1 , wherein the controller is further configured to, upon updating the data structure, determine whether the contents of the data structure are consistent with the contents of a corresponding data structure stored in the non-volatile solid-state device.
13 . A method of operating a storage device that includes a non-volatile solid-state device and a volatile solid-state memory device that is configured to store a first data structure that maps logical block addresses stored in the data storage device to respective physical memory locations in the non-volatile solid-state storage device, the method comprising:
determining whether the contents of the first data structure are consistent with the contents of a corresponding second data structure stored in the non-volatile solid-state storage device;
based on the contents of the first data structure being consistent with the contents of a corresponding second data structure, determining whether a host command to flush the first data structure has been received, and
if the host command to flush the first data structure has been received, copying the contents of the first data structure into the non-volatile solid-state device.
14 . The method of claim 13 , further comprising, prior to determining whether the contents of the first data structure are consistent with the contents of the corresponding second data structure stored, modifying the contents of first data structure.
15 . The method of claim 14 , further comprising, upon modifying the first data structure:
determining whether a link state between the data storage device and a host has changed, and
if the link state between the data storage device and the host has changed, copying the contents of the modified first data structure into the non-volatile solid-state device.
16 . The method of claim 14 , further comprising, upon modifying the first data structure:
receiving a host command to go into a sleep state or a lower power state, and
upon receiving the host command to go into the sleep state or the lower power state, copying the contents of the modified first data structure into the non-volatile solid-state device.
17 . The method of claim 14 , further comprising, upon modifying the first data structure:
determining whether a power connection to the data storage device has been broken, and
if the power connection has been broken, copying the contents of the updated first data structure into the non-volatile solid-state device.
18 . The method of claim 14 , further comprising, upon modifying the first data structure, updating a value of a flag to indicate the contents of the first data structure are not consistent with the contents of the corresponding second data structure.
19 . The method of claim 13 , wherein determining whether the contents of the first data structure are consistent with the contents of the corresponding second data structure comprises checking a value of a flag indicating whether the contents of the first data structure are consistent with the contents of the corresponding second data structure.
20 . The method of claim 13 , wherein the host command to flush the updated first data structure is included in a field of a system interface command.