Overhead calculation in writing synchronized data to magnetic tape

Various embodiments for writing received synchronized data to magnetic tape having a plurality of wraps using a magnetic tape drive adapted for performing the writing according to an available plurality of predefined tape speeds are provided. In one such embodiment, for each of the available plurality of predefined tape speeds, an average overhead per synchronized command for performing a recursively accumulated backhitchless flush (RABF) cycle is calculated. One of the available plurality of predefined tape speeds having a lowest calculated average overhead is selected. The RABF cycle is performed using the selected one of the available plurality of predefined tape speeds.

CROSS-REFERENCE TO RELATED APPLICATIONS

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates in general to computers, and more particularly to a method, system, and computer program product for incorporating a calculation of overhead into a method for writing synchronized data to magnetic tape media in a computing environment.

2. Description of the Related Art

Magnetic tape provides a means for physically storing data which may be archived or which may be stored in storage shelves of automated data storage libraries and accessed when required. Data stored in this manner has an aspect of permanence, which allows copies of the data stored in memory or disk at a host system to be erased, knowing that a copy exists on magnetic tape. The available storage space at the host system is relatively expensive, and there is a desire to release the storage space as soon as possible. Hence, data is typically transferred through an intermediate staging buffer, such as a hard disk, to the tape drive, and there is also a desire to release and overwrite the staging buffer as soon as possible. Thus, it is often desirable to “synchronize” the data.

“Synchronized data” is defined as data or other information that is subject to a “synchronizing event” or similar command requiring the tape drive to not return “Command Complete” to a write type of command, or an indication that the command has been or will be successfully executed, until it has actually committed the data to media, specifically, the magnetic tape. As the result, if power is lost, the data can be recovered from the tape, whereas it may not be recoverable from a volatile DRAM storage of the tape drive buffer.

One example of a synchronizing event is a Write Filemark command with the Immediate bit set to “0”. This means that the drive is not to respond immediately, but instead is to respond when the command has completed, meaning that any data sent as part of the command is written out to tape. A specialized case of a Write Filemark command is where the number of Filemarks field is also set to “0”, meaning that the Write Filemark command has no data of its own, and all data which precedes the command must be written to tape before a command complete is sent. Hence, this command is often referred to as a “Synchronize” command, as is known to those of skill in the art.

Another example of a synchronizing event is a host selectable write mode known to those of skill in the art as “non-buffered writes”, where an implicit synchronize must be performed after each record is written from the host. “Command Complete” is not returned for any write command until the data is successfully written on media. Herein, writing any data record, group of records, or other mark, is defined as a “transaction”, and writing such data record, etc., as the result of a synchronizing event is defined as a “synchronized transaction”.

A difficulty with respect to magnetic tape is that the data is recorded sequentially without long gaps between data sets, whereas synchronized transactions are stored in separate bursts for each synchronizing event, with a noticeable time period before writing the next transaction. This requires that the tape drive “backhitch” after writing the synchronized transaction in order to write the next transaction closely following the preceding transaction. Tape is written or read while it is moved longitudinally at a constant speed. Hence, a backhitch requires that the tape be stopped, reversed to beyond the end of the previous transaction, stopped again, and accelerated up to speed in the original direction by the time that the end of the previous transaction is reached. As is understood by those of skill in the art, the backhitch process consumes a considerable amount of time, and, if a large number of small synchronized transactions are to be stored, the throughput of the tape drive is reduced dramatically. As an example, backhitch times can vary from about half a second to over three seconds.

SUMMARY OF THE INVENTION

