Memory system
The memory system securely erases data using a physical method and confirms its completion through a mapping table, addressing the need for secure and verified data deletion.
Patent Information
- Application Number
- JP2023036753
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-03-09
AI Technical Summary
Existing memory systems lack the ability to securely erase specific data using a physical secure erase method and confirm if the erasure has been correctly executed.
A memory system with a non-volatile memory and a controller that manages a mapping table to securely erase data by transitioning to a first mode, performing data erase operations, and using a copy of the mapping information to confirm erasure.
Ensures secure erasure of data and allows confirmation of its completion, enhancing data security and integrity.
Smart Images

Figure 2024127539000001
Abstract
Description
[Technical field]
[0001] SUMMARY OF THE DISCLOSURE The present invention relates to a technique for controlling a non-volatile memory. [Background technology]
[0002] In recent years, memory systems equipped with nonvolatile memories have become widespread. One such memory system is a solid-state drive (SSD) equipped with a NAND flash memory.
[0003] Overwrite, block erase, and cryptographic erase are known as secure erase methods for safely and reliably erasing data stored in an SSD. Secure erase methods are classified into physical secure erase methods, which are erase methods that physically and irreversibly make stored data unreadable, and logical secure erase methods, which are erase methods that logically make stored data unreadable. Overwrite and block erase are each an example of a physical secure erase method. Cryptographic erase is an example of a logical secure erase method.
[0004] In cryptographic erase, the encryption key used to encrypt data stored on the SSD is erased using a physical secure erase method, making the data undecryptable and logically erased.
[0005] Recently, there has been a demand for secure erasure of specific data among data stored in a memory system such as an SSD by a physical secure erasure method.
[0006] Furthermore, there is a demand for confirmation as to whether or not secure erasure of specific data has been performed correctly. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] U.S. Pat. No. 10,403,369 [Patent Document 2] U.S. Pat. No. 10,353,612 [Patent Document 3] US Patent Application Publication No. 2016 / 0274800 [Patent Document 4] JP 2022-007376 A Summary of the Invention [Problem to be solved by the invention]
[0008] An embodiment of the present invention provides a memory system that can perform secure erasure of specific data using a physical secure erase method and can verify whether the secure erasure of the specific data has been performed correctly. [Means for solving the problem]
[0009] According to an embodiment, a memory system includes a non-volatile memory including a plurality of blocks each of which is a unit of a data erase operation, and a controller electrically connected to the non-volatile memory. The controller manages a first table that holds mapping information indicating a mapping between each of one or more logical area identifiers and each of one or more physical addresses of the non-volatile memory. In response to receiving a first command from a host requesting secure erasure of data to be securely erased that is associated with a first logical area identifier, the controller holds a copy of first mapping information included in the first table that corresponds to the first logical area identifier. The controller identifies one or more first blocks among the plurality of blocks in which data to be securely erased that is associated with the first logical area identifier is stored. The controller executes at least the data erase operation on at least the one or more first blocks. After executing the data erase operation on the one or more first blocks, the controller transitions to a first mode. In the first mode, in response to receiving a read command from the host specifying the first logical area identifier, the controller reads data from a storage location in the non-volatile memory corresponding to a first physical address that is mapped to the first logical area identifier in the copy of the first mapping information. [Brief description of the drawings]
[0010] [Figure 1] 1 is a block diagram showing an example of the configuration of an information processing system including a memory system according to a first embodiment. [Diagram 2] 2 is a diagram showing an example of the configuration of a logical-physical address conversion table (L2P table) used in the memory system according to the first embodiment. [Diagram 3] FIG. 2 is a diagram showing an example of a plurality of namespaces managed in the memory system according to the first embodiment. [Figure 4]1 is a diagram showing an overview of a write operation and a physical secure erase operation executed in the memory system according to the first embodiment. [Diagram 5] 1 is a flowchart showing the procedure of a physical secure erase operation executed in the memory system according to the first embodiment. [Figure 6] 4 is a diagram showing an example of a data structure written to each block in the memory system according to the first embodiment; [Figure 7A] 6 is a flowchart showing some steps of processing related to an Audit function executed in the memory system according to the first embodiment. [Figure 7B] 10 is a flowchart showing the remaining steps of the process related to the Audit function executed in the memory system according to the first embodiment. [Figure 8] 11 is a flowchart showing a procedure of a process executed in the memory system according to the first embodiment for an I / O command received before a first specific command is received. [Figure 9] 11 is a flowchart showing a procedure of processing for an I / O command received during execution of a first specific command, which is executed in the memory system according to the first embodiment. [Figure 10A] 1 is a diagram showing an example of the contents of each active block before the start of a physical secure erase operation in the memory system according to the first embodiment. FIG. [Figure 10B] 1A and 1B are diagrams showing an example of the contents of each free block before the start of a physical secure erase operation in the memory system according to the first embodiment. [Figure 11] 1A and 1B are diagrams showing an example of the contents of each active block after an unmap operation is executed in the memory system according to the first embodiment. [Figure 12A] 4 is a diagram showing an example of the contents of each active block after a garbage collection operation is executed in the memory system according to the first embodiment. FIG. [Figure 12B]1A and 1B are diagrams showing an example of the contents of each free block after a garbage collection operation is executed in the memory system according to the first embodiment. [Figure 13] 11 is a flowchart showing the procedure of a physical secure erase operation executed in a memory system according to a second embodiment. [Figure 14A] 13 is a flowchart showing the procedure of a physical secure erase operation executed in a memory system according to a third embodiment. [Figure 14B] 13 is a flowchart showing the procedure of an unmap operation and a garbage collection operation executed in a memory system according to a third embodiment. [Figure 14C] 13 is a flowchart showing another procedure of the unmap operation and the garbage collection operation executed in the memory system according to the third embodiment. [Figure 15A] 11 is a flowchart showing some steps of processing related to an Audit function executed in a memory system according to a third embodiment. [Figure 15B] 13 is a flowchart showing the remaining steps of the process related to the Audit function executed in the memory system according to the third embodiment. [Figure 16A] 13 is a flowchart showing the procedure of a physical secure erase operation executed in a memory system according to a fourth embodiment. [Figure 16B] 13 is a flowchart showing the procedure of an unmap operation and a garbage collection operation executed in a memory system according to a fourth embodiment. [Figure 16C] 13 is a flowchart showing another procedure of the unmap operation and the garbage collection operation executed in the memory system according to the fourth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] Hereinafter, an embodiment will be described with reference to the drawings. (First embodiment) A description will be given of the configuration of an information processing system including a memory system according to the first embodiment. Fig. 1 is a block diagram showing an example of the configuration of an information processing system 1 including a memory system according to the first embodiment.
[0012] The information processing system 1 includes a host (host device) 2 and a memory system 3. The host 2 is an information processing device configured to control the memory system 3. Examples of the host 2 include a personal computer, a server computer, a mobile terminal, or an in-vehicle device. The memory system 3 is a semiconductor storage device configured to write data to a non-volatile memory and read data from the non-volatile memory. The memory system 3 may be realized as, for example, a solid state drive (SSD) or a universal flash storage (UFS) device. In the following, an example in which the memory system 3 is realized as an SSD will be described. In the following, the memory system 3 is referred to as SSD3.
[0013] The SSD 3 may be connected to the host 2 via a cable or a network. Alternatively, the SSD 3 may be built into the host 2.
[0014] The interface for connecting the host 2 and the SSD 3 may be, but is not limited to, SATA (Serial ATA), SAS (Serial Attached SCSI), M-PHY, PCI Express (PCIe) (registered trademark), or Ethernet (registered trademark).
[0015] The SSD 3 includes a controller 4 and a nonvolatile memory 5. The nonvolatile memory 5 is, for example, a NAND type flash memory. Hereinafter, the nonvolatile memory 5 will be referred to as the NAND type flash memory 5. The SSD 3 may also include a random access memory 6. The random access memory 6 is, for example, a dynamic random access memory (DRAM). Hereinafter, the random access memory 6 will be referred to as the DRAM 6.
[0016] The NAND flash memory 5 includes a memory cell array having a plurality of memory cells arranged in a matrix. The NAND flash memory 5 may be a two-dimensional flash memory or a three-dimensional flash memory.
[0017] The memory cell array of the NAND flash memory 5 includes a plurality of blocks BLK0 to BLKx-1. Each of the blocks BLK0 to BLKx-1 includes a plurality of pages (here, pages P0 to Py-1). Each page includes a plurality of memory cells connected to the same word line. Each of the blocks BLK0 to BLKx-1 is a unit of a data erase operation (hereinafter also referred to as a block erase) for erasing data from the NAND flash memory 5. A block may also be referred to as an "erase block," a "physical block," or a "physical erase block." Each of the pages P0 to Py-1 is a unit of a data write operation and a data read operation. Note that initial data (for example, all-1 data) can be read from a block in an erased state (i.e., a block in which a data erase operation has been executed and before a data write operation has been executed).
[0018] The controller 4 may be realized by a circuit such as a System-on-a-chip (SoC). The controller 4 is electrically connected to the NAND flash memory 5 via a NAND interface 13 that is compliant with, but not limited to, the Toggle NAND Flash Interface and the Open NAND Flash Interface (ONFI). The controller 4 operates as a memory controller configured to control the NAND flash memory 5.
[0019] The controller 4 may function as a flash translation layer (FTL) configured to perform data management and block management of the NAND flash memory 5.
[0020] The data management performed by the FTL includes (1) management of mapping information indicating mapping between each of a plurality of logical area identifiers, each of which specifies a plurality of logical areas, and each of one or more physical addresses of the NAND flash memory 5, and (2) processing for concealing constraints of the NAND flash memory 5 (e.g., page-based data write / read operations and block-based data erase operations).
[0021] The logical region identifier may be a namespace identifier, a logical address, a combination of a namespace identifier and a logical address, or a key in a key-value store.
[0022] The logical address is an address used by the host 2 to address a logical address within the logical address space of the SSD 3. As the logical address, a logical block address (LBA) may be used.
[0023] The controller 4 is configured to create and manage multiple namespaces. The multiple namespaces are logical address ranges independent of each other. The multiple namespaces are used to make one memory system operate as if it were multiple memory systems. The multiple namespaces are used by the host 2 to access the SSD 3. A namespace identifier is an identifier used by the host 2 to specify a namespace.
[0024] The management of the mapping information is performed using an address conversion table (logical-physical address conversion table: L2P table) 37, which is a table that holds the mapping information. The L2P table 37 is also called a mapping table. Each physical address mapped to a logical area identifier indicating a certain logical area indicates the latest physical storage location in the NAND flash memory 5 where data associated with this logical area identifier was written. The L2P table 37 may be loaded from the NAND flash memory 5 to the DRAM 6 when the SSD 3 is started up.
[0025] When a logical address (e.g., LBA) is used as a logical area identifier, the mapping information held in the L2P table 37 is information indicating mapping between each LBA and each physical address PBA (physical block address) in a unit of a predetermined management size called a cluster. For example, one cluster has a size that is an integer multiple of the size of a sector (also called a logical block) specified by the LBA. An example of the size of a sector is 512B or 4KiB, and an example of the size of a cluster is 4KiB. The size of the cluster may be larger than 4KiB. When the size of a sector specified by the LBA is smaller than the size of a cluster, bitmap data indicating whether each data of a plurality of sectors included in each cluster is valid data or invalid data may be stored in the L2P table 37.
[0026] When a key of a key-value store is used as a logical area identifier, the mapping information held in L2P table 37 is, but is not limited to, information indicating the correspondence between a hash value of each key, a pointer to each key, a unique number corresponding to each key, the size of the value corresponding to each key, and a physical address list including one or more physical addresses where the value corresponding to each key is stored.
[0027] 2 is a diagram showing an example of the configuration of the L2P table 37. Here, a description will be given of an example of the configuration of the L2P table 37 in the case where a logical address such as an LBA is used as a logical area identifier.
[0028] In the L2P table 37, a physical address mapped to a certain logical address indicates the most recent physical storage location in the NAND flash memory 5 where the data associated with this logical address was written.
[0029] The L2P table 37 includes a plurality of entries corresponding to a plurality of logical addresses, respectively. In an entry corresponding to a certain logical address, a physical address PBA mapped to this logical address is stored. For example, when the controller 4 writes data associated with a certain logical address to a certain physical storage location in the NAND flash memory 5, the controller 4 updates the L2P table 37 to map the physical address PBA indicating this physical storage location to this logical address.
[0030] 2 illustrates a case where physical addresses PBA0, PBA2, PBA1, PBA4, PBA5, and PBA6 are mapped to logical addresses 0x000, 0x001, 0x002, 0x005, 0x006, and 0x007, respectively. When data associated with a certain logical address is not written to the NAND flash memory 5, a predetermined constant (e.g., a NULL value) may be stored in the entry corresponding to this logical address.
[0031] Returning to the explanation of FIG. 1, in the NAND flash memory 5, a data write operation to a page is possible only once per data erase operation to a block including the page. In other words, new data cannot be directly overwritten to an area in a block to which data has already been written. For this reason, when updating data that has already been written, the controller 4 writes new data to an unwritten area in that block (or another block), and treats the previous data as invalid data. In other words, when data associated with a certain logical area identifier is updated, the controller 4 writes the updated data to a different physical storage location, not the physical storage location where the previous data is stored. Then, the controller 4 updates the L2P table 37 to map a physical address indicating this different physical storage location to this logical area identifier, and invalidates the previous data.
[0032] The block management performed by the FTL includes bad block management, wear leveling, and garbage collection.
[0033] Wear leveling is an operation for equalizing the number of rewrites (number of program / erase cycles) for each block.
[0034] Garbage collection is an operation for reducing the number of blocks that contain a mixture of valid and invalid data and for increasing the number of free blocks, which are blocks that do not contain valid data.
[0035] Valid data means the latest data associated with a logical area identifier indicating a certain logical area. For example, data stored in a physical storage location referenced by mapping information held by the L2P table 37 (i.e., data managed by the controller 4 as the latest data in association with a logical area identifier) is valid data. In other words, valid data is data that may be read by the host 2 later.
[0036] Invalid data means data stored in a physical storage location that is not referenced by the mapping information held by the L2P table 37. For example, data stored in a physical storage location indicated by a physical address that is not mapped to any logical area identifier (i.e., data that is not managed by the controller 4 in association with a logical area identifier as the latest data) is invalid data. Invalid data is data that is no longer likely to be read by the host 2. When data associated with a logical area identifier indicating a certain logical area is updated, valid data previously associated with that logical area identifier becomes invalid data, and the updated data becomes new valid data. Also, when an unmap operation, which will be described later, is performed on a logical area identifier indicating a certain logical area, valid data previously associated with that logical area identifier becomes invalid data.
[0037] In garbage collection, the controller 4 selects only valid data in some blocks that contain a mixture of valid and invalid data, and copies it to another block (e.g., a free block). The controller 4 updates the L2P table 37 to map the destination physical address to the logical area identifier with which the copied valid data was associated. A block that contains only invalid data as a result of valid data being copied to another block is released as a free block. This makes it possible to reuse the block for writing data after a data erase operation on the block.
[0038] In addition to the above-mentioned NAND interface (I / F) 13, the controller 4 includes a host interface (I / F) 11, a CPU 12, a DRAM interface (I / F) 14, a direct memory access controller (DMAC) 15, a static RAM (SRAM) 16, and an ECC (Error Correction Code) encoding / decoding unit 17. The host I / F 11, the CPU 12, the NAND I / F 13, the DRAM I / F 14, the DMAC 15, the SRAM 16, and the ECC encoding / decoding unit 17 are interconnected via a bus 10.
[0039] The host I / F 11 is a host interface circuit configured to perform communication with the host 2. The host I / F 11 may be, for example, a SATA interface controller, a SAS interface controller, a PCIe controller, or an Ethernet controller.
[0040] The host I / F 11 receives various commands from the host 2. The SATA interface uses ATA commands defined in the ATA standard. The SAS interface uses SCSI commands defined in the SCSI standard. The PCIe interface and the Ethernet interface use NVMe commands defined in the NVM Express (NVMe) (registered trademark) standard. These commands include a write command, a read command, an unmap command, and the like.
[0041] A write command (write request) is a command that requests the SSD 3 to write user data (write data) associated with a logical area identifier indicating a certain logical area to the NAND flash memory 5. When a combination of a logical address (particularly an LBA) and a namespace identifier is used as the logical area identifier, a write command may include, for example, a namespace identifier that identifies a certain namespace, a logical address (start LBA) within this namespace, the size of the write data (the number of sectors), and a data pointer (buffer address) indicating the location in the memory of the host 2 where this write data is stored. The start LBA indicates the first sector associated with the write data.
[0042] A read command (read request) is a command that requests the SSD 3 to read data associated with a logical area identifier indicating a logical area specified by this read command from the NAND flash memory 5. When a combination of a logical address (particularly an LBA) and a namespace identifier is used as the logical area identifier, the read command may include a namespace identifier that identifies a certain namespace, a logical address (start LBA) within this namespace, the size (number of sectors) of the data to be read, and a data pointer (buffer address) indicating the location in the memory of the host 2 to which this data should be transferred. The start LBA indicates the first sector associated with the data to be read.
[0043] The unmap command is a command that requests the SSD 3 to invalidate data associated with a logical area identifier specified by this unmap command. When a combination of a logical address (particularly an LBA) and a namespace identifier is used as the logical area identifier, the controller 4 deletes the physical address from each entry of the L2P table 37 that corresponds to the logical address range (LBA range) specified by the unmap command. In this case, the controller 4 may delete the physical address from each entry by overwriting these entries with NULL values. This unmap operation makes the data associated with each logical address included in this logical address range invalid data.
[0044] The command received from the host 2 also includes a command (hereinafter referred to as a specific command) requesting the SSD 3 to securely erase data associated with a logical area identifier indicating a specific logical area. In the following description, the specific logical area is referred to as a logical area to be securely erased. An identifier indicating a logical area to be securely erased is referred to as a logical area identifier to be securely erased. Data associated with a logical area identifier to be securely erased is referred to as data to be securely erased. A logical area to be securely erased is a logical area identified by a logical area identifier (logical area identifier to be securely erased) specified by a specific command.
[0045] The data to be securely erased includes both data currently associated with the logical area identifier to be securely erased and data previously associated with this logical area identifier to be securely erased. The data currently associated with the logical area identifier to be securely erased means valid data currently associated with the logical area identifier to be securely erased. The data previously associated with the logical area identifier to be securely erased means invalid data that has been invalidated by updating the data associated with this logical area identifier, etc. In the SSD3, since the updated data is written to a physical storage location different from the physical storage location where the old data is stored, the data is updated while the old data remains as invalid data in the old physical storage location. The data to be securely erased also includes such invalid data.
[0046] The specific command is, for example, a command that specifies a logical area identifier that identifies a logical area to be securely erased, and requests the secure erasure of data to be securely erased.
[0047] Alternatively, the specific command may be a command requesting secure erasure of data to be securely erased without specifying a logical area identifier that identifies a logical area to be securely erased. In this case, the host 2 first transmits one or more commands that specify a logical area identifier that identifies a logical area to be securely erased to the SSD 3. Next, the host 2 transmits a specific command to the SSD 3 that requests secure erasure of data to be securely erased.
[0048] If the logical area identifier that identifies the logical area to be securely erased is a namespace identifier, the logical area to be securely erased is the namespace identified by the namespace identifier. In this case, the data to be securely erased includes both data currently associated with the namespace identified by the namespace identifier and data previously associated with this namespace.
[0049] In this way, in a case where the controller 4 is configured to manage a plurality of namespaces each identified by a plurality of namespace identifiers, the namespace identifiers can be used as logical area identifiers for identifying the namespaces to be securely erased.
[0050] When the logical area identifier for identifying the logical area to be securely erased is a logical address such as an LBA, the logical area to be securely erased is a sector identified by the logical address. In this case, the data to be securely erased includes both the data currently associated with the logical address indicating this sector and the data previously associated with this logical address. Note that, when the controller 4 manages multiple namespaces, a combination of a namespace identifier and a logical address may be used as a logical area identifier for identifying the logical area to be securely erased.
[0051] The specific command may specify one or more logical addresses that identify one or more sectors to be securely erased. In this case, the specific command may specify a logical address range. The logical address range is specified, for example, by a logical address indicating the beginning of the logical area to be securely erased and the number of sectors from that address. When multiple logical address ranges are to be securely erased, the host 2 may first send to the SSD 3 multiple commands each specifying a logical address range to be securely erased, and then send to the SSD 3 a specific command requesting secure erasure of data to be securely erased that is associated with the logical address range to be securely erased. Of course, the specific command may include multiple parameters that specify multiple logical address ranges. In this case, when the controller 4 manages multiple namespaces, a combination of a namespace identifier and a logical address range may be used as one logical area identifier that identifies a logical area to be securely erased.
[0052] If the controller 4 supports a key-value store, a key in the key-value store can be used as a logical area identifier to identify the logical area to be securely erased. In this case, the logical area to be securely erased is the logical area identified by the key. The data to be securely erased includes both the data currently associated with the key indicating this logical area and the data previously associated with this key. A specific command can specify one or more keys that identify one or more logical areas to be securely erased.
[0053] In the first embodiment, a combination of a namespace identifier and a logical address (LBA) is used as a logical area identifier specified by an I / O command such as a write command or a read command. The combination of the namespace identifier and the logical address (LBA) specified by the I / O command indicates the logical area to be accessed. If the controller 4 supports a key-value store, the key of the key-value store or the combination of the namespace identifier and the key indicates the logical area to be accessed.
[0054] The specific command may be a command requesting execution of a secure erase operation accompanied by an audit function. The audit function is a function that enables the host 2 to check whether data associated with a logical area identifier specified by the specific command has been securely erased (physically securely erased or logically securely erased) from the NAND flash memory 5. In the following, it is assumed that a command requesting execution of a secure erase operation accompanied by an audit function is used as the specific command. Details of the audit function will be described later.
[0055] FIG. 3 is a diagram for explaining a plurality of namespaces managed in the SSD 3. As shown in FIG.
[0056] FIG. 3 illustrates an example in which the controller 4 manages namespaces NS#1, NS#2, and NS#3. Each namespace is identified by a namespace identifier (NSID). Each namespace includes a set of multiple contiguous logical addresses (LBAs). The logical address range corresponding to each namespace starts from LBA0. Each namespace can be set to any size. The size of each namespace corresponds to the number of LBAs included in the namespace.
[0057] Figure 3 illustrates an example in which namespace NS#1 includes multiple consecutive LBAs from LBA0 to LBA(i-1), namespace NS#2 includes multiple consecutive LBAs from LBA0 to LBA(j-1), and namespace NS#3 includes multiple consecutive LBAs from LBA0 to LBA(k-1).
[0058] When a plurality of namespaces are managed by the controller 4, each of the logical addresses (internal logical addresses inLBA) in one internal logical address space of the SSD 3 and each of the physical addresses of the NAND flash memory 5 may be mapped using one L2P table 37. For example, the controller 4 may convert the LBA range (LBA0 to LBA(i-1)) of the namespace NS#1 into the internal logical address range inLBA0 to inLBA(i-1), convert the LBA range (LBA0 to LBA(j-1)) of the namespace NS#2 into the internal logical address range inLBAi to inLBA(i+j-1), and convert the LBA range (LBA0 to LBA(k-1)) of the namespace NS#3 into the internal logical address range inLBA(i+j) to inLBA(i+j+k-1). The controller 4 uses one L2P table 37 to manage the mapping between each of the internal logical addresses in the internal logical address range inLBA0 to inLBA(i+j+k−1) and each of the physical addresses.
[0059] Alternatively, the L2P table 37 may be created for each namespace.
[0060] Returning to the description of FIG. 1, the CPU 12 is a processor configured to control the host I / F 11, the NAND I / F 13, the DRAM I / F 14, the DMAC 15, the SRAM 16, and the ECC encoding / decoding unit 17. In response to the start of the SSD 3, the CPU 12 loads a control program (firmware) from the NAND flash memory 5 or a ROM (not shown) into the SRAM 16, and executes this firmware to perform various processes. The firmware may be loaded into the DRAM 6. The CPU 12 can execute command processing for processing various commands from the host 2. The operation of the CPU 12 is controlled by the firmware described above. A part or all of the command processing may be executed by dedicated hardware in the controller 4.
[0061] This firmware causes the CPU 12 to function as a namespace management unit 21, a write control unit 22, a read control unit 23, and an erase control unit 24.
[0062] The namespace management unit 21 creates, manages, deletes, etc. namespaces based on namespace management commands received from the host 2 .
[0063] The write control unit 22 processes a write command received from the host 2 via the host I / F 11. The write command specifies a logical area identifier (e.g., a namespace identifier (NSID) and a start LBA), a size of write data, and the like. The write control unit 22 writes the write data associated with the write command received from the host 2 via the host I / F 11 to the NAND flash memory 5 via the NAND I / F 13. Then, the write control unit 22 updates the L2P table 37 so that each LBA associated with the write data is mapped to the physical address to which this write data is written.
[0064] The write control unit 22 may write the write data together with a logical area identifier (e.g., LBA) associated with the write data to the NAND flash memory 5. In this case, the logical area identifier may be written to the same block as the block to which the data is written. In particular, the logical area identifier may be written to the same page as the page to which the data is written.
[0065] The read control unit 23 processes a read command received from the host 2 via the host I / F 11. The read command specifies a logical area identifier (e.g., a namespace identifier (NSID) and a start LBA), a size of the data to be read, etc. The read control unit 23 acquires a physical address where the data to be read is stored by referring to the L2P table 37. Then, the read control unit 23 reads the data to be read from the NAND flash memory 5 via the NAND I / F 13.
[0066] When the write data and the logical area identifier associated with this write data have been written to the NAND flash memory 5, the read control unit 23 may read the read target data and the logical area identifier associated with this read target data from the NAND flash memory 5. When the logical area identifier specified in the read command does not match the logical area identifier read from the NAND flash memory 5, the read control unit 23 may determine that the read target data is invalid data.
[0067] The erase control unit 24 performs secure erasure on data to be securely erased, which is associated with the identifier of a logical area to be securely erased, by a physical secure erase method in response to a specific command received from the host 2 via the host I / F 11. After performing the secure erase operation, the erase control unit 24 transitions to an Audit mode. The Audit mode is an operation mode for executing an Audit function for a read command requesting reading of data associated with the identifier of a logical area to be securely erased. In order to perform the secure erase operation with the Audit function, the erase control unit 24 includes a mapping information copy unit 241, an unmap unit 242, a garbage collection (GC) unit 243, a secure erase unit 244, and an Audit function execution unit 255.
[0068] The mapping information copy unit 241 holds a copy of the mapping information corresponding to the logical area to be securely erased among the mapping information included in the L2P table 37. This copy of the mapping information is backup information indicating the mapping information corresponding to the logical area to be securely erased immediately before the secure erase operation for the logical area to be securely erased is started. The mapping information copy unit 241 holds a copy of the mapping information corresponding to the logical area to be securely erased by copying the mapping information corresponding to the logical area to be securely erased from the L2P table 37 to the NAND flash memory 5 or a volatile memory (e.g., SRAM 16 or DRAM 6) in the SSD 3. This copy of the mapping information is not changed and maintains the contents at the time of copying even if the mapping information in the L2P table 37 is changed after copying by each of the unmap operation and the garbage collection operation.
[0069] The unmapping unit 242 performs an unmapping operation to invalidate the data to be securely erased. For example, the unmapping unit 242 deletes all physical addresses currently mapped to the identifiers of logical areas to be securely erased from the L2P table 37, thereby invalidating the data to be securely erased.
[0070] The GC unit 243 selects each block storing the data to be securely erased and valid data of the data other than the data to be securely erased as a GC target block (copy source block). The data to be securely erased of the valid data in the copy source block is invalidated by the unmap operation. Therefore, the valid data of the data other than the data to be securely erased is the remaining valid data in the copy source block, that is, the valid data associated with the logical area identifier other than the logical area identifier to be securely erased. The GC unit 243 executes a copy operation to copy only the valid data of the data other than the data to be securely erased from the copy source block to the copy destination block. By the unmap operation and the copy operation, the copy source block becomes a free block in which no valid data is stored.
[0071] After executing the copy operation, the secure erase unit 244 executes at least a data erase operation on all blocks that store the data to be securely erased, including the copy source block, thereby allowing the secure erase unit 244 to securely erase the data to be securely erased by the physical secure erase method.
[0072] The operation of the mapping information copy unit 241 to save a copy of the mapping information corresponding to the logical area to be securely erased may be performed before the unmap operation in the secure erase operation is performed, or may be performed while this unmap operation is being performed.
[0073] In the latter case, when the unmapping unit 242 deletes a physical address (physical address to be deleted) mapped to the logical area identifier to be securely erased from the mapping information of the L2P table 37, the mapping information copying unit 241 may store a copy of a part of the mapping information of the L2P table 37, including the physical address to be deleted, in a volatile memory in the NAND flash memory 5 or the SSD 3. For example, consider a case where the unmapping unit 242 invalidates data associated with LBA100 among the logical area identifiers to be securely erased. In this case, when the unmapping unit 242 deletes mapping information including the physical address PBA mapped to LBA100 from the mapping information of the L2P table 37, the mapping information copying unit 241 acquires the mapping information including the physical address PBA to be deleted from the L2P table 37 and stores it in a volatile memory in the NAND flash memory 5 or the SSD 3.
[0074] The unmap operation may be performed during the execution of the garbage collection operation. In this case, the mapping information copy unit 241 may store a copy of the mapping information corresponding to the logical area to be securely erased in a block that has become a free block during the execution of the garbage collection operation in the secure erase operation. This makes it possible to hold a copy of the mapping information corresponding to the logical area to be securely erased without putting a strain on the storage area of the volatile memory in the SSD 3, even in a state in which data equivalent to the capacity of the SSD 3 is written in the nonvolatile memory 5.
[0075] After executing the secure erase, the Audit function execution unit 245 transitions the controller 4 to the Audit mode. First, in response to receiving a specific command from the host 2, the Audit function execution unit 245 holds the logical area identifier (also referred to as the first logical area identifier) included in the specific command. For example, the Audit function execution unit 245 holds the first logical area identifier by storing the first logical area identifier in the SRAM 16 or the DRAM 6. Then, after completing the secure erase operation, the Audit function execution unit 245 transitions the controller 4 to the Audit mode.
[0076] In the Audit mode, in response to receiving a read command specifying the first logical area identifier from the host 2, the controller 4 acquires the physical address mapped to the first logical area identifier, which is the identifier of the logical area to be securely erased, from a copy of the mapping information, not from the L2P table 37. Then, the controller 4 reads data from a physical storage location in the NAND flash memory 5 corresponding to the acquired physical address, and transmits the read data to the host 2. As will be described later, the data read from this physical storage location is, for example, initial data, valid data not to be securely erased that was used for overwriting, data having a specific data pattern, or invalid data.
[0077] Furthermore, regardless of whether the controller 4 is in the audit mode or not, in response to receiving from the host 2 a read command specifying another logical area identifier indicating another logical area other than the first logical area, the controller 4 acquires a physical address mapped to this other logical area identifier from the mapping information in the L2P table 37. Then, the controller 4 reads data from a physical storage location in the NAND flash memory 5 corresponding to the acquired physical address, and transmits the read data to the host 2.
[0078] Furthermore, the Audit function execution unit 245 discards the retained copy of the first logical area identifier and mapping information in response to receiving a command requesting termination of the Audit mode or a write command specifying the first logical area identifier from the host 2. Then, the Audit function execution unit 245 causes the controller 4 to exit the Audit mode.
[0079] The other components within the controller 4 will now be described.
[0080] The NAND I / F 13 is a NAND controller configured to control the NAND flash memory 5 under the control of the CPU 12 .
[0081] The DRAM I / F 14 is a DRAM controller configured to control the DRAM 6 under the control of the CPU 12 .
[0082] Part of the storage area of the DRAM 6 may be used as a write buffer 31, a read buffer 32, and a command buffer 33. Part of the storage area of the DRAM 6 may be used as an area for storing a block list 34 to be securely erased, a free block list 35, an active block list 36, and an L2P table 37.
[0083] The write buffer 31 temporarily stores data to be written to the NAND flash memory 5 .
[0084] The read buffer 32 temporarily stores the data read from the NAND flash memory 5 .
[0085] The command buffer 33 temporarily stores a command received from the host 2 until the command is executed.
[0086] The list of blocks to be securely erased 34 stores the block identifiers of the blocks in which data to be securely erased is stored.
[0087] The free block list 35 stores the block identifier of each free block. A free block is a block that does not store valid data.
[0088] The active block list 36 stores a block identifier for each active block, which is a block that contains valid data.
[0089] The ECC encoding / decoding unit 17 performs encoding and decoding of data. For example, during a write operation, the ECC encoding / decoding unit 17 performs encoding of data to generate an error correction code. The ECC encoding / decoding unit 17 adds an error correction code to user data to generate a codeword to be written. During a read operation, the ECC encoding / decoding unit 17 performs decoding. That is, the ECC encoding / decoding unit 17 uses the error correction code to perform error correction of the codeword read from the NAND flash memory 5 to restore the user data.
[0090] Next, an operation for safely and reliably erasing data by the physical secure erase method (hereinafter referred to as a physical secure erase operation) will be described.
[0091] 4 shows an overview of a write operation and a physical secure erase operation executed in the SSD 3. Before describing the physical secure erase operation, the write operation will first be described.
[0092] The write control unit 22 writes the write data to the write buffer 31. If a write destination block 56 has not been assigned, the write control unit 22 selects one free block from among the free blocks managed by the free block list 35, performs block erasure on the selected free block, and assigns the free block that has been block-erased as the write destination block 56.
[0093] The write control unit 22 writes the write data in the write buffer 31 to a writable page of the write destination block 56. The write control unit 22 updates the L2P table 37. When the write data is written to the write destination block 56, the write destination block 56 becomes a block to which valid data has been partially written (hereinafter also referred to as a partially written block). Since a partially written block also stores valid data, it is managed as an active block.
[0094] When the destination block 56 becomes filled with write data and there are no more writable pages in the destination block 56, the write control unit 22 assigns a new free block as the destination block, and writes the write data in the write buffer 31 to the writable pages in the newly assigned destination block.
[0095] Next, the unmap operation and garbage collection operation performed in the physical secure erase operation will be described.
[0096] When a specific command instructing secure erasure of data associated with a logical area identifier is received from the host 2, the unmapping unit 242 executes an unmapping operation so that one or more physical addresses mapped to each of all logical area identifiers specified in the specific command are deleted from the mapping information of the L2P table 37. In other words, the unmapping unit 242 invalidates the data to be securely erased. As a result, all data to be securely erased becomes invalid data. An active block that no longer has valid data is removed from the active block list 36 and is instead managed by the free block list 35.
[0097] Then, the GC unit 243 executes a garbage collection operation. In this garbage collection operation, the GC unit 243 copies only the remaining valid data after the data to be securely erased is invalidated from one or more first blocks in which the data to be securely erased is stored to one or more destination blocks. Since the data to be securely erased has been invalidated by the unmap unit 242, the remaining valid data stored in the one or more first blocks is valid data among data associated with a logic area identifier indicating a logic area other than the logic area to be securely erased, that is, valid data not to be securely erased.
[0098] As a result, the active block group does not include blocks that contain a mixture of data to be securely erased and valid data other than the data to be securely erased. By copying the remaining valid data, one or more first blocks (copy source blocks) no longer contain valid data and are treated as free blocks. Therefore, one or more first blocks are removed from the active block list 36 and are instead managed by the free block list 35.
[0099] Next, a detailed example of the garbage collection operation executed by the GC unit 243 will be described. The data to be securely erased is, for example, any one of (i) data (user data) in a namespace to be securely erased that is identified by a namespace identifier when only the namespace identifier is specified by a specific command, (ii) data in a logical area that is identified by a combination of a namespace identifier and an LBA range when a specific command specifies this namespace identifier, and (iii) a value that is identified by a key of a key-value store when a specific command specifies this key.
[0100] The GC unit 243 selects an active block storing data to be securely erased as the copy source block 52. The active block storing data to be securely erased is a block that includes data to be securely erased and valid data that is not to be securely erased.
[0101] The GC unit 243 selects one of the free blocks managed by the free block list 35. The GC unit 243 may preferentially select a free block generated during execution of a garbage collection operation (copy operation) by the GC unit 243. The GC unit 243 performs block erasure on the selected free block. Then, the GC unit 243 assigns the free block that has been block-erased as the copy destination block 54.
[0102] The GC unit 243 copies the remaining valid data stored in the source block 52, i.e., the valid data not subject to secure erasure, from the source block 52 to the destination block 54. The GC unit 243 updates the L2P table 37 to map the physical address indicating the destination physical memory location to which the valid data has been copied to the logical area identifier of the copied valid data. The data subject to secure erasure in the source block 52 remains in an unmapped state. The destination block 54 to which the valid data has been copied becomes an active block and is managed by the active block list 36.
[0103] When the logical area identifier associated with the write data has been written to the copy source block 52 together with the write data, the GC unit 243 may read the logical area identifier associated with the valid data to be copied together with the data from the copy source block 52 and copy them to the copy destination block 54. The logical area identifier may be copied to the same page as the page to which the data has been copied.
[0104] When copying of all valid data in the copy source block 52 is completed, the copy source block 52 becomes a free block and is managed by the free block list 35 .
[0105] The GC unit 243 selects another active block that stores data to be securely erased as a new source block 52. The GC unit 243 copies valid data that is not to be securely erased from the new source block 52 to the destination block 54. The GC unit 243 updates the L2P table 37 to map a physical address indicating the destination physical memory location to which the valid data has been copied to a logical area identifier of the copied valid data. The data to be securely erased in the source block 52 remains in an unmapped state.
[0106] When the destination block 54 is filled with data, that is, when there are no more writable pages in the destination block 54, the GC unit 243 selects one of the free blocks managed by the free block list 35. The GC unit 243 performs block erasure on the selected free block. Then, the GC unit 243 assigns the free block that has been block-erased as the new destination block 54.
[0107] The source block to which the valid data has been copied is managed as a free block by the free block list 35, and can therefore be reused as the destination block 54. The GC unit 243 may select the source block that has become a free block by copying as the destination block. In this case, the GC unit 243 performs block erasure on the selected block. As a result, data to be securely erased in the source block that has become a free block by copying is erased. The GC unit 243 assigns the block that has been block erased as a new destination block 54. Then, the GC unit 243 copies valid data that is not to be securely erased from the source block 52 to the destination block 54. In this way, the source block that has become a free block is reused as the destination block 54, and the data to be securely erased in the source block is erased by block erasure and is further overwritten with valid data that is not to be securely erased.
[0108] In this way, the GC unit 243 performs at least block erase on the copy source block that has become a free block in which no valid data is stored due to copying.
[0109] When the garbage collection operation for all active blocks storing data to be securely erased is completed, the data to be securely erased will no longer exist in any blocks other than free blocks.
[0110] Next, an example of the above-mentioned block erase operation performed in a physical secure erase operation will be described.
[0111] After executing the garbage collection operation, the secure erase unit 244 performs at least block erasure on one or more first free blocks that store the data to be securely erased, among the free blocks managed by the free block list 35.
[0112] Here, the one or more first free blocks include (i) one or more blocks that have not been used as copy destination blocks among one or more copy source blocks that have become free blocks in which valid data is not stored by copying, and (ii) one or more free blocks that have existed before the start of the garbage collection operation and that have not been used as copy destination blocks among free blocks storing invalid data of the logical area to be securely erased. The invalid data of the logical area to be securely erased in (ii) includes data that has already been invalidated before the start of the physical secure erase operation among data of the logical area to be securely erased.
[0113] The secure erase unit 244 performs a process of finding free blocks corresponding to (i) and free blocks corresponding to (ii) from the free blocks managed by the free block list 35, and performs at least block erasure on each of the found free blocks. Alternatively, the secure erase unit 244 may perform at least block erasure on each of all free blocks managed by the free block list 35.
[0114] As a result, data to be securely erased that is stored in each block that remains as a free block after the garbage collection operation is securely erased by at least block erasure, and data to be securely erased that is stored in some blocks that are reused as copy destination blocks is securely erased by overwriting (i.e., block erasure + overwriting with valid data that is not subject to secure erasure).
[0115] After performing the garbage collection operation, the secure erase unit 244 may perform block erase on each free block storing the data to be securely erased, and may further write a specific data pattern, such as all 0's or all 1's, or a combination thereof, to each free block. The secure erase unit 244 may also generate and write an error correction code corresponding to the specific data pattern. Furthermore, the secure erase unit 244 may write the logical area identifier written before the block erase to the block where the block erase was performed. This also allows all of the data to be securely erased by block erase and overwriting with the specific data pattern.
[0116] Next, the Audit function will be described. As described above, when the data to be securely erased is securely erased by block erase or overwrite, the physical storage location where the data to be securely erased was stored stores data of another logical area or is in an erased state. The host 2 can issue a read command specifying the logical area identifier to be securely erased in order to check whether the secure erase of the data to be securely erased has been performed normally. The controller 4 that has transitioned to the Audit mode reads data from the physical storage location where the data to be securely erased was stored based on this read command, and transmits the read data to the host 2. As described later, the data read from this physical storage location is, for example, initial data, valid data not to be securely erased that was used for overwriting, data having a specific data pattern, or invalid data.
[0117] In order to realize the audit function, the audit function execution unit 245 holds a logical area identifier to be securely erased when a specific command requesting a secure erase operation accompanied by the audit function is received. The mapping information copy unit 241 holds a copy of mapping information corresponding to the logical area to be securely erased before an unmap operation based on this specific command. The mapping information copy unit 241 stores, for example, the copy of mapping information corresponding to the logical area to be securely erased in a free block as valid management data.
[0118] The Audit function execution unit 245 transitions the controller 4 to the Audit mode after executing a secure erase operation based on a specific command that requests a secure erase operation accompanied by the Audit function.
[0119] Then, when the controller 4 receives a read command from the host 2 while in the audit mode, it judges whether or not the logical area identifier included in the received read command is the same as the held identifier of the logical area to be securely erased. If the read command includes a logical area identifier different from the held identifier of the logical area to be securely erased, the controller 4 reads data from a physical storage location in the NAND flash memory 5 corresponding to the physical address indicated by the mapping information in the L2P table 37, and transmits the read data to the host 2. This allows the controller 4 to normally process a read command that specifies a logical area other than the logical area to be securely erased.
[0120] On the other hand, if the received read command contains a logical area identifier that is the same as the held logical area identifier to be securely erased, the controller 4 reads data from the physical memory location in the NAND flash memory 5 that corresponds to the physical address indicated by the copy of the mapping information stored by the mapping information copy unit 241, and transmits the read data to the host 2.
[0121] If the physical storage location indicated by this physical address is in an erased state, or if a specific data pattern is overwritten at this physical storage location without an error correction code corresponding to this specific data pattern, the error correction may fail in the ECC encoding / decoding unit 17. This is because a correct codeword including a pair of data and an error correction code that matches this data is not stored at this physical storage location. In this case, the controller 4 may transmit to the host 2 the data itself (i.e., data before error correction) read from the physical storage location in the NAND flash memory 5. For example, this data is initial data (e.g., all-1 data) when this physical storage location is in an erased state, and is a specific data pattern used for overwriting when this physical storage location is overwritten. Alternatively, the controller 4 may transmit to the host 2 a completion response corresponding to the received read command indicating that an uncorrectable error has occurred.
[0122] If the physical storage location indicated by this physical address has been reused as the copy destination block 54, or if a specific data pattern and its corresponding error correction code have been overwritten in this physical storage location without including the logical area identifier, the logical area identifier mapped to the physical address indicated by the copy of the mapping information will not match the logical area identifier read together with the data from this physical storage location. In this case, the controller 4 may send to the host 2, as a completion response corresponding to the received read command, a notice that the read data was invalid.
[0123] If the completion response received from SSD 3 indicates an error (an uncorrectable error or invalid data), the host 2 can confirm that the secure erasure of the data to be securely erased has been successfully performed. Alternatively, if the data received from SSD 3 is different from the data to be securely erased, the host 2 can confirm that the secure erasure of the data to be securely erased has been successfully performed. The host 2 may detect that the data received from SSD 3 and the data to be securely erased are different from each other by, for example, storing a hash value for each piece of data associated with each logical area identifier.
[0124] When the controller 4 receives a write command from the host 2 while in the audit mode, it judges whether or not the logical area identifier included in the received write command is the same as the held logical area identifier to be securely erased. If the write command includes a logical area identifier different from the held logical area identifier to be securely erased, the controller 4 writes data associated with the write command to the write destination block 56 and updates the mapping information in the L2P table 37. At this time, the copy of the mapping information stored by the mapping information copy unit 241 is maintained without being updated.
[0125] On the other hand, if the write command includes a logical area identifier that is the same as the held logical area identifier to be securely erased, the controller 4 discards the held logical area identifier to be securely erased and the copy of the mapping information, and exits the audit mode. The controller 4 then writes data associated with the write command to the destination block 56, and updates the mapping information in the L2P table 37. As a result, if a logical area identifier that is the same as the logical area identifier to be securely erased is specified by a read command received thereafter, the controller 4 can read the updated data that has been newly written to the destination block 56, and transmit the read updated data to the host 2.
[0126] Furthermore, when the controller 4 receives a command to end the audit mode from the host 2, it discards the identifier of the logical area to be securely erased and the copy of the mapping information that is being held. Then, the controller 4 exits the audit mode.
[0127] In this way, the audit function for data to be securely erased is realized. Note that the data to be securely erased that is associated with the logical area identifier to be securely erased at the time of receiving the specific command is sufficient as the data to be securely erased for the audit function. Therefore, data to be securely erased that was previously associated with the logical area identifier to be securely erased is not subject to the audit function.
[0128] In the following, it is assumed that a first specific command is used as the above-mentioned specific command, which requests a secure erase operation on data in a specific namespace. The first specific command uses a namespace identifier (NSID) that identifies a specific namespace as a logical area identifier indicating the logical area to be securely erased. The first specific command also requests the execution of a secure erase operation accompanied by an audit function.
[0129] FIG. 5 is a flowchart showing the procedure of the physical secure erase operation executed in the memory system according to the first embodiment.
[0130] When the controller 4 receives a command from the host 2 (step S102), the CPU 12 determines whether or not the received command is a first specific command (step S104).
[0131] If the received command is not the first specific command (NO in step S104), the CPU 12 executes a process according to the received command (step S106).
[0132] If the received command is a first specific command (YES in step S104), the audit function execution unit 245 holds the NSID included in the received first specific command as the NSID of a specific namespace (namespace to be securely erased) (step S108).
[0133] The mapping information copy unit 241 holds a copy of the mapping information corresponding to the namespace to be securely erased (step S110). Specifically, the mapping information copy unit 241 stores a copy of the mapping information corresponding to the namespace to be securely erased, among the mapping information held in the L2P table 37, in the NAND flash memory 5, the SRAM 16, or the DRAM 6.
[0134] The unmapping unit 242 executes an unmapping operation to invalidate all data in the namespace to be securely erased (step S112).
[0135] In step S112, for example, the unmap unit 242 deletes the physical addresses from the entries in the L2P table 37 corresponding to all the LBAs in the namespace to be securely erased. Alternatively, the unmap unit 242 stores NULL values in these entries. This unmap operation makes all the clusters corresponding to the namespace to be securely erased invalid in the L2P table 37. That is, the data associated with all the clusters corresponding to the namespace to be securely erased is internally recognized as data that may be discarded. As a result, all the data in the namespace to be securely erased becomes invalid.
[0136] Here, the case where the mapping information copy operation in step S110 and the unmap operation in step S112 are executed as separate procedures has been described, but these operations may be executed simultaneously. In this case, the mapping information copy unit 241 may copy the mapping information corresponding to the logical area to be unmapped to the NAND flash memory 5, the SRAM 16, or the DRAM 6 immediately before the unmap operation is executed.
[0137] If all data stored in a certain active block is data to be securely erased, at the end of the unmap operation, this active block becomes a free block that stores only invalid data.
[0138] If an active block stores both data to be securely erased and valid data in a namespace not to be securely erased, at the end of the unmap operation, the active block stores invalid data from the data to be securely erased and valid data in the namespace not to be securely erased.
[0139] The GC unit 243 executes a garbage collection operation (GC operation) so that blocks in which data to be securely erased (invalid data) and valid data in a namespace not to be securely erased are mixed are eliminated from the active block group (step S114).
[0140] The GC unit 243 selects all active blocks that store at least invalid data of namespaces to be securely erased as GC target blocks (i.e., copy source blocks). The active blocks that store invalid data of namespaces to be securely erased are blocks that store invalid data of namespaces to be securely erased and valid data of namespaces not to be securely erased. Alternatively, in order to simply implement a garbage collection operation, the GC unit 243 may select all active blocks that store at least invalid data as copy source blocks, regardless of whether the data is invalid data of namespaces to be securely erased. The active blocks that store at least invalid data are blocks that store invalid data and valid data of namespaces not to be securely erased.
[0141] The GC unit 243 may store the block identifier of each active block selected as a copy source block in the list 34 of blocks to be securely erased.
[0142] The GC unit 243 can check which namespace data is stored in each block based on information such as that shown in FIG.
[0143] Fig. 6 shows an example of the data structure written to a block. In the example of Fig. 6(a), a pair of a namespace identifier and an LBA, and data identified by the pair are written to each page. Therefore, the GC unit 243 can determine whether or not the block including the page stores data of a namespace to be securely erased by reading the pair of the namespace identifier and the LBA of each page.
[0144] In another example of the data structure written in a block, as shown in Fig. 6(b), in addition to the information in Fig. 6(a), a list of namespace identifiers of the namespaces associated with the data stored in this block is written in one of the pages (e.g., the last page). Therefore, the GC unit 243 can determine whether the block stores data of a namespace to be securely erased by reading only the page of each block in which this list is stored, without reading all the pages of each block. Note that the list of namespace identifiers and the list of LBAs associated with the data stored in this block may be written in one of the pages of this block.
[0145] Returning to the description of step S114 in Fig. 5, the GC unit 243 selects any one of the free blocks. The GC unit 243 performs block erasure on the selected free block. The GC unit 243 assigns the free block that has been block-erased as the copy destination block 54.
[0146] The GC unit 243 copies valid data from among the data excluding the data to be securely erased, i.e., valid data in a namespace not to be securely erased, from the source block 52 to the destination block 54. The GC unit 243 updates the L2P table 37 to map each LBA of the valid data in the namespace not to be securely erased to each physical address of the destination.
[0147] When the valid data of the namespaces not subject to secure erasure is copied, the valid data of the namespaces not subject to secure erasure in the copy source block 52 becomes invalid data. Since all LBAs of the namespaces subject to secure erasure are unmapped before copying, all data in the copy source block 52 becomes invalid data after the copy operation is performed. That is, when all valid data of the namespaces not subject to secure erasure stored in the copy source block 52 is copied to the copy destination block, the copy source block 52 becomes a free block. Therefore, when all valid data of the namespaces not subject to secure erasure in all copy source blocks is copied to some copy destination blocks, the data subject to secure erasure will not exist other than in the free block. In other words, the invalid data of the namespaces subject to secure erasure will exist only in some free blocks.
[0148] The GC unit 243 determines whether or not the end condition of the garbage collection operation is satisfied (step S122). When all copying to valid data of namespaces not to be securely erased from blocks in which data of namespaces to be securely erased and valid data of namespaces not to be securely erased are completed, data to be securely erased (invalid data of namespaces to be securely erased) disappears from active blocks. In other words, invalid data of namespaces to be securely erased will exist only in free blocks. Therefore, the end condition may be that blocks storing invalid data of namespaces to be securely erased no longer exist in the active block group.
[0149] The GC unit 243 continues to execute the GC operation of step S114 until there are no more blocks storing invalid data in the namespace to be securely erased among the active blocks (NO in step S122, step S114).
[0150] When the end condition of the garbage collection operation is satisfied (YES in step S122), the GC unit 243 ends the GC operation. At this point, there is no longer any possibility that invalid data in the namespace to be securely erased exists outside of the free block.
[0151] The secure erase unit 244 performs at least a block erase operation on each free block in which invalid data is stored in the namespace to be securely erased (step S124). The source block reused as the destination block has already been block erased by the garbage collection operation in step S114. Therefore, by combining the block erase operation on each source block performed in step S114 with the block erase operation in step S124, all data in the namespace to be securely erased is securely erased by block erase.
[0152] In step S124, the secure erase unit 244 performs block erase on each free block in which invalid data of the namespace to be securely erased is stored, and may further write a specific data pattern to each of these free blocks. As a result, the invalid data of the namespace to be securely erased stored in each free block is overwritten with a specific data pattern. When the source block is reused as the destination block, the invalid data of the namespace to be securely erased stored in the source block has already been overwritten with valid data of another namespace by the garbage collection operation in step S114. Therefore, by combining the overwrite in step S114 and the overwrite in step S124, all of the data of the namespace to be securely erased is securely erased by overwrite.
[0153] The secure erase unit 244 may perform block erasure on all of the free blocks, which allows the process of step S124 to be easily performed, in which at least block erasure is performed on each free block in which invalid data is stored in the namespace to be securely erased.
[0154] Alternatively, in order to reduce the number of blocks to be block erased, the secure erase unit 244 may perform a process to identify one or more free blocks in which invalid data is stored in the namespace to be securely erased, and perform block erasure on only the identified one or more free blocks.
[0155] In either the former or latter case, at least one or more free blocks in which invalid data is stored in the namespace to be securely erased are targeted for the physical secure erase operation.
[0156] In the latter case, when only active blocks storing invalid data of namespaces to be securely erased are determined as blocks to be GC targets in step S114, the secure erase unit 244 may classify free blocks existing at the start of step S124 into group I of free blocks generated by the GC operation in step S114 (i.e., a group of blocks managed in the list 34 of blocks to be securely erased) and group II of other free blocks. The secure erase unit 244 can easily identify free blocks as free blocks storing invalid data of namespaces to be securely erased without checking the contents of each free block belonging to group I. The secure erase unit 244 can check the contents of each free block belonging to group II to determine whether or not each of these free blocks is a free block storing invalid data of namespaces to be securely erased.
[0157] Upon completion of the process of step S124, the erase control unit 24 notifies the host 2 of the completion of the first specific command by transmitting a response indicating the completion of the first specific command to the host 2 (step S126).
[0158] Then, the Audit function execution unit 245 executes the Audit function (step S128). In step S128, the controller 4 transmits data that can be used to check whether or not the secure erase has been executed normally to the host 2, in response to the read command issued from the host 2, using the NSID held in step S108 and the copy of the mapping information held in step S110. Details of the procedure of step S128 will be described with reference to the flowcharts of Figures 7A and 7B.
[0159] Fig. 7A is a flowchart showing some steps of the process related to the Audit function executed in the memory system according to the first embodiment, and Fig. 7B is a flowchart showing the remaining steps of the process related to the Audit function.
[0160] When the Audit function execution unit 245 notifies the host 2 of the completion of the first specific command in step S126 described with reference to FIG. 5, it transitions the controller 4 to the Audit mode as shown in FIG. 7A (step S302).
[0161] The controller 4 determines whether or not a command has been received from the host 2 (step S304).
[0162] If a command has not been received from the host 2 (NO in step S304), the controller 4 waits until a command is received.
[0163] When a command is received from the host 2 (YES in step S304), the controller 4 determines whether the received command is a read command (step S306).
[0164] If the received command is a read command (YES in step S306), the controller 4 determines whether or not the NSID included in the received read command matches the NSID of the namespace to be securely erased that was held in step S108 described with reference to Fig. 5 (step S308). The controller 4 may switch the order of execution of steps S306 and S308. In this case, the controller 4 may omit the process of step S320.
[0165] If the NSID included in the received read command does not match the NSID of the namespace to be securely erased (NO in step S308), the controller 4 refers to the mapping information in the L2P table 37 and obtains the physical address mapped to the logical address included in the received read command from the mapping information in the L2P table 37 (step S310).
[0166] The controller 4 reads data from the physical storage location in the NAND flash memory 5 indicated by the physical address acquired in step S310, and transmits the read data to the host 2 (step S312), and the process by the controller 4 returns to step S304. That is, the controller 4 waits until it receives the next command.
[0167] If the NSID included in the received read command matches the NSID of the namespace to be securely erased (YES in step S308), the controller 4 refers to the copy of the mapping information held in step S110 and obtains the physical address mapped to the logical address included in the received read command from the copy of the mapping information (step S314). The copy of the mapping information stores the physical address that was mapped to this logical address before the secure erase operation started.
[0168] The controller 4 reads the data from the physical storage location in the NAND flash memory 5 indicated by the physical address acquired in step S314, and transmits the read data to the host 2 (step S316). Then, the process by the controller 4 returns to step S304.
[0169] If the received command is not a read command (NO in step S306), the controller 4 determines whether the received command is a write command (step S318), as shown in FIG. 7B.
[0170] If the received command is a write command (YES in step S318), the controller 4 determines whether the NSID included in the received write command matches the NSID corresponding to the namespace to be securely erased that was held in step S108 (step S320).
[0171] If the NSID included in the write command does not match the NSID of the namespace to be securely erased (NO in step S320), the controller 4 writes the data associated with the write command to the NAND flash memory 5 (step S322).
[0172] The controller 4 updates the mapping information in the L2P table 37 so that the physical address indicating the physical storage location where the data associated with the write command is written is mapped to the logical address specified by the write command (step S324). Then, the process by the controller 4 returns to step S304 in FIG. 7A.
[0173] If the NSID included in the write command matches the NSID of the namespace to be securely erased (YES in step S320), the controller 4 discards the copy of the mapping information and the NSID of the namespace to be securely erased (step S326). Then, the controller 4 exits the audit mode (step S328) and terminates the audit function. After exiting the audit mode, the controller 4 writes the data associated with the write command to the NAND flash memory 5 (step S330). The controller 4 updates the mapping information in the L2P table 37 so that the physical address indicating the physical memory location to which the data associated with the write command is written is mapped to the logical address specified by the write command (step S332).
[0174] If the received command is not a write command (NO in step S318), the controller 4 determines whether the received command is an Audit mode end command (step S334).
[0175] If the received command is an audit mode termination command (YES in step S334), the controller 4 discards the copy of the mapping information and the NSID of the namespace to be securely erased (step S336), exits the audit mode (step S338), and terminates the audit function.
[0176] If the received command is not an Audit mode end command (NO in step S334), the controller 4 executes command processing based on the received command (step S340).
[0177] Next, a description will be given of how to handle an I / O command when a first specific command requesting secure erasure of data in a specific namespace is received. Examples of the I / O command include a write command, a read command, and an unmap command.
[0178] First, the handling of an I / O command that has been received and is incomplete before the first specific command is received will be described.
[0179] In the processing of the first specific command, an operation of retaining a copy of mapping information corresponding to the secure erase target area and an unmap operation of invalidating the secure erase target data are executed. Therefore, in order to prevent a situation in which the mapping information corresponding to the secure erase target logical area is updated by the processing of an I / O command during the processing of the first specific command, the controller 4 aborts an incomplete write command for the secure erase target area (here, the secure erase target namespace) and an incomplete unmap command for this secure erase target namespace.
[0180] Alternatively, the controller 4 may wait for the completion of the processing of the uncompleted write command or the uncompleted unmap command, and may start the execution of the first specific command after the processing of these commands is completed. In particular, if the processing of these commands is close to completion, the controller 4 may not abort these commands, but may start the execution of the first specific command after the processing of these commands is completed.
[0181] FIG. 8 is a flowchart showing a procedure of a process for an I / O command that is received and incomplete before the first specific command is received.
[0182] The controller 4 receives a first specific command requesting secure erasure of data in a specific namespace from the host 2 (step S702). The controller 4 determines whether or not there is an I / O command currently being executed for this specific namespace (namespace to be securely erased), or an I / O command that has been received but has not yet started to be executed for the namespace to be securely erased (hereinafter, these I / O commands are also referred to as uncompleted commands) (step S704).
[0183] If there is an uncompleted command for the namespace to be securely erased (YES in step S704), the controller 4 determines whether the uncompleted command is a command (e.g., a write command or an unmap command) that causes an update of mapping information corresponding to the logical area to be securely erased (step S706).
[0184] If the uncompleted command is a command that will cause the mapping information to be updated (YES in step S706), the controller 4 determines whether the processing of this command is about to be completed (step S708).
[0185] If the processing of this command is not about to be completed (NO in step S708), the controller 4 aborts the uncompleted command (step S712). If the commands received from the host 2 are not permitted to be executed out of order in step S712, for example, if the controller 4 aborts a write command, it aborts all subsequent I / O commands received from the host 2 after receiving this write command.
[0186] After aborting the uncompleted command, the controller 4 starts the execution of the first specific command (step S714).
[0187] If the processing of the uncompleted command is about to be completed (YES in step S708), the controller 4 may wait for the processing of the uncompleted command to be completed without aborting the uncompleted command (step S710, NO in step S710). Then, in response to the completion of the processing of the uncompleted command (YES in step S710), the controller 4 starts the execution of the first specific command (step S714).
[0188] If the uncompleted command for the namespace to be securely erased is neither a write command nor an unmap command, for example, if there is an uncompleted read command for the namespace to be securely erased (NO in step S706), the controller 4 does not abort the uncompleted command and waits for the uncompleted command to be processed to be completed (step S710, NO in step S710). Then, in response to the completion of the uncompleted command, the controller 4 starts execution of the first specific command (step S714).
[0189] Next, handling of an I / O command received during execution of the first specific command will be described with reference to Fig. 9. Fig. 9 is a flowchart showing the procedure of processing an I / O command received during execution of the first specific command.
[0190] The controller 4 receives a first specific command requesting secure erasure of data in a specific namespace (step S802) and starts execution of the first specific command (step S804). If an I / O command is received during execution of the first specific command (step S806), the controller 4 determines whether the received I / O command is for this specific namespace (namespace to be securely erased) (step S808).
[0191] If the I / O command received during execution of the first specific command is an I / O command for a namespace to be securely erased (YES in step S808), the controller 4 aborts the received I / O command (step S810). Alternatively, the controller 4 may suspend execution of the received I / O command until processing of the first specific command is completed (i.e., until completion of the first specific command is notified to the host 2) (step S810), and execute the received I / O command after processing of the first specific command is completed.
[0192] If the I / O command received during execution of the first specific command is an I / O command for a namespace other than the namespace to be securely erased (NO in step S808), the controller 4 can selectively use the following first method or second method. Therefore, the controller 4 determines whether to select the first method or the second method (step S812). When the first method is selected, the controller 4 executes the process of step S814. When the second method is selected, the controller 4 executes the process of step S816.
[0193] First Method (Step S814): If the I / O command for another namespace is a write command, the controller 4 suspends execution of this write command at least until the GC operation is completed, and executes the write command after the GC operation is completed.
[0194] If the I / O command for the other namespace is a read command, the controller 4 executes this read command normally. However, if the command received from the host 2 is not permitted to be executed out of order, the controller 4 executes the read commands for the other namespace in the same order as the order in which these read commands were received. Then, at the time of receiving a write command for the other namespace that follows the read command for the other namespace, the controller 4 suspends the processing of this received write command and all I / O commands for the other namespace that follow the received write command at least until the GC operation is completed. After the GC operation is completed, the controller 4 executes the received write command and all I / O commands for the other namespace that follow the received write command in the same order as the order in which these commands were received.
[0195] In the description of the first method, the controller 4 may or may not treat the unmap command in the same way as a write command. If the controller 4 does not treat the unmap command in the same way as a write command, the controller 4 executes the unmap command normally, in the same way as a read command.
[0196] Second method (step S816): If the I / O command for the other namespace is a write command, an unmap command, or a read command, the controller 4 executes this I / O command as normal. This second method has the advantage that the processing of the I / O command for the other namespace is not significantly delayed, but the time required for processing the first specific command increases by the time required for processing this I / O command. Furthermore, there is a possibility that even invalid data generated by writing write data (update data) associated with the write command for the other namespace will become the target of the GC operation. In this case, the time required for processing the first specific command will further increase.
[0197] Next, an example of a secure erase operation on data in a particular namespace will be described with reference to Figures 10A, 10B, 11, 12A, and 12B.
[0198] Fig. 10A is a diagram showing an example of the contents of each active block before the start of a secure erase operation. Fig. 10A shows an example in which three blocks, block BLK0, block BLK1, and block BLK2, are active blocks in which valid data is stored.
[0199] Block BLK0 is an active block that is being written to and is assigned as a destination block. Block BLK0 has an unwritten storage area shown as blank. Blocks BLK1 and BLK2 are each active blocks in which data has been written up to the end of the block.
[0200] If the controller 4 manages three namespaces, namespace A, namespace B, and namespace C, data from namespace A, namespace B, and namespace C may be mixed in each of blocks BLK0, BLK1, and BLK2. Furthermore, valid data and invalid data of each namespace may be mixed in each of blocks BLK0, BLK1, and BLK2.
[0201] Fig. 10B is a diagram showing an example of the contents of each free block before the start of a secure erase operation. Fig. 10B illustrates an example in which four blocks, block BLK3, block BLK4, block BLK5, and block BLK6, are free blocks in which no valid data is stored.
[0202] 10B, free block BLK3 stores invalid data of namespace A and invalid data of namespace C, but does not store invalid data of namespace B. Free blocks BLK4 to BLK6 each store invalid data of namespace A, invalid data of namespace B, and invalid data of namespace C.
[0203] Assume that the non-volatile memory 5 contains three active blocks as shown in FIG. 10A and four free blocks as shown in FIG. 10B, and the SSD 3 receives a first specific command from the host 2 requesting secure erasure of data in namespace B.
[0204] In this case, the unmapping unit 242 executes an unmapping operation that invalidates the data associated with all LBAs belonging to namespace B.
[0205] Figure 11 is a diagram showing an example of the contents of each active block after an unmap operation has been performed. In Figure 11, the bold text indicates data in namespace B that has become newly invalid data as a result of the unmap operation.
[0206] Before the unmap operation is performed, block BLK0 stores one invalid data item in namespace B and two valid data items in namespace B, as shown in Fig. 10A. As a result of the unmap operation, both of the two valid data items in namespace B in block BLK0 become invalid data, as shown in Fig. 11.
[0207] Before the unmap operation is performed, block BLK1 stores two invalid data in namespace B and four valid data in namespace B, as shown in Fig. 10A. As a result of the unmap operation, all four valid data in namespace B in block BLK1 become invalid data, as shown in Fig. 11.
[0208] Before the unmap operation is performed, block BLK2 stores three invalid data in namespace B and four valid data in namespace B, as shown in Fig. 10A. As a result of the unmap operation, all four valid data in namespace B in block BLK2 become invalid data, as shown in Fig. 11.
[0209] After executing the unmap operation, the GC unit 243 selects all of the active blocks storing invalid data in namespace B as GC target blocks, that is, as copy source blocks, and executes the GC operation.
[0210] 11, each of the active blocks, block BLK0, block BLK1, and block BLK2, stores invalid data in namespace B. Therefore, all of these three active blocks, block BLK0, block BLK1, and block BLK2, are selected as copy source blocks.
[0211] 12A is a diagram showing an example of the contents of each active block after a GC operation is performed. In FIG. 12A, the symbols (A), (B), and (C) in each physical storage location indicate that the namespaces corresponding to the data previously stored in that physical storage location are Namespace A, Namespace B, and Namespace C, respectively.
[0212] FIG. 12A illustrates an example in which blocks BLK6 and BLK5, which were free blocks before the GC operation, are used as copy destination blocks by the GC operation and have become active blocks by copying valid data thereto.
[0213] Block BLK6 becomes the active block by copying valid data from each of blocks BLK1 and BLK2 to block BLK6. As a result of this copying, all of the valid data from each of namespaces A and C that was stored in block BLK1 and all of the valid data from each of namespaces A and C that was stored in block BLK2 are stored in block BLK6.
[0214] Block BLK5 becomes the active block by copying valid data from block BLK0 to block BLK5, and as a result of this copying, all valid data from namespace A and namespace C that was stored in block BLK0 is now stored in block BLK5.
[0215] Hereinafter, a GC operation that transitions the states of blocks BLK6 and BLK5 from free blocks shown in Fig. 10B to active blocks shown in Fig. 12A will be described. The GC unit 243 performs a block erase on block BLK6. Then, the GC unit 243 copies valid data remaining in block BLK1 after executing an unmap operation that invalidates the data in namespace B, that is, valid data of namespaces other than namespace B, from block BLK1 to block BLK6. At this time, the GC unit 243 copies the valid data of namespaces other than namespace B so that they are arranged contiguously in multiple physical storage locations in block BLK6.
[0216] Furthermore, the GC unit 243 copies the valid data remaining in block BLK2 after the execution of the unmap operation that invalidates the data of namespace B, i.e., the valid data of namespaces other than namespace B, from block BLK2 to block BLK6. At this time, the GC unit 243 copies the valid data of namespaces other than namespace B so that they are arranged contiguously in multiple subsequent physical storage locations in block BLK6.
[0217] As a result, block BLK6 is filled with valid data of namespaces other than namespace B that is stored in block BLK1, and valid data of namespaces other than namespace B that is stored in block BLK2. As a result, the invalid data of namespace B that was stored in block BLK6, which was a free block before the GC operation, is overwritten with valid data of namespaces other than namespace B.
[0218] 12A, the bold letters indicate the physical storage locations from which data in namespace B was erased. The invalid data in namespace B that was stored in block BLK6, which was a free block before the GC operation, has been overwritten with valid data in namespaces other than namespace B.
[0219] Similarly, the GC unit 243 performs a block erase on block BLK5. Then, the GC unit 243 copies the valid data remaining in block BLK0 after executing the unmap operation that invalidates the data of namespace B, that is, the valid data of namespaces other than namespace B, from block BLK0 to block BLK5. At this time, the GC unit 243 copies the valid data of namespaces other than namespace B so that they are arranged contiguously in multiple physical storage positions in block BLK5. Note that in this example, data is not written to the end of block BLK5, but the remaining physical storage positions may be filled with dummy data such as all 0s.
[0220] Referring again to FIG. 12A and focusing on the bold text, the invalid data in namespace B stored in block BLK5 has either been overwritten with valid data in a namespace other than namespace B, or the physical storage location where the invalid data was stored has been erased.
[0221] As a result of the above GC operation, blocks BLK0 to BLK2, which store data (invalid data) in namespace B, become free blocks. In addition, the two blocks BLK5 and BLK6, which have become the new active blocks, store only valid data in namespaces other than namespace B, and do not store data in namespace B. Therefore, blocks that contain a mixture of data from namespaces that are subject to secure erasure and valid data in namespaces that are not subject to secure erasure no longer exist in the active block group.
[0222] 12B is a diagram showing an example of the contents of each free block after a GC operation has been executed. After a GC operation has been executed, the free blocks managed by the free block list 35 include three blocks (BLK0, BLK1, BLK2) that have become free blocks as a result of the GC operation, and two blocks (BLK3, BLK4) that were free blocks before the GC operation started.
[0223] Each of free block BLK0, free block BLK1, and free block BLK2 is a block that has become a free block by a GC operation and has not been used as a copy destination block for the GC operation. Free block BLK0, free block BLK1, and free block BLK2 store invalid data of namespace B that is subject to secure erasure, but do not store valid data of namespaces A and C that are not subject to secure erasure. Therefore, the controller 4 can perform block erasure on each of free block BLK0, free block BLK1, and free block BLK2.
[0224] The controller 4 performs block erasure on each of the free blocks BLK0, BLK1, and BLK2, thereby enabling data in the namespace B to be securely erased to be securely erased from each of the free blocks BLK0, BLK1, and BLK2.
[0225] In addition, in the GC operation, any of free blocks BLK0, BLK1, and BLK2 can be reused as a destination block for the GC operation. The block reused as the destination block is first block erased. Then, data of namespace B to be securely erased that was stored in the block reused as the destination block is overwritten with valid data of namespace not to be securely erased that is copied from the source block. In this way, data of namespace B to be securely erased that was stored in the block reused as the destination block is securely erased by block erasure and overwriting that are performed during the GC operation.
[0226] Free block BLK3 was a free block before the GC operation began, and was not used as a destination block for the GC operation.
[0227] The free block BLK3 does not store data of the secure erase target namespace B. Therefore, the controller 4 does not need to perform block erasure on the free block BLK3.
[0228] Free block BLK4 was a free block before the GC operation started, and was not used as a destination block for the GC operation. Free block BLK4 stores invalid data of namespace B to be securely erased. Therefore, a block erase is performed on free block BLK4. As a result, the data of namespace B to be securely erased is securely erased from free block BLK4.
[0229] As described above, according to the first embodiment, an operation of retaining a copy of mapping information corresponding to the namespace to be securely erased is executed in response to receiving a first specific command requesting secure erasure of data in a specific namespace from the host 2. Next, an unmap operation of invalidating the data in the namespace to be securely erased and a GC operation of copying valid data among data in namespaces other than the namespace to be securely erased from one or more blocks (copy source blocks) in which the data of the namespace to be securely erased is stored to one or more copy destination blocks are executed.
[0230] As a result, one or more blocks in which data of the namespace to be securely erased is stored become free blocks, so that data of the namespace to be securely erased is no longer present anywhere other than in the free blocks.
[0231] When the copy source block becomes a free block, the free block can be reused as a copy destination block. In this case, the data of the namespace to be securely erased stored in the free block is erased by block erase, and is overwritten with valid data from the namespaces other than the namespace to be securely erased.
[0232] In this way, in the first embodiment, a portion of the data (valid data and invalid data) in a specified specific namespace can be securely erased by block erasing and overwriting during GC operation. Also, data in a specific namespace stored in one or more free blocks can be securely erased by at least block erasing after GC operation. As a result, all of the data (valid data and invalid data) in a specified specific namespace is securely erased.
[0233] After the secure erase operation is thus executed, the controller 4 transitions to the Audit mode. In the Audit mode, in response to receiving a read command from the host 2 specifying the namespace to be securely erased, the controller 4 refers to the copy of the mapping information stored therein, instead of the L2P table 37. This allows the controller 4 to obtain the physical addresses that were mapped to the respective logical addresses in the namespace to be securely erased before the secure erase operation was started. The controller 4 executes a read operation to read data from the physical memory location in the NAND flash memory 5 that corresponds to the physical address indicated by the copy of the mapping information. Then, the controller 4 transmits the read data to the host 2.
[0234] The host 2 can check whether or not the data to be securely erased has been securely erased from the NAND flash memory 5 by comparing the data received from the controller 4 in the audit mode with the data to be securely erased.
[0235] Then, when the controller 4 receives a write command specifying a namespace to be securely erased from the host 2, the controller 4 discards the copy of the mapping information and the information indicating the namespace to be securely erased that is held, and exits the audit mode. After exiting the audit mode, the controller 4 executes a write process and a process of updating the mapping information in the L2P table 37.
[0236] Next, advantages of the secure erase operation according to the first embodiment will be described in comparison with some comparative examples.
[0237] First, the differences between the configuration of SSDs according to some comparative examples and the configuration of the SSD 3 according to the first embodiment will be described.
[0238] <Comparative Example #1> In the SSD according to Comparative Example #1, a plurality of endurance groups are managed so that a plurality of namespaces belong to a plurality of different endurance groups, respectively. An endurance group is a unit for managing physical resources of a NAND flash memory. All physical resources of a NAND flash memory are divided into a plurality of endurance groups so that each block in the NAND flash memory is used in only one endurance group. When secure erasure of data in a specific namespace is performed, each block included in an endurance group corresponding to the specific namespace is subject to secure erasure.
[0239] <Comparative Example #2> In the SSD according to Comparative Example #2, all physical resources of the NAND flash memory belong to only one endurance group, but the correspondence between multiple namespaces and multiple blocks is managed one-to-one so that data in different namespaces is written to different blocks. When secure erasure of data in a specific namespace is performed, each block mapped one-to-one to the specific namespace is subject to secure erasure.
[0240] First Embodiment In the SSD 3 according to the first embodiment, multiple namespaces are managed, but all physical resources of the NAND flash memory belong to only one endurance group, and data from multiple namespaces are allowed to coexist in the same block. This is because the secure erase operation according to the first embodiment can perform a physical secure erase operation on data in a specific namespace specified by the host 2 even in an environment in which data from multiple namespaces coexists in the same block.
[0241] (1) User Data Erase speed In the SSD3 according to the first embodiment, it is necessary to perform a GC operation before block erasure. Therefore, the speed of the operation of securely erasing user data is relatively slow. However, secure erasure of data in a specific namespace is, for example, when transferring a PC to another person, and data in a namespace in which OS backup data is stored is to be maintained and data in a namespace containing user data is to be erased. Since the frequency of use is extremely low, a slow secure erase speed is acceptable.
[0242] In Comparative Example #1 and Comparative Example #2, the speed of the operation of securely erasing user data depends on the implementation, but it is possible to perform the operation at a relatively high speed.
[0243] (2) Number of blocks currently being written Here, we consider a case in which user data from the host is written to the SLC memory area (SLC: single level cell) of the NAND flash memory, and when the SSD is idle, the user data from the SLC memory area is written to the TLC memory area (TLC: triple level cell) or QLC memory area (QLC: quad level cell).
[0244] In the SSD 3 according to the first embodiment, the number of partially written blocks required is two. One of the two partially written blocks is an SLC block used as a destination block for an SLC storage area. The other partially written block is a TLC / QLC block used as a destination block for a TLC / QLC storage area.
[0245] In Comparative Example #1 and Comparative Example #2, the number of SLC blocks required is equal to the number of namespaces, and the number of TLC / QLC blocks required is equal to the number of namespaces.
[0246] (3) Overprovisioning In the SSD 3 according to the first embodiment and the comparative example #2, the over-provisioning area can be shared by multiple namespaces.
[0247] In Comparative Example #1, it is necessary to prepare an overprovisioning area for each namespace.
[0248] (4)SLC storage area In the SSD 3 according to the first embodiment, the SLC storage area is shared between namespaces, so that a certain namespace can temporarily use the entire capacity of the SLC storage area.
[0249] In Comparative Example #1 and Comparative Example #2, it is necessary to prepare an independent SLC storage area for each namespace. If the capacity required for one SLC storage area is fixed regardless of the namespace size, the number of blocks that can be allocated to the TLC / QLC storage area is reduced. As a result, the storage capacity of the non-volatile memory cannot be used efficiently, and the drive capacity (Total Capacity), which is the sum of the storage capacity of the TLC / QLC storage area and the storage capacity of all the SLC storage areas, is reduced in proportion to the number of namespaces.
[0250] (5) Alignment between block size and namespace size Generally, the size of one block is several tens of MB. Meanwhile, the size of each namespace is an integral multiple of a sector. This can lead to inconsistencies between the block size and the namespace size.
[0251] In the SSD 3 according to the first embodiment, one block can be shared by multiple namespaces, so even if a mismatch occurs between the block size and the namespace size, it is less likely to be affected by this and capacity efficiency is less likely to decrease.
[0252] In Comparative Example #1 and Comparative Example #2, if a mismatch occurs between the block size and the namespace size, the effect is that this mismatch occurs, and the capacity efficiency decreases.
[0253] (6) Creating multiple namespaces reduces drive capacity For reasons (2) to (5), creating multiple namespaces in one SSD may result in a reduction in drive capacity.
[0254] In the SSD 3 according to the first embodiment, since there is only one endurance group, it is possible to efficiently create multiple namespaces. Therefore, there is no reduction in drive capacity due to the creation of multiple namespaces.
[0255] In Comparative Example #1, an independent endurance group is required for each namespace, so creating multiple namespaces results in a large reduction in drive capacity.
[0256] In Comparative Example #2, the degree of the effect of the reduction in drive capacity due to the creation of multiple namespaces is intermediate between that of the first embodiment and Comparative Example #1.
[0257] Second embodiment Next, a second embodiment will be described. The configuration of the SSD according to the second embodiment is the same as the configuration of the SSD 3 according to the first embodiment shown in FIG. 1. The second embodiment performs a physical secure erase operation on data in a specific namespace, as in the first embodiment, but differs from the first embodiment in the process related to the unmap operation. In the first embodiment, the controller 4 performs the unmap operation before the GC operation. In contrast, in the second embodiment, the controller 4 performs the unmap operation while the GC operation is being executed.
[0258] 13 is a flowchart showing the procedure of the physical secure erase operation executed in the memory system according to the second embodiment. The description of the same procedures as those of the physical secure erase operation executed in the memory system according to the first embodiment described with reference to FIG. 5 will be omitted.
[0259] When the NSID of the namespace to be securely erased is held (step S108), the GC unit 243 executes a GC operation. During the execution of the GC operation, the mapping information copy unit 241 executes an operation of copying mapping information corresponding to the namespace to be securely erased, and the unmapping unit 242 executes an unmapping operation (step S132).
[0260] In step S132, the GC unit 243 selects, as a GC target block (i.e., a copy source block), an active block that stores at least data in a namespace to be securely erased, i.e., data to be securely erased, regardless of whether the data in the namespace to be securely erased is valid data or invalid data. Alternatively, in order to simply implement a GC operation, the GC unit 243 may select, as a copy source block, all of the active blocks that store at least invalid data, regardless of whether the data is in a namespace to be securely erased.
[0261] When the valid data stored in the copy source block is data to be securely erased, the mapping information copy unit 241 executes an operation of copying mapping information corresponding to the data to be securely erased stored in the copy source block from the L2P table 37 to the NAND flash memory 5, etc., and the unmapping unit 242 executes an unmapping operation of invalidating the valid data stored in the copy source block. That is, the mapping information copy unit 241 holds a copy of mapping information indicating a physical memory location where the valid data to be securely erased is stored among the valid data stored in the copy source block. Then, the unmapping unit 242 executes an unmapping operation of invalidating the valid data to be securely erased among the valid data stored in the copy source block. This allows the mapping information copy unit 241 to copy mapping information corresponding to the data to be securely erased immediately before being invalidated by the unmapping unit 242 from the L2P table 37 to the NAND flash memory 5, etc. When the valid data of the namespace not subject to secure erasure stored in the copy source block is copied to the copy destination block, and the valid data of the namespace subject to secure erasure stored in the copy source block is also unmapped, the copy source block becomes a free block. As a result, the data subject to secure erasure will not exist anywhere other than in free blocks. In other words, the data (invalid data) of the namespace subject to secure erasure will only exist in some free blocks.
[0262] After the GC operation, the operation of copying mapping information, and the unmap operation are executed (step S132), the termination conditions for the GC operation are judged (step S122), a block erase operation is executed (step S124), and the host 2 is notified of command completion (step S126), as in the first embodiment. Then, the Audit function execution unit 245 executes the Audit function (step S128).
[0263] The handling of I / O commands when a first specific command requesting secure erasure of data in a specific namespace is executed and the processing related to the Audit function are the same as in the first embodiment, and therefore a description thereof will be omitted.
[0264] In the second embodiment, the same effects as in the first embodiment can be obtained.
[0265] Third embodiment Next, a third embodiment will be described. The configuration of the SSD according to the third embodiment is the same as that of the SSD3 according to the first embodiment shown in FIG. 1. In the first and second embodiments, a namespace identifier is used as a logical area identifier indicating a logical area to be securely erased, but in the third embodiment, a logical address for identifying a sector to be securely erased and the number of sectors from that logical address are used as a logical area identifier indicating a logical area to be securely erased. For example, an LBA is used as the logical address. When the SSD3 has multiple namespaces, the logical area identifier indicating the logical area to be securely erased also includes a namespace identifier indicating the namespace to be securely erased.
[0266] In the third embodiment, the data to be securely erased is data associated with one or more specific LBAs that indicate one or more sectors to be securely erased, including both data currently associated with the LBAs and data previously associated with the LBAs.
[0267] The second specific command used in the third embodiment requests secure erasure of data associated with one or more specific LBAs, more specifically, data associated with one or more specific LBAs indicating one or more sectors to be securely erased. The second specific command may include a parameter specifying one or more specific LBAs. The one or more specific LBAs may be represented by an LBA range. The second specific command also requests execution of a secure erase operation with an audit function.
[0268] When the host 2 targets multiple LBA ranges for secure erasure, the host 2 may first send multiple commands to the SSD 3, each of which specifies an LBA range, and then send a second specific command to the SSD 3 requesting secure erasure of one or more specific LBA ranges. Of course, the second specific command may include multiple parameters that specify multiple LBA ranges. In this way, by requesting secure erasure by specifying multiple LBA ranges, the GC operation described below can be performed only once. This makes it possible to reduce the amount of data copied and the number of times blocks are erased compared to when secure erasure is requested for each LBA range, thereby reducing wear on memory cells.
[0269] In addition, when the host 2 targets one or more specific LBAs or one or more specific LBA ranges in a specific namespace for secure erasure, the host 2 may specify a namespace identifier that identifies the specific namespace and one or more specific LBAs or one or more specific LBA ranges.
[0270] FIG. 14A is a flowchart showing the procedure of a physical secure erase operation executed in a memory system according to the third embodiment.
[0271] When the controller 4 receives a command from the host 2 (step S202), the CPU 12 judges whether the received command is a second specific command (step S204). The second specific command requests secure erasure of data in one or more specific LBAs by the physical secure erase method.
[0272] If the received command is not the second specific command (NO in step S204), the CPU 12 executes a process according to the received command (step S206).
[0273] If the received command is a second specific command (YES in step S204), the Audit function execution unit 245 holds one or more specific LBAs (e.g., a specific LBA range) included in the received second specific command (step S208). Each of the one or more specific LBAs is also referred to as an LBA to be securely erased. The specific LBA range is also referred to as an LBA range to be securely erased.
[0274] The mapping information copy unit 241 holds a copy of the mapping information corresponding to the LBAs to be securely erased (for example, the range of LBAs to be securely erased) (step S210).
[0275] The unmapping unit 242 performs an unmapping operation (step S212). Next, the GC unit 243 performs a GC operation (step S214).
[0276] Here, we have described a case where the mapping information copying operation in step S210 and the unmapping operation in step S212 are each performed as separate procedures, but these operations may also be performed simultaneously as a single operation, such that the mapping information corresponding to the LBA to be unmapped is copied immediately before the unmapping operation is performed.
[0277] The procedures for the unmap operation (step S212) and the GC operation (step S214) differ depending on the relationship between the sector size and the cluster size. FIG. 14B is a flowchart showing the procedures for the unmap operation and the GC operation when the sector size is equal to the cluster size. This procedure is the procedure when one sector to be securely erased corresponds to one cluster. FIG. 14C is a flowchart showing the procedures for the unmap operation and the GC operation when the sector size is smaller than the cluster size. In this case, data of at least one sector to be securely erased exists in a part of one cluster storing valid data.
[0278] As shown in FIG. 14B, when the sector size is equal to the cluster size, the unmap unit 242 performs an unmap operation to invalidate data associated with all LBAs to be securely erased specified by the host 2 (step S212A). The unmap unit 242 deletes physical addresses from the entries of the L2P table 37 corresponding to all LBAs included in the second specific command. Alternatively, the unmap unit 242 stores NULL values in these entries. This unmap operation makes all clusters corresponding to the LBAs to be securely erased invalid in the L2P table 37. As a result, data associated with all LBAs to be securely erased becomes invalid data.
[0279] The GC unit 243 selects at least all active blocks that store invalid data of the LBA to be securely erased as GC target blocks (i.e., copy source blocks). Alternatively, in order to simply implement the GC operation, the GC unit 243 may select at least all active blocks that store invalid data as copy source blocks, regardless of whether the data is invalid data of the LBA to be securely erased.
[0280] The GC unit 243 may store the block identifier of each active block selected as a copy source block in the list 34 of blocks to be securely erased.
[0281] The GC unit 243 selects any one of the free blocks. The GC unit 243 performs block erasure on the selected free block. The GC unit 243 assigns the free block that has been block-erased as a copy destination block.
[0282] The GC unit 243 copies valid data out of the data excluding the data to be securely erased, that is, valid data in the LBAs not to be securely erased, from the source block to the destination block (step S214A).
[0283] The GC unit 243 updates the L2P table 37 to map each of the LBAs of the copied valid data to each of the physical addresses of the copy destination.
[0284] The procedure of the unmap operation and the GC operation when the sector size is smaller than the cluster size will be described with reference to Figure 14C. The description of the same procedures as those of the unmap operation and the GC operation described with reference to Figure 14B will be omitted.
[0285] When the sector size is smaller than the cluster size, bitmap data indicating whether the data of each sector in the cluster is valid or invalid is stored, for example, in the L2P table 37 as described above.
[0286] The unmapping unit 242 selects a cluster including data of at least one sector to be securely erased as a target for the unmapping operation, and determines whether all sectors in this cluster are sectors to be securely erased (step S212B-1).
[0287] If all sectors in the cluster are to be securely erased, that is, if all data in the cluster is to be securely erased (YES in step S212B-1), the unmapping section 242 executes an unmapping operation to invalidate the data of this cluster (step S212B-4).
[0288] If the cluster includes one or more sectors not to be securely erased and one or more sectors to be securely erased (NO in step S212B-1), the unmap unit 242 updates the bitmap data so that the data of all sectors to be securely erased in the cluster is invalidated (step S212B-2).
[0289] The unmap unit 242 determines whether or not the data in all sectors within the cluster has been invalidated by this invalidation (step S212B-3).
[0290] If all sectors included in the cluster have become invalid sectors (YES in step S212B-3), the unmap unit 242 executes an unmap operation to invalidate the data of this cluster (step S212B-4).
[0291] If all sectors included in the cluster are not invalid, that is, if the cluster includes a valid sector that is not the target of secure erasure (NO in step S212B-3), the processing of this cluster by the unmap unit 242 ends.
[0292] The unmapping unit 242 determines whether or not the unmapping operation has been completed for all clusters that are the targets of the unmapping operation (step S212B-5).
[0293] If there is a cluster for which the unmapping operation has not been performed (NO in step S212B-5), the unmapping section 242 performs the determination in step S212B-1 on the next cluster.
[0294] When the unmap operation for all clusters is completed (YES in step S212B-5), the GC unit 243 copies data of all clusters including valid data in the active block (i.e., data not subject to secure erasure) from the source block to the destination block (step S214B-1).
[0295] In step S214B-1, if there is an invalid sector in the cluster, the GC unit 243 changes the data of the sector to an appropriate value before copying it to the destination block. The appropriate value is, for example, all 0s or all 1s, random data, or a combination thereof.
[0296] The GC unit 243 updates the entry in the L2P table 37 to map the LBA of the copied data to the physical address of the cluster to which it is copied.
[0297] Returning to the description of Fig. 14A, after the GC operation is performed (step S214), the GC unit 243 judges whether or not the end condition of the GC operation is satisfied (step S222), as in the first embodiment. The end condition may be that no block storing invalid data of the LBA to be securely erased exists in the active block group.
[0298] The GC unit 243 continues to execute the GC operation until there are no more blocks storing invalid data of the LBAs to be securely erased in the active block group (NO in step S222, step S214).
[0299] When the GC operation end condition is satisfied (YES in step S222), the GC operation ends in the GC unit 243. At this point, there is no longer any possibility that invalid data in the LBA to be securely erased exists in any place other than the free block.
[0300] In addition, when all active blocks that store at least invalid data are selected as GC target blocks, regardless of whether the data is invalid data in the LBA to be securely erased, the end condition for the GC operation may be that no blocks that store invalid data exist in the active block group, regardless of whether the data is invalid data in the LBA to be securely erased. However, this end condition reduces the efficiency of the GC operation. Therefore, this end condition may be adopted when the ratio of invalid data to valid data is high in each of all active blocks.
[0301] After judging the end condition of the GC operation (step S222), the secure erase unit 244 performs at least a block erase operation on each free block in which invalid data of the LBA to be securely erased is stored (step S224). As a result, all invalid data of the LBA to be securely erased is securely erased by block erase.
[0302] In step S224, the secure erase unit 244 performs block erase on each free block in which invalid data of the LBA to be securely erased is stored, and may further write a specific data pattern to each of these free blocks as in the first embodiment. As a result, all of the invalid data of the LBA to be securely erased is securely erased by overwriting.
[0303] The secure erase unit 244 may perform block erasure on all free blocks regardless of whether or not invalid data of the LBA to be securely erased is stored in the free blocks. This allows the process of performing at least block erasure on each free block in which invalid data of the LBA to be securely erased is stored (step S224) to be easily performed.
[0304] Alternatively, in order to reduce the number of blocks on which block erasure is performed, the secure erase unit 244 may execute a process to identify one or more free blocks in which invalid data is stored in the LBA to be securely erased, and perform block erasure on only the identified one or more free blocks.
[0305] In either the former or latter case, at least one or more free blocks in which invalid data of the LBA to be securely erased is stored are to be subject to secure erasure.
[0306] Upon completion of the process of step S224, the erase control unit 24 notifies the host 2 of the completion of the second specific command by transmitting a response indicating the completion of the second specific command to the host 2 (step S226).
[0307] Then, the Audit function execution unit 245 executes the Audit function (step S228). By executing the Audit function, the controller 4 transmits data to the host 2 that can be used to check whether or not the secure erase has been executed normally, using the specific LBA held in step S208 and the copy of the mapping information held in step S210, in response to the read command issued from the host 2. Details of the procedure of step S228 will be described with reference to the flowchart of FIG.
[0308] 15A and 15B are flowcharts showing the procedure of processing related to the Audit function executed in the memory system according to the third embodiment. Descriptions of the same procedures as those of the processing related to the Audit function executed in the memory system according to the first embodiment described with reference to FIGS. 7A and 7B will be omitted.
[0309] When the completion of the second specific command is notified to the host 2 in step S226 described with reference to FIG. 14A, the Audit function execution unit 245 transitions the controller 4 to the Audit mode as shown in FIG. 15A (step S302).
[0310] If the command received in step S304 is a read command (YES in step S306), the controller 4 determines whether or not the LBA included in the received read command matches the specific LBA held in step S208 described with reference to FIG. 14A, for example, whether or not the LBA included in the received read command belongs to the specific LBA range held in step S208 (step S342). The controller 4 may switch the order of execution of steps S306 and S342. In this case, the controller 4 may omit the process of step S344.
[0311] If the LBA included in the read command does not match a specific LBA, for example, if the LBA included in the read command does not belong to a specific LBA range (NO in step S342), the controller 4 refers to the mapping information in the L2P table 37 and obtains the physical address mapped to the LBA included in the received read command (step S310).
[0312] If the LBA included in the read command matches a specific LBA, for example, if the LBA included in the read command belongs to a specific LBA range (YES in step S342), the controller 4 refers to the copy of the mapping information retained in step S210 described with reference to FIG. 14A, and obtains the physical address mapped to the LBA included in the received read command (step S314).
[0313] As shown in FIG. 15B, if the received command is a write command (YES in step S318), the controller 4 determines whether the LBA included in the received write command matches the specific LBA held in step S208, for example, whether the LBA included in the received write command belongs to the specific LBA range held in step S208 (step S344).
[0314] If the LBA included in the write command does not match a specific LBA, for example, if the LBA included in the write command does not belong to a specific LBA range (NO in step S344), the controller 4 executes the process of step S322 and the process of step S324.
[0315] If the LBA included in the write command matches a specific LBA, for example, if the LBA included in the write command belongs to a specific LBA range (YES in step S344), the controller 4 discards the copy of the mapping information and the information indicating the specific one or more LBAs (for example, the specific LBA range) (step S346).Then, the controller 4 executes the process of step S328, the process of step S330, and the process of step S332.
[0316] If the received command is an Audit mode exit command (YES in step S334), the controller 4 discards the copy of the mapping information and the information indicating one or more specific LBAs (e.g., a specific LBA range) (step S348).Then, the controller 4 exits the Audit mode (step S338) and ends the Audit function.
[0317] The handling of the I / O command when the second specific command is received is the same as in the first embodiment, and therefore a description thereof will be omitted.
[0318] As described above, according to the third embodiment, the data of one or more specific LBAs can be securely erased by the physical secure erase method. Also, if a cluster that stores valid data and partly contains data of a sector to be securely erased is included in the copy source block, the controller 4 changes the data of the sector to be securely erased to a data pattern such as all 1 or all 0 when copying the entire data of this cluster to the copy destination block. Therefore, even if a cluster exists in which a sector to be securely erased and a valid sector not to be securely erased are mixed, it is possible to correctly copy data of a valid sector not to be securely erased while ensuring the safety of the physical secure erase operation.
[0319] Furthermore, the controller 4 can execute an audit function to check whether or not the secure erase operation on the data in the sector to be securely erased has been executed normally.
[0320] (Fourth embodiment) Next, a fourth embodiment will be described. The configuration of the SSD according to the fourth embodiment is the same as the configuration of the SSD 3 according to the first embodiment shown in FIG. 1. The fourth embodiment performs secure erasure of data at a specific LBA, as in the third embodiment, but differs from the third embodiment in the process related to the unmap operation. In the third embodiment, the controller 4 performs the unmap operation before the GC operation. In contrast, in the fourth embodiment, the controller 4 performs the unmap operation while the GC operation is being executed.
[0321] Fig. 16A is a flowchart showing the procedure of the physical secure erase operation executed in the memory system according to the fourth embodiment. The description of the same procedures as those of the physical secure erase operation executed in the memory system according to the third embodiment described with reference to Fig. 14A will be omitted.
[0322] When the LBAs to be securely erased (e.g., the range of LBAs to be securely erased) included in the second specific command received in step S202 are held (step S208), the GC unit 243 executes a GC operation. During the execution of the GC operation, the mapping information copy unit 241 executes an operation of copying mapping information corresponding to the LBAs to be securely erased (e.g., the range of LBAs to be securely erased), and the unmapping unit 242 executes an unmapping operation (step S232).
[0323] As in the third embodiment, the procedure of step S232, which includes the GC operation, the operation of copying mapping information, and the unmap operation, differs depending on the relationship between the sector size and the cluster size.
[0324] 16B is a flowchart showing the procedure of the GC operation and the unmap operation when the sector size is equal to the cluster size, in which one sector to be securely erased corresponds to one cluster.
[0325] In step S232A-1, the GC unit 243 selects an active block that stores at least data of the LBA to be securely erased and valid data of the LBA not to be securely erased as a GC target block (i.e., a copy source block), regardless of whether the data of the LBA to be securely erased is valid data or invalid data. Alternatively, in order to simply implement the GC operation, the GC unit 243 may select all active blocks that store invalid data as copy source blocks, regardless of whether the data is of the LBA to be securely erased. The GC unit 243 copies the valid data of the LBA not to be securely erased from the copy source block to the copy destination block.
[0326] In step S232A-2, if valid data of the LBA to be securely erased is stored in the copy source block, the mapping information copy unit 241 executes an operation of copying mapping information corresponding to the data to be securely erased stored in the copy source block. The unmap unit 242 executes an unmap operation of invalidating the valid data stored in the copy source block. This allows the mapping information copy unit 241 to copy the mapping information immediately before it is invalidated. When the valid data of the LBA not to be securely erased stored in the copy source block is copied to the copy destination block and an unmap operation of invalidating the valid data of the LBA to be securely erased stored in the copy source block is also performed, the copy source block becomes a free block. As a result, the data of the LBA to be securely erased does not exist anywhere other than the free block. In other words, the data (invalid data) of the LBA to be securely erased exists only in some free blocks.
[0327] 16C is a flowchart showing the procedure of the GC operation and the unmap operation when the sector size is smaller than the cluster size. In this case, the bitmap data indicating whether the data of each sector in the cluster is valid or invalid is stored in, for example, the L2P table 37, as described above.
[0328] The mapping information copy unit 241, the unmap unit 242, and the GC unit 243 select a cluster including at least one valid sector as a target for the mapping information copy operation, the unmap operation, and the GC operation, and determine whether all sectors in this cluster are sectors to be securely erased (step S232B-1).
[0329] If the cluster to be processed includes at least one sector to be securely erased (YES in step S232B-1), the mapping information copy unit 241 holds a copy of the mapping information corresponding to the cluster to be processed (step S232B-2).
[0330] The unmap unit 242 updates the bitmap data so that the data of all sectors to be securely erased in the cluster is invalidated (step S232B-3).
[0331] The unmap unit 242 determines whether or not the data in all sectors within the cluster has been invalidated by this invalidation (step S232B-4).
[0332] If the data in all sectors in the cluster has been invalidated (YES in step S232B-4), the unmapping section 242 executes an unmapping operation to invalidate the data in that cluster (step S232B-5).
[0333] After step S232B-5, if the cluster includes a sector that has not been invalidated (i.e., the cluster stores valid data of one or more sectors that are not subject to secure erasure) (NO in step S232B-4), or if the cluster to be processed does not include a sector that is subject to secure erasure (NO in step S232B-1), the GC unit 243 copies valid data in the cluster (i.e., valid data of one or more sectors that are not subject to secure erasure) from the source block to the destination block (step S232B-6). At this time, the GC unit 243 replaces data of the invalidated sectors in the cluster with appropriate values, as in the third embodiment. In step S232B-5, if all sectors in the cluster are valid, the GC unit 243 copies data of all sectors to the destination block, and the GC unit 243 updates the L2P table 37 to update the physical address of the source cluster to the physical address of the destination cluster.
[0334] The GC unit 243 determines whether the operation of copying mapping information, the operation of unmapping, and the operation of GC have been completed for all clusters including valid sectors (step S232B-7).
[0335] If there is a cluster for which these operations have not been completed (NO in step S232B-7), the GC unit 243 performs the determination in step S232B-1 on the next cluster for which these operations have not been completed.
[0336] When the operation of copying mapping information, the operation of unmapping, and the operation of GC have been completed for all clusters (YES in step S232B-7), the process by the GC unit 243 proceeds to step S222.
[0337] Finally, all valid data is copied to the destination block, and the source block becomes a free block. This means that the data of the LBA to be securely erased will not exist anywhere other than in free blocks. In other words, the data of the LBA to be securely erased (invalid data) will only exist in some free blocks.
[0338] Returning to the explanation of Fig. 16A, after the GC operation is executed (step S232), the termination conditions for the GC operation are judged (step S222), a block erase operation is executed (step S224), the host 2 is notified of the command completion (step S226), and the Audit function (step S228) is executed, similarly to the third embodiment.
[0339] The handling of I / O commands when the second specific command is executed and the processing related to the Audit function are the same as in the third embodiment, and therefore a description thereof will be omitted.
[0340] In the fourth embodiment, the same effects as in the third embodiment can be obtained.
[0341] As described above, according to the first to fourth embodiments, the secure erase operation using the GC operation can securely erase the data to be securely erased that is associated with the logical area identifier of the logical area to be securely erased, and after the secure erase operation using the GC operation is completed, an Audit function can be executed to check whether the secure erasure of the data to be securely erased has been performed correctly.
[0342] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims.
[0343] For example, the controller 4 may use a different means to transmit to the host 2 a completion response indicating that the specific command has been received and a completion response indicating that the execution of the specific command has been completed. [Explanation of symbols]
[0344] 1...information processing system, 2...host, 3...SSD, 4...controller, 5...NAND flash memory, 6...DRAM, 11...host interface, 12...CPU, 13...NAND interface, 14...DRAM interface, 15...DMAC, 16...SRAM, 17...ECC encoding / decoding unit, 21...name space management unit, 22...write control unit, 23...read control unit, 24...erase control unit, 31...write buffer, 32...read buffer, 33...command buffer, 34...block list to be securely erased, 35...free block list, 36...active block list, 37...L2P table, 241...mapping information copying unit, 242...unmapping unit, 243...GC unit, 244...secure erase unit, 245...Audit function execution unit.
Claims
1. a non-volatile memory including a plurality of blocks each of which is a unit of a data erase operation; a controller electrically connected to the non-volatile memory; The controller: managing a first table that holds mapping information indicative of a mapping between each of one or more logical area identifiers and each of one or more physical addresses of the non-volatile memory; In response to receiving a first command from a host requesting secure erasure of data to be securely erased that is associated with a first logical area identifier, retaining a copy of first mapping information corresponding to the first logical area identifier among the mapping information included in the first table; Identifying one or more first blocks among the plurality of blocks in which data to be securely erased that is associated with the first logical area identifier is stored; performing at least the data erase operation on at least the one or more first blocks; transitioning to a first mode after performing a data erase operation on the one or more first blocks; in the first mode, in response to receiving a read command from the host specifying the first logical area identifier, reading data from a storage location in the non-volatile memory corresponding to a first physical address that is mapped to the first logical area identifier in the copy of the first mapping information; It is configured as follows: Memory system.
2. The controller: In response to receiving the first command from the host, invalidating data to be securely erased that is associated with the first logical area identifier among valid data stored in the one or more first blocks; performing a copy operation to copy valid data other than the data to be securely erased that is associated with the first logical area identifier, among the valid data stored in the one or more first blocks, to one or more copy destination blocks among the plurality of blocks; performing the data erase operation on the one or more first blocks after performing the copy operation; [0023] 2. The memory system of claim 1.
3. The controller: In the first mode, in response to receiving from the host a read command specifying a second logical area identifier different from the first logical area identifier, reading data from a storage area in the non-volatile memory corresponding to a second physical address that is mapped to the second logical area identifier in the mapping information included in the first table, and transmitting the read data to the host; [0023] 2. The memory system of claim 1.
4. The controller: exiting the first mode in response to receiving from the host a command requesting an end of the first mode or a write command specifying the first logical area identifier; [0023] 2. The memory system of claim 1.
5. The controller: holding the first logical area identifier specified by the first command; discarding the first logical area identifier in response to receiving from the host a command requesting termination of the first mode or a write command specifying the first logical area identifier; [0023] 5. The memory system of claim 4.
6. The controller: discarding the copy of the first mapping information in response to receiving from the host a command requesting termination of the first mode or a write command specifying the first logical area identifier; [0023] 5. The memory system of claim 4.
7. When the one or more first blocks include a plurality of first blocks, the controller: performing the data erase operation on a second block that is one of the plurality of first blocks; performing a copy operation to copy valid data, other than the data to be securely erased that is associated with the first logical area identifier, among valid data stored in a third block that is different from the second block among the plurality of first blocks, to the second block on which the data erase operation has been performed; [0023] 2. The memory system of claim 1.
8. The controller: In response to receiving the first command from the host, invalidating data to be securely erased that is associated with the first logical area identifier; performing at least the data erasure operation on one or more blocks that have not stored valid data since before the data to be securely erased associated with the first logical area identifier is invalidated among the plurality of blocks and that store invalid data among the data to be securely erased associated with the first logical area identifier; [0023] 2. The memory system of claim 1.
9. The controller is configured to manage a plurality of namespaces, each of which is identified by a plurality of namespace identifiers; The first logical area identifier is a namespace identifier for identifying a namespace to be securely erased.
2. The memory system of claim 1.
10. the first logical area identifier includes one or more logical addresses identifying one or more sectors to be securely erased; 2. The memory system of claim 1.
11. The first logical region identifier includes one or more keys that identify one or more values to be securely erased.
2. The memory system of claim 1.
12. The controller: storing the copy of the first mapping information in the non-volatile memory; It is configured as follows:
2. The memory system of claim 1.
13. The controller: performing the data erase operation on a second block that is one of the one or more first blocks; storing the copy of the first mapping information in a second block on which the data erase operation was performed; It is configured as follows:
13. The memory system of claim 12.
14. The controller: Invalidating data to be securely erased that is associated with the first logical area identifier by deleting a third physical address that is mapped to the first logical area identifier in the mapping information included in the first table from the mapping information; when deleting the third physical address from the mapping information, a part of the mapping information including the third physical address is retained as the copy. [0023] 2. The memory system of claim 1.
15. The data to be securely erased associated with the first logical area identifier includes invalid data.
2. The memory system of claim 1.
16. The controller: sending a response to the host, as a response to the read command, indicating that error correction has failed for the data read from the storage location corresponding to the first physical address; [0023] 2. The memory system of claim 1.
17. The controller: reading the data from a memory location corresponding to the first physical address that is in an erased state due to execution of a data erase operation on the one or more first blocks; It is configured as follows:
2. The memory system of claim 1.
18. The controller: after performing a data erase operation on the one or more first blocks, writing data having a specific data pattern for overwriting data to a memory location corresponding to the first physical address; reading data having the specific data pattern from a storage location corresponding to the first physical address in response to receiving the read command from the host; [0023] 2. The memory system of claim 1.
19. The controller: sending a response to the host, as a response to the read command, indicating that the data read from the storage location corresponding to the first physical address was invalid data; [0023] 2. The memory system of claim 1.
Citation Information
Patent Citations
Memory comptroller, nonvolatile storage device, nonvolatile storage system, and memory control method
JP2020003858A
Memory system and control method
JP2022007376A
Selective erasure of data in a SSD
US20200218465A1
US10,353,612
US10,403,369
