This application claims priority to and the benefit of Japanese Patent Application No. 2013-105094 filed May 17, 2013, the entire contents of which are incorporated herein by reference.
This disclosure relates to a data storage system and a control method thereof. In particular, this disclosure relates to a data storage system that performs garbage collection and to a control method thereof.
Recently, the use of Solid State Drives (SSDs), which are high-speed and have low power consumption, in data storage systems used in applications that handle big data, such as a Structured Query Language (SQL) database, has been examined.
As an example of the structure of an SSD, a hybrid SSD that combines high-speed ReRAM with high-density NAND flash memory has been proposed (for example, see H. Fujii et al., “x11 performance increase, x6.9 endurance enhancement, 93% energy reduction of 3D TSV-integrated hybrid ReRAM/MLC NAND SSDs by data fragmentation suppression”, Symp. VLSI Circuits 2012, pp. 134-135 (NPL 1)). For reasons such as cost reduction, however, SSDs that use only NAND flash memory are also being examined.
In databases such as SQL, row data are used as a unit in the database. An SSD executes processing (queries) such as insert, erase, and update in units of row data. The size of row data is normally approximately several hundred bytes.
In NAND flash memory, the unit of writing is a page. As illustrated in
As described above, since the unit of writing in NAND flash memory is a page, an instruction to write in NAND flash memory is issued with a Logical Page Address (LPA) indicated in the logical address space in
When the controller of NAND flash memory is instructed to write to a certain logical page address, the controller converts the logical page address to a physical page address and writes the data. The correspondence between logical page addresses and physical page addresses is not fixed, but rather changes in accordance with the condition of use of the NAND flash memory. The controller of the NAND flash memory stores the correspondence between logical page addresses and physical page addresses.
In the example illustrated in
In this way, in an SSD that uses NAND flash memory, since the unit of writing data is a page, an invalid page occurs each time data are updated. The same is also true when data are not being updated but rather inserted into a free area of a page. Accordingly, in NAND flash memory, upon each insertion or update, the number of invalid pages increases, and the amount of free space decreases. Therefore, when the amount of free space decreases and falls below a predetermined threshold, an SSD performs garbage collection to generate free space.
When the free space in the NAND flash memory becomes smaller than a predetermined threshold, the SSD selects a block to be erased (“target block”) and reads the data in all of the valid pages in the target block (step S201). Next, the SSD writes the data of the read valid pages into a block for writing that has free pages (step S202). The SSD then erases the data in the target block (step S203).
In this way, when the free space in the NAND flash memory decreases, the SSD can increase the amount of free space by performing garbage collection and erasing the data in the target block.
NPL 1: If, Fujii et al., “x11 performance increase, x6.9 endurance enhancement, 93% energy reduction of 3D TSV-integrated hybrid ReRAM/MLC NAND SSDs by data fragmentation suppression”. Symp. VLSI Circuits 2012, pp. 134-135
Since the unit of erasure in NAND flash memory is a block, however, in order to generate a free block, at the time of garbage collection it is necessary to copy valid pages in the target block selected by wear-leveling or the like into free pages of another block, set all of the pages in the target block to be invalid pages, and then erase the entire block.
In this case, if the number of valid pages in the target block is large, a long time is required to copy all of the valid pages. For example, if it takes approximately 1.7 ms to copy one page, and the number of valid pages is approximately 100, then a long time of 100 ms or greater is required for the copy.
In such a data storage system, it thus takes time to copy valid pages during garbage collection, leading to the problem of degradation in processing capability. Furthermore, if the free space in the memory decreases, then garbage collection occurs frequently, thereby the problem of the degradation in processing capability becoming more significant as the amount of free space in the memory decreases.
Therefore, it would be helpful to provide a data storage system, and control method thereof, that can reduce the degradation in processing capability due to copying at the time of garbage collection.
In order to solve the above problem, the disclosed data storage system includes a memory unit comprising a memory, into which data are written in units of pages, and a memory controller configured to control writing of data the memory; and a controller configured to indicate, to the memory controller, a logical page address to which data are to be written, such that the memory controller determines a target block that is a block to be erased when garbage collection is next performed, and provides the controller with information on a logical page address corresponding to a physical page address of a valid page in the target block, and the controller instructs the memory controller to write data to the logical page address received from the memory controller.
In the disclosed data storage system, the controller may instruct the memory controller to write the data by distributing the data between each logical page address received from the memory controller.
In the disclosed data storage system, when updating data stored in the memory, the controller may instruct the memory controller to erase non-updated data and to write newly updated data to the logical page address received from the memory controller.
In the disclosed data storage system, the memory controller may start garbage collection upon free space in the memory falling below a predetermined threshold.
In order to solve the above problem, the disclosed method of controlling a data storage system is a method of controlling a data storage system that includes a memory into which data are written in units of pages, the method including: determining a target block that is a block to be erased when garbage collection is next performed; converting a physical page address of a valid page in the target block into a corresponding logical page address; and writing data to the logical page address yielded by conversion.
The disclosed data storage system, and control method thereof, can reduce the degradation in processing capability due to copying at the time of garbage collection.
In the accompanying drawings:
The following describes the disclosed embodiments with reference to the drawings.
The memory unit 110 includes a memory controller 112 and a memory 114 formed by NAND flash memory.
For example from the perspective of wear-leveling, the memory controller 112 determines a target block in the memory 114. The target block is a block that is to be erased upon the next garbage collection.
The memory controller 112 converts the physical page address of a valid pane in the target block into a logical pane address and provides information on the logical page address to the controller 120.
The memory controller 112 monitors the free space in the memory 114. When the free space in the memory 114 falls below a predetermined threshold, the memory controller 112 starts garbage collection on the target block that was determined in advance.
Upon receiving an instruction from the controller 120 to execute an insert, erase, or update process on a certain logical page address, the memory controller 112 converts the logical page address to a physical page address and then executes the insert, erase, or update process on the physical page address in the memory 114.
When writing to the memory 114, the memory controller 112 cannot overwrite the same physical page address without first performing an erase. Therefore, as a page, the memory controller 112 reads the data at the logical page address that is to be written to, adds the row data to be inserted to the page, and then writes, the result to a free page in another block. Subsequently, the memory controller 112 sets the valid page that was copied to be an invalid page.
The memory 114 is formed by NAND flash memory. In the memory 114, the unit of writing is a page, and the unit of erasure is a block.
The controller 120 receives, from the memory controller 112, information on the logical page address that corresponds to each valid page in the target block that is to be erased at the time of the next garbage collection.
When inserting row data into the memory 114, the controller 120 issues an instruction to insert row data at the logical page address corresponding to a valid page in the target block received from the memory controller 112. Details on the processing when the controller 120 inserts row data are provided below.
When updating row data in the memory 114, the controller 120 issues an instruction to erase the original row data and to insert the new, updated data at the logical page address corresponding to a valid page in the target block received, from the memory controller 112. In other words, the controller 120 executes the process to update row data as a process that combines erasure and insertion. Details on the processing when the controller 120 updates row data are provided below.
In the state in
As a result of the process described in
In the example illustrated in
Upon receiving the instruction to insert row data at the logical page addresses LPA0 to LPA3 from the controller 120, then for example as illustrated in
At this time, the controller 120 does not insert the row data by packing the row data in order from the front, for example so that four sets of row data are all inserted into LPA0, but rather inserts the row data by distributing the row data between LPA0 to LPA3. Since the controller 120 thus inserts the row data by distributing the row data, a state in which each page has free space can be maintained until the space in the memory 114 becomes extremely strained. This allows avoidance of a situation in which, due to a lack of free space in the valid pages in the target block, the controller 120 cannot designate a valid page in the target block as the destination for insertion of row data.
When executing a process to update row data, the controller 120 does not update row data directly as in the process illustrated in
For example, in the example illustrated in
Upon receiving the instruction to insert the newly updated row data at the logical page address LPA3 from the controller 120, then for example as illustrated in
Since the controller 120 thus executes the update process as a process that combines erasure and insertion, a valid page in the target block can be turned into an invalid page in the update process as well, as in the insertion process. As a result, even when the proportion of update processes is high among the processes executed by the data storage system 100, all of the valid pages in the target block can be turned into invalid pages by repeating the update and insertion processes.
In
In
In
In
Examination of the characteristics of power consumption in
The vertical axis in
As illustrated in
As illustrated in
In this way, by the controller 120 receiving information on the logical page address of a valid page in the target block from the memory controller 112 and issuing an instruction to write data to the logical page address, this embodiment allows the valid pages in the target block to be set to invalid pages. As at result, at the time of garbage collection, since no valid pages remain in the target block, processing to copy the valid pages in the target block becomes unnecessary, thereby achieving an improvement over a conventional technique with respect to all of processing capability, power consumption, and the number of rewrites.
Furthermore, having the controller 120 issue an instruction to distribute and write data to the logical page addresses received from the memory controller 112 reduces the occurrence of a situation in which a valid page cannot be designated for writing due to a lack of free space in the valid pages of the target block.
Since the controller 120 executes the update process as a process that combines erasure and insertion, a valid page in the target block can be turned into an invalid page in the update process as well as in the insertion process.
Having the memory controller 112 start garbage collection once the free space in the memory 114 falls below a predetermined threshold also reduces the chance of the free space in the memory 114 falling below a predetermined value.
Although this disclosure is based on embodiments and drawings, it is to be noted that various changes arid modifications will be apparent to those skilled in the art based on this disclosure. Therefore, such changes and modifications are to be understood as included within the scope of this disclosure.
For example, in the above embodiment, an example of using NAND flash memory as the memory is described, but this disclosure is not limited to NAND flash memory and may be applied to any memory having similar characteristics.
Number | Date | Country | Kind |
---|---|---|---|
2013-105094 | May 2013 | JP | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2014/002450 | 5/8/2014 | WO | 00 |