In the related U.S. Pat. No. 6,856,479 incorporated by reference above, a method for writing synchronized tape is provided that reduces the number of backhitches. In one such embodiment of that method, a controller detects a pattern of synchronizing events for received data records to be written to tape, writes each transaction of data records to the magnetic tape, accumulates the synchronized transactions in a buffer, and subsequently recursively writes the accumulated transactions of data records from the buffer to the magnetic tape in a sequence. A single backhitch may be employed to place the recursively written accumulated data records following the preceding data. This and other embodiments of this method may be termed a “Recursively Accumulated Backhitchless Flush,” or RABF cycle, as will be referred to herein. When the host transfers a small amount of data and issues a synchronization command repeatedly, the tape drive enters a RABF mode of operation. The drive then moves to a work or temporary area of the tape, and writes the data temporarily without an accompanying backhitch. After the temporary area is fully used, the drive returns from the temporary area to the original area and recursively writes the data (which was written on the temporary area) on the original area. Pursuant to RABF cycles, the number of backhitches is reduced, and performance of the drive is maximized over normal writing in situations where the host application transfers a small amount of data and issues a synchronization command repeatedly.

In general, pursuant to RABF cycles, the tape drive writes the data with the fastest tape speed on the temporary area because the data can be written in the shortest time. The throughput from drive to tape is therefore defined by the tape speed and the linear density on the tape. In some situations, however, writing the data in the temporary area using a slower tape speed may improve performance. In one such situation, the host does not immediately transfer the data following a synchronization command. In this situation, the synchronization command is sent and received by the drive, yet the host application does not immediately transfer data. Meanwhile, the drive head is located over the temporary area, and the drive is waiting for the subsequent data. In other words, in such a situation, the total amount of data to be written on the temporary area is smaller, and the occurrence of recursive writing (which contributes to the overhead of a RABF cycle) increases. If a smaller tape speed is implemented in this case, the area of the temporary tape to run without writing is smaller than the case with faster tape speeds. This means that use of the smaller tape speed may reduce the occurrence of recursive writing, and result in better throughput.

To address situations where latency between the synchronization command and receipt of data is higher (and a default position of the fastest tape speed in the temporary area doesn't necessarily result in the highest performance), a need exists for a mechanism whereby the RABF cycle incorporates a consideration of factors in an overhead calculation, in order to select an appropriate tape speed to maximize throughput and performance in such situations.

Accordingly, various embodiments for writing received synchronized data to magnetic tape having a plurality of wraps using a magnetic tape drive adapted for performing the writing according to an available plurality of predefined tape speeds are provided. In one such embodiment, for each of the available plurality of predefined tape speeds, an average overhead per synchronized command for performing a recursively accumulated backhitchless flush (RABF) cycle is calculated. One of the available plurality of predefined tape speeds having a lowest calculated average overhead is selected. The RABF cycle is performed using the selected one of the available plurality of predefined tape speeds.

Related method, system, and computer program product embodiments are provided and provide additional advantages.

DETAILED DESCRIPTION OF THE DRAWINGS

As previously indicated, the illustrated embodiments depict and describe various techniques for improving execution of a RABF cycle by considering overhead calculations for each of a number of possible tape speeds. These embodiments detect the situation where smaller tape speeds result in better throughput than faster tape speeds, and select the slower tape speed. By selecting the slower tape speed in some cases, the embodiments promote tape durability

To illustrate the scenario described previously, consider the following example using the following tape speeds. A first tape speed (SP1) has a rate of 10 meters/second (m/sec). A second tape speed (SP2) has a rate of 5 m/s. Two wraps in the temporary area are referred to as ABF1and ABF2. Following a small amount of transaction data (data sent between the synchronization command) transferred from the host, the drive enters a RABF mode of operation. The drive then writes the next transaction data in the first temporary wrap ABF1. When the full area of ABF1is written, the drive then moves to the second temporary wrap ABF2. Once the areas of ABF1and ABF2are written, the drive moves to the original wrap and recursively writes the data that was written in ABF1and ABF2. Once the recursive write is concluded, the drive returns to the ABF1wrap for the next synchronization command. In other words, the RABF cycle is repeated until the host application stops transferring the small data and high frequency of synchronization commands such that the drive exists the RABF mode of operation.

If the length of temporary wraps ABF1and ABF2are each 100 meters, the time expended while writing these wraps is as follows. For the faster tape speed SP1, the time expended is (100 m)*(2 wraps)/(10 m/s)=20 seconds. For the slower tape speed SP2, the time expended is (100 m)*(2 wraps)/(5 m/s)=40 seconds. These values indicate that the recursive write process occurs per every 20 seconds (for the faster tape speed) or 40 seconds (for the slower tape speed). Because the occurrence of recursive writes is smaller in the slower tape speed) (every 40 seconds vs. every 20 seconds), any overhead stemming from the recursive writing itself is reduced. This will be further illustrated, following. In addition to the foregoing, the use of slower tape speeds in situations warranting the slower speed promotes durability of the magnetic tape.

