MEMORY SYSTEM AND CONTROL METHOD - Patent application
Patent Information
- Application Number
- JP2021011137
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-01-27
- Publication Date
- 2024-09-09
- Estimated Expiration
- 2041-01-27
Smart Images

Figure 0007547231000017 
Figure 0007547231000012 
Figure 0007547231000009
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] Storage devices such as SSDs, which are capable of high-speed data input and output, are also effectively used as swap areas due to their high performance. Swap areas are storage areas used to temporarily store data swapped out from the host's memory by the swapping function of the operating system running on the host. In SSDs, a process is executed to store the data swapped out from the host's memory to the SSD in a non-volatile manner. This allows the swapped-out data to be retained in the SSD across power cycles of the SSD.
[0004] However, like volatile memory in the host, the swap area is required to retain stored data only while the host is powered on. Therefore, retaining data swapped out from the host memory in the SSD across power cycles of the SSD means that data that is no longer used by the host continues to be retained in the SSD. This can cause unnecessary wear and tear on the non-volatile memory in the SSD.
[0005] Therefore, there is a need for a new technology that can reduce wear on non-volatile memory. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2009-223787 A [Patent Document 2] Patent No. 6320322 [Patent Document 3] U.S. Pat. No. 9,563,566 Summary of the Invention [Problem to be solved by the invention]
[0007] An object of the present invention is to provide a memory system and a control method capable of reducing wear of a non-volatile memory. [Means for solving the problem]
[0008] According to an embodiment, a memory system connectable to a host includes a non-volatile memory and a controller electrically connected to the non-volatile memory. In response to receiving a first namespace creation command from the host specifying a first attribute, the controller creates a first namespace including a first logical address range and having a first attribute. The controller receives a power cutoff notice from the host notifying the user that power supply to the memory system will be cut off. And then, Alternatively, during a first period from when an abnormal power outage of the memory system is detected until power is supplied again to the memory system and the controller is in a ready state to process commands from the host, each of the logical addresses included in the first logical address range is placed in an unallocated state in which no physical address of the non-volatile memory is mapped. [Brief description of the drawings]
[0009] [Figure 1] 1 is a block diagram showing an example of the configuration of an information processing system including a memory system according to an embodiment. [Diagram 2] 1 is a diagram showing an example of the configuration of a NAND flash memory in a memory system according to an embodiment; [Diagram 3]1 is a diagram showing an example of the configuration of a logical-physical address conversion table managed in the memory system according to the embodiment. [Figure 4] 1 is a diagram for explaining a plurality of namespaces managed in a memory system according to an embodiment; [Diagram 5] 1 is a diagram showing a namespace management table managed in a memory system according to an embodiment. [Figure 6] FIG. 4 is a diagram showing a block management table managed in the memory system according to the embodiment. [Figure 7] 1 is a diagram showing a block use order management table managed in a memory system according to an embodiment. [Figure 8] 4 is a diagram for explaining data written to a NAND flash memory included in the memory system according to the embodiment; [Figure 9A] 11 is a first diagram for explaining the restoration preparation process of the logical-physical address conversion table executed in the memory system according to the embodiment. FIG. [Figure 9B] FIG. 11 is a second diagram for explaining the restoration preparation process of the logical-physical address conversion table executed in the memory system according to the embodiment. [Figure 10] A diagram for explaining an operation of creating a namespace with a clear attribute and an operation of omitting a restoration preparation process for a logical-physical address conversion table associated with a namespace with a clear attribute, which are performed in a memory system according to an embodiment. [Figure 11] 11A and 11B are diagrams for explaining a clearing process executed in the memory system according to the embodiment. [Figure 12] 11 is a diagram for explaining an operation of setting or discarding a logical-physical address conversion table associated with a namespace having a clear attribute to an initial state, which is executed in the memory system according to the embodiment. [Figure 13]11 is a diagram for explaining an operation executed in the memory system according to the embodiment, in which each of the blocks associated with a namespace having a clear attribute is managed as a free block. [Figure 14] FIG. 13 is a diagram for explaining a process for reformatting a namespace having a clear attribute, which is executed in a host. [Figure 15] 1 is a flowchart showing the procedure of a namespace creation process executed in a memory system according to an embodiment. [Figure 16] 11 is a flowchart showing the procedure of a restoration preparation process executed in the memory system according to the embodiment. [Figure 17] A flowchart showing the steps of processing performed in a memory system according to an embodiment during the period from when a power interruption notice is received from a host until power is supplied again to the memory system and the memory system controller becomes ready. [Figure 18] 11 is a flowchart showing the procedure of processing executed in a memory system according to an embodiment during the period from the detection of an unauthorized power outage to the time when power is supplied again to the memory system and the controller of the memory system becomes ready. [Figure 19] 1 is a flowchart showing the procedure of a shutdown preparation process executed in a memory system according to an embodiment. [Figure 20] 1 is a flowchart showing the procedure of a suspend preparation process executed in a memory system according to an embodiment. [Figure 21] 11 is a flowchart showing the procedure of a clearing process executed in the memory system according to the embodiment. [Figure 22] 11 is a flowchart showing the procedure of processes executed in the memory system and the host according to the embodiment after power is supplied again to the memory system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] Hereinafter, an embodiment will be described with reference to the drawings. 1 is a block diagram showing an example of the configuration of an information processing system 1 including a memory system according to an embodiment. The information processing system 1 includes a host (host device) 2 and an SSD 3.
[0011] The memory system 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 may be realized as an SSD 3 including a NAND flash memory 5, for example.
[0012] 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. As a standard for a logical interface for connecting the host 2 and the SSD 3, NVM Express is TM (NVMe TM ), Serial Attached SCSI (SAS), or Serial ATA (SATA), etc. may be used.
[0013] The host 2 is an information processing device configured to control the SSD 3. Examples of the host 2 include a personal computer, a server computer, a mobile terminal, and an in-vehicle device.
[0014] The host 2 includes a processor 101 and a memory 102. The processor 101 is a central processing unit (CPU) configured to control the operation of each component in the host 2. The processor 101 executes software (host software) that is loaded into the memory 102 from another storage device or an SSD 3 connected to the host 2. The host software includes an operating system (OS) 1011. In addition to the operating system 1011, the host software also includes a file system, a device driver, and an application program.
[0015] The memory 102 is a main memory provided in the host 2. The memory 102 is realized by, for example, a random access memory such as a dynamic random access memory (DRAM). A DRAM is a volatile memory in which stored data is lost when the power supply is cut off.
[0016] The operating system 1011 manages the resources of the entire information processing system 1, including the processor 101, the memory 102, and the SSD 3. The operating system 1011 also manages application programs (hereinafter simply referred to as "programs") that run on the host 2.
[0017] 1, the operating system 1011 includes a process management unit 1111 and a memory management unit 1112. The process management unit 1111 manages the generation, execution, and termination of each process executed in the host 2. The memory management unit 1112 executes a process of allocating a portion of a memory area in the memory 102 to a specific process based on a memory allocation request from the process management unit 1111.
[0018] When starting execution of a certain program, the process management unit 1111 in the operating system 1011 generates a process for this program. Then, the process management unit 1111 requests the memory management unit 1112 to allocate memory for this generated process. Upon receiving the memory allocation request, the memory management unit 1112 allocates a portion of the memory area in the memory 102 to this process. The process management unit 1111 reads this program from the SSD 3 or another storage device in the information processing system 1, and loads this program into the allocated memory area.
[0019] Here, it will be explained that the contents of a memory area allocated to a certain process are written to the SSD 3 or read from the SSD 3 at the timing of swap-out or swap-in.
[0020] The memory management unit 1112, which has received a memory allocation request from the process management unit 1111, may save data stored in a memory area allocated to another process to the SSD 3 in order to secure a memory area to be allocated to this process. This saving process is called swap-out. The data swapped out from the memory 102 to the SSD 3 is written to a non-volatile memory in the SSD 3. When a process that has been swapped out is to be executed again on the processor 101, a process is performed in which the swapped-out data is read from the SSD 3 and restored to the memory area in the memory 102. This restoration process is called swap-in.
[0021] Here, swapping out and swapping in between the memory 102 and the SSD 3 is performed only when the power supply of the host 2 is on. After the operating system 1011 is shut down and the power supply of the host 2 is turned off, that is, after the power supply from the host 2 to the SSD 3 is cut off, the data written to the SSD 3 by swapping out is no longer used by the host 2.
[0022] Similar to data written to SSD3 by swapping out, for example, files written to a folder called the "Tmp folder" (or " / Tmp directory") will also become data that is not used by host2 after host2 is powered off by shutting down operating system 1011, i.e., after power supply to SSD3 is cut off.
[0023] Next, a description will be given of the configuration of the SSD 3. The SSD 3 includes a controller 4, a non-volatile memory (for example, a NAND flash memory 5), a random access memory (for example, a DRAM 6), and a power supply circuit 7.
[0024] The controller 4 controls a data write operation to write data to the NAND flash memory 5 based on a command received from the host 2, and a data read operation to read data to be read from the NAND flash memory 5 based on a command received from the host 2.
[0025] The controller 4 may be realized by a circuit such as a System-on-a-chip (SoC). Each function of the controller 4 may be realized by a dedicated hardware circuit, a processor that executes a program (firmware), or a combination of these.
[0026] 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 or the Open NAND Flash Interface (ONFI). The controller 4 operates as a memory controller configured to control the NAND flash memory 5.
[0027] 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.
[0028] The data management performed by the FTL includes (1) management of address translation data (mapping information) indicating the correspondence between each logical address and each physical address of the NAND flash memory 5, and (2) processing for concealing the constraints of the NAND flash memory 5 (e.g., read / write operations in page units and erase operations in block units). A physical address corresponding to a certain logical address indicates a physical storage location in the NAND flash memory 5 where data corresponding to this logical address is written. The controller 4 uses a logical-to-physical address translation table (L2P table) to manage the mapping between each logical address and each physical address. A logical block address (LBA) may be used as the logical address.
[0029] In this embodiment, the controller 4 is configured to use multiple L2P tables (e.g., L2P tables 31-1 to 31-n) corresponding to multiple namespaces, respectively, to manage, for each namespace, the mapping between each logical address corresponding to the namespace and each physical address of the NAND flash memory 5.
[0030] A part or all of the address translation data of each of the L2P tables 31-1 to 31-n is loaded from the NAND flash memory 5 to the DRAM 5 during an initialization process executed by the controller 4 in response to power being supplied to the SSD 3.
[0031] Each of the L2P tables 31-1 to 31-n may be realized as a hierarchical L2P table including a plurality of tables corresponding to a plurality of hierarchical levels, although this is not limited thereto. An example of the configuration of the hierarchical L2P table will be described later with reference to FIG.
[0032] The NAND flash memory 5 includes a memory cell array including 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.
[0033] 2, 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 for erasing data. Each of the pages P0 to Py-1 is a unit of a data write operation and a data read operation.
[0034] Returning to Fig. 1 for explanation, the NAND type flash memory 5 is used to store a plurality of L2P tables 31-1 to 31-n corresponding to the plurality of namespaces NS#1 to NS#n, respectively, and a plurality of user data 41-1, ..., 41-n corresponding to the plurality of namespaces NS#1 to NS#n, respectively.
[0035] The DRAM 6 is a volatile memory. A part of the memory area of the DRAM 6 is used to store the L2P tables 31-1 to 31-n, the namespace management table 32, the block management table 33, and the block use order management table 34. The details of the namespace management table 32, the block management table 33, and the block use order management table 34 will be described later with reference to FIGS. 5, 6, and 7.
[0036] The power supply circuit 7 uses power supplied from the host 2, i.e., the power supply voltage Vcc, to generate a power supply voltage for driving the controller 4, a power supply voltage for driving the NAND flash memory 5, and a power supply voltage for driving the DRAM 6, and supplies these generated power supply voltages to the controller 4, the NAND flash memory 5, and the DRAM 6, respectively.
[0037] Furthermore, the power supply circuit 7 communicates with the controller 4. When the voltage value of the power supply voltage Vcc drops below a predetermined value, the power supply circuit 7 notifies the controller 4 that the power supply to the SSD 3 has been cut off (hereinafter referred to as a power off detection notification). For example, when the power off detection notification is received from the power supply circuit 7 before receiving a notification from the host 2 notifying the SSD 3 that the power supply to the SSD 3 will be cut off (hereinafter referred to as a power cut advance notification), the controller 4 detects that an unauthorized power cut has occurred. An unauthorized power cut refers to a phenomenon in which the power supply to the SSD 3 is suddenly cut off without notifying the SSD 3 that the power supply to the SSD 3 will soon be cut off.
[0038] The power supply circuit 7 may also have a power loss protection (PLP) function that enables the power supply voltage to be continuously supplied to each of the controller 4, the NAND flash memory 5, and the DRAM 6 for a predetermined period of time after an unauthorised power outage occurs. In this case, the power supply circuit 7 may be connected to, for example, a capacitor 71. When the supply of the power supply voltage Vcc from the host 2 to the power supply circuit 7 is cut off due to an unauthorised power outage, the power supply circuit 7 uses the energy stored in the capacitor 71 to supply the power supply voltage to each of the controller 4, the NAND flash memory 5, and the DRAM 6 for a predetermined period of time after the unauthorised power outage occurs.
[0039] Next, a detailed configuration of the controller 4 will be described. The controller 4 includes a host interface (host I / F) 11, a CPU 12, a NAND interface (NAND I / F) 13, a DRAM interface (DRAM I / F) 14, a direct memory access controller (DMAC) 15, a static random access memory (SRAM) 16, and an error correction code (ECC) encoding / decoding unit 17. The host interface 11, the CPU 12, the NAND interface 13, the DRAM interface 14, the DMAC 15, the SRAM 16, and the ECC encoding / decoding unit 17 are interconnected via a bus 10.
[0040] The host interface 11 is a host interface circuit configured to perform communication with the host 2. The host interface circuit 11 receives various requests or notifications from the host 2. Examples of the various requests or notifications include a power interruption notice, a namespace creation request (namespace creation command), a namespace deletion request (namespace deletion command), a write request (write command), and a read request (read command).
[0041] As described above, the power cutoff advance notice is a notice giving advance notice of a cutoff of power supply to the SSD 3. Before the power of the host 2 is turned off, the host 2 sends a power cutoff advance notice to the SSD 3 to notify the SSD 3 that the power supply to the SSD 3 will soon be cut off.
[0042] As the advance notice of power interruption, for example, a Shutdown Notification defined in the NVMe standard or a STANDBY IMMEDIATE command defined in the SATA standard may be used.
[0043] When the controller 4 receives a power cutoff advance notice from the host 2, the controller 4 performs a shutdown preparation process including a process of writing the contents of the DRAM 6 that have not yet been written to the NAND flash memory 5 (for example, the contents of the updated L2P table) to the NAND flash memory 5. The host 2 does not cut off the supply of power to the SSD 3 until the controller 4 notifies the host 2 that the shutdown preparation process of the SSD 3 has been completed, or until a predetermined period has elapsed since the host 2 sent the power cutoff advance notice to the SSD 3.
[0044] The create namespace command is a command that requests the SSD 3 to create a namespace. The delete namespace command is a command that requests the SSD 3 to delete a specific namespace.
[0045] A write command is a command that requests the SSD 3 to write data (write data) to a specific namespace. The write command specifies a namespace identifier of the namespace to which the write data should be written, a start LBA corresponding to the write data, a size of the write data (the number of LBAs), a data pointer (buffer address) indicating the location in memory 102 where the write data is stored, and the like.
[0046] The read command is a command that requests the SSD 3 to read the read target data. The read command specifies a namespace identifier of a namespace from which the read target data should be read, a start LBA corresponding to the read target data, a size of the read target data (the number of LBAs), a data pointer (buffer address) indicating a position in the memory 102 to which the read target data should be transferred, and the like.
[0047] The NAND interface 13 is a NAND controller configured to control the NAND flash memory 5 under the control of the CPU 12. When the NAND flash memory 5 is composed of multiple NAND flash memory chips (NAND flash memory dies), the NAND interface 13 may be connected to these NAND flash memory chips via multiple channels (Ch).
[0048] The DRAM interface 14 is a DRAM controller configured to control the DRAM 6 under the control of the CPU 12 .
[0049] Under the control of the CPU 12, the DMAC 15 executes data transfer between the memory 102 of the host 2 and the SRAM 16 (or the DRAM 6).
[0050] The SRAM 16 is a volatile memory. The SRAM 16 includes an internal buffer 161. The internal buffer 161 may be used as a write buffer for temporarily storing write data to be written to the NAND flash memory 5.
[0051] When write data is to be written to the NAND flash memory 5, the ECC encoding / decoding unit 17 encodes the write data to add an ECC to the write data as a redundant code. When data is read from the NAND flash memory 5, the ECC encoding / decoding unit 17 corrects errors in the read data by using the ECC added to the data.
[0052] The CPU 12 is a processor configured to control the host interface 11, the NAND interface 13, the DRAM interface 14, the DMAC 15, the SRAM 16, and the ECC encoding / decoding unit 17. The CPU 12 loads a control program (firmware) stored in the NAND flash memory 5 or a ROM (not shown) into the SRAM 16 (or the DRAM 6), and executes this firmware to perform various processes.
[0053] The CPU 12 can function as a namespace management command processing unit 21, an I / O command processing unit 22, a clear processing unit 23, and a restoration processing unit 24. A part or all of each of the namespace management command processing unit 21, the I / O command processing unit 22, the clear processing unit 23, and the restoration processing unit 24 may be realized by dedicated hardware in the controller 4.
[0054] The namespace management command processing unit 21 creates a namespace in response to a namespace creation command received from the host 2, and manages the created namespace. The namespace management command processing unit 21 can create and manage multiple namespaces. Multiple namespaces are logical address ranges independent of each other. Multiple namespaces are used to operate one storage device as if it were multiple storage devices. Multiple namespaces are used by the host 2 to access the SSD 3.
[0055] Furthermore, in response to a namespace deletion command received from the host 2, the namespace management command processing unit 21 deletes the namespace specified by this namespace deletion command.
[0056] In this embodiment, the namespace management command processing unit 21 is configured to create and manage a namespace with a clear attribute. A namespace with a clear attribute is a namespace in which data associated with the logical address range of the namespace is permitted to be invalidated after the power supply to the SSD 3 is cut off. In other words, a namespace with a clear attribute is a namespace in which data written to the namespace does not need to be retained across power cycles of the SSD 3.
[0057] The process in which the power supply from the host 2 to the SSD 3 is cut off and then the power is supplied again from the host 2 to the SSD 3 corresponds to one power cycle of the SSD 3.
[0058] Once the power supply to SSD3 is cut off, even if power is supplied again to SSD3, data written by host 2 to a namespace having the clear attribute before power supply to SSD3 was cut off can no longer be referenced by host 2. Data written to a namespace having the clear attribute is retained only while power is supplied to SSD3, that is, only while the power state of host 2 is in an operational state (powered on state) in which host software can be executed.
[0059] The namespace management command processing unit 21 supports a new namespace creation command that can specify a clear attribute. This new namespace creation command includes a parameter that specifies whether the attribute of the namespace to be created is a clear attribute or a non-clear attribute. This parameter is set by the host 2 to a value indicating the clear attribute or a value indicating the non-clear attribute.
[0060] When a namespace creation command specifying the clear attribute, that is, a namespace creation command including a parameter set to a value indicating the clear attribute, is received from the host 2, the namespace management command processing unit 21 creates a namespace having the clear attribute and transmits a namespace identifier of the created namespace to the host 2. Then, by using the namespace management table 32, the namespace management command processing unit 21 manages the namespace identifier of the created namespace in association with attribute information indicating the clear attribute.
[0061] The host 2 can use a namespace with a clear attribute as a namespace to which data that does not need to be retained across power cycles of the SSD 3 is written, for example, as a swap area.
[0062] When a namespace creation command that does not specify the clear attribute, that is, a namespace creation command including a parameter set to a value indicating the non-clear attribute, is received from the host 2, the namespace management command processing unit 21 creates a namespace with a non-clear attribute. A namespace with a non-clear attribute is a namespace that requires data associated with the logical address range of this namespace to be retained across power cycles of the SSD 3. Then, by using the namespace management table 32, the namespace management command processing unit 21 manages the namespace identifier of this created namespace in association with attribute information indicating the non-clear attribute.
[0063] The host 2 can use a namespace having a non-clear attribute as a namespace to which data that needs to be retained across power cycles of the SSD 3 is written.
[0064] The I / O command processing unit 22 executes processing of various I / O commands received from the host 2. The I / O commands include a write command, a read command, and the like.
[0065] When the controller 4 receives a write command specifying a certain namespace identifier from the host 2, the I / O command processing unit 22 executes a process of writing data associated with the received write command to the NAND flash memory 5. In this case, the I / O command processing unit 22 assigns a write destination block for a specific namespace identified by the namespace identifier specified by the received write command. Then, the I / O command processing unit 22 writes the data associated with the received write command to this write destination block. Note that if a write destination block for this specific namespace has already been assigned, there is no need to perform a process of newly assigning a write destination block. Then, the I / O command processing unit 22 updates the L2P table associated with this specific namespace so that a physical address indicating a physical storage location in the NAND flash memory 5 to which this data has been written is mapped to a logical address corresponding to this data. The L2P table associated with this specific namespace is used to manage the mapping between each logical address included in the logical address range of this specific namespace and each physical address in the NAND flash memory 5.
[0066] When the controller 4 receives a read command specifying a certain namespace identifier from the host 2, the I / O command processing unit 22 refers to the L2P table associated with the namespace specified by this namespace identifier, and acquires a physical address mapped to the LBA of the read target data specified by the received read command. The I / O command processing unit 22 reads from the NAND flash memory 5 the data stored in the physical storage location in the NAND flash memory 5 indicated by the acquired physical address. The I / O command processing unit 22 then returns the read data to the host 2 as the read target data.
[0067] The clear processing unit 23 executes a clear process for a namespace having a clear attribute. The clear process is executed during the period from when the controller 4 receives a power-off advance notice from the host 2 or detects an unauthorized power-off until power is supplied again to the SSD 3 and the controller 4 becomes ready to process commands.
[0068] The clear process is a process that puts each of the logical addresses included in the logical address range included in the namespace with the clear attribute into an unallocated state in which no physical address is mapped. This clear process makes all data associated with the logical address range included in the namespace with the clear attribute invalid. Therefore, the clear process makes the namespace with the clear attribute into a state similar to that of a namespace immediately after creation in which no data has yet been written. Therefore, all blocks associated with the namespace with the clear attribute become free blocks that do not contain valid data.
[0069] Therefore, for example, by using a namespace having a clear attribute as a storage destination for data that does not need to be retained across power cycles of SSD3, such as a swap area, it is possible to prevent the physical storage area in the NAND flash memory 5 from being wasted by data that does not need to be retained across power cycles of SSD3.
[0070] The clear processing unit 23 may execute the clear processing during the period from when power is supplied to the SSD 3 again until when the controller 4 enters a ready state, for example.
[0071] Alternatively, the clear processing unit 23 may execute the clear process in response to the controller 4 receiving a power-off advance notice from the host 2, or in response to the controller 4 detecting an unauthorized power-off. In a case where the clear processing unit 23 executes the clear process in response to the controller 4 receiving a power-off advance notice from the host 2, or in response to the controller 4 detecting an unauthorized power-off, it is preferable that the clear processing unit 23 writes information indicating that the clear process has been completed as status information of the clear process to the NAND flash memory 5 when the clear process is completed. This allows the clear processing unit 23 to determine whether or not the clear process for the namespace having the clear attribute has been completed normally after power is supplied to the SSD 3 again.
[0072] In the case where the clear process is executed during the period from when power is supplied to the SSD 3 again until the controller 4 becomes ready, the clear processing unit 23 does not need to execute the clear process when the controller 4 receives a power-off advance notice from the host 2 or when the controller 4 detects an unauthorized power-off. Therefore, for example, it is possible to shorten the time required for the SSD 3 to transition to a state in which it can be safely shut down after the SSD 3 receives a power-off advance notice. Furthermore, since there is no need to execute a process of writing status information indicating whether the clear process has been completed or not to the NAND flash memory 5, the amount of processing that the controller 4 needs to execute can be reduced compared to the case where the clear process is executed in response to receiving a power-off advance notice or detecting an unauthorized power-off.
[0073] The clear processing unit 23 can set the L2P table 31-1 corresponding to the namespace NS#1 having the clear attribute to an initial state in order to set each logical address included in the namespace having the clear attribute (for example, the namespace NS#1) to an unallocated state. The L2P table 31-1 being in the initial state means that a specific value (for example, an initial value) for indicating an unallocated state is stored in the L2P table 31-1 as address conversion data.
[0074] Alternatively, instead of setting the L2P table 31-1 corresponding to the namespace NS#1 having the clear attribute to the initial state, the clear processing unit 23 may discard the L2P table 31-1 corresponding to the namespace NS#1 having the clear attribute, thereby setting each of the logical addresses included in the namespace NS#1 to an unassigned state. In this case, the clear processing unit 23 may newly generate an L2P table in the initial state and assign the generated table to the namespace NS#1 as a new L2P table 31-1 for the namespace NS#1.
[0075] When the L2P table 31-1 is realized as a hierarchical L2P table including multiple tables corresponding to multiple hierarchical levels, the clear processing unit 23 can easily set each of the logical addresses included in the namespace NS#1 to an unallocated state by setting to an initial state or discarding only the table of the highest hierarchical level among the multiple hierarchical levels in the hierarchical L2P table.
[0076] The Advanced Configuration and Power Interface (ACPI) specification is known as a standard for power control of a system such as a computer. In the ACPI specification, the power state of a system is defined as a system state (S0 state to S5 state), and the power state of a device is defined as a device power state (D0 state to D3 state). In the following description, the power states defined in the ACPI specification are exemplified as possible power states of the host 2 and the SSD 3, although they are not limited thereto.
[0077] When the power state of host 2, i.e., the system power state, transitions from an operating state (S0 state) to a suspended state (S3 state or S4 state), host 2 sends an instruction (hereinafter referred to as a suspend instruction) to SSD 3 to change the current power state of SSD 3 (i.e., the current device power state of SSD 3) from an on state (D0 state) to a low power state (e.g., D1 state, D2 state, or D3 state) corresponding to the suspended state (S3 state or S4 state) of host 2.
[0078] Here, the operating state (S0 state) is a state in which the processor 101 executes instructions and reads and writes from and to the memory 102 can be performed by the processor 101. As the suspend state, a sleep state (S3 state) or a hibernation state (S4 state) is used. In the sleep state (S3 state), almost all the components in the host 2 except for the memory 102 are in a power-off state. On the other hand, in the hibernation state (S4 state), the contents of the memory 102 are stored as a hibernation file in a namespace with a non-clear attribute in the SSD 3, and almost all the components in the host 2 including the memory 102 are in a power-off state.
[0079] In response to receiving this suspend command from the host 2, the controller 4 transitions the current power state of the SSD 3 from the ON state (D0 state) to a low power state (D1 state, D2 state, or D3 state).
[0080] The on state (D0 state) is a state in which power is supplied to the SSD 3 and the SSD 3 can execute command processing. The low power state (D1 state, D2 state, or D3 state) is a power supply state in which power consumption is lower than that of the on state (D0 state). In the low power state, command processing is basically not executed. In the D3 state, the power supplied to the SSD 3 is cut off. In the D1 state and the D2 state, for example, in order to reduce the power consumption of the SSD 3, the power supply to at least a part of the components of the SSD 3, for example, the DRAM 6, is cut off while the state in which power is supplied to the SSD 3 is maintained.
[0081] For example, when the power state of the host 2 transitions from an operating state (S0 state) to a sleep state (S3 state), the host 2 may transmit a suspend instruction to the SSD 3 to change the current power state of the SSD 3, for example, from the D0 state to the D1 state or the D2 state. In this case, the current power state of the SSD 3 transitions from the D0 state to the D1 state or the D2 state.
[0082] Furthermore, for example, when the power state of the host 2 transitions from an operating state (S0 state) to a hibernation state (S4 state), the host 2 may transmit a suspend instruction to the SSD 3 to change the current power state of the SSD 3, for example, from the D0 state to the D3 state. In this case, the current power state of the SSD 3 transitions from the D0 state to the D3 state.
[0083] In addition, when the power state of the host 2 returns to an operating state from a suspended state and the operating system 101 resumes processing, the host 2 sends an instruction (hereinafter referred to as a resume instruction) to the SSD 3 to return the current power state of the SSD 3 from a low power state (e.g., D1 state, D2 state, or D3 state) to an operating state (D0 state).
[0084] While the SSD3 is in the D3 state, the supply of the power supply voltage Vcc to the SSD3 is stopped. Therefore, when the current power state of the SSD3 is returned from the D3 state to the D0 state, the host 2 also starts supplying the power supply voltage Vcc to the SSD3, so that power (power supply voltage Vcc) is supplied to the SSD3 again.
[0085] In response to receiving this resume command from the host 2, the controller 4 transitions the current power state of the SSD 3 from a low power state (D1 state, D2 state, or D3 state) to the ON state (D0 state).
[0086] When the power state of the host 2 returns from the suspended state to the operating state, the operating system 1011 may return to the memory 102 the data that was swapped out to the SSD 3 before the transition to the suspended state.
[0087] Therefore, when a suspend instruction is received from the host 2, or when a resume instruction is received from the host 2, the clear processing unit 23 does not perform the clear processing. This allows the SSD 3 to continue to hold the data written in the namespace having the clear attribute. Therefore, the host 2 can normally read from the SSD 3 the data that was swapped out to the SSD 3 before transitioning to the suspended state.
[0088] The restoration processing unit 24 executes a process of loading the L2P table from the NAND type flash memory 5 to the DRAM 6, a shutdown preparation process, a restoration process for restoring the L2P table, and a restoration preparation process which is a preparation process for this restoration process.
[0089] After power is supplied from the host 2 to the SSD 3, the restoration processor 24 loads the address translation data included in each of the L2P tables 31-1 to 31-n stored in the NAND flash memory 5 to the DRAM 6. In this case, the restoration processor 24 does not necessarily need to load the entire address translation data included in each L2P table to the DRAM 6, and may load only a part of the address translation data included in each L2P table to the DRAM 6. When data is written to a certain namespace, the I / O command processor 22 updates the address translation data corresponding to this namespace stored in the DRAM 6 so that the physical address at which this data is written is mapped to the logical address corresponding to this data. In this way, the address translation data of each of the L2P tables 31-1 to 31-n is updated on the DRAM 6.
[0090] For the L2P tables corresponding to each of the namespaces having the non-clear attribute, the restoration processing unit 24 performs a shutdown preparation process in response to the controller 4 receiving a power cut advance notice from the host 2. In this shutdown preparation process, the restoration processing unit 24 writes the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P table stored in the NAND flash memory 5 to the NAND flash memory 5. This allows the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P table stored in the NAND flash memory 5 to be reflected in the L2P table stored in the NAND flash memory 5 before the power supply to the SSD 3 is cut off. Note that if the power supply circuit 7 has a PLP function, the restoration processing unit 24 can perform a shutdown preparation process for the L2P tables corresponding to each of the namespaces having the non-clear attribute even when the controller 4 detects that an unauthorized power cut has occurred.
[0091] The restoration processing unit 24 omits the execution of the shutdown preparation process for the L2P tables corresponding to each namespace having the clear attribute. In other words, when the controller 4 receives a power cut advance notice from the host 2, the restoration processing unit 24 does not write the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P tables stored in the NAND flash memory 5 to the NAND flash memory 5. When the power supply circuit 7 has a PLP function, even if the controller 4 detects that an unauthorized power cut has occurred, the restoration processing unit 24 omits the execution of the shutdown preparation process for the L2P tables corresponding to the namespaces having the clear attribute.
[0092] In this way, by omitting the execution of the shutdown preparation process for the L2P tables corresponding to each namespace having the clear attribute, the amount of writing to the NAND flash memory 5 can be reduced compared to a configuration in which the shutdown preparation process is executed for all L2P tables corresponding to all namespaces.
[0093] When an illegal power outage occurs, the shutdown preparation process for the L2P table corresponding to each namespace having the non-cleared attribute cannot be normally executed, and the latest contents of the L2P table corresponding to each namespace having the non-cleared attribute may be lost. In this case, after the illegal power outage, when power is supplied to the SSD 3 again, the restoration processing unit 24 executes the restoration process for restoring the L2P table corresponding to each namespace having the non-cleared attribute. The restoration processing unit 24 does not execute the restoration process for restoring the L2P table corresponding to each namespace having the cleared attribute. Details of the restoration process will be described later with reference to FIG. 9A to FIG. 9B.
[0094] Also, while SSD3 is in the on state (D0 state), the restoration processing unit 24 only performs restoration preparation processing for the L2P tables corresponding to each of the namespaces having a non-clear attribute, and does not perform restoration preparation processing for the L2P tables corresponding to each of the namespaces having a clear attribute.
[0095] In the restoration preparation process for an L2P table corresponding to a namespace having a non-clear attribute, the restoration processing unit 24 executes the following process.
[0096] The restoration processing unit 24 executes the following operations: (1) at each checkpoint, an operation of writing updated address translation data in the DRAM 6 that has not yet been reflected in the L2P table stored in the NAND flash memory 5 to the NAND flash memory 5, and (2) at each checkpoint, an operation of writing a sequence number assigned to a block currently assigned as a write destination block for this namespace to the NAND flash memory 5 as information for identifying a block group to be used for restoration processing of the L2P table for this namespace. Details of the restoration preparation processing will be described later with reference to Figures 9A and 9B.
[0097] For the L2P table corresponding to the namespace having the clear attribute, the restoration processing unit 24 does not execute the restoration preparation process.
[0098] In other words, for an L2P table corresponding to a namespace having a clear attribute, the restoration processing unit 24 does not execute restoration preparation processing including: (3) an operation of writing, at each checkpoint, updated address conversion data in the DRAM 6 that has not yet been reflected in the L2P table stored in the NAND flash memory 5 to the NAND flash memory 5; and (4) an operation of writing, at each checkpoint, the sequence number assigned to the block currently assigned as the write destination block for this namespace to the NAND flash memory 5 as information for identifying the group of blocks to be used for the restoration processing of the L2P table for this namespace.
[0099] In this way, by omitting the execution of restoration preparation processing for L2P tables corresponding to namespaces having a clear attribute, the load on the controller 4 can be reduced compared to a configuration in which restoration preparation processing is executed for all L2P tables corresponding to all namespaces.
[0100] Next, a configuration example of the address conversion table will be described below with reference to Fig. 3, which is a diagram showing a configuration example of the address conversion table managed in the SSD 3 according to the embodiment.
[0101] Each of the L2P tables 31-1 to 31-n can be realized as a single-level L2P table without a hierarchical structure, or as a hierarchical L2P table with a hierarchical structure. In Fig. 3, it is assumed that the L2P table 31-1 corresponding to the namespace NS#1 is realized as a hierarchical L2P table.
[0102] The L2P table 31-1 realized as a hierarchical L2P table includes a plurality of tables corresponding to a plurality of hierarchical levels. The number of hierarchical levels may be any number equal to or greater than two, but here, the case where the number of hierarchical levels is three is illustrated as an example.
[0103] The L2P table 31-1 includes a lower level table T1-1, an upper level table T1-2, and a top level table T1-3.
[0104] The lower table T1-1 is a table for managing each physical address in the NAND flash memory 5 to which the data received from the host 2 is written. The logical address range of the namespace NS#1 is further divided into a plurality of ranges. Each of the plurality of ranges includes a specific number of consecutive logical addresses (LBAs). For example, the lower table T1-1 includes a plurality of address translation data equal in number to the number of the plurality of ranges. In the case where the logical address range of the namespace NS#1 is divided into 128 ranges each including 32 LBAs, the lower table T1-1 includes 128 address translation data called segments, that is, segments #0, #1, ..., #96, ..., #127.
[0105] One segment of the lower table T1-1 includes 32 physical addresses corresponding to 32 consecutive LBAs as mapping information. Each segment belonging to the lower table T1-1 is also called a lower segment. The logical address range covered by one lower segment corresponds to 32 LBAs.
[0106] The upper table T1-2 is a table for managing the physical addresses in the NAND flash memory 5 to which each lower segment is written. The upper table T1-2 also includes a plurality of address conversion data called segments, for example, segments #0, #1, ..., #3.
[0107] One segment of the upper table T1-2 indicates, for example, 32 positions (physical storage positions) in the NAND flash memory 5 where 32 consecutive lower segments are stored. Since each segment of the upper table T1-2 indicates the positions of 32 lower segments, the total number of segments included in the upper table T1-2 is 1 / 32 of the total number of lower segments. The range of logical addresses covered by one segment of the upper table T1-2 corresponds to 32×32 LBAs. Each segment of the upper table T1-2 is also referred to as an upper segment.
[0108] The top-level table T1-3 includes one address translation data called a segment. The segment of the top-level table T1-3 indicates the location (physical storage location) in the NAND flash memory 5 where all the upper segments #0, #1, ..., #3 are stored. That is, the segment of the top-level table T1-3 includes four pointers (pointers 0, 1, 2, 3) corresponding to the upper segments #0, #1, ..., #3, respectively. Each of the four pointers indicates the location of the corresponding upper segment. The logical address range covered by the segment of the top-level table T1-3 corresponds to 4 x 32 x 32 LBAs. The segment of the top-level table T1-3 is called the top-level segment or the root table.
[0109] Thus, the logical address range covered by one top segment is larger than the logical address range covered by one upper table segment, and the logical address range covered by one upper table segment is larger than the logical address range covered by one lower table segment.
[0110] Therefore, the controller 4 can set the 32×32 LBAs corresponding to the upper segment #0 to an unallocated state simply by setting a specific value indicating an unallocated state to each of the 32 entries in the upper segment #0. Also, instead of setting a specific value to each of the 32 entries in the upper segment #0, the controller 4 can set the value of pointer 0 in the top segment to a specific value indicating an unallocated state, for example. Even in this case, it is possible to set the 32×32 LBAs corresponding to the upper segment #0 to an unallocated state.
[0111] In the clearing process for the namespace NS#1, the controller 4 sets, for example, four pointers in the top-level segment to specific values indicating an unallocated state. This makes it possible to easily put all the LBAs included in the namespace NS#1 into an unallocated state. Alternatively, the controller 4 may discard the top-level segment itself. In this case, it is possible to put all the LBAs included in the namespace NS#1 into an unallocated state. When the top-level segment is discarded, the controller 4 may create a new top-level segment and reassign the newly created top-level segment as the top table of the L2P table of the namespace NS#1.
[0112] FIG. 4 is a diagram for explaining a plurality of namespaces managed in the SSD 3 according to the embodiment.
[0113] 4 illustrates an example in which namespace NS#1, namespace NS#2, ..., namespace NS#n are managed by the controller 4 of the SSD 3. Each namespace is identified by a namespace identifier (NSID).
[0114] Each namespace contains a set of contiguous logical addresses (LBAs). The logical address range corresponding to each namespace starts from LBA 0. Each namespace can be set to any size. The size of each namespace corresponds to the number of LBAs contained in the namespace.
[0115] Figure 4 illustrates an example in which namespace NS#1 includes i+1 consecutive LBAs from LBA0 to LBAi, namespace NS#2 includes j+1 consecutive LBAs from LBA0 to LBAj, and namespace NS#n includes k+1 consecutive LBAs from LBA0 to LBAk.
[0116] A namespace management table 32 is used to manage information related to these namespaces.
[0117] 5 is a diagram showing a namespace management table 32 managed in the SSD 3 according to the embodiment. In the namespace management table 32, for each created namespace, a namespace identifier, a clear identifier, and a namespace size are managed as namespace information.
[0118] The namespace identifier (NSID) of each namespace is an identifier used by the controller 4 to access each namespace. The clear identifier is an identifier indicating whether the corresponding namespace has a clear attribute. The clear identifier is used as attribute information indicating either a clear attribute or a non-clear attribute. For example, a clear identifier set to "1" indicates that the corresponding namespace has a clear attribute. On the other hand, for example, a clear identifier set to "0" indicates that the corresponding namespace has a non-clear attribute.
[0119] Figure 5 illustrates an example in which a namespace NS#1 assigned with a namespace identifier NSID1 and a namespace NS#n assigned with a namespace identifier NSIDn have a clear attribute, and a namespace NS#2 assigned with a namespace identifier NSID2 does not have a clear attribute (has a non-clear attribute).
[0120] The size of a namespace is indicated by the number of logical addresses (LBAs) included in the logical address range of the corresponding namespace.
[0121] Next, block management in the SSD 3 according to the embodiment will be described.
[0122] When the controller 4 receives a write command from the host 2, the I / O command processing unit 22 determines a destination namespace based on the namespace identifier included in the write command. The destination blocks currently assigned to each namespace are managed by a block management table 33. As shown in Fig. 6, the block management table 33 manages active block lists 331-1, 331-2, ..., 331-n corresponding to the namespaces NS#1, NS#2, ..., NS#n, respectively.
[0123] Each of the active block lists 331-1, 331-2, ..., 331-n manages the block identifiers of the active blocks in which valid data of the corresponding namespace is stored. Each of the active block lists 331-1, 331-2, ..., 331-n also manages the block identifier of the write destination block currently assigned for the corresponding namespace as one of the block identifiers of the active blocks.
[0124] Valid data means data associated with a certain logical address. For example, data stored at a physical address referenced by a certain L2P table (i.e., data associated with a logical address as the latest data) is valid data. Valid data is data that may be read later by the host 2. A block in which at least one valid data is written is managed as an active block.
[0125] Invalid data means data that is not associated with any logical address. For example, data stored in a physical address that is not referenced by any L2P table is invalid data. Invalid data is data that is no longer likely to be read by the host 2. When update data associated with a certain logical address is written to the NAND flash memory 5, the data previously associated with that logical address becomes invalid data, and the update data becomes valid data. Also, when a clear process is executed for a certain namespace, all valid data previously associated with the logical addresses of that namespace becomes invalid data.
[0126] The block identifiers of each block that does not contain valid data are managed by the free block list 332 as the block identifiers of free blocks.
[0127] The following describes writing to the namespace NS#2 and management of each block assigned to the namespace NS#2. Similar processing is performed for other namespaces.
[0128] The active block list 331-2 is a list that manages the block identifiers of the active blocks associated with the namespace NS#2. For example, when a write command received by the controller 4 from the host 2 includes the namespace identifier (NSID2) of the namespace NS#2, the I / O command processing unit 22 writes the write data associated with this write command to the next writable page in the write destination block assigned to the namespace NS#2. Then, the I / O command processing unit 22 updates the L2P table 31-2 associated with the namespace NS#2 so that the logical address corresponding to the write data is associated with the physical address in the NAND flash memory 5 to which the write data has been written.
[0129] If there is no writable page in the destination block when writing the next data to that block, the I / O command processing unit 22 selects an arbitrary free block from the free block list 332 and newly assigns the selected free block as the destination block for namespace NS#2.
[0130] When a new block is assigned as a destination block for namespace NS#2, controller 4 assigns a sequence number to the new block. The sequence number is a number that indicates the order in which the block was assigned as a destination block for namespace NS#2.
[0131] FIG. 7 is a diagram showing the block use order management table 34 managed in the SSD 3 according to the embodiment.
[0132] The block usage order management table 34 manages, for each namespace, the correspondence between the block identifiers of the blocks assigned as write destination blocks for that namespace and the sequence numbers assigned to these blocks.
[0133] Here, the explanation focuses on the block usage order management table 341-2 associated with the namespace NS#2. First, the namespace NS#2 is created, and when the controller 4 receives the first write command associated with the namespace NS#2, the controller 4 selects an arbitrary free block (for example, block BLK1) from the free block list 332 and assigns block BLK1 as the write destination block for the namespace NS#2. At this time, the controller 4 assigns sequence number 1 to block BLK1.
[0134] After the data writing to block BLK1 progresses and there are no more writable pages in block BLK1, the controller 4 selects, for example, block BLK3 from the free block list 332 and assigns block BLK3 as a write destination block for namespace NS#2. Then, the controller 4 assigns sequence number 2 to block BLK3.
[0135] By repeating this operation, the controller 4 assigns sequence numbers 3 and 4 to block BLK0, which is assigned as the next write destination block for namespace NS#2, and to block BLK2, which is assigned as the next write destination block.
[0136] As a result, in the block usage order management table 341-2, BLK1, BLK3, BLK0, and BLK2 are managed as block identifiers for the blocks to which sequence numbers 1, 2, 3, and 4 are assigned, respectively.
[0137] FIG. 8 is a diagram for explaining data written to the NAND flash memory 5 included in the SSD 3 according to the embodiment.
[0138] Here, an example of data written to block BLK1 will be described. In Fig. 8, each row in block BLK1 represents a page, which are page 0, page 1, ..., page y-1 from the top.
[0139] In each page, for example, four pieces of data each having a size of 4 KiB are stored together with four logical addresses (LBAs) corresponding to the four pieces of data. For example, the four pieces of data written in page 0 correspond to LBA16, LBA17, LBA18, and LBA20, respectively. The controller 4 can read the four pieces of data and the four LBAs corresponding to these four pieces of data from each page in the block BLK1, and can thereby know the four LBAs corresponding to the four physical addresses to which these four pieces of data are written. Note that instead of storing pairs of data and LBAs in each page, the controller 4 may write a list of LBAs corresponding to each piece of data written in the block BLK1 in the last page Py-1 in the block BLK1.
[0140] In this manner, by using a configuration in which an LBA is written to each block together with data, even if an abnormal power outage causes the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P table in the NAND flash memory 5 to be lost, the L2P table in the NAND flash memory 5 can be restored by analyzing the contents of the last few blocks to which data was written.
[0141] Next, a description will be given of an example of restoration preparation processing executed by the restoration processing unit 24. Here, a description will be given of restoration preparation processing for the namespace NS#2 having a non-clear attribute.
[0142] First, the operation of writing the updated address translation data of the L2P table 31-2 to the NAND flash memory 5 will be described.
[0143] Figure 9A is the first diagram for explaining the restoration preparation processing of L2P table 31-2 executed in SSD 3 of the embodiment, and Figure 9B is the second diagram for explaining the restoration preparation processing of L2P table 31-2 executed in SSD 3 of the embodiment.
[0144] The restoration processing unit 24 periodically writes the updated address translation data of the L2P table 31-2 from the DRAM 6 to the NAND flash memory 5. The timing of this operation is called a checkpoint. The checkpoint period may be a fixed time or may be determined by a specific algorithm.
[0145] At the first checkpoint cp1, the restoration processing unit 24 writes the updated address conversion data in the DRAM 6 that has not yet been reflected in the L2P table 31-2 on the NAND flash memory 5 to the NAND flash memory 5, thereby reflecting the contents of the updated address conversion data in the L2P table 31-2 on the NAND flash memory 5.
[0146] 9A, it is assumed that the address translation data corresponding to LBA10, LBA35, and LBA290 have not yet been reflected in the L2P table 31-2 in the NAND flash memory 5. In this case, the restoration processing unit 24 writes the address translation data corresponding to LBA10, LBA35, and LBA290, respectively, as updated address translation data to the NAND flash memory 5 so that the address translation data corresponding to LBA10, LBA35, and LBA290, respectively, are reflected in the L2P table 31-2 in the NAND flash memory 5.
[0147] At this time, the restoration processing unit 24 writes the sequence number assigned to the block currently assigned as the write destination block for the namespace NS#2 as checkpoint information to the NAND flash memory 5. As shown in Fig. 9B, at the time of checkpoint cp1, the block BLK0 is assigned as the write destination block for the namespace NS#2. Therefore, the restoration processing unit 24 writes the sequence number 3 assigned to the block BLK0 to the NAND flash memory 5 as checkpoint information.
[0148] At the next checkpoint cp2, the restoration processing unit 24 rewrites the updated address conversion data in the DRAM 6 that has not yet been reflected in the L2P table 31-2 on the NAND flash memory 5 to the NAND flash memory 5, thereby reflecting the contents of the updated address conversion data in the L2P table 31-2 on the NAND flash memory 5.
[0149] 9A, it is assumed that the address translation data corresponding to LBA26, LBA34, and LBA553 have not yet been reflected in the L2P table 31-2 in the NAND flash memory 5. In this case, the restoration processing unit 24 writes the address translation data corresponding to LBA26, LBA34, and LBA553, respectively, as updated address translation data to the NAND flash memory 5 so that the address translation data corresponding to LBA26, LBA34, and LBA553, respectively, are reflected in the L2P table 31-2 in the NAND flash memory 5.
[0150] At this time, the restoration processing unit 24 writes the sequence number assigned to the block currently assigned as the write destination block for the namespace NS#2 as checkpoint information to the NAND flash memory 5. As shown in Fig. 9B, at the time of checkpoint cp2, the block BLK20 is assigned as the write destination block for the namespace NS#2. Therefore, the restoration processing unit 24 writes the sequence number 8 assigned to the block BLK20 to the NAND flash memory 5 as checkpoint information.
[0151] As shown in FIG. 9A, at the next checkpoint cp3, the restoration processing unit 24 writes the address translation data corresponding to LBA7, LBA88, and LBA357, respectively, to the NAND flash memory 5 as updated address translation data.
[0152] In addition, the restoration processing unit 24 writes, as checkpoint information, the sequence number assigned to the block currently assigned as the write destination block for the namespace NS#2, to the NAND flash memory 5. As shown in Fig. 9B, at the time of checkpoint cp3, the block BLK31 is assigned as the write destination block for the namespace NS#2. Therefore, the restoration processing unit 24 writes the sequence number 23 assigned to the block BLK31 to the NAND flash memory 5 as checkpoint information.
[0153] When power is supplied again from the host 2 to the SSD 3 after an abnormal power outage, the restoration processing unit 24 identifies a group of blocks to be used for the restoration processing of the L2P table 31-2 based on the checkpoint information (sequence number) obtained at the last checkpoint.
[0154] For example, assume that an unauthorized power outage occurs immediately after checkpoint cp1. In this case, in the restoration process of the L2P table 31-2, the restoration processor 24 acquires from the block usage order management table 341-2 the sequence number assigned to the block currently assigned as the write destination block for the namespace NS#2, i.e., the block assigned as the write destination block when the unauthorized power outage occurred. Then, the restoration processor 24 identifies, as the block group to be used for the restoration process of the L2P table 31-2, the blocks assigned with sequence numbers that belong to the range from sequence number 3 acquired at checkpoint cp1 to the sequence number assigned to the block assigned as the write destination block when the unauthorized power outage occurred.
[0155] For example, if an uninterrupted power outage occurs while block BLK2 is assigned as the destination block, the sequence number assigned to block BLK2, which was assigned as the destination block at the time of the uninterrupted power outage, is 4, so block BLK0, which has sequence number 3 acquired at checkpoint cp1, and block BLK2, which has sequence number 4, are identified as the group of blocks to be used for the restoration process of L2P table 31-2.
[0156] Next, the restoration processing unit 24 uses the LBAs stored in each of the blocks BLK0 and BLK2 to identify the correspondence between each of the physical addresses in the blocks BLK0 and BLK2 and the LBAs corresponding to the data stored in each of these physical addresses.The restoration processing unit 24 then restores the L2P table 31-2 in the NAND flash memory 5 to the latest contents using the identified correspondence between each physical address and each LBA.
[0157] FIG. 10 is a diagram for explaining an operation of creating a namespace with a clear attribute and an operation of omitting a restoration preparation process for an L2P table associated with a namespace with a clear attribute, which are performed in an SSD3 according to an embodiment.
[0158] For example, when it is desired to create a namespace to be used as a swap area, the host 2 transmits a namespace creation command specifying a clear attribute to the SSD 3. When the controller 4 receives this namespace creation command from the host 2, the namespace management command processing unit 21 creates a namespace having a clear attribute. By using the namespace management table 32, the namespace management command processing unit 21 manages the namespace identifier of this created namespace in association with attribute information indicating the clear attribute. Then, the controller 4 creates an L2P table corresponding to the created namespace. In addition, for each namespace created by the namespace management command processing unit 21, the controller 4 manages the active block list using the block management table 33 and manages the block usage order using the block usage order management table 34.
[0159] When the controller 4 receives from the host 2 a namespace deletion command requesting the deletion of a namespace, the namespace management command processing unit 21 deletes the namespace having the namespace identifier specified by the namespace deletion command.
[0160] The restoration processing unit 24 skips the restoration preparation process of the L2P table associated with the namespace having the clear attribute. The restoration preparation process includes an operation of writing, at each checkpoint, the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P table stored in the NAND flash memory 5 to the NAND flash memory 5, and an operation of writing, at each checkpoint, the sequence number given to the block currently assigned as the write destination block for this namespace to the NAND flash memory 5 as information for identifying a block group to be used for the restoration process of this L2P table.
[0161] FIG. 11 is a diagram for explaining the clearing process executed in the SSD 3 according to the embodiment.
[0162] The clear processing unit 23 executes the clear processing during the period from when the controller 4 receives a power-off advance notice from the host 2 or detects an unauthorized power-off until power is supplied again to the SSD 3 and the controller 4 becomes ready to process commands from the host 2.
[0163] For example, the clear processing unit 23 may execute a clear process so that each of the logical addresses included in the namespace having the clear attribute becomes unallocated in response to power being supplied again to the SSD 3. In the clear process, for example, the clear processing unit 23 sets the L2P table associated with the namespace having the clear attribute to an initial state or discards the L2P table, thereby putting the logical addresses included in the namespace having the clear attribute into an unallocated state.
[0164] FIG. 12 is a diagram for explaining an operation of setting or discarding a logical-physical address conversion table associated with a namespace having a clear attribute to an initial state in a clear process executed in the SSD 3 according to the embodiment.
[0165] Here, it is assumed that each of the L2P table 31-1 associated with the namespace NS#1, the L2P table 31-2 associated with the namespace NS#2, ..., the L2P table 31-n associated with the namespace NS#n is realized as a hierarchical L2P table.
[0166] The L2P table 31-1 includes a lower table T1-1, an upper table T1-2, and a top-level table T1-3. The L2P table 31-2 includes a lower table T2-1, an upper table T2-2, and a top-level table T2-3. The L2P table 31-n includes a lower table Tn-1, an upper table Tn-2, and a top-level table Tn-3.
[0167] Note that while FIG. 12 shows the number of lower segments and the number of upper segments as being the same across all L2P tables, in reality the number of lower segments and the number of upper segments included in a given L2P table are determined according to the size of the namespace corresponding to that L2P table.
[0168] The clear processing unit 23 selects the namespaces NS#1 and NS#n having the clear attribute from among the namespaces NS#1 to NS#n, and executes the clear processing for the namespaces NS#1 and NS#n.
[0169] First, the clear process for the namespace NS#1 will be described. The clear processor 23 sets each of the logical addresses managed in the L2P table 31-1 associated with the namespace NS#1 to an unassigned state. For example, the clear processor 23 sets the top-level table T1-3 included in the L2P table 31-1 to an initial state or discards it. When the top-level table T1-3 is set to the initial state or discarded, the controller 4 cannot refer to the higher-level table T1-2, and further cannot refer to the lower-level table T1-1.
[0170] Therefore, by setting the top-level table T1-3 to its initial state or discarding it, each of the logical addresses included in the namespace NS#1 becomes unallocated.
[0171] Similarly, the clearing processing unit 23 sets each of the logical addresses managed in the L2P table 31-n to an unallocated state. For example, the clearing processing unit 23 sets the top table Tn-3 included in the L2P table 31-n to an initial state or discards it. As a result, each of the logical addresses included in the namespace NS#n becomes an unallocated state.
[0172] As a result, all of the active blocks associated with the namespace NS#1 having the clear attribute and all of the active blocks associated with the namespace NS#n having the clear attribute become blocks that store only invalid data. Therefore, the clear processing unit 23 moves all of the block identifiers of the active blocks that were associated with the namespaces NS#1 and NS#n having the clear attribute to the free block list 332.
[0173] FIG. 13 is a diagram for explaining an operation of managing, as free blocks, each of the blocks (active blocks) associated with a namespace having a clear attribute in the clear process executed in the SSD 3 according to the embodiment.
[0174] When the clear processing unit 23 sets each logical address included in the namespace NS#1 to an unallocated state, data stored in every active block managed by the active block list 331-1 becomes invalid data. Similarly, when the clear processing unit 23 sets each logical address included in the namespace NS#n to an unallocated state, data stored in every active block managed by the active block list 331-n becomes invalid data.
[0175] As a result, there are no blocks in which valid data is written among the blocks managed by the active block list 331-1. The clear processing unit 23 moves the block identifiers of all blocks managed by the active block list 331-1 to the free block list 332.
[0176] Similarly, there will be no blocks in which valid data is written among the blocks managed by the active block list 331-n. The clear processing unit 23 moves the block identifiers of all blocks managed by the active block list 331-n to the free block list 332. As a result, each of the active blocks associated with each namespace having the clear attribute becomes reusable as a physical storage area available for writing data (or management information such as an L2P table).
[0177] FIG. 14 is a diagram for explaining a process executed in the host 2 for reformatting a namespace having a clear attribute.
[0178] Information about the format of a namespace, such as information indicating the type of file system corresponding to this namespace and information indicating the mount point of this namespace, is written in several LBAs around LBA0 of a namespace. When a clear process is executed for a namespace with a clear attribute, the information about the format cannot be read from this namespace with a clear attribute. Therefore, in order to make the namespace with a clear attribute usable again for writing and reading data, the host 2 executes a reformatting process to write the information about the format again to this namespace with a clear attribute.
[0179] After power is supplied again to SSD3 and the controller 4 is in a ready state, the host 2 may first obtain information from SSD3 regarding each namespace managed by SSD3, and identify namespaces that have a clear attribute from among the namespaces managed by SSD3.
[0180] In this case, the host 2 transmits a namespace information acquisition request that specifies the NSID of a specific namespace to the controller 4. As the namespace information acquisition request, for example, an identify command (Identify Namespace data structure) defined in the NVMe standard may be used.
[0181] The namespace management command processing unit 21 that has received the namespace information acquisition request transmits namespace information related to the namespace having the specified NSID to the host 2. This namespace information includes various information related to the namespace having the specified NSID, such as a global namespace identifier for uniquely identifying this namespace, a clear identifier that is attribute information of this namespace, and the size of this namespace. As the global namespace identifier, for example, a Namespace Globally Unique Identifier (NGUID) may be used. A storage device that complies with the NVMe standard may include multiple controllers. The NGUID is an identifier that can uniquely identify each namespace managed in a storage device that complies with the NVMe standard.
[0182] When the host 2 confirms that this namespace has the clear attribute, it instructs the SSD 3 to execute a format operation, thereby reformatting this namespace. By reformatting this namespace, it is possible to rewrite information about the format of this namespace to several LBAs around LBA 0 of this namespace. This allows the host 2 to start using this namespace with the clear attribute again, for example, as a swap area.
[0183] After the reformatting process has been completed for all namespaces with the clear attribute, host 2 issues I / O commands (write command, read command) to SSD 3 and cooperates with SSD 3 to write data to and read data from each namespace.
[0184] FIG. 15 is a flowchart showing the procedure of a namespace creation process executed in the SSD 3 according to the embodiment.
[0185] First, the controller 4 receives a namespace creation command from the host 2 (step S101). The namespace creation command is a namespace management command that requests the creation of a namespace. The namespace creation command specifies the size of the namespace to be created and the attribute (clear attribute or non-clear attribute) of the namespace to be created.
[0186] The controller 4 determines whether or not the namespace creation command received in step S101 specifies a clear attribute (step S102).
[0187] If the received namespace creation command specifies the clear attribute (Yes in step S103), the controller 4 creates a namespace with the clear attribute (step S103). In step S103, the controller 4 uses the namespace management table 32 to manage the namespace identifier of the namespace created in step S103 in association with attribute information indicating the clear attribute.
[0188] If the received namespace creation command does not specify the clear attribute (i.e. specifies the non-clear attribute) (No in step S103), the controller 4 creates a namespace with a non-clear attribute (step S104). By using the namespace management table 32, the controller 4 manages the namespace identifier of the namespace created in step S104 in association with attribute information indicating the non-clear attribute.
[0189] The controller 4 returns namespace information related to the namespace created in step S103 or step S104 to the host 2 (step S105). Here, the namespace information sent by the controller 4 to the host 2 includes at least the namespace identifier of the created namespace. The namespace information may include the namespace identifier of the created namespace, the size of the created namespace, and attribute information indicating the attribute (clear attribute or non-clear attribute) of the created namespace.
[0190] FIG. 16 is a flowchart showing the procedure of the restoration preparation process executed in the SSD 3 according to the embodiment.
[0191] The controller 4 selects, in order, a number of L2P tables corresponding to a number of namespaces managed by the controller 4, one by one as L2P tables to be subjected to the restoration preparation process, and executes the following process for each selected L2P table.
[0192] First, the controller 4 selects one L2P table to be subjected to the restoration preparation process (step S201). The controller 4 determines whether or not the namespace associated with the L2P table selected in step S201 has a clear attribute (step S202).
[0193] If the namespace associated with the selected L2P table has the clear attribute (Yes in step S202), the controller 4 ends the restoration preparation process, since there is no need to execute the restoration process for the L2P table associated with the namespace with the clear attribute.
[0194] If the namespace associated with the selected L2P table does not have a clear attribute (has a non-clear attribute) (No in step S202), the controller 4 performs a restoration preparation process for the selected L2P table for each checkpoint. Here, it is assumed that the selected L2P table is the L2P table 31-2 associated with the namespace NS#2.
[0195] When the checkpoint timing is reached, the controller 4 first writes to the NAND flash memory 5 the updated address conversion data of the selected L2P table 31-2 stored in the DRAM 6 that has not yet been reflected in the L2P table 31-2 stored in the NAND flash memory 5 (step S203).
[0196] Then, the controller 4 writes the sequence number assigned to the block currently assigned as the write destination block for the namespace NS#2 to the NAND flash memory 5 as checkpoint information for identifying a group of blocks to be used for restoring the L2P table 31-2 (step S204). In step S204, the controller 4 performs a process of recording this sequence number, for example, together with a checkpoint number for identifying the current checkpoint, as checkpoint information in the NAND flash memory 5.
[0197] FIG. 17 is a flowchart showing the procedure of processing executed in the SSD 3 according to this embodiment during the period from when a power interruption advance notice is received from the host 2 until power is supplied again to the SSD 3 and the controller 4 of the SSD 3 enters a ready state.
[0198] Here, it is assumed that the clear process is executed after power is supplied to SSD3 again.
[0199] The controller 4 receives a power-off advance notice or a suspend instruction from the host 2 (step S301). The controller 4 determines whether the notice / instruction received in step S301 is a power-off advance notice or a suspend instruction, that is, whether the process to be executed is a shutdown preparation process or a suspend preparation process (step S302).
[0200] If the notification / instruction received in step S301 is a power cut advance notification (shutdown in step S302), the controller 4 executes a shutdown preparation process (step S303). In the shutdown preparation process, the controller 4 selects an L2P table associated with a namespace having a non-clear attribute, and executes a process of writing updated address translation data to the NAND flash memory 5.
[0201] When the shutdown preparation process is completed, the controller 4 notifies the host 2 that the shutdown preparation process is completed (step S304). When the host 2 confirms that the shutdown preparation process of the SSD 3 is completed, it cuts off the supply of power to the SSD 3.
[0202] When power is supplied again from the host 2 to the SSD 3 after the power supply to the SSD 3 is cut off (power on in step S305), the controller 4 starts a series of initialization sequences for making the state of the controller 4 a ready state in which it can process commands from the host 2. During this initialization sequence, the controller 4 executes a clear process for the namespace having the clear attribute (step S306). In step S306, the controller 4 sets each logical address included in the logical address range of the namespace having the clear attribute to an unallocated state, and further moves the block identifier of each block associated with the namespace having the clear attribute to the free block list 332.
[0203] During this initialization sequence, the controller 4 also executes an operation of loading at least a part of the address translation data of each of the L2P tables 31-1, ..., 31-n from the NAND flash memory 5 to the DRAM 6. For example, when the L2P table 31-1 associated with the namespace NS#1 having the clear attribute is discarded, a new L2P table for the namespace NS#1 is created, and at least a part of the address translation data of this created L2P table is loaded to the DRAM 6.
[0204] When the initialization sequence is completed, the controller 4 becomes ready to process commands from the host 2. The controller 4 notifies the host 2 that the controller 4 has become ready (step S310).
[0205] If the notification / instruction received in step S301 is a suspend instruction (suspend in step S302), the controller 4 executes a suspend preparation process (step S307). In the suspend preparation process, the controller 4 executes a process of writing updated address translation data stored in the DRAM 6 for the L2P tables corresponding to all namespaces to the NAND flash memory 5. Then, the controller 4 executes a process of transitioning the current power state of the SSD 3 from the on state (D0 state) to a low power state (D1 state, D2 state, or D3 state) specified by the suspend instruction.
[0206] When the suspend preparation process is completed, the controller 4 notifies the host 2 that the suspend preparation process is completed (step S308). If the transition destination power state specified in the suspend instruction is the D3 state, the host 2 cuts off the supply of power to the SSD 3 upon confirming that the suspend preparation process of the SSD 3 is completed.
[0207] After the power state of SSD3 has transitioned to the low power state, when a resume instruction is received from the host 2 (step S309), the controller 4 starts processing for returning the power state of SSD3 from the low power state to the ON state (D0 state). If SSD3 is in the D3 state, power may be supplied from the host 2 to SSD3, and a resume instruction may be sent from the host 2 to SSD3.
[0208] When the power state of SSD3 returns to the ON state (D0 state) from the low power state and the controller 4 enters a ready state in which it can process commands from the host 2, the controller 4 notifies the host 2 that it has entered a ready state (step S310).
[0209] FIG. 18 is a flowchart showing the procedure of processing executed in the SSD 3 according to the embodiment during the period from the detection of an unauthorized power outage to the time when power is supplied again to the SSD 3 and the controller 4 of the SSD 3 enters a ready state.
[0210] Here, it is assumed that the clear process is executed after power is supplied again to the SSD 3. If the power supply circuit 7 has a PLP function, the shutdown preparation process described with reference to Fig. 17 is executed even when an abnormal power outage occurs. If the power supply circuit 7 does not have a PLP function, the shutdown preparation process is not executed when an abnormal power outage occurs. In the following, it is assumed that the power supply circuit 7 does not have a PLP function.
[0211] When the controller 4 receives a power-off detection notification from the power supply circuit 7 before receiving a power-off advance notification from the host 2, the controller 4 detects that an unauthorized power-off has occurred (step S401).
[0212] When power is supplied again from the host 2 to the SSD 3 (power on in step S402) after the power supply to the SSD 3 is cut off due to an abnormal power outage, the controller 4 starts an initialization sequence. During this initialization sequence, the controller 4 executes a clear process for the namespace with the clear attribute (step S403). In step S403, the controller 4 sets each of the logical addresses included in the namespace with the clear attribute to an unallocated state, and further moves the active blocks associated with the namespace with the clear attribute to the free block list 332.
[0213] During the initialization sequence, the controller 4 further performs a restoration process for the L2P table corresponding to each namespace having a non-clear attribute (step S404). Since the L2P tables associated with the namespaces having the clear attribute have been set to the initial state or discarded, the controller 4 performs the restoration process only for the L2P tables associated with each namespace having a non-clear attribute.
[0214] During this initialization sequence, the controller 4 also executes an operation of loading at least a part of the address translation data of each of the L2P tables 31-1, ..., 31-n from the NAND flash memory 5 to the DRAM 6. For example, when the L2P table 31-1 associated with the namespace NS#1 having the clear attribute is discarded, a new L2P table for the namespace NS#1 is created, and at least a part of the address translation data of this created L2P table is loaded to the DRAM 6.
[0215] When the initialization sequence is completed, the controller 4 becomes ready to process commands from the host 2. The controller 4 notifies the host 2 that the controller 4 has become ready (step S405).
[0216] FIG. 19 is a flowchart showing the procedure of the shutdown preparation process executed in the SSD 3 according to the embodiment.
[0217] The controller 4 starts the shutdown preparation process when a power cut advance notice is received from the host 2. If the power supply circuit 7 has a PLP function, the controller 4 also starts the shutdown preparation process when it detects that an unauthorized power cut has occurred.
[0218] In the shutdown preparation process, the controller 4 first judges whether or not the updated address translation data exists in the DRAM 6 and whether or not the updated address translation data includes unselected address translation data that has not yet been subjected to the processes of steps S502 to S505 (step S501). If unselected address translation data exists (Yes in step S501), the controller 4 selects unselected address translation data from the updated address translation data in the DRAM 6 (step S502). If the updated address translation data does not exist in the DRAM 6, or if the processes of steps S502 to S505 have been performed on all the updated address translation data and there is no unselected address translation data (No in step S501), the process of FIG. 19 is terminated.
[0219] In step S502, the controller 4 selects any address translation data that has not yet been selected from the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P tables 31-1, ..., 31-n stored in the NAND flash memory 5.
[0220] The controller 4 determines whether or not the address translation data selected in step S502 is associated with a namespace having a clear attribute (step S503). That is, the controller 4 determines whether or not the namespace associated with the L2P table containing the selected address translation data has a clear attribute.
[0221] If the address translation data selected in step S502 is associated with a namespace having a clear attribute (Yes in step S503), the controller 4 skips execution of the process of writing the selected address translation data to the NAND flash memory 5 (step S504).
[0222] If the address translation data selected in step S502 is associated with a namespace having a non-clear attribute (No in step S503), the controller 4 executes a process of writing the selected address translation data to the NAND flash memory 5 (step S505). As a result, the contents of the selected address translation data are reflected in the L2P table in the NAND flash memory 5 corresponding to the selected address translation data.
[0223] After step S504 or step S505, the process returns to step S501. In step S501, the controller 4 determines again whether or not there is unselected address translation data in the updated address translation data in the DRAM 6.
[0224] If unselected address translation data exists in the updated address translation data in the DRAM 6 (Yes in step S501), the controller 4 executes the processes of steps S502 to S505 again.
[0225] When there is no unselected address translation data in the updated address translation data in the DRAM 6 (No in step S501), the controller 4 ends the process.
[0226] FIG. 20 is a flowchart showing the procedure of the suspend preparation process executed in the SSD 3 according to the embodiment.
[0227] When a suspend command is received from the host 2, the controller 4 starts a suspend preparation process.
[0228] In the suspend preparation process, the controller 4 first judges whether or not the updated address translation data exists in the DRAM 6 and whether or not the updated address translation data includes unselected address translation data that has not yet been subjected to the processes of steps S602 to S603 (step S601). If unselected address translation data exists (Yes in step S601), the controller 4 selects unselected address translation data from the updated address translation data in the DRAM 6 (step S602). If the updated address translation data does not exist in the DRAM 6, or if the processes of steps S602 to S603 have been performed on all the updated address translation data and there is no unselected address translation data (No in step S601), the process of FIG. 20 is terminated.
[0229] In step S602, the controller 4 selects any address translation data that has not yet been selected from the updated address translation data in the DRAM 6 that has not yet been reflected in the L2P tables 31-1, ..., 31-n stored in the NAND flash memory 5.
[0230] The controller 4 writes the address translation data selected in step S602 to the NAND flash memory 5 (step S603). As a result, the contents of the selected address translation data are reflected in the L2P table in the NAND flash memory 5 that corresponds to the selected address translation data.
[0231] After step S603, the process returns to step S601. In step S601, the controller 4 determines again whether or not there is unselected address translation data in the updated address translation data in the DRAM 6.
[0232] If there is unselected address translation data among the updated address translation data in the DRAM 6 (Yes in step S601), that is, if there is updated address translation data remaining in the DRAM 6 that has not yet been reflected in the L2P tables 31-1, ..., 31-n stored in the NAND flash memory 5, the controller 4 executes the processes of steps S602 to S603 again.
[0233] If there is no unselected address translation data among the updated address translation data in the DRAM 6 (No in step S601), that is, if there is no updated address translation data remaining in the DRAM 6 that has not yet been reflected in the L2P tables 31-1, ..., 31-n stored in the NAND flash memory 5, the controller 4 terminates the process.
[0234] FIG. 21 is a flowchart showing the procedure of the clearing process executed in the SSD 3 according to the embodiment.
[0235] The controller 4 refers to the namespace management table 32 to determine whether or not a namespace having a clear attribute exists (step S701).
[0236] If a namespace with a clear attribute exists (Yes in step S701), the controller 4 sets each logical address included in the logical address range included in the namespace with the clear attribute to an unallocated state (step S702), for example, by setting the L2P table associated with the namespace with the clear attribute to an initial state or by discarding it. If the L2P table associated with the namespace with the clear attribute is realized by a hierarchical L2P table, in step S702, the controller 4 sets the table of the highest hierarchical level in the hierarchical L2P table to an initial state or discards it.
[0237] Then, the controller 4 moves the block identifiers of all blocks that were associated with namespaces having the clear attribute to the free block list 332, and manages all these blocks as free blocks (step S703).
[0238] If there is no namespace having the clear attribute (No in step S701), the controller 4 ends the clear process.
[0239] FIG. 22 is a flowchart showing the procedure of processes executed in the SSD 3 and the host 2 according to this embodiment after power is supplied to the SSD 3 again.
[0240] When power is supplied to the SSD 3 again after the power supply to the SSD 3 is cut off, the controller 4 in the SSD 3 starts an initialization process including a clear process (step S801). During the initialization process, the controller 4 also executes a process of loading at least a part of the address translation data of each of the L2P tables 31-1 to 31-n in the NAND flash memory 5 onto the DRAM 6.
[0241] When the controller 4 becomes ready, the controller 4 notifies the host 2 of this (S802). When notified by the controller 4 that it has become ready, the host 2 transmits a namespace information acquisition request specifying the NSID of a specific namespace to the controller 4 (step S803). Having received the namespace information acquisition request from the host 2, the controller 4 transmits namespace information relating to the namespace having the specified NSID to the host 2 (step S804). The namespace information includes a global namespace identifier for uniquely identifying this namespace, a clear identifier which is attribute information of this namespace, the size of this namespace, etc.
[0242] When host 2 confirms that this namespace has the clear attribute, it executes a reformatting process to write information about the format of this namespace to several LBAs around LBA 0 of this namespace (step S805). This makes it possible to normally access this namespace that has already been cleared.
[0243] As described above, according to this embodiment, when the controller 4 receives a namespace creation command specifying a clear attribute from the host 2, the controller 4 creates a namespace having a clear attribute. In response to receiving a write command from the host 2 specifying a namespace identifier that identifies a namespace having a clear attribute, the controller 4 executes an operation of writing data associated with the received write command to the NAND flash memory 5. In addition, the controller 4 executes an operation of updating the L2P table corresponding to this namespace having the clear attribute so that the physical address of the NAND flash memory 5 to which this data has been written is mapped to the logical address corresponding to this data.
[0244] During the period from when the power cutoff notice is received or when an unauthorized power cut is detected until power is supplied again to the SSD 3 and the controller 4 becomes ready, the controller 4 sets each of the logical addresses included in the logical address range of the namespace with the clear attribute to an unallocated state in which no physical address of the NAND flash memory 5 is mapped. As a result, all data associated with the logical address range included in the namespace with the clear attribute becomes invalid data, so that the namespace with the clear attribute becomes the same state as a namespace immediately after creation in which no data has been written yet. Therefore, all blocks associated with the namespace with the clear attribute become free blocks that do not contain valid data.
[0245] Therefore, for example, by using a namespace having a clear attribute as a storage destination for data that does not need to be retained across power cycles of the SSD 3, it is possible to prevent the physical storage area in the NAND flash memory 5 from being wasted by data that does not need to be retained across power cycles of the SSD 3. This makes it possible to reduce wear on the NAND flash memory 5.
[0246] Furthermore, when the controller 4 receives a power cut advance notice from the host 2, for the L2P table corresponding to the namespace having the clear attribute, the controller 4 does not execute the process of writing the updated address translation data stored in the DRAM 6 to the NAND flash memory 5. In this way, by omitting the process of maintaining the L2P table corresponding to the namespace having the clear attribute with the latest contents, the amount of data written to the NAND flash memory 5 can be reduced, and unnecessary wear and tear on the NAND flash memory 5 can be further reduced.
[0247] Furthermore, while the SSD 3 is in the ON state (D0 state), the controller 4 also omits the execution of the restoration preparation process for the L2P table corresponding to the namespace having the clear attribute.
[0248] In this manner, in this embodiment, various processes are omitted for the address conversion data of the L2P table associated with a namespace having a clear attribute, thereby reducing the load on the controller 4 and suppressing wear on the NAND flash memory 5.
[0249] 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. [Explanation of symbols]
[0250] 1...information processing system, 2...host, 3...SSD, 4...controller, 5...NAND flash memory, 6...DRAM, 7...power supply circuit, 10...bus, 11...host interface, 12...CPU, 13...NAND interface, 14...DRAM interface, 15...DMAC, 16...SRAM, 17...ECC encoding / decoding unit, 21...namespace management command processing unit, 22...I / O command processing unit, 23...clear processing unit, 24...restoration processing unit, 31-1 to 31-n...L2P table, 32...namespace management table, 33...block management table, 34...block usage order management table.
Claims
1. 1. A memory system connectable to a host, comprising: A non-volatile memory; a controller electrically connected to the non-volatile memory; The controller: In response to receiving a first namespace creation command from the host specifying a first attribute, creating a first namespace including a first logical address range and having the first attribute; A memory system configured to set each of the logical addresses included in the first logical address range to an unallocated state in which no physical address of the non-volatile memory is mapped, during a first period of time from receiving a power-off notification from the host notifying the host that power supply to the memory system will be cut off, or from detecting an unauthorized power-off of the memory system, to when power is again supplied to the memory system and the controller becomes ready to process commands from the host.
2. 2. The memory system of claim 1, wherein the first attribute indicates that data associated with the first logical address range is not required to be retained across power cycles of the memory system.
3. The memory system of claim 1 , wherein the controller is further configured to manage a first namespace identifier for identifying the first namespace in association with attribute information indicating the first attribute.
4. 2. The memory system of claim 1, wherein the controller is configured to place each of the logical addresses in the first logical address range in the unallocated state during the first period of time from when power is again applied to the memory system until the controller reaches the ready state.
5. 2. The memory system of claim 1, wherein the controller is configured to place each of the logical addresses included in the first logical address range in the unallocated state in response to receiving the power-off notice from the host or in response to detecting the unauthorized power-off.
6. The controller: managing a first logical-physical address conversion table for managing mapping between each of the logical addresses included in the first logical address range and each of the physical addresses of the non-volatile memory; in response to receiving a first write command from the host, the first write command specifying a first namespace identifier for identifying the first namespace; writing first data associated with the first write command to the non-volatile memory; 2. The memory system of claim 1, further configured to update the first logical-physical address conversion table so that a first physical address indicating a physical memory location in the non-volatile memory to which the first data is written is mapped to a first logical address corresponding to the first data.
7. 7. The memory system of claim 6, wherein the controller is configured to set each of the logical addresses included in the first logical address range to the unallocated state by setting or discarding the first logical-physical address translation table to an initial state.
8. the first logical-physical address conversion table includes a plurality of tables corresponding to a plurality of hierarchical levels, each of the plurality of tables includes one or more address conversion data, and each of the one or more address conversion data included in the table of each hierarchical level covers a logical address range corresponding to each hierarchical level such that each address conversion table corresponding to a higher hierarchical level covers a wider logical address range than each address conversion data corresponding to a lower hierarchical level; 7. The memory system of claim 6, wherein the controller is configured to place each of the logical addresses in the first logical address range in the unallocated state by setting or discarding a table of a highest hierarchical level of the plurality of hierarchical levels to an initial state.
9. Further comprising a volatile memory, The controller: loading address translation data included in the first logical-physical address translation table from the non-volatile memory to the volatile memory; updating address translation data stored in the volatile memory in response to execution of the first write command; The memory system of claim 6, further configured to, when the power interruption notice is received from the host, set each of the logical addresses included in the first logical address range to the unallocated state during the first period without writing to the non-volatile memory any updated address conversion data in the volatile memory that has not yet been reflected in the first logical-physical address conversion table stored in the non-volatile memory.
10. The controller:
10. The memory system of claim 9, further configured to: in response to receiving an instruction from the host to transition a power state of the memory system from an on state to a low power state corresponding to a suspended state of the host, write updated address translation data in the volatile memory that is not yet reflected in the first logical-physical address translation table stored in the nonvolatile memory to the nonvolatile memory.
11. The controller: in response to receiving a second namespace creation command from the host that does not specify the first attribute, creating a second namespace that includes a second logical address range, the second namespace having a second attribute that requires data associated with the second logical address range to be preserved across power cycles of the memory system; managing a second logical-physical address conversion table for managing mapping between each of the logical addresses included in the second logical address range and each of the physical addresses of the non-volatile memory; further loading second address translation data included in the second logical-physical address translation table from the non-volatile memory to the volatile memory; updating the second address translation data stored in the volatile memory in response to execution of a second write command that specifies a second namespace identifier for identifying the second namespace; The memory system of claim 9, further configured to, in response to receiving the power interruption notification from the host, write to the non-volatile memory the updated second address conversion data in the volatile memory that has not yet been reflected in the second logical-physical address conversion table stored in the non-volatile memory.
12. The controller: in response to receiving a second namespace creation command from the host that does not specify the first attribute, creating a second namespace that includes a second logical address range, the second namespace having a second attribute that requires data associated with the second logical address range to be preserved across power cycles of the memory system; managing a second logical-physical address conversion table for managing mapping between each of the logical addresses included in the second logical address range and each of the physical addresses of the non-volatile memory; further loading second address translation data included in the second logical-physical address translation table from the non-volatile memory to the volatile memory; updating the second address translation data stored in the volatile memory in response to execution of a second write command that specifies a second namespace identifier for identifying the second namespace; With regard to the second logical-physical address conversion table, a restoration preparation process is performed, the restoration preparation process including: (1) an operation of writing, at each checkpoint, the second address conversion data updated in the volatile memory that has not yet been reflected in the second logical-physical address conversion table stored in the nonvolatile memory to the nonvolatile memory; and (2) an operation of writing, at each checkpoint, a sequence number assigned to a first block currently assigned as a write destination block for the second namespace to the nonvolatile memory as information for identifying a block group to be used for a restoration process of the second logical-physical address conversion table stored in the nonvolatile memory, With respect to the first logical-physical address conversion table, (3) an operation of writing, to the nonvolatile memory, the updated address conversion data in the volatile memory that has not yet been reflected in the first logical-physical address conversion table stored in the nonvolatile memory at each checkpoint, and (4) an operation of writing, to the nonvolatile memory, a sequence number assigned to a second block currently assigned as a write destination block for the first namespace at each checkpoint, as information for identifying a block group to be used for a restoration process of the first logical-physical address conversion table stored in the nonvolatile memory, 10. The memory system of claim 9, wherein the sequence number assigned to the first block indicates an order in which the first block was assigned as a destination block for the second namespace, and the sequence number assigned to the second block indicates an order in which the second block was assigned as a destination block for the first namespace.
13. A method for controlling a memory system including a non-volatile memory, comprising: In response to receiving a first namespace creation command from a host specifying a first attribute, creating a first namespace that includes a first logical address range, wherein data associated with the first logical address range is not required to be retained across power cycles of the memory system; A control method comprising: placing each of the logical addresses included in the first logical address range in an unallocated state in which no physical address of the non-volatile memory is mapped, during a first period from receiving a power cut notification from the host notifying that power supply to the memory system will be cut off, or from detecting an unauthorized power cut of the memory system, to when power is again supplied to the memory system and a controller in the memory system becomes ready to process commands from the host.
14. A memory system connectable to a host, comprising: A non-volatile memory; a controller electrically connected to the non-volatile memory; The controller: in response to receiving a first namespace creation command from the host specifying a first attribute, creating a first namespace including a first logical address range and having the first attribute; using a hierarchical first logical-physical address translation table including a plurality of tables corresponding to a plurality of hierarchical levels to manage mapping between each of the logical addresses included in the first logical address range and each of the physical addresses of the non-volatile memory, each of the plurality of tables including one or more address translation data, each of the one or more address translation data included in the table of each hierarchical level covering a logical address range corresponding to each hierarchical level such that each address translation table corresponding to a higher hierarchical level covers a wider logical address range than each address translation data corresponding to a lower hierarchical level; in response to receiving a first write command from the host specifying a first namespace identifier for identifying the first namespace, writing first data associated with the first write command to the nonvolatile memory, and updating the first hierarchical logical-physical address conversion table so that a first physical address indicating a physical storage location in the nonvolatile memory to which the first data has been written is mapped to a first logical address corresponding to the first data; The memory system is configured to set each of the logical addresses included in the first logical address range to an unallocated state to which no physical address of the non-volatile memory is mapped, by setting or discarding a table of a highest hierarchical level among the plurality of hierarchical levels to an initial state, during a first period from receiving a power-off notice from the host predicting that power supply to the memory system will be cut off or detecting an unauthorized power-off of the memory system, to when power is again supplied to the memory system and the controller is in a ready state to process commands from the host.
15. Further comprising a volatile memory, The controller: loading address translation data included in the hierarchical first logical-physical address translation table from the non-volatile memory to the volatile memory; updating address translation data stored in the volatile memory in response to execution of the first write command; 15. The memory system of claim 14, further configured to, when the power interruption advance notice is received from the host, set each of the logical addresses included in the first logical address range to the unallocated state by setting the table at the highest hierarchical level to an initial state or discarding it during the first period without writing to the nonvolatile memory updated address translation data in the volatile memory that has not yet been reflected in the hierarchical first logical-physical address translation table stored in the nonvolatile memory.
16. The controller:
16. The memory system of claim 15, further configured to: in response to receiving an instruction from the host to transition a power state of the memory system from an on state to a low power state corresponding to a suspend state of the host, write updated address translation data in the volatile memory that is not yet reflected in the hierarchical first logical-physical address translation table stored in the non-volatile memory to the non-volatile memory.
17. The controller: in response to receiving a second namespace creation command from the host that does not specify the first attribute, creating a second namespace that includes a second logical address range, the second namespace having a second attribute that requires data associated with the second logical address range to be preserved across power cycles of the memory system; managing a second logical-physical address translation table for managing mapping between each of the logical addresses included in the second logical address range and each of the physical addresses of the non-volatile memory; further loading second address translation data included in the second logical-physical address translation table from the non-volatile memory to the volatile memory; updating the second address translation data stored in the volatile memory in response to execution of a second write command specifying a second namespace identifier for identifying the second namespace; 16. The memory system of claim 15, further configured to, in response to receiving the power interruption notice from the host, write to the nonvolatile memory the updated second address translation data in the volatile memory that has not yet been reflected in the second logical-physical address translation table stored in the nonvolatile memory.
18. The controller: in response to receiving a second namespace creation command from the host that does not specify the first attribute, creating a second namespace that includes a second logical address range, the second namespace having a second attribute that requires data associated with the second logical address range to be preserved across power cycles of the memory system; managing a second logical-physical address translation table for managing mapping between each of the logical addresses included in the second logical address range and each of the physical addresses of the non-volatile memory; further loading second address translation data included in the second logical-physical address translation table from the non-volatile memory to the volatile memory; updating the second address translation data stored in the volatile memory in response to execution of a second write command specifying a second namespace identifier for identifying the second namespace; With respect to the second logical-physical address conversion table, a restoration preparation process is performed, including: (1) an operation of writing, at each checkpoint, the second address conversion data updated in the volatile memory that has not yet been reflected in the second logical-physical address conversion table stored in the nonvolatile memory to the nonvolatile memory; and (2) an operation of writing, at each checkpoint, a sequence number assigned to a first block currently assigned as a write destination block for the second namespace to the nonvolatile memory as information for identifying a block group to be used for a restoration process of the second logical-physical address conversion table stored in the nonvolatile memory, With respect to the hierarchical first logical-physical address conversion table, the present invention is further configured to omit execution of a restoration preparation process including: (3) an operation of writing, at each checkpoint, the updated address conversion data in the volatile memory that has not yet been reflected in the hierarchical first logical-physical address conversion table stored in the nonvolatile memory to the nonvolatile memory; and (4) an operation of writing, at each checkpoint, a sequence number assigned to a second block currently assigned as a write destination block for the first namespace to the nonvolatile memory as information for identifying a block group to be used for a restoration process of the hierarchical first logical-physical address conversion table stored in the nonvolatile memory, 16. The memory system of claim 15, wherein the sequence number assigned to the first block indicates an order in which the first block was assigned as a destination block for the second namespace, and the sequence number assigned to the second block indicates an order in which the second block was assigned as a destination block for the first namespace.
19. A method for controlling a memory system including a non-volatile memory, comprising: in response to receiving a first namespace creation command from a host specifying a first attribute, creating a first namespace including a first logical address range and having the first attribute; managing mapping between each of the logical addresses included in the first logical address range and each of the physical addresses of the non-volatile memory using a hierarchical first logical-physical address conversion table including a plurality of tables corresponding to a plurality of hierarchical levels; in response to receiving a first write command from the host specifying a first namespace identifier for identifying the first namespace, writing first data associated with the first write command to the non-volatile memory, and updating the first hierarchical logical-physical address conversion table so that a first physical address indicating a physical storage location in the non-volatile memory to which the first data has been written is mapped to a first logical address corresponding to the first data; each of the plurality of tables includes one or more address conversion data, and each of the one or more address conversion data included in the table of each hierarchical level covers a logical address range corresponding to each hierarchical level such that each address conversion table corresponding to a higher hierarchical level covers a wider logical address range than each address conversion data corresponding to a lower hierarchical level; the control method further comprising: during a first period from receiving a power cut advance notice from the host that advances the cutoff of power to the memory system, or detecting an unauthorized power cut of the memory system, to when power is again supplied to the memory system and a controller in the memory system is in a ready state capable of processing commands from the host, setting a table at a highest hierarchical level among the plurality of hierarchical levels to an initial state or discarding the table, so as to set each of the logical addresses included in the first logical address range to an unallocated state to which no physical address of the non-volatile memory is mapped.
Citation Information
Patent Citations
Epoxy resin composition
JP1988020322A
Data storage system and cache control method to be applied to the same
JP1998187541A
Highly reliable computer system, check point data sampling / Restoring method therein and recording medium where the method is programmed and recorded
JP1999024996A
Terminal unit
JP2007317176A
Information processor and processing method, and program
JP2009223787A
