1. Technical Field
The present invention relates to a clustering device for a flash memory and a method thereof, more specifically to a clustering device for a flash memory and a method thereof that can minimize a block copy cost.
2. Description of the Related Art
Flash memories are popular as storages for portable electronic devices because of their properties such as low power consumption, non-volatile, and portability. The flash memory has a plurality of successive blocks having the same size, and one block has a plurality of successive pages having the same size. The flash memory can carry out read, write, and erase operations. At this time, in the flash memory, the read and write operations are performed per page and the erase operation is performed per block.
Such flash memories have their inherent properties as contrasted with typical storage such as discs. For example, while the disc has no difference in the speeds of performing the read and write operations, the flash memory has the difference in the speeds of performing the read and write operations. That is, the write operation has the slower performing speed than the read operation in the flash memory. Secondly, the flash memory has the new operation, which is the erase operation, but the typical storages have no erase operation. It is impossible that the flash memory performs the in-place update of stored data due to its physical properties. To update the stored data, the flash memory uses the method of invalidating a page in which the data is stored and storing another page, in which updated data is stored, at another area. At this time, the previous page is invalidated by the erase operation. Before the erase operation is performed, it must be preceded that the valid data in a pertinent block is copied to another block. This is called “block copy.” As such, the erase operation has very large overhead, which is caused by the frequently performed writing operation. In addition, in the case of the flash memory, the frequencies that the erase operation is able to be performed at one block is typically limited to one billion times or less. The block, in which the erase operation has been already performed one billion times and more, is not usable any more. That is, the frequent performance of the erase operation causes the lifetime of the flash memory to be shortened. Accordingly, it is very important to reduce the performance of the erase operation in the flash memory.
In order to reduce the performance of the erase operation, a hot data clustering method is suggested, which stores the frequently updated data in the same page or block. Here, hot data refers to the frequently updated data. The page storing the hot data is easy to be invalidated because the update is frequently performed. Accordingly, if the pages of the hot data are stored in the same block, it is possible to reduce the copy cost of the pertinent block when the erase operation is performed. This causes the frequency of performing the write operation and the frequency of performing the erase operation to be decreased. Thus, the general efficiency of the flash memory is improved. However, even though hot data is gathered in a certain block, there may be many valid pages in the block when the erase operation is requested. For example, it is assumed that one block has a total of 8 pages, each page has the same period of 3, and hot data is stored per page. Then, with the passage of time, pages are successively written in the block. When the erase operation is requested at T5, the block has three invalid pages 0 through 2 and four valid pages 3 through 6. At this time, if the erase operation is performed, the 4 valid pages must be copied to another block. This causes expensive block copy cost and also the copy to be frequently performed, thereby lowering the efficiency of the flash memory and inducing frequent performance of the erase operation. Accordingly, the lifetime of the flash memory is shortened.
The present invention, which is contrived to solve the aforementioned problems, provides a clustering device for a flash memory and a method thereof that can improve the performance of a write operation of the flash memory and increase the lifetime of the flash memory.
A clustering device for a flash memory can gather pages having similar update times and perform a write operation of the pages in a same block.
If there are some data having different update periods in a same page, an update period of the page can become identical to that of data having a shortest update period.
The clustering device for a flash memory can include an allocator, configured to allocate a page that is to store data on the basis of a group management table, if a write operation is requested; and a cleaner, configured to erase a block selected by an erase policy, if an erase operation is requested.
The group management table can manage a plurality of group entities and comprises a group update time and a list of the blocks of the group.
The group can be a set of blocks storing pages having similar update times, and one group can correspond to one group management table entry.
If a page Pj is updated, the page Pj can be stored at a group entry Ei that satisfies the following formula:
E
i−1.updatetime<Pj.updatetime≦Ei.updatetime
A clustering method for a flash memory can include checking whether data writing is new data writing or previous data updating, if the data writing is requested; invalidating a page in which previous data has been stored and calculating an update time of a pertinent page, if it is checked that the data writing is the previous data updating; checking whether there is a blank page in a group corresponding to the calculated update time, if there is the group; and storing the updated data at the blank page if there is the blank page.
The clustering method for a flash memory can further include allocating a new block and adding the block into the group, if there is no blank page. In this case, the updated data can be stored at a blank page of the added block.
The clustering method for a flash memory can further include storing the updated data at a blank page of a block that is not included in the group, if there is no group entry corresponding to the calculated update time.
If it is checked that the data writing is the new data writing, the data can be stored at a blank page of a block that is not included in the group entry.
A clustering method for a flash memory can include invalidating a page in which previous data has been stored and calculating an update time of a pertinent page, if data writing is requested; and checking whether there is a group corresponding to the calculated update time and storing updated data at a blank page if there is the group.
The clustering method for a flash memory can further include allocating a new block and adding the allocated block into the pertinent group, if there is no blank page in the pertinent group.
The clustering method for a flash memory can further include storing the updated data at a block that is not included in the group, if there is no pertinent group.
Hereinafter, a clustering device for a flash memory and a method thereof in accordance with an embodiment of the present invention will be described with referenced to the accompanying drawings.
If the pages having the different update periods but the similar expected update times are written in the same block, all the pages of the block may be invalid after the update completion time. At this time, if the erase operation of the block having the invalid pages is performed at the T5, the block copy cost can be significantly decreased.
The allocator 12 can allocate a page to store data when the write operation is requested and mange a group management table to allocate pages. Here, the group management table refers to a table that manages blocks per group to allocate areas at which updated pages are to be stored.
A group refers to a set of blocks storing pages having the similar update time. One group can correspond to one group management table entry. The group management table can manage a plurality of group entries. One group entry can include a group update time and a list of the blocks of the group. The group update time refers to a maximum value of the update times of the pages written in the pertinent group.
If a certain page Pj is updated, the Pj will be stored in a group entry Ei, which satisfies the following formula 1:
E
i−1.updatetime<Pj.updatetime≦Ei.updatetime [Formula 1]
As time goes by, the group entry having the update time that is before the current time may be erased in the table and a new group entry can be created. At this time, the update time of the group entry can be automatically given by a predetermined update time interval. A user can determine the update time interval according to data type. If the update time interval is widely determined, this may increase the update time intervals of the pages which are to pertain to the same group. Accordingly, when the erase operation is performed, there is much possibility that there are many valid pages in the pertinent block, thereby increasing the block copy cost. In contrast, if the update time interval is narrowly determined, this may enable the group update time to be subdivided, thereby decreasing the number of the pages which are to pertain to the same group. Accordingly, many blocks having a lot of blank pages may be erased. Thus, it is important to determine an adequate value.
When the erase operation is requested, the cleaner 14 can erase blocks selected by the erase policy. The possibility that a block is selected may be increased as there are more invalid pages and less valid pages in a certain block and there are less frequencies that the erase operation is performed.
If data writing is requested, the clustering device 10 can check whether the requested data writing is new data writing or previous data updating by comparing the update time of a pertinent page with update time values of each group by use of the group management table (S101). If the requested data writing is the new data writing, it is impossible to estimate the update time. Accordingly, the new data is stored at the block that is not included in the group (S103 and S105). In contrast, if the requested data writing is previous data updating, it is possible to invalidate a page in which the previous data has been stored and calculate the update time of the page (S107). Moreover, the allocator 12 can search the group management table in order to check whether there is a group entry corresponding to the calculated update time. If there is the group entry corresponding to the calculated update time, the allocator 12 can check whether there is a blank page in a pertinent group (S109 and S111). If there is the blank page in the group, the updated data can be stored at a pertinent page (S113). If there is no blank page in the group, the allocator 12 can allocate a new block and add the allocated block to store the updated data (S115 and S117). If there is no group corresponding to the calculated update time, the updated data can be stored at the block that is not included in the group.
In the group management table, a user must determine the number of groups and the update time interval of group optionally. If all data of the flash memory is managed per group, the overhead is too large. It is not meaningful to manage the data in which little update is performed per group. Accordingly, the data that is to be updated within a certain period of time can be managed by using the limited number of groups. At this time, the data in which no update is performed and the data that can be updated but is unable to pertain to the group due to the long expected update time can follow the typical writing operation method. In accordance with an embodiment of the present invention, the experiment has measured the change of performance of the clustering method for the flash memory according to the number of groups. The update time interval of group refers to a value determining the update time of each group. If the update time internal of group is widely determined, this may widen the update time intervals of pages that are to pertain to the same group, thereby increasing the possibility that there are more valid pages in the pertinent block when the erase operation is performed. Accordingly, the block copy cost may be increased. In contrast, if the update time interval of group is narrowly determined, this may enable the group update time to be subdivided, thereby decreasing the number of the pages which are to pertain to the same group. Accordingly, many blocks having a lot of blank pages may be erased. Thus, it is important to determine an adequate value.
In the experiment, the capacity of the flash memory is determined on the basis of the 1 G NAND flash memory, and the CAT is used as the cleaning policy. The data used for the experiment is based on the data having regular update times.
Moreover, random data and locality data having 4 locality types are used to measure the performance of various data. In particular, the locality data, 90/10, 70/10, 50/10, 30/10, and 10/10 and the random data 10/10 are used. The locality data 90/10 indicates that 90% of the operation is focused on 10% of the data and the remainder 10% of the operation is focused on 90% of the data. The locality data 70/30 indicates that 70% of the operation is focused on 10% of the data and the remainder 30% of the operation is focused on 90% of the data.
The probability density function of exponential random variables was used in order to generate the locality data. The probability density function satisfies the formula 2.
A λ value can be found by integrating the probability density function of exponential random variables of the formula 2 and the locality data can be created by determining the frequency per each page and adjusting the magnitude of the inverse number of the frequency.
In the experiment, the data is successively stored at 90% of the flash memory in order to initiate the flash memory. At least 2% vacant space of the flash memory is maintained. The time at which the experiment is performed is based on the time after the page is updated 40 billion times. The total frequency of the erase operation and the average block copy cost is measured after the page is updated 40 billion times as the standard of measuring the performance of the experiment. Moreover, the erase cost of the following formula 3 can be used in consideration of the weight (writing: 1, erasing: 10) of the write and erase operations.
Erase cost=(Average block copy cost+10)×Frequency of erase operation [Formula 3]
Moreover, in order to compare the performances of the dynamic data clustering method and the clustering method for the flash memory according to an embodiment of the present invention, it is possible to measure the performances of the expected-update-time-based clustering method and the hot data clustering method, which is the existing data clustering method of the flash memory. The DAC is selected among the hot data clustering methods as the comparison target of the clustering method for the flash memory in accordance with an embodiment of the present invention. Since the performance of the DAC is significantly changed according to the number of legions and time threshold values, a total of 6 environments are used. The parameters can be determined through the following table 1. Since the DAC1 method does not divide the regions, the DAC1 method is the representative writing method of a typical flash memory. The expected-update-based clustering method (UTC) determines the size of table as 16 and the update time interval of group as 20. The result is shown through
As shown in
In the experiment, measuring the change of performance of the expected-update-time-based clustering method, the environment variables are added to precisely measure the performance through various experiments. The following table 2 shows the update time intervals of group and the number of groups, used in the experiment.
Here, when one certain parameter value is changed as the representative parameter, another environment value is fixed as the representative value. For example, when the experiment is performed changing the update time interval of group in the order of 1, 5, 10, 20, 40, 80, 160, and 320, the number of groups is fixed as 16. The target data of the experiment is the data having the locality 90/10.
A first experiment measures the change of performance of the expected-update-time-based clustering method according to the change of the number of groups when the update time interval of group is fixed. The result is shown through
A second experiment measures the change of performance of the expected-update-time-based clustering method according to the change of the update time interval of group when the number of groups is fixed. The result is shown through
The above detailed descriptions are only examples of the present invention, and a variety of modifications and forms can be made from such examples in the present invention. Thus, the detailed descriptions serve only for describing the present invention and by no means limit or restrict the spirit and scope of the present invention. It shall be understood that a large number of permutations and other equivalent embodiments are possible. The true scope of the present invention must be defined only by the spirit of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
10-2008-0062735 | Jun 2008 | KR | national |