Referring toFIG. 1, a tape drive10is illustrated which may implement aspects of the present invention. The tape drive provides a means for reading and writing information with respect to a magnetic tape cartridge11. A cartridge and associated tape drive are illustrated, such as those adhering to the Linear Tape Open (LTO) format. An example of a single reel tape drive is the IBM® 3580 Ultrium® magnetic tape drive based on LTO technology. Another example of a single reel tape drive is the IBM® 3590 Magstar® magnetic tape drive and associated magnetic tape cartridge. An example of a dual reel cartridge is the IBM® 3570 magnetic tape cartridge and associated drive.

As is understood by those of skill in the art, a magnetic tape cartridge11comprises a length of magnetic tape14wound on one or two reels15,16. Also as is understood by those of skill in the art, a tape drive10comprises one or more controllers18of a recording system for operating the tape drive in accordance with commands received from a host system20received at an interface21. The tape drive may comprise a standalone unit or comprise a part of a tape library or other subsystem. The tape drive10may be coupled to the host system20directly, through a library, or over a network, and employ the Small Computer Systems Interface (SCSI), Fibre Channel Interface, etc.

The magnetic tape cartridge11may be inserted in the tape drive10, and loaded by the tape drive so that one or more read and/or write heads23of the recording system reads and/or writes information with respect to the magnetic tape14as the tape is moved longitudinally by one or more motors25. The magnetic tape comprises a plurality of parallel tracks, or groups of tracks. In some formats, such as the LTO format, discussed above, the tracks are arranged in a serpentine back and forth pattern of separate wraps, as is known to those of skill in the art. Also as known to those of skill in the art, the recording system comprises a wrap control system27to electronically switch to another set of read and/or write heads, and/or to seek and move the read and/or write heads23laterally relative to the magnetic tape, to position the heads at a desired wrap or wraps, and, in some embodiments, to track follow the desired wrap or wraps. The wrap control system may also control the operation of the motors25through motor drivers28, both in response to instructions by the controller18. Controller18also provides the data flow and formatting of data to be read from and written to the magnetic tape, employing a buffer30and a recording channel32, as is known to those of skill in the art.

As discussed above, magnetic tape provides a means for physically storing data that may be archived or that may be stored in storage shelves of automated data storage libraries and accessed when required. Tape drives often employ a “read after write” process to insure that the data is written correctly to provide an aspect of permanence. This permanence allows copies of the data stored in memory or disk at the host system20to be erased, knowing that a correct copy exists on magnetic tape.

Considering the foregoing discussion, one embodiment of a RABF cycle may be defined as follows. First, the tape head moves from the original wrap to the first temporary wrap (again termed ABF1). As a second step, the data is written on the ABF1wrap. As a third step, the tape head moves from the first to the second temporary wrap (ABF1to ABF2). Fourth, data is written to the ABF2wrap. Fifth, the tape head moves from the ABF2wrap to the original wrap (once the temporary areas are filled). Sixth and finally, the drive recursively writes the data from ABF1and ABF2to the original wrap. For each of these steps, a synchronization command may be issued.

