A disc drive is a data storage device used to store digital data. A typical disc drive includes a number of rotatable magnetic recording discs that are axially aligned and mounted to a spindle motor for rotation at a high constant velocity. A corresponding array of read/write heads access the discs to write data to and read data from the discs.
The discs are divided into a number of addressable blocks that are assigned host-level addresses (sometimes referred to as logical block addresses or LBAs). Each LBA typically has a corresponding physical block address (PBA) used by servo control circuitry to align a head with the appropriate portion of the medium to access the desired LBA.
In addition to the servo control circuitry to move the heads to the various tracks, the disc drives are also provided with read/write channel circuitry to write data to and read data from the discs, and interface control circuitry to facilitate communication and data transfer with a host device. A disc drive is typically configured to operate in accordance with an industry standard interface protocol, such as Small Computer Systems Interface (SCSI) or AT Attached (ATA, and known widely as IDE). Communications and data transfers are carried out between host and drive in accordance with these protocols.
Disc drives of the present generation typically accommodate command queuing, which allows multiple input/output (I/O) commands to be received in a command queue and executed by the drive in an order different than that received. SCSI protocols currently support up to 256 pending commands in the command queue, while ATA protocols allow up to 32 commands. A search strategy is used to execute the commands in an order that will potentially provide the highest transfer rate. For example, if several commands require access to data blocks close to the current position of the heads, and other commands require access to data blocks at distant locations on the discs, the drive may proceed to execute all of the local accesses before moving the heads to the distant locations and accessing the data blocks at the distant locations to minimize seek time (i.e., time spent moving from one track to the next).
The time required for a particular data block to rotate around and reach the head (latency) is an important factor when selecting the execution order, as delays in waiting for the disc to rotate significantly decrease the resulting transfer rate. Selection of the execution order typically includes estimating how much time it would take to reach each of the data blocks associated with the pending access commands based on latency and the time required to perform any necessary head switches and seeks.
A disc drive can typically employ various run-time selectable strategies (parameters) to improve the host throughput and read cache hit ratio, such as read on arrival (ROA) and read look ahead (RLA). ROA and RLA generally entail reading data blocks and placing the contents into the data buffer even though the host has not specifically requested the data from such data blocks, on the basis that the host may request the data in the near future.
ROA involves performing a seek command to move the head to a destination track on which a target data block resides, and commencing to read the data blocks on the track that precede the target data block until the target data block reaches the head. By contrast, RLA involves receiving a command to move to a new target track, but because the target data block is a large angular distance away from the head, the drive delays seeking to the new track and instead maintains the head on the current track and reads additional data blocks on the current track before moving to the destination track and reading the target data block. The foregoing strategies can provide improved performance under certain circumstances, such as when the command stream has a high degree of locality.
Another run-time selectable parameter that can improve host throughput is write caching. Write caching involves delaying the writing of data received from the host in favor of execution of other previously requested accesses (as opposed to immediately writing the data upon receipt). Advantages associated with write caching include the fact that more commands are available to choose from during the sorting strategy, which statistically improves overall access times.
However, allowing a command to be considered for disc access before other commands that have been in the system longer creates potential overlap problems. One of these problems occurs when a newer read command is promoted ahead of an older write command. If the older write command has cached data or a pending command that has not yet been written to disc and the newer read command is requesting data in the same LBA range as that of the older write command, old data will be accessed by the read command. If the read command goes to disc without recognition of the older cached write data an undesired overlap occurs. Other variations of overlap conditions can occur as well.
Overlap problems can also occur when a newer write command is improperly promoted ahead of an older read command. A write command that is given disc access before an older read command that is requesting data that overlaps the LBA range of the write command results in a read of newer data than that requested. Similarly, an older read command could recognize and send newer write cache data as a read cache hit instead of going to disc.
Disc drives typically avoid the improper promotion of commands by performing overlap checking. An overlap check takes place when a newer command is considered for promotion in front of older commands. The LBA range of a command considered for promotion is compared to the LBA range of the older commands. If the LBA ranges do overlap then the newer command is prevented from promotion until the overlap condition no longer exists, i.e., the older command has been executed.
The process of overlap checking can be complicated by the use of performance enhancing features (PEF) such as ROA and RLA. Unlike an overlap check that takes place with PEFs disabled, the LBA ranges of pending read commands are not known. Although the LBA range attributable to the requested data is known, the LBA range attributable to the PEFs is not known. The uncertainty is due to the inability of the system to determine the LBA range prior to the scheduling of a command for disc access since the LBA range added by a PEF cannot be determined until the order of commands is determined.
Disc drives compensate for the inability to check for overlap of the LBA ranges due to PEFs by adding LBAs to the existing LBA range of pending read commands. The added LBAs reflect the largest case scenario that could be attributed to a PEF. The extended amount can be the size of a cache segment or of some virtual cache structure. The enlarged ranged of LBAs then undergoes an overlap check with the LBA ranges of pending commands.
However, the enlarged LBA range creates an additional problem due to the overlap check. The significant increase in LBA range results in an increased incidence of detected overlaps. Since the commands responsible for the overlap are not granted disc access until the overlap condition ends and pending write commands are not allowed to be cached, commands are forced to remain in the buffer for a longer period of time. The delay diminishes disc data throughput.
Accordingly, there is a need for improvements in the art to provide effective control of cached commands in a disc drive to improve data transfer performance.