Some non-volatile storage technologies, for example, Solid State Disk (“SSD”) storage, have a limited of the number of times they can be written. These devices are often organized in pages or cells and each cell may have a specified write limit. One particular technology called Single Layer Cell (“SLC”) often specifies that each cell can be written 100,000 times while the device still maintains the ability to accomplish those writes successfully and continue to meet its other specifications. Another type of solid state disk, called Multi Layer Cell (“MLC”), has cell write specifications of 10,000 or even 5,000 writes. The vendors of these devices couple controllers and software/firmware to provide what is called “wear-leveling technology.” Wear-leveling technology keeps track of how often each physical cell has been written and will move data around and switch logical addresses so as to even out the wear on all cells. Often these wear-leveling technologies also use a set of spare cells to provide a working set for moving data and for pre-erasing cells to improve performance. The better of the wear-leveling technologies have a low write expansion factor, meaning that the algorithm itself imposes a small to negligible amount of write activity.
In general, in one aspect, the invention features a method. The method includes counting a number of writes to a device (“D1-n”) consisting of n sub-devices (“Da”):
where:
The method further includes for each sub-device Da determining a write rate for sub-device Da at the end of time period p (“WRa,p”) using the following equation:
where:
The method further includes controlling the write rate to sub-device Da in time periods after time period p so that device D1-n will have a guaranteed lifetime (“LD1-n”).
Implementations of the invention may include one or more of the following. Controlling the write rate to Da in time periods after time period p may include controlling the write rate to Da in time periods after time period p to make the overall write rate computed at the end of a time period q after time period p (“WRa,q”) less than an allowed overall write rate for Da (“WAa”) so that device D1-n will have lifetime LD1-n, where:
A curve representing WAa over time from an origin to LD1-n may have a shape selected from a group consisting of a straight line, a segmented line having levels and durations, and a curve. A user may be allowed to select the levels and durations of the segmented line. Controlling the write rate to sub-device Da in time periods after time period p may include accumulating write rate credits in low write activity time periods for use in high activity time periods. Controlling the write rate to sub-device Da in time periods after time period p may include allowing high write rates in time periods while keeping an average write rate for Da (“WAa”) so that device D1-n will have lifetime LD1-n, where:
A user may be allowed to adjust LD1-n.
In general, in another aspect, the invention features a database system. The database system includes one or more nodes. The database system includes a plurality of CPUs, each of the one or more nodes providing access to one or more CPUs. The database system includes a plurality of virtual processes, each of the one or more CPUs providing access to one or more virtual processes. Each virtual process is configured to manage data, including rows from the set of database table rows, stored in one of a plurality of data-storage facilities. The database system includes a process. The process counts a number of writes to a device (“D1-n”) consisting of n sub-devices (“Da”):
where:
For each sub-device Da, the process determines a write rate for sub-device Da at the end of time period p (“WRa,p”) using the following equation:
where:
The process controls the write rate to sub-device Da in time periods after time period p so that device D1-n will have a guaranteed lifetime (“LD1-n”).
In general, in another aspect, the invention features a computer program, stored in a computer-readable tangible medium. The program includes executable instructions that cause a computer to count a number of writes to a device (“D1-n”) consisting of n sub-devices (“Da”):
where:
For each sub-device Da, the computer determines a write rate for sub-device Da at the end of time period p (“WRa,p”) using the following equation:
where:
The computer controls the write rate to sub-device Da in time periods after time period p so that device D1-n will have a guaranteed lifetime (“LD1-n”).
Some system vendors offer long term warranties or service plans with expectations of 3, 5, or even 7.5 years of lifetime from a I/O-limited device, which is defined to be a device with a limited number of lifetime reads or writes, such as an SLC device or an MLC device. Were an application were to write to such a I/O-limited device at full speed, the write cycles available to the I/O-limited device might be consumed long before the typical lifetime expectation and before the warranted lifetime.
A wear-leveling technique is provided that that improves the likelihood that an I/O-limited device will achieve a specified lifetime, where lifetime is expressed in units of time.
One embodiment of an environment for such a wear-leveling technique, illustrated in
In one embodiment, memory controllers 125 (only one is labeled) provide an interface between I/O-limited device 130 (only one is labeled) and the bus. Thus, in one embodiment, the processor 105 or any other device (e.g., the memory 120 or a peripheral through I/O 110) can access an I/O-limited device 130 through the respective memory controller.
In one embodiment, all of the memory controllers illustrated in
In one embodiment, each I/O-limited device 130 can be inserted or removed from the system. In one embodiment, for example, each I/O-limited device 130 is a USB “thumb” drive and can be attached to the system by plugging it into one of a plurality of universal serial bus (“USB”) ports provided by the system. Similarly, in one embodiment, each I/O-limited device 130 can be removed from the system by following the procedures for removing a device appropriate for the operating system being used and removing the I/O-limited device 130 from the USB port to which it is connected.
Further, in one embodiment, each I/O-limited device 130 can be attached to any memory controller 125. That is, in one embodiment, each memory controller is coupled to a USB port that is accessible to the outside world. In one embodiment, any of the I/O-limited device 130 can be plugged in to any of the USB ports.
One embodiment of a memory controller 125, shown in more detail in
In one embodiment, the wear-leveling technique uses I/O metering technology to control the write rate to a I/O-limited device 130. For each I/O-limited device 130, a history is maintained of writes accumulating to that device and the ongoing write rate is controlled such that the specified write cycles of the I/O-limited device 130 will not be exceeded.
In one embodiment of the invention a lifetime average write rate is calculated for a I/O-limited device 130 and the actual write rate to that device is not allowed to exceed the lifetime average write rate. In one embodiment, the actual write rate is periodically computed as an average of number of write cycles to the device divided by the amount of time over which those writes were made. In one embodiment, the actual write rate is periodically computed by dividing the number of writes over a window of time by the length of the time window. In one embodiment, the window of time ends at or near the time the actual write rate is computed. In one embodiment, the window of time ends at a time earlier than the time the actual write rate is computed. These embodiments do not require keeping track of specific devices.
In one embodiment individual devices are tracked. In one embodiment, the tracking is by address location in a computer system. In one embodiment, the tracking is by unique serial numbers associated with the I/O-limited device 130.
In one embodiment, illustrated in
One embodiment of the processing associated with inserting an I/O-limited device into a system, illustrated in
In one embodiment, the memory manager 305 manages storing data on the I/O-limited device. In one embodiment, this includes maintaining tables to reflect the mapping between logical addresses used by the system and physical addresses on the I/O-limited device that the memory manager 305 is managing. In one embodiment, the memory manager 305 also storing data to and retrieving data from the I/O-limited device. In one embodiment, this data includes data about the I/O-limited device, including for example the serial number of the I/O-limited device. In one embodiment, the memory manager 305 also manages the data being written to the I/O-limited device to keep the actual write rate to the I/O-limited device to within an allowed write rate that the memory manager 305 is provided. In one embodiment, it does this by using the memory 215 to buffer data to reduce the write rate to a particular I/O-limited device.
In one embodiment, when an I/O-limited device is attached to the system, as shown in
In one embodiment, as shown in
In one embodiment, illustrated in
In one embodiment, the system illustrated in
In one embodiment, the memory manager performs the same functions described above with respect to
In one embodiment, the remaining lifetime of an I/O-limited device is provided to the wear out management system 510 along with the write cycle limitations and the device capacity and the wear out management system 510 dynamically adjusts the allowed write rate accordingly. In one embodiment, the write cycle limitations and device capacity are provided to the wear out management system through an I/O (not shown) such as that described above in connection with
In one embodiment, illustrated in
In one embodiment, the wear out management system 510 uses that information to determine an allowed write rate, which it provides to the memory manager 605. In one embodiment, the memory manager 605 manages writes to its SLC or MLC device to achieve the allowed write rate.
In one embodiment, illustrated in
In one embodiment, the wear out management system 510 adjusts the allowed write rate by accumulating write credits for periods of low activity on a particular I/O-limited device. One embodiment of such an approach, illustrated in
In one embodiment, the wear out management system 510 does not constrain peaks of activity as long as a long term average write rate is within conformance levels. One embodiment of such an approach, illustrated in
In one embodiment, also shown in
In one embodiment, the wear out management system allows user specification of the allowed peak or average write rates according to a calendar. In one embodiment, this would result in an average write rate to achieve warranty (i.e., the dashed lines in
In one embodiment, the wear out management system 510 allows the user to change the desired lifetime, where increasing the lifetime would necessitate a decrease in average write rate, and reducing the lifetime would enable an increase in the average write rate.
In one embodiment, the write rate to a I/O-limited device is slowed by temporarily storing the data intended for the I/O-limited device in the memory 215 of the device's memory controller 125, as discussed above.
In one embodiment, data intended for the I/O-limited device to which writes are to be slowed is temporarily or permanently redirected to another I/O-limited device or to another memory. For example, in one embodiment shown in
Now assume that it is desired to slow the write rate to I/O-limited device 520A and that it is desired to do this by redirecting writes to logical addresses ADDR1-P to one or more I/O-limited device 520B-N. To accomplish this in one embodiment, the wear out management system 510 commands memory manager 515A to stop responding to logical addresses ADDR1-P and divides the responsibility for responding to those logical addresses among one or more of memory managers 515B-N. Then when data 530A arrives, memory manager 515A ignores it and the memory managers 515B-N that have been assigned to be responsive to such data store it in corresponding physical space in their respective I/O-limited devices.
In general, the technique described herein includes counting the number of writes to a device (“D1-n”) consisting of n sub-devices (“Da”):
where:
For each sub-device Da, the technique determines a write rate for sub-device Da at the end of time period p (“WRa,p”) using the following equation:
where:
The technique controls the write rate to sub-device Da in time periods after time period p so that device D1-n will have a guaranteed lifetime (“LD1-n”).
In one embodiment, controlling the write rate to Da in time periods after time period p includes controlling the write rate to Da in time periods after time period p to make the overall write rate computed at the end of a time period q after time period p (“WRa,q”) less than an allowed overall write rate for Da (“WAa”) so that device D1-n will have lifetime LD1-n, where:
In one embodiment, controlling the write rate to sub-device Da in time periods after time period p includes accumulating write rate credits in low write activity time periods for use in high activity time periods, as illustrated in
In one embodiment, controlling the write rate to sub-device Da in time periods after time period p includes allowing high write rates in time periods while keeping an average write rate for Da (“WAa”) so that device D1-n will have lifetime LD1-n, where:
as illustrated in
The foregoing description of the preferred embodiment of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto.
Number | Name | Date | Kind |
---|---|---|---|
6850443 | Lofgren et al. | Feb 2005 | B2 |
7467253 | Yero | Dec 2008 | B2 |
7689762 | Hobson | Mar 2010 | B2 |
7802064 | Kim | Sep 2010 | B2 |
20090259819 | Chen et al. | Oct 2009 | A1 |
20100268865 | Ramiya Mothilal | Oct 2010 | A1 |
Entry |
---|
“STEC Small Cards Wear Leveling and Lifetime Calculator”, STEC Application Note AN-0702, (Jan. 5, 2008). |
Perdue, Ken “Wear Leveling”, Spansion Application Note, Wear Leveling AN, Revision 01, (Apr. 30, 2008). |
“USB Flash Wear-Leveling and Life Span”, Corsair Frequently Asked Questions, (Jun. 2007). |