Embodiments described herein relate generally to a data storage apparatus having nonvolatile memories, a memory control method, and an electronic apparatus having a data storage apparatus.
In recent years, the development of solid-state drives (SSDs) for use as data storage apparatuses has been ongoing. Each SSD comprises a NAND flash memory (hereinafter referred to as a “flash memory” in some cases), which is a programmable nonvolatile memory.
In the SSD, the interference noise between any adjacent memory cells increases at the time of writing or reading data, because the size of each memory cell is decreasing. Inevitably, the SSD is susceptible to program disturbance.
Recently, lower pages are written at a write voltage somewhat lower than the normal potential in order to prevent the interference noise between any adjacent memory cells while upper pages are being written while data is being written in units of logical blocks. In this method, however, the data retention is degraded faster than before if the data writing is interrupted while a page is being written.
Various embodiments will be described hereinafter with reference to the accompanying drawings.
The data storage apparatus according to an embodiment comprises a first controller, a second controller, a third controller, and a fourth controller. The first controller controls a flash memory, writing and reading data, in units of blocks, to and from the flash memory. The second controller detects any a write-interrupted block is interrupted by the first controller. The third controller sets the write-interrupted block detected by the second controller, as a block to be refreshed in another block. The fourth controller performs the process of refreshing.
As shown in
The technical terms used in describing this embodiment will be defined as follows.
The “compaction process” is a migration processing in which valid clusters are first extracted from a logical block of a compaction-source block (i.e., block to be compacted), and then transferred to a new logical block (i.e., a compaction-destination block). The compaction process can release any recording area (logical block) not used at all. The migration processing will be hereinafter referred to as “refresh process.” Besides the compaction process, the garbage collection is well known as a process of releasing recording (memory) areas.
“Clusters” are data units to be managed, which are equivalent to pages. Each cluster is composed of, for example, eight sectors. A “sector” is the smallest data unit to be accessed. A “valid cluster” is a cluster holding the latest data. An “invalid cluster” is a cluster holding data not latest.
Each logical block is composed of a plurality of physical blocks. In the present embodiment, a “logical block” is composed of 64 physical blocks, i.e., 8 channels×4 banks×2 planes. A “plane” is a district that can be accessed at a time in a memory chip. In this embodiment, one plane is equivalent to two clusters (i.e., one logical page). A “channel” is a transmission path through a NAND controller transmits data. In this embodiment, eight channels are used to transmit at most eight data items in parallel (that is, at the same time). A “bank” is a set of memory chips managed by the NAND controller of each channel.
As shown in
The host interface controller 2 controls the transfer of data, commands and addresses between a host and the SSD 1. The host is, for example, a computer including an interface conforming to the serial ATA (SATA) standard. The host interface controller 2 stores the data (write data) transferred from the host, in the data buffer 3. Further, the host interface controller 2 transfers any command and any address from the host to the main controller 4.
The data buffer 3 is a memory constituted by, for example, a dynamic random access memory (DRAM). The data buffer 3 is not limited to a DRAM. It may instead be a volatile random access memory of any other type, such as static random access memory (SRAM). Alternatively, the data buffer 3 may be a nonvolatile random access memory such as magneto resistive random access memory (MRAM) or ferroelectric random access memory (FeRAM).
The data buffer 3 has a write buffer area (WB area) 31 and a compaction buffer area (CB area) 32. The WB area 31 holds the write data (user data) transferred from the host. The CB area 32 holds the write data (valid data) in the compaction process. The data buffer 3 may include an area holding a logical-to-physical address conversion table.
The main controller 4 includes, for example, a microprocessor (MPU), and performs a main controlling of the SSD controller 10. The main controller 4 includes a read/write controller 41, a block management module 42, and a compaction controller 43. The main controller 4 controls the memory controller 5, i.e., all NAND controllers 50 to 57.
The read/write controller 41 controls the data reading and the data writing, in accordance with the read/write command transferred from the host through the host interface controller 2. Further, the read/write controller 41 controls the data writing (data refreshing) in the flash memory 6 in the compaction process, in response to a write command for the compaction process from the compaction controller 43.
The block management module 42 uses a block management table, managing the state of each block (logical block) in the flash memory 6 and also any page written in the flash memory 6. As shown in
The compaction controller 43 is a controller configured to control the compaction process. The compaction controller 43 retrieves any compaction-source block (i.e., block to be compacted), retrieves the valid clusters existing in each block, counts the valid clusters, and generates a compaction command. The compaction controller 43 transfers a read command and a write command to the read/write controller 41, in order to read and write data that will be subjected to the compaction process.
The memory controller 5 has NAND controllers 50 to 57 associated with channels ch0 to ch7, respectively. In response to a command from the read/write controller 41, the memory controller 5 writes data to the flash memory 6 or reads data from the flash memory 6. Each of the NAND controllers 50 to 57 reads or writes data in parallel to or from the memory chips constituting one channel, or performs bank-interleaving with respect to the four banks 0 to 3. In response to a command from the read/write controller 41 that operates in unison with the compaction controller 43, the memory controller 5 reads data from, or write data to, the flash memory 6 in the compaction process.
As shown in
The write-interrupted block detection module 44 detects any block on which the writing has been interrupted at a page. The prior refresh controller 45 manages the block detected by the write-interrupted block detection module 44, as a block to be refreshed prior to other blocks. To be more specific, the prior refresh controller 45 cause the compaction controller 43 to select the block so detected, as block to be compacted prior to other blocks. In this embodiment, the compaction controller 43 is equivalent to a controller that performs refresh process.
The electronic apparatus 20 is, for example, a personal computer. As
The compaction process according to this embodiment will be outlined with reference to
In the SSD 1, as more and more data is written in the flash memory 6, the ratio of the storage area that cannot hold valid data increases in a block, because of the invalid data (not the latest). To make the best use of the block in which the storage area of valid data is in low density, the SSD 1 performs the compaction process.
As shown in
Note that each of the blocks 60A and 60B is composed of several logical pages (P0, P1, P2,). Each logical page is composed of few clusters (for example, two clusters). Any valid cluster is valid data of a unit of cluster. The compaction controller 43 acquires, from the block management module 42, the valid clusters 61A and 61B contained in the compaction-source blocks 60A and 60B, respectively. In most cases, each block contains log information for distinguishing a valid cluster from an invalid cluster (i.e., invalid data).
The compaction controller 43 outputs a compaction command to the read/write controller 41 to perform the compaction process. The read/write controller 41 performs the compaction process in unison with the compaction controller 43. In response to a command from the read/write controller 41, the memory controller 5 performs a read process, reading the valid clusters 61A and 61B from the compaction-source blocks 60A and 60B, respectively. Further, the memory controller 5 performs a write process, writing the valid clusters 61A and 61B read from the compaction-source blocks 60A and 60B, respectively, to a compaction-destination block 60C. The compaction-destination block 60C is a free block selected from the block-management table list stored in the block management module 42.
In the compaction process described above, the valid clusters 61A and 61B are collected from the compaction-source blocks 60A and 60B, respectively, and are transferred to the compaction-destination block 60C. After this data transfer (i.e., refresh process) has been performed, the compaction-source blocks 60A and 60B can be utilized again as free blocks, by virtue of an erasure process.
A refresh control process according to the embodiment will be explained with reference to the flowchart of
In response to the write command transferred from the host through the host interface controller 2, the read/write controller 41 controls the write process. More precisely, the memory controller 5 performs a write process (host-write process), writing data in the block designated in the flash memory 6, in response to the command from the read/write controller 41. In this write process, the block management module 42 uses the block management table of
At the time the data is completely written in the block, the write-interrupted block detection module 44 refers to the block management table, detecting a block (block ID) in either active state or writing state (Block 600). Alternatively, the write-interrupted block detection module 44 may detect any block the data writing to which was interrupted prior to the power supply interruption at start of the SSD1.
As shown in
The write-interrupted block detection module 44 detects any block that is active and holds less written pages than the block can hold (Block 601). In this embodiment, the write-interrupted block detection module 44 detects a block (ID=1) holding 100 written pages, as a write-interrupted block (YES in Block 602).
The write-interrupted block detection module 44 notifies the ID (=1) of the write-interrupted block detected and the number of pages (=100) written in the block, to the prior refresh controller 45 (Block 603). The prior refresh controller 45 manages the block so notified, as a block that should be subjected to the prior refresh process. More specifically, the prior refresh controller 45 commands the compaction controller 43 to select this block as the compaction-source block to be compacted prior to any other blocks (Block 604).
Performed these steps sequentially in the compaction process, the compaction controller 43 selects a write-interrupted block as compaction-source block and then performs the refresh process, transferring the data from the write-interrupted block to another block (free block). After the refresh process, all data held in the write-interrupted block are invalidated and erased, converting the block to a free block.
Thus, any write-interrupted block, in which the page writing has been interrupted, is never left as it is, and is converted to a free block without fail. The data can therefore be saved before the block becomes not readable because the errors can no longer be corrected due to the degraded data retention. This ensures the high operating reliability of the SSD 1.
Another refresh control process according to the embodiment will be explained with reference to the flowchart of
As shown in
In response to the write command transferred from the host through the host interface controller 2, the read/write controller 41 starts controlling the write process (YES in Block 700). The read/write controller 41 notifies a write process event to the timer module 46 at the start of the write process (Block 701). In response to the write process event, the timer module 46 performs timer resetting.
The timer module 46 periodically determines whether a prescribed time has elapsed since the timer resetting (from the time the write process started) (Block 702). Note that the prescribed time is based on the memory-cell characteristic evaluated during the manufacture of the flash memory 6. Once the prescribed time has elapsed, the timer module 46 commands the read/write controller 41 to interrupt the write process (Block 703). The timer module 46 measures the time elapsed from the start of the last write process performed on the block.
In response to the write interrupt command, the read/write controller 41 interrupts the write process on the block, and prepares a free block as new block in which to write data (Block 704). The read/write controller 41 then notifies the ID of the write-interrupted block and the number of pages written in the block to the prior refresh controller 45 (Block 705). For example, as shown in
The prior refresh controller 45 manages (or registers) the block having the ID so notified, as a block to recover. The prior refresh controller 45 then commands the compaction controller 43 to select the block registered as the block to recover (Block 706).
Performed these steps sequentially in the compaction process, the compaction controller 43 selects the block to recover, as compaction-source block in which data has not been completely written because the prescribed time has elapsed. The compaction controller 43 then performs the refresh process, transferring the data from the right-interrupted block to another block (free block) prepared. After the refresh process, all data held in the write-interrupted block are invalidated and erased, converting the block to a free block.
Thus, the degradation of data retention can be suppressed in any block in which data is being written and for which the write command from the host is delayed. The data can be therefore saved before it can no longer be read due to the limited error-correction ability. This ensures the high operating reliability of the SSD 1.
The block management module 42 according to the modified embodiment has such a block management table as shown in
The write-interrupted block detection module 44 notifies the ID of the block detected and the number of pages written in the block, to the stabilization process controller 47. The stabilization process controller 47 writes, in the block so notified, dummy data for the fewest remaining pages, thereby stabilizing the data-storage state of the block.
The stabilization process performed by the stabilization process controller 47 in the modified embodiment will be explained with reference to
As shown in
The read/write controller 41 further determines whether the write-destination page is an upper page or a lower page (Block 802). If the write-destination page is a lower page, the read/write controller 41 causes the block management module 42 to add the number of unstable pages to the block management table (Block 803). If the write-destination page is an upper page, the read/write controller 41 causes the block management module 42 to subtract the number of unstable pages from the block management table (Block 804).
How data is written to the flash memory 6, in units of pages, will be explained with reference to
Consequently, it takes a longer time than otherwise, in order to read data correctly.
In the modified embodiment, the stabilization process controller 47 therefore performs a stabilization process, writing dummy data and thereby stabilizing the data of the pages 5 and 7. The stabilization process according to the modified embodiment will be explained, with reference to
In response to the notification from the write-interrupted block detection module 44, the stabilization process controller 47 refers to the block management table through the block management module 42, thereby determine whether any unstable page remains in the block (Block 900). If any unstable remains in the block, the stabilization process controller 47 determines the write-destination page in which to write dummy data, on the basis of the memory-element setting specific to the flash memory 6 (Block 901).
The stabilization process controller 47 then causes the read/write controller 41 to instruct the memory controller 5 that dummy data (for example, all-zero data) should be written in the write-destination page determined (Block 902). The memory controller 5 therefore performs a write process of writing the dummy data in the write-destination page of the designated block (i.e., block 2) of the flash memory 6.
Further, the stabilization process controller 47 determines whether the write-destination page is an upper page or a lower page (Block 903). If the write-destination page is an upper page, the stabilization process controller 47 causes the read/write controller 41 causes the block management module 42 to subtract the number of unstable pages from the block management table (Block 904). When the block management table comes to have no unstable pages, the stabilization process controller 47 terminates the stabilization process (Block 900).
In the modified embodiment, the stabilization process controller 47 performs such a stabilization process as described above. In the stabilization process, the system data to be necessarily used after the normal write process is interrupted needs to be transferred to a data-save area. That is, the storage area can be saved for the system data.
The data written in the stabilization process the stabilization process controller 47 performs is divided into pages stabilized and pages not stabilized.
Therefore, the stabilization process controller 47 needs to write the system data in upper pages 8, 10 and 12 and lower page 9, and dummy data in lower page 11, in such a order as shown in
In the modified embodiment, the stabilization process is performed on the basis of the number of pages and the number of unstable pages, all written in any write-interrupted block, writing the dummy data or system data in some pages, thereby to stabilize these pages. The unstable pages are therefore reduced in number, suppressing the degradation of data retention in any write-interrupted block. This ensures the high operating reliability of the SSD 1. The compaction process must be performed to transfer the data of any unstable page to save the data. Nonetheless, since the stabilization process stabilizes the page, the compaction process need not be performed so often to transfer the page data. Further, the time for writing data necessary for the stabilization process can be minimized since it is determined whether each page is an upper page or a lower page and the least pages necessary for stabilization are written.
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 claims the benefit of U.S. Provisional Application No. 61/669,374, filed Jul. 9, 2012, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61669374 | Jul 2012 | US |