The following terminology and assumptions may be used in herein, following:A: Acceleration of Tape SpeedSP_x: Tape SpeedD: Size of data set (Data set is a unit to be written on tape)S_x: Transfer rate of tape speed SP_xn_x: The number of data sets to be recursively written with tape speed SP_xR_x: The number of synchronization commands during one RABF cycle with tape speed x (ABF1, ABF2, Recursive Write).
In addition, the following transfer rates may be defined, where m_1, m_2, and m_3represent ratios of current speed to a highest tape speed. These values may be obtained for a particular tape speed x following the performance of one RABF cycle at that tape speed. For example, for a particular computing environment, the following may be obtained:
S—1=163 MB/sec=S—1*m—1(m—1=1)
S—2=143 MB/sec=S—1*m—2(m—2=134/163)
S—3=109 MB/sec=S—2*m—3(m—3=109/163).

Using the foregoing assumptions, an average overhead per synchronization command may be calculated as Overhead_S_x=Time_To_Write_One_Dataset+(Time_To_Recursive_Write+Tape_Motion for One_RABF_Cycle)/R_x. Again, the following assumptions and terminology may be used:Time_To_Write_One_Dataset=D/S_xTime_To_Recursive_Write=D*n_x/S_xTape_Motion for_One_RABF_Cycle (all six steps of RABF cycle)=(SP_x/A)*6Time_To_Wrap_Change_From_Original_to_ABF1=(SP_x/A)*2Time_To_Wrap_Turn_From_ABF1_to_ABF2=(SP_x/A)*2Time_To_Wrap_Turn_From_ABF2_to_Original=(SP_x/A)*2.
The same average overhead value may then be calculated with respect to an additional speed y and z:
Overhead—S—y=D/(S—x*m—y)+((D*n—x/m—y)/(S—x*m—y)+(S—x*m—y/A)*6)/(R—x/m—y)
Overhead—S—z=D/(S—x*m—z)+((D*n—x/m—z)/(S—x*m—z)+(S—x*m—z/A)*6)/(R—x/m—z).

Once the average overhead values are obtained, the RABF cycle is executed using the tape speed having the smallest calculated average overhead. In other words, given a total time of one RABF cycle, if a calculated average overhead value for a particular tape speed is the smallest of the calculated overhead values, the RABF cycle achieves the best performance using that particular tape speed.

Turning toFIG. 2, an exemplary method50for synchronous writing of data to tape incorporating a consideration of overhead values for predefined tape speeds is illustrated. As one skilled in the art will appreciate, various steps in the method50may be implemented in differing ways to suit a particular application. In addition, the described methods may be implemented by various means, such as hardware, software, firmware, or a combination thereof operational on or otherwise associated with the magnetic tape drive. For example, the method50may be implemented, partially or wholly, as a computer program product including a computer-readable storage medium having computer-readable program code portions stored therein. The computer-readable storage medium may include disk drives, flash memory, digital versatile disks (DVDs), compact disks (CDs), and other types of storage mediums.

While the method50below is presented as an iterative mechanism, the skilled artisan will appreciate that in some embodiments, certain steps in the method50may occur in parallel. For example, the calculation of an average overhead value may take place concurrently for each of a number of predefined tape speeds.

Method50begins (step52) as the drive detects a pattern of synchronization commands (synchronizing events) causing it to enter a RABF mode of operation, and the RABF cycle starts (step54). If this is the first RABF cycle executed in a period of time (step56), the RABF is performed using the fastest available tape speed (step58). If the RABF cycle is not the first cycle executed, then X is defined as the fastest available tape speed (step60). A determination is made as to whether the host transfer rate is smaller than X (step62). If this is not the case, the tape speed Y with the smallest calculated overhead value is selected (step70), and the RABF is performed using the selected tape speed (step72). The method then ends (step74).

Returning to step62, if however, the host transfer rate is determined to be smaller than X, then the method50calculates the average overhead using speed X (step64). If a slower tape speed than X is not identified (step66), then the method again proceeds to step70to select the speed Y having the smallest calculated overhead and execute the RABF cycle with the selected speed Y (again, step72). On the other hand, if a slower tape speed than X is identified (again, step66), then X is then redefined as the next slower tape speed (step68). The method50then returns to step62, where the host transfer rate is again examined to determine if it is smaller than the redefined tape speed X. Steps62-68continue until a slower tape speed is not identified.