Embodiments relate generally to a memory device, in particular, a memory device that performs garbage collection.
A memory device of one type includes a nonvolatile semiconductor memory and a controller that controls the semiconductor memory.
In general, according to an embodiment, a memory device includes a nonvolatile memory unit including a plurality of blocks, and a memory controller. The memory controller is configured to determine target blocks for garbage collection, and transfer valid data in the target blocks to another block during the garbage collection. The target blocks includes a first block that has a valid data ratio greater than zero and equal to or smaller than a predetermined value and a second block that has a valid data ratio greater than the predetermined value.
Various embodiments will be described hereinafter with reference to the accompanying drawings. In the description below, substantially the same functions and elements are denoted by same reference numerals, and a description will be given only where necessary. Further, in the present disclosure, a plurality of expressions may be used for some elements. These expressions are merely illustrative examples, and these elements may be expressed by other expressions.
[1. Configuration]
[1-1. Overall Configuration (Information Processing System)]
Referring to
As shown in
Further, the SSD 10 can be used by being mounted in the host 40 such as a server, in a data center, a cloud computing system, or the like which is operated in a company (enterprise). Thus, the SSD 10 may be an enterprise SSD (eSSD).
The host (host apparatus) 40 includes a plurality of connectors (for example, slots) 50 which opens upward, for example. Each connector 50 is, for example, a Serial Attached SCSI (SAS) connector. According to this SAS connector, the host 40 and each SSD 10 can execute high speed communication by 6 Gbps dual ports. Here, each connector 50 is not limited to this, and may be, for instance, a PCI Express (PCIe) or an NVM Express (NVMe).
Further, the plural SSDs 10 are attached to the connectors 50 of the host 40, respectively, and are juxtaposed and supported upright in a substantially vertical direction. According to this configuration, the plural SSDs 10 can be mounted in a compact size, and the size of the host 40 can be reduced. The shape of each SSD 10 is a 2.5-inch small form factor (SFF). By this SFF shape, the SSD 10 can have a compatible shape with an enterprise HDD (eHDD). Thus, the SSD 10 has system compatibility with the eHDD.
In the meantime, the SSD 10 is not limited to the use for enterprises. For example, the SSD 10 is naturally applicable as a storage medium of a consumer electronic device such as a notebook portable computer or a tablet terminal.
[1-2. Memory System]
Referring to
As shown in
The NAND memory 30 is a semiconductor memory which includes a plurality of blocks (blocks A to Z) 31, and stores data in each block 31 in a nonvolatile manner. The NAND memory 30 stores write data transmitted from the host 40 in the blocks 31 in accordance with control of the memory controller 20, and reads the stored data from the blocks 31. The NAND memory 30 erases the data stored in the blocks 31 in accordance with the control of the memory controller 20. The blocks 31 will be described in detail below.
The memory controller (controller, memory control unit) 20 controls the NAND memory 30 on the basis of a command COM, a logical address LBA, and data DATA, etc., transmitted from the host 40. The memory controller 20 includes a host interface 21, a memory interface 22, a controller 23, an encoding and decoding unit 24, a buffer 27, and a write and read controller 28, which are electrically connected to each other through a control line 29.
The host interface (host I/F) 21 transfers the command (write command, read command, and erase command, etc.) COM, the logical address LBA, and the data DATA, etc., between the memory controller 20 and the host 40. The host interface 21 may convert the logical address LBA transmitted from the host 40 to a predetermined physical address PBA using an address conversion table.
The memory interface (memory I/F) 22 transfers a command, write data, and read data, etc., between the memory controller 20 and the NAND memory 30.
The encoding/decoding unit 24 includes an encoding unit 24a and a decoding unit 24b. The encoding unit 24a generates an error correction code for write data transmitted from the host 40 during a data write operation. The decoding unit 24b corrects an error of read data transmitted from the NAND memory 30 using the error correction code during a data read operation.
The buffer (data storage) 27 stores the write data, the read data, and the first and second block lists L1 and L2, etc. More specifically, the buffer 27 temporarily stores data until the size of the write data transmitted from the host 40 reaches a predetermined data size that is suited to the NAND memory 30. For example, the buffer 27 temporarily stores the write data until the size of the data reaches 16 KB, which corresponds to a page size. Further, the buffer 27 temporarily stores the read data read from the NAND memory 30. More specifically, the read data stored in the buffer 27 is rearranged in an order suited to the host 40 (an order of the logical address LBA which is designated by the host 40).
Moreover, the buffer 27 stores the first and second block lists L1 and L2. The first and second block lists L1 and L2 are lists each indicating block information of blocks (garbage collection source blocks) from which data can be transferred during a garbage collection (or compaction). The first and second block lists L1 and L2 will be described in detail below.
The write and read controller 28 controls the data write operation and the data read operation in accordance with the controller 23. The write and read controller 28 writes the write data in the NAND memory 30 in parallel using a plurality of channels (for example, four channels) in order to meet a predetermined speed requirement, for example, in the data write operation.
The controller 23 controls the respective components (21, 22, 24, 27 and 28) of the memory controller 20 through the control line 29, and controls the operation of the entire memory controller 20. The controller 23 includes, for example, a central processing unit (CPU).
Here, the configuration of the memory system 10 illustrated in
[1-3. Block]
Referring to
Block A includes a plurality of memory cell units MU arranged along word lines. Each of the memory cell units MU includes a NAND string (memory cell string) including eight memory cells MC0 to MC7 to which a current path is serially connected along a bit line, select transistor S1 on the source side which is connected to one end of the current path of the NAND string, and select transistor S2 on the drain side which is connected to the other end of the current path of the NAND string. Memory cells MC0 to MC7 each include a control gate CG and a floating gate FG. Here, the memory cell unit MU includes eight memory cells MC0 to MC7, but is not limited thereto. It suffices that the memory cell unit MU is constituted of at least two memory cells, for example, 56 memory cells or 32 memory cells.
One end of the current path of a select transistor S1 on the source side is connected to one end of the NAND string, and the other end is commonly connected to the source line SL. One end of the current path of a select transistor S2 on the drain side is connected to the other end of the NAND string, and the other end is connected to each of bit lines BL0 to BLm-1.
Word lines WL0 to WL7 are commonly connected to the control gates CG of the plurality of memory cells MC0 to MC7 arranged along the word line, respectively. A select gate line SGS is commonly connected to gate electrodes of a plurality of select transistors S1 arranged along the word line. A select gate line SGD is also commonly connected to gate electrodes of a plurality of select transistors S2 in the word line direction.
As shown in
[1-4. First and Second Block Lists]
Referring to
As shown in
As shown in
Valid data ratio DR2n, which is the least in the second block list L2, is greater than valid data ratio DR1n, which is the greatest in the first block list L1 (DR2n>DR1n). Thus, the block number of the block having a greater valid data ratio than the blocks in the first block list L1 is shown in the second block list L2. In other words, the second block list L2 is a list indicating a block number of a block having a valid data ratio greater than the blocks in the first block list L1. As described, the memory controller 20 manages a second group of blocks having the valid data ratio greater than or equal to the second threshold value DR2n in the second block list L2.
Here, the “valid data ratio” refers to a ratio of valid data stored in a block to a storage capacity of the block in the first and second block lists L1 and L2. For example, the valid data ratio refers to a ratio of the number of clusters corresponding to valid data VD to the number of clusters which can be written in a block. The “valid data (VD)” refers to a data to be written in a block to which data may be transferred during the garbage collection. The “block number (block information)” is information by which a block can be identified (for example, physical block address PBA).
Here, the structures of the first and second block lists L1 and L2 are not limited to those shown in
Further, the first block list L1 and the second block list L2 are separately controlled in the above embodiment, but contents of the first block list L1 and the second block list L2 may be managed in one list.
[2. Operation]
Next, the operation of the memory system 10 according to the first embodiment is described.
[2-1. Generating and Updating Processing of Second Block List L2]
Referring to
In step S11, the memory controller 20 selects one block from the NAND memory 30.
In step S12, the memory controller 20 determines whether the valid data ratio of the block selected in step S11 is greater than valid data ratio DR2n which is the least in the second block list L2. If the valid data ratio of the selected block is less than the valid data ratio DR2n (No in S12), the process proceeds to step S14.
In step S13, if the valid data ratio of the selected block is greater than the valid data ratio DR2n (Yes in S12), the memory controller 20 replaces the block BK2n with the least valid data ratio in the second block list L2 with the selected block. More specifically, in this case, the memory controller 20 refers to the second block list L2, and replaces the block BK2n with the valid data ratio DR2n which is the least in the second block list L2 with the selected block. The new block is sorted in the second block list L2 in accordance with the valid data ratio of the block.
In step S14, the memory controller 20 determines whether there is a block to be checked next. If there is a block to be checked next (Yes in S14), the memory controller 20 repeats steps S12 and S13. On the other hand, if there is no block to be checked (No in S14), the memory controller 20 ends the operation.
Here, the processing shown in
[2-2. Garbage Collection Processing]
Referring to
In step S21, the memory controller 20 selects the block BK11 with the least valid data ratio from the first block list L1. More specifically, the memory controller 20 refers to the first block list L1, and selects the block BK11 having the least valid data ratio DR11.
In step S22, the memory controller 20 carries out the garbage collection processing with respect to the selected block BK11.
For example, as shown in
Referring to
As shown in, for example,
Referring to
For example, it is assumed that the threshold value is two. In this case, in the example shown in
Referring to
For example, as shown in
Here, all valid data in the blocks BK11 and BK12 are moved by moving the valid data VD11 and VD12 to the block BK00. Thus, the blocks BK11 and BK12 can be used as free blocks in which all pages PA are writable.
Referring to
For example, as shown in
Referring to
As shown in
On the other hand, if the valid data amount in the block to which data are to be transferred has not reached the predetermined threshold value (No in S27), the process returns to step S25, and the memory controller 20 repeats the above operation.
As has been described above, at least the following advantageous effects (1) and (2) can be obtained from the configuration and operation of the memory system 10 according to the first embodiment.
(1) The write time required for the garbage collection can be reduced, and the garbage collection can be completed within a write time required by the host 40.
As shown in
Thus, write times TGCW1 and TGCW2 required for GC writes GCW1 and GCW2 need to be determined in order to determine overall latency TWQ for the write request WQ from the host 40. In this regard, the write times TGCW1 and TGCW2 correspond to a time for transferring the valid data VD from an original block to a destination block.
For example, to reduce the write times TGCW1 and TGCW2, a block with many valid data VD (block with a high valid data ratio) needs to be selected as a block from which data is transferred. The block with many valid data VD includes many valid data VD that can be transferred. Thus, the data size of the valid data VD that is to be transferred from the block amounts to a write unit (for example, page size). Accordingly, the write times TGCW1 and TGCW2 required for the garbage collection depend on the time to fill a predetermined data size (for example, page size) with the data to be transferred.
Therefore, the memory system 10 according to the first embodiment includes the first block list L1 in which blocks with a low valid data ratio are registered, and the second block list L2 in which blocks with a high valid data ratio are registered (
As a result of the garbage collections GC1 and GC2, the valid data VD11, VD12, and VD21 to VD23 of blocks BK11, BK12, and BK21 are written in the block BK00. Thus, the data size of the valid data VD11, VD12 and VD21 to VD23 satisfies a write unit (for example, page size).
Accordingly, a block with many valid data for the garbage collection GC2 can be selected from the second block list L2. This can reduce the write times TGCW1 and TGCW2 required for the garbage collection further. In addition, since this can reduce the write times TGCW1 and TGCW2 required for the garbage collection further, the overall latency TWQ for the write request WQ can be reduced.
(2) Invalid data write can be prevented, allowing the NAND memory 30 to have a greater lifetime.
This advantageous effect is described by comparing the first embodiment with a comparative example.
A case where the garbage collection is performed using only blocks with a low valid data ratio is described as a comparative example.
If the garbage collection is performed with respect to only blocks with a low valid data ratio, the size of valid data to be transferred may be small. As many blocks are selected for the garbage collection, many blocks can be free blocks as the valid data therein are transferred to a destination block.
However, if the garbage collection is performed with respect to only blocks with low valid data, the data size may not satisfy a write unit (page size), even if several blocks are selected for the garbage collection. In such a case, for example, invalid data needs to be further written to satisfy the write unit.
Writing such invalid data is unnecessary writing. Such an unnecessary writing may reduce a lifetime of a memory cell of a NAND memory, which generally has a limited number of writing times.
As described above, in the memory system according to the comparative example, as invalid data writing may be needed, the lifetime of the NAND memory may be reduced.
The memory system 10 according to the first embodiment can select a single block BK21 to satisfy the data size of the page PA, i.e., the valid data VD21 to VD23, from the second block list L2 including blocks with a high valid data ratio, as described in
As described above, the memory system 10 according to the first embodiment does not need to perform writing the invalid data, and allows the NAND memory 30 to have a greater lifetime.
In addition, in the comparative example, more invalid data must be written in order to reduce the write time by limiting the number of processed blocks with low valid data ratio.
The memory controller 20 according to the first embodiment switches a block from which valid data is transferred from the first block list L1 to the second block list L2 based on the number of processed blocks, and performs the garbage collection (No in S24 of
As described above, the reduction in the write time by limiting the number of processed blocks with a low valid data ratio can be achieved without writing invalid data by selectively switching the block from which data is transferred from the first block list L1 to the second block list L2.
Referring to
[Configuration]
[Second Block List L2A]
Referring to
Since the other configuration is substantially the same as that in the first embodiment, it is not described in detail.
[Operation]
[Generating and Updating Processing of Second Block List L2A]
Referring to
As shown in
In step S31, the memory controller 20 determines whether the elapsed time after data has been written in a selected block is greater than or equal to the predetermined threshold value TTH1. If the elapsed time is less than the predetermined threshold value TTH1 (No in S31), the memory controller 20 carries out step S14 in the same manner.
In step S32, if the elapsed time is greater than or equal to the predetermined threshold value TTH1 (Yes in S31), the memory controller 20 determines whether a valid data ratio of a block with a time greater than or equal to the threshold value TTH1 is greater than the minimum value DR2n in the second block list L2A.
In step S13, if the valid data ratio of the block with the time greater than or equal to the threshold value TTH1 is greater than the minimum value DR2n in the second block list L2A (Yes in S32), the memory controller 20 replaces the block BK2n with the selected block in the same manner.
On the other hand, if the valid data ratio of the block with the time greater than or equal to the threshold value TTH1 is less than the minimum value DR2n in the second block list L2A (No in S32), the memory controller 20 carries out step S14 in the same manner.
The second block list L2A that lists blocks having a high valid data ratio and an elapsed time longer than the fixed time (TTH1) can be generated and updated by repeating such operations.
[Garbage Collection Processing]
Referring to
As shown in
In step S33, the memory controller 20 records the time at which the process starts. More specifically, the memory controller 20 stores the time at which the garbage collection processing starts in a predetermined memory. The recorded time is used in step S34.
In step S34, the memory controller 20 determines whether the elapsed time is greater than a threshold value (second threshold value) TTH2. The threshold value TTH2 is a threshold value preset in order to complete the garbage collection within a given time. The threshold value TTH2 is equivalent to approximately 70% of the upper limit of write times TGCW1 and TGCW2 required for the garbage collection shown in
More specifically, the memory controller 20 calculates a difference between the start time of the processing recorded in step S33 and the time determined in step S34, and calculates an elapsed time from the start. The memory controller 20 compares the calculated elapsed time from the start with the threshold value TTH2. The memory controller 20 determines whether the elapsed time is greater than the threshold value TTH2 on the basis of the result of the comparison.
If the elapsed time is greater than predetermined threshold value TTH2 (Yes in S34), the memory controller 20 carries out step 25 in the same manner. If the elapsed time is less than predetermined threshold value TTH2 (No in S34), the memory controller 20 carries out step 21 in the same manner.
Since the other operations are substantially the same as the ones in the first embodiment, they are not described in detail.
As described above, at least the following advantageous effects (1) and (2) can be obtained from the configuration and operation of the memory system 10 according to the second embodiment. Moreover, advantageous effect (3) can be obtained according to the second embodiment.
(3) Reliability of data stored in the NAND memory 30 can be improved.
The second block list L2A according to the second embodiment further includes the elapsed times WT21 to WT2n from the writing. Each of the elapsed times WT21 to WT2n is greater than the predetermined threshold value TTH1 (
In this regard, in the NAND memory 30, an electrical charge at a floating gate FG of the memory cell MC decreases little by little after the writing, and bit errors gradually increase. Thus, valid data stored for a long time from the writing may need to be rewritten before an error can be no longer corrected.
In the second embodiment, a block with data of the elapsed time greater than predetermined threshold value TTH1 is selected (S25 in
As shown above, data of the NAND memory 30 can be stored more securely by performing the garbage collection with respect to a block having data with a great elapsed time selected from the second block list L2A. As a result, data stored in the NAND memory 30 can be rewritten before an error can be no longer corrected, and the reliability of the data stored in the NAND memory 30 can be improved.
Referring to
[Configuration]
[Second Block List L2B]
Referring to
Since the other configuration is substantially the same as in the second embodiment, it is not described in detail.
[Operation]
[Generating and Updating Processing of Second Block List L2B]
Referring to
As shown in
In step S41, the memory controller 20 refers to the second block list L2B, and determines whether the valid data ratio of the selected block is greater than or equal to the predetermined threshold value DRTH. If the valid data ratio of the selected block is less than the predetermined threshold value DRTH (No in S41), the memory controller 20 carries out step S14 in the same manner.
If the valid data ratio of the selected block is greater than or equal to the predetermined threshold value DRTH in step S42 (Yes in S41), the memory controller 20 determines whether a time elapsed after the start of writing is greater than the minimum time WT2n in the second block list L2B. If the time elapsed after the start of writing is less than the minimum time WT2n in the second block list L2B (No in S42), the memory controller 20 carries out step S14 in the same manner.
If the time elapsed after the start of writing is greater than the minimum time WT2n in the second block list L2B (Yes in S42), the memory controller 20 replaces the block BK2n with the minimum write time in the second block list L2B with the selected block in step S43.
Since the other operations are substantially the same as in the second embodiment, they are not described in detail.
As described above, at least the following advantageous effects (1) to (3) can be obtained from the configuration and operation of the memory system 10 according to the third embodiment.
Moreover, the memory system 10 according to the third embodiment includes the second block list L2B in which elapsed times WT21 to WT2n are sorted in descending order (WT21 ≧ . . . ≧WT2n) (
Thus, it is advantageous in that the reliability of the data stored in the NAND memory 30 can be further improved.
Referring to
[Configuration]
[Second Block List L2C]
Referring to
As shown in
Since the other configuration is substantially the same as that of the third embodiment, it is not described in detail.
[Operation]
[Generating and Updating Processing of Second Block List L2C]
Referring to
As shown in
In step S51, the memory controller 20 determines whether an elapsed time from writing of the selected block is greater than or equal to the predetermined threshold value TTH1. If the elapsed time from writing is less than the predetermined threshold value TTH1 (No in S51), the memory controller 20 carries out step S14 in the same manner.
If the elapsed time from writing is greater than or equal to the predetermined threshold value TTH1 in step S52 (Yes in S51), the memory controller 20 determines whether the number of erasures of the selected block is less than the maximum value EN2n in the second block list L2C. If the number of erasures is larger than the maximum value EN2n in the second block list L2C (No in S52), the memory controller 20 carries out step S14.
If the number of erasures is less than the maximum value EN2n in the second block list L2C in step S53 (Yes in S52), the memory controller 20 replaces the block BK2n with the largest number of erasures in the second block list L2C with the selected block.
Since the other operations are substantially the same as those in the third embodiment, they are not described in detail.
As has been described above, at least the following advantageous effects (1) to (3) can be obtained from the configuration and operation of the memory system 10 according to the fourth embodiment.
Moreover, the memory system 10 according to the fourth embodiment includes the second block list L2C that further includes the numbers of erasures EN21 to EN2n (
Thus, according to the fourth embodiment, a block not selected in the first block list L1 because of its small number of erasures and its high valid data ratio can be selected for the garbage collection by using the second block list L2C. As a result of the garbage collection, the block selected from the second block list L2C becomes a free block in the same manner. Thus, according to the fourth embodiment, wear leveling can be performed by changing a block with the small number of erasures to a free block and reusing it.
Although the above description is provided using the first to fourth embodiments, the configuration, and operation, etc., are not limited to the description. They can be modified as necessary.
For example, what is managed by the first and second block lists L1 and L2 is not limited to the above. For example, the memory controller 20 can also manage the number of valid data and the data size of the valid data, etc., in the second block list L2, instead of the valid data ratio.
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from the U.S. Provisional Patent Application No. 62/156,038, filed May 1, 2015, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
62156038 | May 2015 | US |