Directed sanitization of memory
The present disclosure includes apparatuses and methods for directed sanitization of memory. One example method comprises, responsive to receiving a sanitization command, performing a deterministic garbage collection operation on a memory, wherein performing the deterministic garbage collection operation results in physical erasure of all invalid data stored on the memory without losing valid data stored on the memory.
1. An apparatus for directed sanitization of memory, comprising:
a memory; and
a controller coupled to the memory and configured to perform a deterministic garbage collection operation on the memory responsive to receiving a sanitization command;
wherein, performing the deterministic garbage collection operation results in physical erasure of all invalid data stored on the memory without losing valid data stored on the memory; and
wherein the apparatus includes a host configured to:
provide the sanitization command to the controller;
prior to providing the sanitization command to the controller, identify logical block addresses (LBAs) associated with a file targeted for deletion; and
provide the LBAs associated with the file targeted for deletion to the controller;
wherein the controller is configured to, prior to performing the deterministic garbage collection operation, update a logical to physical address mapping based on the LBAs associated with the file targeted for deletion such that data corresponding to the LBAs associated with the file targeted for deletion is included in the physical erasure of all invalid data stored on the memory.
2. The apparatus of claim 1 , wherein the LBAs associated with the file targeted for deletion reside in a trimming queue of the host, and wherein the host is configured to provide the LBAs associated with the file targeted for deletion to the controller in association with a forced flush of the trimming queue.
3. An apparatus for directed sanitization of memory, comprising:
a memory; and
a controller coupled to the memory and configured to initiate a deterministic garbage collection operation responsive to receiving a sanitization command from a host, wherein the deterministic garbage collection operation comprises:
identifying currently invalid logical block addresses (LBAs);
identifying physical blocks to which the currently invalid LBAs map, the identified physical blocks containing at least some invalid data;
physically erasing the identified physical blocks; and
for those identified physical blocks containing at least some valid data, relocating the at least some valid data to a different physical block prior to physical erasure such that, subsequent to a completion of the deterministic garbage collection operation, the memory no longer includes physical blocks containing both valid data and invalid data;
wherein a forced flush of a trimming queue of the host is initiated in association with the sanitization command such that a LBA to physical block address table used by the controller is updated prior to initiation of the deterministic garbage collection operation.
4. The apparatus of claim 3 , wherein the memory comprises a number of NAND Flash memory devices in which a physical block is a unit of erasure and is configured to store a plurality of pages of data.
5. The apparatus of claim 3 , wherein, in the absence of the sanitization command, the controller is configured to perform garbage collection on the memory non-deterministically as a background operation.
6. The apparatus of claim 3 , wherein the controller is configured to provide a completion status of the sanitization command to the host.
7. The apparatus of claim 6 , wherein the completion status indicates a degree of a completion of the sanitization command.
8. The apparatus of claim 6 , wherein the host is configured to poll the controller to obtain the completion status.
9. A method for directed sanitization of memory, comprising:
initiating, by a controller, a deterministic garbage collection operation on a memory responsive to receiving a sanitization command from a host; and
receiving, in association with the sanitization command, invalid LBAs form a trimming queue of the host;
wherein performing the deterministic garbage collection operation comprises:
identifying currently invalid logical block addresses (LBAs);
identifying physical blocks to which the currently invalid LBAs map, the identified physical blocks containing at least some invalid data;
physically erasing the identified physical blocks; and
for those identified physical blocks that contain at least some valid data, relocating the at least some valid data to a different physical block prior to physical erasure such that, subsequent to a completion of the deterministic garbage collection operation, the memory no longer includes physical blocks containing both valid data and invalid data.