A non-volatile memory of present invention includes a number of memory blocks and a static wear leveling device. The static wear leveling device includes a memory unit for storing the erase counts of the memory blocks and a controlling unit for getting the erase counts from the memory unit, and calculating the standard deviation based on the EC, and deciding the way of the static wear leveling cycle according to the standard deviation. The controlling unit deciding the way of the static wear leveling cycle include the steps of setting at least one predetermined threshold point and judging whether the standard deviation of the erase counts is smaller than the predetermined threshold point. If the standard deviation of the erase counts is smaller than the predetermined threshold point, the static wear leveling cycle starts for a first amount of cycles and moves the static data stored a first number of memory blocks. If the standard deviation of the erase counts is bigger than the predetermined threshold point, starts for a second amount of cycles and moves the static data stored a second number of memory blocks.
|
1. A method of controlling a non-volatile memory comprising a plurality of memory blocks storing static data, the method comprising:
calculating an erase count (EC) of each of the memory blocks; and
calculating a standard deviation of the erase counts to decide a way of a static wear leveling cycle;
wherein the way of a static wear leveling cycle comprises:
setting at least one predetermined threshold point; and
judging whether the standard deviation of the erase counts is bigger than the predetermined threshold point;
wherein, if the standard deviation of the erase counts is bigger than the predetermined threshold point, the static wear leveling cycle starts; and
wherein, if the standard deviation of the erase counts is not bigger than the predetermined threshold point, the static wear leveling cycle does not start;
wherein the static data comprises data adapted to be rewritten very few or never rewritten, including a procedure code of an operating system.
3. A non-volatile memory comprising:
a plurality of memory blocks; and
a static wear leveling device including:
a memory unit configured to store erase counts of the memory blocks; and
a controlling unit configured to obtain the erase counts from the memory unit, to calculate a standard deviation based on the erase counts, and to decide a way of a static wear leveling cycle based at least partly on the standard deviation;
wherein the controlling unit is configured to decide the way of the static wear leveling cycle, the way comprising:
setting at least one predetermined threshold point; and
judging whether the standard deviation of the erase counts is smaller than the predetermined threshold point;
wherein, if the standard deviation of the erase counts is smaller than the predetermined threshold point, the static wear leveling cycle starts for a first amount of cycles and moves static data stored a first number of memory blocks;
wherein, if the standard deviation of the erase counts is bigger than the predetermined threshold point, the static wear leveling cycle starts for a second amount of cycles and moves static data stored a second number of memory blocks.
2. The method of
5. The non-volatile memory of
|
This application claims priority to and the benefit of Chinese Patent Application No. 200810021556.3 filed in the State Intellectual Property Office of P.R.C. (SIPO) on Aug. 5, 2008, the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to a non-volatile memory and its controlling method, and more particularly, to a flash memory and a method of controlling erasing of static memory area of the flash memory.
2. Description of the Related Technology
The non-volatile memory has been widely utilized for computing devices and portable electronic equipments. The advantage of the non-volatile memory is that the data stored in the memory is not erased when the power supply to the memory is terminated, and the data can be read again as long as the power supply to the memory resumes. Flash memory, which is one type of the non-volatile memory, has been gradually used as memory units in the computing devices and the portable electronic equipments to replace traditional hard disks, because of its numerous advantages, i.e., low electric power consumption, high speed, no vibration, and portability.
A conventional flash memory device is arranged in a plurality of memory blocks. Each of the memory blocks includes a plurality of memory cells typically arranged in a matrix form. Each of the memory blocks includes bit lines and word lines. The bit lines extend parallel to one another in a column direction. The word lines extend parallel to one another in a row direction perpendicular to the column direction. Each bit line includes a string of memory cells.
Each of the memory cells includes a floating gate transistor. The floating gate transistors of a bit line are coupled to one another in series from source to drain. The control gates of the floating gate transistors of memory cells of a common row are coupled to the same word line. Each of the memory cells stores a charge (or a lack of charge). The amount of stored charge can be used to represent, for example, one or more states, which can represent one or more digits (for example, bits) of data. The charge stored in the floating gate transistor sets the threshold voltage of the floating gate transistor.
In a conventional method of writing data on a memory block, during a write operation, data is typically written on a set of memory cells coupled to a single word line. Such a set of memory cells can be referred to as a “page.” In one arrangement, a page may include all memory cells sharing a word line. In other arrangements, a page may be formed by every two memory cells coupled to a single word line. In certain arrangements, a page may be formed by every four memory cells coupled to a single word line. It will be understood that a page may be formed by any suitable selected number of memory cells coupled to a word line. The pages can be used as memory units for reading, writing and erasing data.
During a process of renewing data in a flash memory, memory blocks for storing old data will erase data saved in corresponding memory cells, i.e., the memory cells will take high voltage so as to release electrons. However, the erasing action with high voltage to the memory cell may damage the operating characteristics of the memory cell and rapidly wear the memory cell. As a result, after a certain number of cycles of erasing or rewriting, the memory cells may not correctly save electrons which correspond to data to be stored therein, and consequently error data may be generated when reading or writing new data into the memory blocks of the flash memory.
Normally, data stored in a flash memory is divided into two types: dynamic data and static data. The dynamic data may include data adapted to be rewritten frequently, for instance, a file allocation table. The static data may include data adapted to be rewritten very few times or never rewritten, for instance, a procedure code of the operating system. Therefore, the memory blocks for storing the dynamic data will be used more frequently than the memory blocks for storing the static data and will wear faster than the memory blocks for storing the static data, and consequently will reach its lifetime earlier than the memory blocks for storing the static data. The lifetime of the memory cell can be estimated based on its erasing cycles, normally about 10,000 to about 100,000 times. If the memory blocks in the flash memory cannot be read or rewritten at a relatively average level, some of the memory blocks will reach its lifetime because of more frequent wearing actions. When more and more memory blocks in the flash memory reach their lifetime, the flash memory will be no longer operational. However, other memory blocks may be still operational before reaching their lifetime because of fewer wearing actions, which is not desirable to the overall lifetime of the flash memory.
In one embodiment, a controlling method for a non-volatile memory having a plurality of memory blocks comprises the step of calculating erase count (EC) of each of the memory blocks, and the step of calculating the standard deviation of the erase counts of the memory blocks to decide the way of a static wear leveling cycle.
In another embodiment, the way of a static wear leveling cycle comprises the step of setting at least one predetermined threshold point, and the step of judging whether the standard deviation of the erase counts is bigger than the predetermined threshold point. If the standard deviation of the erase counts is bigger than the predetermined threshold point, the static wear leveling cycle starts. If the standard deviation of the erase counts is not bigger than the predetermined threshold point, the static wear leveling cycle does not start.
A non-volatile memory according to one embodiment comprises a plurality of memory blocks and a static wear leveling device. The static wear leveling device includes a memory unit for storing the erase counts of the memory blocks and a controlling unit for getting the erase counts from the memory unit, and calculating the standard deviation based on the erase counts, and deciding the way of the static wear leveling cycle according to the standard deviation. The controlling unit decides the way of the static wear leveling cycle comprise the steps of setting at least one predetermined threshold point and judging whether the standard deviation of the erase counts is smaller than the predetermined threshold point. If the standard deviation of the erase counts is smaller than the predetermined threshold point, the static wear leveling cycle starts for a first amount of cycles and moves the static data stored a first number of memory blocks. If the standard deviation of the erase counts is bigger than the predetermined threshold point, starts for a second amount of cycles and moves the static data stored a second number of memory blocks.
According to another embodiment, a non-volatile memory comprises a plurality of memory blocks and a static wear leveling device. The static wear leveling device includes a memory unit for storing the latest erasing time (ET) of the memory blocks, and a controlling unit for getting the latest ET from the memory unit, and finding out a memory block having the earliest ET, and starting the static wear leveling action for the memory block having the earliest ET.
In order to extend the overall lifetime of a flash memory, memory blocks in the flash memory can be erased or rewritten at a relatively average level. Example methods of averagely wearing the memory blocks include a dynamic wear leveling technology and a static wear leveling technology. The dynamic wear leveling technology searches for empty memory blocks which are not used or most infrequently used in the past for storing dynamic data so as to avoid repeatedly erasing or rewriting the memory blocks which have been used for many times in the past. However, the dynamic wear leveling technology can only mostly level the wearing actions of the memory blocks for storing the dynamic data; it does not have a chance to level the memory blocks for storing static data, since the memory blocks for storing static data are always occupied by data adapted to be rewritten very few times or never rewritten.
The static wear leveling technology is developed to level the wearing actions of the memory blocks for storing static data. During a process of writing data, the static wear leveling technology firstly move static data stored in the flash memory from the its original memory blocks to the memory blocks which were most frequently used in the past wearing actions, and then wear the original memory blocks for the static data, and thirdly write the new data into the original memory blocks which were used in the past for the static data. As a result, all the memory blocks in the flash memory, either the memory blocks for the dynamic data or the memory blocks for the static data, can be rewritten or wear at a relatively average level, such that the overall lifetime of the flash memory can be extended.
However, before moving the static data from the memory blocks, the original memory blocks for storing the static data must be identified first. The method may restrict the type of the memory blocks based on the wearing times of corresponding memory blocks. This method has a shortcoming. For instance, considering a flash memory which has finished a first static wear leveling action, the original memory blocks with low wearing times now store the dynamic data which was moved from the memory blocks with high wearing time. Consequently, in a second static wear leveling action, since the current memory blocks for storing the dynamic data have low wearing times, they may be mistaken as the other original memory blocks for storing static data, and therefore the dynamic data stored in these memory blocks may be regarded as static data and be moved out to other memory blocks. Under these circumstances, the memory blocks with low wearing times will always be regarded as the memory blocks for storing static data and rewritten with new data. As a result, the memory blocks with low wearing times will be repeatedly read and rewritten even more frequently than in an instance using the static wear leveling technology, and let the overall lifetime of the flash memory become even shorter. Furthermore, during the process of a static wear leveling cycle, the static data will be moved out from its original memory blocks and new dynamic data will be written in the original memory blocks, the moving-in and moving-out process of the data will take much more time than a simple moving-in process of the data. Therefore, if the static wear leveling cycles occur too frequently, it will influence working efficiency of the flash memory. Examples of wear leveling techniques are disclosed in U.S. Pat. Nos. 6,230,233 and 6,732,221, the disclosures of which are incorporated herein by reference in their entireties.
In some embodiments, in order to improve the accuracy of the static wear leveling technology, the theory of standard deviation used in the statistics field can be used to improve a method of controlling the frequency of static wear leveling cycles.
Standard deviation is a measure of the dispersion of a collection of numbers. A big standard deviation means that many data points are far from the mean (or average value) whereas a small standard deviation means that many data points are close to the mean. The formula of the standard deviation is as follows.
wherein x1, . . . , xN all real numbers, and the formula of the mean is as follows.
For instance, the mean of data set {2, 3, 4, 6, 7, 8} and the mean of data set {0, 1, 3, 7, 9, 10} are both 5. However, the standard deviation of data set {2, 3, 4, 6, 7, 8} is 2.16(2.160246899469287) while the standard deviation of data set {0, 1, 3, 7, 9, 10} is 3.87(3.872983346207417). The smaller standard deviation of data set {2, 3, 4, 6, 7, 8} means that the data points in the data set are closer to the mean 5 while the bigger standard deviation of data set {0, 1, 3, 7, 9, 10} means that the data points in the data set are far from the mean 5.
Similarly, in some embodiments, the standard deviation can be used to observe the distribution of erase counts (EC) for memory blocks, and then define how to start the static wear leveling cycle based on different standard deviations. The term “erase count” refers to the number of erase operations to which a memory block has been subjected. The following example shows the distribution of erase counts for twenty memory blocks.
Assume that a first distribution status of erase counts for twenty memory blocks (Memory Block 1-20) in a flash memory after the flash memory has been used for a certain period of time is as shown in Table 1:
TABLE 1
Memory Block
1
2
3
4
5
6
7
8
9
10
Erase Count
50
45
45
55
50
45
50
55
50
55
(EC)
Memory Block
11
12
13
14
15
16
17
18
19
20
Erase Count
50
45
55
50
45
50
50
45
55
55
(EC)
The mean of all erase counts in the above chart is 50 and the corresponding standard deviation is 3.973597.
Assume that a second distribution status of erase counts for the twenty memory blocks is as shown in Table 2.
TABLE 2
Memory Block
1
2
3
4
5
6
7
8
9
10
Erase Count
75
35
45
40
70
55
40
65
25
30
(EC)
Memory Block
11
12
13
14
15
16
17
18
19
20
Erase Count
50
65
70
45
30
50
55
75
60
25
(EC)
The mean of all erase counts in the above chart is 50.25 and the corresponding standard deviation is 16.50159482.
In summary, the standard deviation 16.50159482 for the second distribution status of erase counts is obviously bigger than the standard deviation 3.97359 for the first distribution status of erase counts. This indicates that the erase counts for the first distribution status is more concentrated than the erase counts for the second distribution status, and correspondingly, the static wear leveling cycles under different distribution status of erase counts can be defined based on the status of the standard deviations. The following example shows how to realize this.
Assume that a flash memory has 1000 memory blocks, and the maximum erase count for the memory cells in the memory blocks are 10,000. Referring to
In one embodiment, δ2 (1%) is defined as a desired set point for standard deviation, i.e., the desired erase count for most of the memory blocks may be between the mean M minus 100 and the mean M plus 100. If the actual erase count is too far from the desired erase count, the static wear leveling action will start so as to redefine the actual erase count to be close to the desired erase count.
If the standard deviation δr falls into area 1 in
If the standard deviation δr falls into area 2 in
If the standard deviation δr falls into area 3 in
If the standard deviation δr falls into area 4 in
The above mentioned examples, including the standard deviation set points δ1, δ2 and δ3, corresponding actual erase counts, E1, E2 and E3, and corresponding memory blocks B1, B2 and B3, are only used as examples to explain the features of the above embodiment. The set points can be adjusted in accordance with the actual requirements of the flash memory. Therefore, they cannot be regarded as restrictions to the features of the embodiment.
In steps S107, S117, S127 and S137, the controlling device of the flash memory compares the actual standard deviation δr of the memory blocks with the predetermined standard deviation set points δ1, δ2 and δ3 and defines which scope the actual standard deviation δr should fall into. If δr≦δ1, step S109 will be chosen and the controlling device of the flash memory can start a static wear leveling cycle after the actual erase counts for some memory blocks have reached a zero-th predetermined value (E0) and move the static data stored in the corresponding memory blocks (B0).
If δ1<δr<δ2, step S119 will be chosen and the controlling device of the flash memory can start a static wear leveling cycle after the actual erase counts for some memory blocks have reached a first predetermined value (E1) and move the static data stored in the corresponding memory blocks (B1). If δ2≦δr<δ3, step S129 will be chosen and the controlling device of the flash memory can start a static wear leveling cycle after the actual erase counts for some memory blocks have reached a second predetermined value (E2) and move the static data stored in the corresponding memory blocks (B2). If δr>δ3, step S139 will be chosen and the controlling device of the flash memory can start a static wear leveling cycle after the actual erase counts for some memory blocks have reached a third predetermined value (E3) and move the static data stored in the corresponding memory blocks (B3), wherein B0<B1<B2<B3 and E0>E1>E2>E3.
Since the static wear leveling action will move the static data stored in the original memory blocks to the new memory blocks so as to release the original memory blocks, it is desirable to ensure that the data stored in the original memory blocks is the static data prior to moving the static data. Otherwise, the controlling device of the flash memory may wrongly define the dynamic data stored in the memory blocks with a low erase count as the static data, and therefore the static wear leveling action may wrongly move the dynamic data stored in the memory blocks with a low erase count to the memory blocks with a high erase count. As a result, the memory blocks with a high erase count will be repeatedly erased and rewritten and will have a shorter lifetime. Therefore, the above embodiment provides a method of determining whether the data stored in the memory blocks with a low erase count is the static data or not while ensuring that the data to be moved by the static wear leveling action is the static data.
Referring to
Referring
Referring to
When a first new data D1 is written into the flash memory, the controlling device 13 stores the new data D1 in the memory block B2 and erases the memory block B0, and the actual erase count for the flash memory B0 is recorded as EC0=1 in the record device 17 and the latest ET for the memory block B0 is recorded as ET0=1 in the counter 131 of the controlling device 13. When a second new data D1 is written into the flash memory, the controlling device 13 stores the new data D1 in the memory block B3 and erases the memory block B2, and the actual erase count for the flash memory B2 is recorded as EC2=1 in the record device 17 and the latest ET for the memory block B2 is recorded as ET2=2 in the counter 131 of the controlling device 13.
Following the order, a third new data D1, a fourth new data D1, a fifth new data D2, a sixth new data D2, and a seventh new data D2 are written into one of the memory blocks one by one. When the sum of the actual erase counts in the flash memory reaches seven (7), the actual erase count of the memory block B0 is EC0=2 and the latest ET of the memory block B0 is ET0=4. The actual erase count of the memory block B1 is EC1=2 and the latest ET of the memory block B 1is ET1=7. The actual erase count of the memory block B2 is EC2=1 and the latest ET of the memory block B2 is ET2=2. The actual erase count of the memory block B3 is EC3=2 and the latest ET of the memory block B3 is ET3=3. The actual erase count of the memory block B4 is EC0=0 and the latest ET of the memory block B4 is ET0=0. The data stored in the memory block B4 has never been erased and rewritten.
In order to evenly make use of all the memory blocks in the flash memory, the third new data D3 stored in the memory block B4 is moved to be stored in the empty memory block with the biggest EC. In this embodiment, the memory block B3 has the biggest EC, and therefore the third new data D3 is moved from the memory block B4 to the memory block B3, and at the same time the data stored in the memory block B4 is erased and its storage status is renewed, and accordingly the latest erase count and ET of the memory block B4 is EC4=1 and ET4=8.
By comparing differences between the actual ETs of memory blocks and the overall ET, it can be determined whether the data stored in the memory stock has not been erased for a long time, and accordingly it can be determined whether the memory stock is storing the static data, so as to decrease the possibility of moving the dynamic data stored in the memory blocks which has a low erase count.
Referring to
It can be seen that the memory blocks B3 and B4 has the smallest EC, namely two times. For the memory block B3, the difference between the actual ET3 of the memory block and the overall ET is: B3ΔEC=14-6=8. For the memory block B4, the difference between the actual ET4 of the memory block and the overall ET is: B4×EC=14-10=4. It can be seen that the memory block B3 has a longer time without erasing action, and therefore the data stored in the memory block B3 is regarded as the static data. Therefore, during the static wearing leveling cycle, the static data stored in the memory block B3 is moved to the memory block B1 which has the highest EC, so as to decrease a possibility of erasing the memory block B1 in the following static wear leveling cycles.
While the invention has been shown and described with respect to embodiments thereof, this is for the purpose of illustration rather than limitation, and other variations and modifications of the embodiments herein shown and described will be apparent to those skilled in the art and are within the scope of the invention. For instance, the type of memory in the above embodiments is flash memory. The embodiments can also apply to other types of memories such as EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), PRAM (Phase-change Random Access Memory), MRAM (Magnetic Random Access Memory), and FRAM (Ferroelectric Random Access Memory).
Lin, Chuan-Sheng, Chen, Ming-Dar, Hsieh, Hsiang-An
Patent | Priority | Assignee | Title |
10896004, | Sep 07 2018 | Silicon Motion, Inc. | Data storage device and control method for non-volatile memory, with shared active block for writing commands and internal data collection |
11036414, | Sep 07 2018 | Silicon Motion, Inc. | Data storage device and control method for non-volatile memory with high-efficiency garbage collection |
11199982, | Sep 07 2018 | Silicon Motion, Inc. | Data storage device and control method for non-volatile memory |
8700839, | Dec 28 2006 | GENESYS LOGIC, INC. | Method for performing static wear leveling on flash memory |
Patent | Priority | Assignee | Title |
5270979, | Mar 15 1991 | SanDisk Technologies LLC | Method for optimum erasing of EEPROM |
6230233, | Sep 13 1991 | SanDisk Technologies LLC | Wear leveling techniques for flash EEPROM systems |
6345001, | Sep 14 2000 | SanDisk Technologies LLC | Compressed event counting technique and application to a flash memory system |
6732221, | Jun 01 2001 | Western Digital Israel Ltd | Wear leveling of static areas in flash memory |
20030165076, | |||
20040153902, | |||
20050204187, | |||
20070208904, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jun 01 2009 | CHEN, MING-DAR | A-DATA TECHNOLOGY SUZHOU CO, LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 023135 | /0144 | |
Jun 01 2009 | HSIEH, HSIANG-AN | A-DATA TECHNOLOGY SUZHOU CO, LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 023135 | /0144 | |
Jun 01 2009 | LIN, CHUAN-SHENG | A-DATA TECHNOLOGY SUZHOU CO, LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 023135 | /0144 | |
Jul 24 2009 | A-Data Technology (Suzhou) Co., Ltd. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Dec 20 2015 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Oct 03 2019 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Oct 05 2023 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Jun 19 2015 | 4 years fee payment window open |
Dec 19 2015 | 6 months grace period start (w surcharge) |
Jun 19 2016 | patent expiry (for year 4) |
Jun 19 2018 | 2 years to revive unintentionally abandoned end. (for year 4) |
Jun 19 2019 | 8 years fee payment window open |
Dec 19 2019 | 6 months grace period start (w surcharge) |
Jun 19 2020 | patent expiry (for year 8) |
Jun 19 2022 | 2 years to revive unintentionally abandoned end. (for year 8) |
Jun 19 2023 | 12 years fee payment window open |
Dec 19 2023 | 6 months grace period start (w surcharge) |
Jun 19 2024 | patent expiry (for year 12) |
Jun 19 2026 | 2 years to revive unintentionally abandoned end. (for year 12) |