Storage device power is the aggregate of power of various operating modes. While read, write, and seek modes of a storage device consume the most power, various idle modes consume significantly less power. By reducing the overall power consumption of a storage device, battery life may be improved. Further, reducing power consumption reduces heat output, which may allow for the removal of fans, resulting in reduced noise and cost. Additionally, lower power drives may also permit the use of smaller hard storage device controllers.
Implementations described and claimed herein reduce the consumption of power in a storage device by caching data associated with write commands received while the storage device is in an idle mode
Other implementations are also described and recited herein.
Storage devices, such as hard disk drives (HDD) and solid state drives (SSD), exist in computers in order to store information such as the operating system used by the computer, software applications and their data, emails, media, amongst other data. Information is constantly read from and written to a storage device. When a storage device receives a request to write information to the storage medium, the storage device determines where the information is to be physically stored on the medium. In the case of a hard disc drive, when the storage device determines a suitable location to store the data, a read/write transducer is moved, by an actuator, to the physical location on the storage medium where the information will be written. The time 1) to determine a location to store the information and 2) move the transducer to the desired location (e.g., seek time) may take up to 10 milliseconds (ms). Computer performance may be drastically affected if the computer has to wait up to 10 ms for each write request that occurs during normal computing. Additionally, when the computer requests to receive existing information from the storage device, through a read request, a comparable amount of time is spent moving the read/write transducer to the physical location where the requested data is stored.
Accordingly, storage devices are equipped with read and write caches to address the problem of reduced performance during a seek or a read/write operation. In one implementation, a cache or a buffer is a temporary storage medium, embedded into the storage device, where data can be temporarily stored. In the case of a write cache, data may be temporarily stored in the write cache before being written to the storage medium. In the case of a read cache, frequently accessed data may be stored in the read cache as a means of reducing the time for accessing this data without accessing the storage medium. A cache may be comprised of random access memory (RAM) such as direct random access memory (DRAM), or static random access memory (SRAM). Reading data from and writing data to RAM is significantly faster than reading data from and writing data to a traditional platter-based hard disc drive. However, RAM is a volatile memory, which means that the memory needs a constant power source to maintain the data stored therein. In other words, once the computer is turned off, or loses power, the storage device's read and write caches are erased. Additionally, RAM may be cost-prohibitive as a storage solution for storage drives, as the cost per gigabyte of RAM is significantly higher than the equivalent cost for hard disc drives, which have eclipsed two terabytes in size. In one implementation, the total size of a storage device cache is between 16 and 32 megabytes (MB) with sizes as high as 128 MB. In one implementation, the write cache and the read cache may equally split the total size of the cache. However, the delineation between the read and write cache may be dynamically altered.
When a storage device utilizes a write cache, data from a write request may be written to the write cache before being persistently written to the storage medium. Writing data to the write cache does not have the same delays as writing data to the hard disk. Once data has been written to the write cache, the computer connected to the storage device does not need to wait for the data to be persistently written to the storage medium. In one implementation, the computer may be unaware that the data still resides in the write cache, and has not yet been persistently written to the storage medium. At a later time, the data can be moved from the write cache (e.g., flushed from the cache) to the storage device's non-volatile storage medium, without degrading performance of the computer. The write cache can be erased once the data is written to the non-volatile storage medium.
Additionally, when a storage device utilizes a read cache, frequently accessed data may be copied from persistent storage in the storage medium to the read cache. When the CPU requests access to data already stored in the read cache, the hard disc does not have to be accessed. As such, response time is improved. Another advantage of reading to and writing from a cache comes from a reduction in the power consumed to retrieve the data from a cache compared to retrieving the data from the storage medium. In other words, the amount of electrical power used to access the read and write cache may be less than the amount of electrical power used to read or write data to/from the hard disc. As such, from a power utilization perspective, it may be beneficial to utilize both the read and write cache as much as possible before accessing the storage medium.
Another advantage to utilizing a storage device's read and write caches is to increase efficiency by postponing access to the storage medium until access is needed. Each time the storage medium is accessed, a temporary spike in power consumption may result. In other words, when the storage device is idle (e.g., no disc access is presently occurring) power consumption may be moderate. When the storage medium is accessed, power consumption increases until the storage device returns to an idle state. If requests to access the storage medium can be temporarily postponed, the storage device can remain in an idle state longer. At a later time, the previously stored requests may be processed in succession while keeping the storage device in a single non-idle state while the requests are processed. As a result, the amount of power consumed by the storage device to process a succession of stored requests is less the power consumed to process each request on-demand.
Another advantage to storing requests and processing them in succession is the ability to reorder the requests to best utilize the storage medium. In other words, when multiple read/write requests are received and stored, there may be a quicker and more efficient manner for processing these requests than in the order in which they were originally received. As such, the time for processing the request and the power consumed may be reduced.
The storage device 106 comprises of at least an interface controller 110, a write cache 112, a read cache 114, and a storage medium 116. In one implementation, the interface controller 110 is responsible for communicating read and write requests to and from the CPU 102, to the storage device 106. In one implementation, when a write request is sent from the CPU 102 to the storage device 106, the interface controller 110 intercepts the data from the write request and places it in the write cache 112. As previously stated, the write cache 112 temporarily holds data to be written to the storage medium 116 as a means of increasing performance of the computer and to reduce power requirements of the storage device. In other words, since the data can be written to the write cache 112 much faster than the storage medium 116, the CPU 102 does not need to wait for the data to be persistently written to the storage medium 116 before proceeding to other operations. As stated above, the time spent determining a write location on a storage medium, as well as the time spent moving a read/write actuator (e.g., seek time) to the desire location, can be lengthy. If the CPU 102 waits for these steps to occur before proceeding to other operations, performance of the CPU 102 decreases considerably. Additionally, the amount of electrical power used to write data to the write cache 112 may be less than that of writing data to the storage medium 116. In one implementation, the data stored in the write cache 112 is flushed from the write cache 112 once the write cache 112 is full. In one implementation, flushing of the write cache means that the data stored in the write cache 112 is copied to the storage medium 116 and then removed from the write cache 112.
In regards to a read request, accessing data from the read cache 114 also provides benefits. If the data request from the read request exists in the read cache 114, the data may be returned to the CPU 102 faster than if the data was retrieved from the storage medium 116. Additionally, the amount of power used to access the data from the read cache is less than the amount of power used to access the data from the storage medium 116.
One implementation for reducing power requirements is to utilize the read and write caches of the storage device 106 as often as possible. In the case of a write request, the interface controller 110 may purposely delay moving data from the write cache 112 to the storage medium 116 until the write cache 112 is full. As such, data remains in the write cache for as long as possible. In the case of a read request, the interface controller 110 accesses the data from the read cache 114, assuming the requested data exists in the read cache. By delaying reading from and writing to the storage medium 116, a reduction in power consumption may result. By storing the data associated with write commands into the write cache, the interface controller 110 is able to write the data to the storage medium 116 in a single pass instead of writing the data after each request is received. Additionally, the interface controller may reorder stored requests into a more efficient processing order than if the requests were processed in the order in which they were received. This may further result in reduced processing time and power consumption.
In one implementation, different idle modes may exist. As illustrated in
An Idle 1 mode offers a savings in power consumption over the Performance Idle mode at the cost of a delay in spin-up or recovery time. In one implementation, when a storage device enters the Idle 1 mode, the electronic components used to synchronize a track follow loop with the embedded pattern on the discs are powered down. Such components may include the read circuitry, pre-amps, and power regulators. Once the components are shut down, the discs continue to spin at the full revolutions per minute (RPM.). However, the read/write transducers or heads are held fixed to protect them from shock events. In Idle 1 mode, the storage device transitions to consuming the lowest amount of power possible, while still maintaining the discs at full RPMs with the heads maintained in position over the discs. In one implementation, the timeframe for powering up the electronics and transitioning back to an active mode is between 50-60 ms.
An Idle 2 mode offers an additional savings in power consumption over the Idle 1 mode at the cost of additional delay in head load time (i.e., the amount of time taken to reposition the heads over the discs). In one implementation, when the storage device transitions into the Idle 2 mode, the read/write heads are moved from the disc and put up on the ramp. By moving the heads away from the discs, there may be a reduction in windage created by the spinning discs, which decreases the power to maintain the discs at full RPMs. Additionally, the voice coil motor (VCM) circuitry can also be powered down during Idle 2 mode. Moving the heads to the ramp and shutting down the VCM circuitry, provides the storage device with additional shock protection over the Idle 1 mode. In one implementation, the time to transition from Idle 2 to an active mode is 200-500 ms.
An Idle 3 mode may also be implemented wherein the discs' spinning RPMs are reduced or stopped completely. Slowing or stopping the rotation of the discs can offer additional power savings over even the Idle 2 mode. However, the spin-up time may increase as well. It is noted, that a differing number of idle modes, and the actions taken within an idle mode, may vary without altering the benefit of a forced idle cache.
It should be appreciated that other events can trigger data stored in the cache or buffer to be written to the disc. For example, data may be written to the disc, from the cache, during a transition between idle modes and a non-cached read command (e.g., a read request for data that is not currently stored in a read cache.) Further, it should be appreciated that an interface controller or other components of a storage device may be used to implement forced idle caching. Additionally, hardware, firmware, software, or a combination thereof may be used to implement forced idle caching.
A cache or buffer containing data from previously issued commands is commonly referred to as a “dirty” cache or buffer. While use of a dirty buffer has a potential risk of losing data stored in the buffer, the advent of portable computers having batteries and battery backup systems significantly reduces the risk of data loss due to a dirty buffer. Portable computers and battery backup systems will generally enter a shutdown mode, forcing the cache or buffer to write to the disc, before the power supply is exhausted.
By increasing the amount of time the storage device remains in lower power modes, a reduction in power consumed by the storage device is realized. Comparing
If the Idle 1 timer in operation 608 has expired, the storage device transitions to an Idle 1 mode in operation 610. As illustrated in
If determination operation 618 determines that the data requested from the read request is not in presently stored in the read cache, processing operation 606 processes the data associated with the read command by accessing the hard disc to retrieve the data. Further, any cached data associated with previously received write commands are also processed since the hard disc was accessed responsive to the non-cached read command. After the data associated with read and write commands are processed, the storage device transitions back to the Performance Idle mode and processing of the storage device returns to operation 602. The storage device transitions back to the Performance Idle mode because the read command resulted in disc access. While in Performance Idle mode, power consumption is higher than the Idle 1 mode. However, the spin-up or disc recovery time of the Performance Idle mode is faster as compared to Idle 1 mode. In one embodiment, spin-up or disc recovery time refers to the amount of time the disc spends returning to its full operating mode. In other words, if the hard disc is in a lower power state such as an Idle 1 mode, some components of the storage device are disabled or turned off as a means of reducing the power consumption of the storage device. However, the trade-off of reduced power consumption is the increased time to re-enable any disabled components.
Returning to determination operation 616, if the received command is a write command, a determination operation 622 determines if there is enough available space in the write cache to store the data associated with the write command. If there is enough space to cache the data from the write command, a store operation 624 stores the data in the write cache, with processing of the storage device returning to Idle 1 mode at operation 610. The storage device remains in Idle 1 mode since no disc access resulted from the write request. If determination operation 622 determines there is insufficient space to store the data associated with the write command, processing of the storage device returns to processing operation 606, where the data associated with the write command, and other cached data, is written to the disc. Once all of the write commands have been processed at processing operation 606, the storage device transitions back to the Performance Idle mode, with processing of the storage device returning to operation 602. The storage device transitions from a state having lower power consumption (e.g., Idle 1 mode) to a state having higher power consumption (e.g., Performance Idle mode) because a disc access resulted from the write command.
Returning to determination operation 612, if no commands are received, a determination operation 626 determines if an Idle 2 timer has expired. The Idle 2 timer is a pre-determined amount of time that the storage device remains in the Idle 1 mode if no commands are received that results in a disc access. In one implementation, the Idle 2 timer is roughly 8-30 seconds. However, the Idle 2 timer, and other timers, is dynamically configurable to any amount of time. If the Idle 2 timer has not expired, processing of the storage device returns to operation 610 where the storage device remains in Idle 1 mode until the Idle 2 timer expires.
Alternatively, if the Idle 2 timer has expired, a determination operation 628 determines if there are any pending commands to be processed. If there are any pending commands, processing operation 630 processes all the commands, which results in a disc access. Thus, the storage device transitions back to Performance Idle mode and processing of the storage device returns to operation 602. One reason for foregoing an Idle 2 mode when there are cached data associated with previously received commands may be for performance benefits. While the Idle 2 mode benefits from a lower power state than the Idle 1 mode, the Idle 2 mode also results in a slower spin-up or disc recovery time. As such, it may be beneficial to enter the Idle 2 mode if there are no cached commands. In one implementation, the Idle 2 timer may be dynamically set to any threshold, and may be user configurable.
If the determination operation 628 determines that no commands are pending, disc access is unnecessary, and the storage device transitions into the Idle 2 mode at operation 632. In one implementation, the Idle 2 mode consumes less power than the Idle 1 mode or the Performance Idle mode. A determination operation 634 determines if any commands have been received. If no commands are received, processing of the storage device returns to the Idle 2 mode at operation 632. The storage device remains in the Idle 2 mode until a command is received resulting in a disc access. When a command is received at determination operation 634, a determination operation 638 further determines whether caching of the storage device is enabled. If caching is not enabled, the processing operation 630 processes all data associated with the previously received commands. Because the processing of commands uses disc access, the storage device transitions back to the Performance Idle mode, and processing of the storage device returns to operation 602.
Alternatively, if determining operation 638 determines that caching is enabled, a determination operation 640 further determines whether the command received in operation 634 is a read command or a write command. If determination operation 640 determines that the received command is a read command, and a determination operation 642 determines that the data to be read already exists in the read cache, an operation 644 returns the data associated with read command to the CPU, from the read cache, without accessing the disc. The storage device remains in the Idle 2 mode, and processing of the storage device returns to operation 632. If determination operation 642 determines that the requested read data is not in the read cache, processing command 630 processes the read command, and other pending commands such as cached write commands. Because the processing of commands resulted in disc access, the storage device transitions back to Performance Idle mode, and processing of the storage device returns to operation 602.
Returning to operation 640, if the command received from operation 634 is a write command, a determination operation 646 determines whether the write cache has enough room to store the data associated with the write command. If determination operation 646 determines there is insufficient room in the write cache, processing operation 630 processes the data associated with the write command, and any other commands in the cache. Because the processing of commands resulted in disc access, the storage device transitions back to the Performance Idle mode, and processing of the storage device returns to operation 602. Alternatively, if there is sufficient space in the write cache to store the data from the write command, an operation 648 stores the data and processing of the storage device returns to and remains in the Idle 2 mode at operation 632. The storage device remains in the Idle 2 mode since disc access was not needed to place the data from the write command into the write cache. The storage device remains in the Idle 2 mode until a command is received that results in disc access or until the write cache becomes full.
While
In another implementation, a hybrid storage device may also benefit from a forced idle cache. A hybrid storage device may be a storage device that utilizes both a platter-based disc array as well as a secondary flash-based storage medium. As with a cache, a flash-based storage medium can be accessed without the slower mechanical components used to access a hard disc. As a result, data can be read from and written to the medium faster and with less power consumption than a hard disc. An additional benefit to a flash-based storage medium is that the memory is non-volatile, so the data is persistently stored. Thus, the medium maintains the data even after power supplied to the storage device is lost.
In another implementation, a hybrid drive may also use a volatile cache or buffer as described through the specification. In other words, the drive may utilize a platter-based disc array, a flash-based storage medium, and a volatile cache. In one implementation, including a flash-based storage medium allows for additional cache storage of both read and write data. In other words, once the read and/or write cache becomes full, additional data from received write commands may be stored in the flash-based storage medium. As such, it may be possible to postpone disc access by maintaining the storage device in an idle mode for a longer period as compared to hard discs that do not utilize a force idle cache. In another implementation, a larger amount of cached read data may also be stored in either the cache and/or the flash-based storage medium. By expanding the amount of read data that may be stored outside of the hard disc, the storage device may remain in a forced idle mode for a longer period, thus increasing the benefits of reduced power consumption. Additionally, with a flash-based storage medium, the read data stored in the medium may persistently exist even after power to the storage device has been lost. Therefore, frequently accessed read data does not have to be moved back to the flash-based medium once the storage device reboots. Further, write data stored in the flash-based storage medium is also persistently stored. In the event of an unexpected power failure, any data associated with a received write command can be recovered and written to the hard disc after the power failure.
While specific modes of storage device operation are disclosed herein, it should be understood that a storage device may reduce power consumption by transitioning to any lower power mode when disc access is unnecessary.
The embodiments of the invention described herein are implemented as logical steps in one or more computer systems. The logical operations of the present invention are implemented (1) as a sequence of processor-implemented steps executing in one or more computer systems and (2) as interconnected machine or circuit modules within one or more computer systems. The implementation is a matter of choice, dependent on the performance requirements of the computer system implementing the invention. Accordingly, the logical operations making up the embodiments of the invention described herein are referred to variously as operations, steps, objects, or modules. It should be understood that logical operations may be performed in any order, unless explicitly claimed otherwise or a specific order is inherently necessitated by the claim language. Furthermore, it should be appreciated that the logical steps disclosed herein may be stored on any computer readable storage medium.
The above specification, examples, and data provide a complete description of the structure and use of example embodiments of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended. Furthermore, structural features of the different embodiments may be combined in yet another embodiment without departing from the recited claims.