Demand allocation of read/write buffer partitions favoring sequential read cache
AssigneeMaxtor Corporation
InventorPhilip E. Brunelle
Life of this patent
Estimating the term…
Abstract
A method and apparatus is disclosed for partitioning a data buffer to create separate read and write buffers, wherein the boundaries between the buffers and the sizes of the buffers change dynamically depending upon the command mix received from the host computer. Data buffer space is allocated to provide highest priority to processing the current host command, and next priority to preserving a read ahead cache.
Claims14
A method for transferring data between a host computer and storage media of a storage device, comprising the steps of:
- (a) receiving a command from the host computer, the command comprising a read or write transaction and a data length;
- (b) if the command is a read transaction, then allocating a read buffer in a forward direction in a circular data buffer starting at a read location in the circular data buffer determined by a host pointer into the circular data buffer, and transferring a read data block from the storage media through the read buffer to the host computer, the read buffer having a length equal to the data length;
- allocating read ahead cache in the circular data buffer in the forward direction;
- initiating a read ahead operation to transfer a plurality of sequential read data blocks from the storage media to the read ahead cache;
- (c) if the command is a write transaction, then allocating a write buffer in a reverse circular direction in the circular data buffer starting at a write location in the circular data buffer determined by subtracting the data length from the host pointer into the circular data buffer, and transferring a write data block from the host computer through the write buffer to the storage media, the write buffer having a length equal to the data length;
- (d) receiving a next command from the host computer, the next command comprising the read or the write transaction and a next data length;
- terminating the read ahead operation if the next command is not the read transaction targeted for a read data block stored in the read ahead cache.
An apparatus for transferring data between a host computer and a storage media of a storage device, comprising:
- means for receiving a command from the host computer, the command comprising a read or a write transaction and a data length;
- means for allocating a read buffer in a forward direction in a circular data buffer starting at a read location in the circular data buffer determined by a host pointer into the circular data buffer if the command is a read transaction, and transferring a read data block from the storage media through the read buffer to the host computer, the read buffer having a length equal to the data length;
- means for allocating a read ahead cache in the circular data buffer in the forward direction;
- means for initiating a read ahead operation to transfer a plurality of sequential read data blocks from the storage media to the read ahead cache;
- means for allocating a write buffer in a reverse circular direction in the circular data buffer starting at a write location in the circular data buffer determined by subtracting the data length from the host pointer into the circular buffer if the command is a write transaction, and transferring a write data block from the host computer through the write buffer to the storage media, the write buffer having a length equal to the data length;
- means for receiving a next command from the host computer, the next command comprising the read or the write transaction and a next data length;
- means for terminating the read ahead operation if the next command is not the read transaction targeted for a read data block stored in the read ahead cache.
Dependencies are inferred from the claim text.