The present invention relates generally to the field of data storage devices and, more particularly, to address translation between two address spaces.
Computers typically include a host computer and a persistent data storage device that stores data. Examples of such data storage devices include magnetic disc drives, optical storage devices, and removable disc drives. The most basic parts of a disc drive are one or more rotatable information storage discs and an actuator that moves a transducer to various locations over the disc to either read information from or write information to the storage media. A disc drive also includes control electronics that manages the flow of data between the host computer and the data storage device, and controls positioning of the read/write heads for accessing desired sectors on the storage media.
Data storage devices typically comprise one or more discs mounted on the hub of a spindle motor for rotation at a constant high speed. Each storage surface of a disc is divided into several thousand tracks that are tightly packed concentric circles. The tracks are typically numbered starting from zero at the outermost track on the disc and increasing for tracks located closer to the center of the disc. Each track is further broken down into data sectors and servo bursts. A data sector is normally the smallest individually addressable unit of information stored in a disc drive and typically holds 512 bytes of information plus additional bytes for internal use by the drive for track identification and error correction. A storage cylinder is defined as a grouping of tracks across two or more recording surfaces that are substantially the same radial distance away from the center of a set of discs (e.g., having the same track number on the various surfaces). This organization of data allows for access to any part of the discs.
The physical geometry of a data storage device refers to its actual physical configuration, including the number of discs, number of tracks or cylinders, number of sectors per track, and number of heads. In some systems, the host computer may specify memory storage locations in terms of the actual physical disc addresses, for example, by specifying the actual physical location on the storage disc by cylinder, head, and sector (CHS) where the desired data are to be found or stored. On the other hand, to facilitate compatibility with a wide variety of host systems, most modern computer systems use so-called virtual or logical block addressing, wherein data are identified by a virtual or logical block address (LBA). As mentioned above, data storage devices are typically written to/read from in sector size blocks of 512 bytes. Host devices also typically use 512-byte sector size blocks to match the sector size of the data storage device. The necessary LBA to CHS address conversions take place under control of a local microprocessor associated with the data storage device.
The present invention is a method and apparatus for converting between a first address space and a second address space. In one embodiment, the invention is directed to a method and apparatus for converting between a logical address space and a physical address space. In particular, in one embodiment, the present invention is directed at converting between a target logical block address (LBA) and a target physical disc sector or cylinder head sector (CHS). In other embodiments, the present invention may be used in any application wherein address translation is desired between address spaces. An interlaced even and odd mapping provides for conversion between the two address spaces. In one embodiment, the present invention is used to convert between a target logical address and a target physical address in a digital computer environment that includes a data storage device for persistent storage.
The present invention may also be thought of as a data storage device having physical sector sizes larger than the logical sector sizes of a host computer. The data storage device partitions the logical address space and provides an interlaced even and odd mapping between the logical address space and the physical address space. The data storage device further converts between a target logical address and a target physical address using the interlaced even and odd mapping scheme.
In one embodiment, the invention is directed to a method including dividing a logical address space to create a plurality of partitions, and mapping the logical address space to a physical address space using an interlaced even and odd mapping. The method may also include storing the interlaced even and odd mapping in a partition table. The method may further include converting between a target logical address and a target physical address using the partition table.
In another embodiment, the invention is directed to an apparatus comprising a partition table that stores an interlaced even and odd mapping between a logical address space and a physical address space, and an address translator that references the partition table and converts between a target logical address within the logical address space and a target physical address within the physical address space.
In another embodiment, the invention is directed to a computer-readable medium containing instructions. The instructions cause a programmable processor to divide a logical address space to create a plurality of partitions, and map the logical address space to a physical address space using an interlaced even and odd mapping, such that consecutive partitions alternate between an even starting logical address and an odd starting logical address. The computer-readable medium may further include instructions to store the interlaced even and odd mapping in a partition table.
The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the invention will be apparent from the description and drawings, and from the claims.
The present invention is a method and apparatus for converting between a target logical address and a target physical address. In particular, in one embodiment, the present invention is directed at converting between a target logical block address (LBA) and a target physical disc sector or cylinder head sector (CHS). In other embodiments, the present invention may be used in any application wherein address translation is desired between address spaces. In one embodiment, the present invention is used to convert between a target logical address and a target physical storage space in a digital computer environment that includes a data storage device for persistent storage. Thus, while many application environments are possible, the present invention will generally be described with respect to use with a digital computer system.
The present invention may also be thought of as a data storage device having physical sector sizes larger than the logical sector sizes of a host computer. The data storage device partitions the logical address space and provides an interlaced even and odd mapping between the logical address space and the physical address space. The data storage device further converts between a target logical address and a target physical address using the interlaced even and odd mapping scheme.
The disc drive 100 includes a base 102 to which various components of the disc drive 100 are mounted. A top cover 104, shown partially cut away, cooperates with the base 102 to form an internal, sealed environment for the disc drive in a conventional manner. The components include a spindle motor 106 that rotates one or more discs 108 at a constant high speed. Information is written to and read from tracks on the discs 108 through the use of an actuator assembly 110, which rotates during a seek operation about a bearing shaft assembly 112 positioned adjacent the discs 108. The actuator assembly 110 includes a plurality of actuator arms 114 that extend towards the discs 108, with one or more flexures 116 extending from each of the actuator arms 114. Mounted at the distal end of each of the flexures 116 is a read/write head 118 which includes an air bearing slider (not shown) enabling the head 118 to fly in close proximity above the corresponding surface of the associated disc 108.
During a seek operation, the position of the read/write heads 118 over the discs 108 is controlled through the use of a voice coil motor (VCM) 124, which typically includes a coil 126 attached to the actuator assembly 110, as well as one or more permanent magnets 128 which establish a magnetic field in which the coil 126 is immersed. The controlled application of current to the coil 126 causes magnetic interaction between the permanent magnets 128 and the coil 126 so that the coil 126 moves in accordance with the well known Lorentz relationship. As the coil 126 moves, the actuator assembly 110 pivots about the bearing shaft assembly 112, and the heads 118 are caused to move across the surfaces of the discs 108.
A flex assembly 130 provides the requisite electrical connection paths for the actuator assembly 110 while allowing pivotal movement of the actuator assembly 110 during operation. The flex assembly includes a printed circuit board 132 to which head wires (not shown) are connected. The head wires are routed along the actuator arms 114 and the flexures 116 to the heads 118. The printed circuit board 132 typically includes circuitry for controlling the write currents applied to the heads 118 during a write operation and a preamplifier for amplifying read signals generated by the heads 118 during a read operation. The flex assembly terminates at a flex bracket 134 for communication through the base deck 102 to a disc drive printed circuit board (not shown) mounted to the bottom side of the disc drive 100.
As shown in
In operation of the disc drive 100, servo control 228 receives servo position information from the tracks 109 via the read/write heads 118 and, in response thereto, provides a correction signal to the actuator coil 126 in order to position the heads 118 with respect to the discs 108. Read/write channel 212 operates to write data to the tracks 109 (
It will be noted that the various operations of the disc drive 100 may be controlled by the microprocessor 216, in accordance with programming stored in system microprocessor memory 224. Those skilled in the art will recognize that typical disc drives include additional circuitry and functions beyond those delineated above, but such are only of general interest to the present discussion and accordingly do not warrant further description.
The sector size of the data storage device 100 of the present invention may have a large sector size as compared to the sector size of host computer 200. For example, data storage device 100 may have sector size of 1024 bytes, 2048 bytes, 4096 bytes, or larger, whereas the host computer sector size is typically 512 bytes. As error correction encoding (ECC) becomes more powerful and recording densities increase, longer synchronization and timing areas are required for each sector, resulting in increased per block overhead. Increasing the data storage device sector block size from 512 bytes results in a decrease in total drive overhead, as fewer total sectors are required. An additional benefit of larger blocks is the reduction of inter-block gaps on the track. A larger block size may thus achieve faster seek times and greater format efficiency.
In order to accommodate disc sector sizes larger than those of the host computer, the present invention provides a scheme to minimize sector misalignment that may result when logical (host) and physical (disc) sector sizes are “mis-matched.” In a typical system, host commands may start from any logical address with any length of logical sector count. In addition, the physical address space is read from/written to in full physical sector length block sizes. By increasing the physical sector size to something larger than the logical sector size, as proposed by the present invention, host commands may result in reads/writes of blocks that are not full physical sector sizes in length. This may deteriorate write performance as each “misaligned” write operation will incur a hidden read. In other words, to perform a partial write, the data storage device may need to perform a read operation to retrieve the data of the entire sector, merge the sector data with the host data, and then write back the merged sector data to the disc. The interlaced even and odd mapping scheme of the present invention provides a distribution of even and odd mappings throughout the logical address space, thus reducing sector misalignment and minimizing any concomitant deterioration in disk drive write performance.
The present invention provides a method and apparatus for converting between a logical address space of a host computer to a physical address space of a data storage device. In particular, the present invention provides an interlaced even and odd mapping scheme for converting between a target logical address and a target physical address, and vice versa. The interlaced even and odd mapping scheme will be generally described with respect to converting between a target logical address such as LBA and a target physical address, such as physical disc sector number or CHS. It shall be understood, however, that the present invention may be used in any application wherein address translation is desired between address spaces without departing from the spirit and scope of the present invention, and that the invention is not limited in this respect.
Address translator 240 converts between a target logical address and a target physical address by means of an interlaced even and odd mapping scheme. Address translator 240 includes a partition table 250 that stores the mapping information to allow conversion between the logical and physical address spaces as described below.
In one embodiment, address translator 240 may include software executed by microprocessor 216 to achieve the address translation. If implemented in software, the invention may be directed to a computer readable medium comprising program code that can be executed in by microprocessor 216 or similar device to perform logical to physical address translation as described herein. In other embodiments, address translator 240 may be implemented in computer hardware or computer firmware, such as ROM, EEPROM, flash memory, and the like. In any event, address translator 240 is configured to convert between a target logical address on the host computer to a target physical address on the data storage device by means of an interlaced even and odd mapping. It shall be understood that the phrase “convert between a target logical address and a target physical address” refers to both converting from a target logical address to a target physical address and converting from a target physical address to a target logical address.
For example, mapping 300 illustrates how an example host LBA range 0 through 16 is mapped to disc sectors 0 through 9. In this example embodiment, there are three partitions 304A, 304B, and 304C. Partition 304A is an even mapping (disc sector 0 to LBA 0). Partition 304B is an odd mapping (disc sector 3 to LBA 5). Partition 304C is an even mapping (disc sector 7 to LBA 12). The last logical sector of each partition is partially mapped, e.g., LBA 4 is mapped to the first half of disc sector 2, LBA 11 is mapped to the first half of disc sector 6, and LBA 16 is mapped to the first half of disc sector 9. This partial mapping leaves the second half of disc sectors 2, 6, and 9 (denoted by reference numerals 310A, 310B, and 310C, respectively) unmapped, ensuring that the starting LBAs of consecutive partitions achieve an alternating pattern of even and odd mappings. In other words, Disc sectors that are partially mapped are referred to herein as “orphan sectors.” In
Referring again to
Partition Number
Partition Type—even or odd mapping
Partition Starting Logical Address
Partition Ending Logical Address
Partition Starting Physical Address
Partition Ending Physical Address
Compensation Value—adjustment for orphan sectors
The compensation value field accounts for the total number of orphan sectors prior to the partition (excluding the partition itself). For example, the compensation value for partition 0 is zero, as there are no orphan sectors before partition 0. The compensation value for partition 1 is one, as there is one orphan sector (disc sector 2) before partition 1. The compensation value for partition 2 is two, as there are two orphan sectors (disc sector 2 and disc sector 6) before partition 2.
Although the example mapping shown in
The total number of partitions of the logical address space, the number of logical addresses (e.g., LBAs) per partition, the number of physical addresses (e.g., disc sectors) per partition, the number of orphan sectors, the number of logical addresses mapped to each physical address, and/or the compensation value may vary depending upon the size of the logical and physical address spaces, host accessing patterns, the particular application involved, and the like. It shall be understood, therefore, that the embodiments given herein are for exemplary purposes only, and that the invention is not limited in these respects.
A description of the process by which address translator 240 converts between a target logical address and a target physical address using the interlaced even and odd mapping scheme will now be described with respect to
For example, assume that the target logical address is LBA 9 as shown in
For example, assume that the target sector is disc sector 8. Because in this example mapping two consecutive LBAs share the same disc sector (except for orphan sectors), conversion from a disc sector to an LBA will always get the smaller one of the two LBAs. Multiplying the target sector by 2 gives 16 (8*2=16) (602). Disc sector 8 falls within partition 2 (604). The compensation value of partition 2 is 2 (606). Subtracting the compensation value from the multiplied target sector results in an LBA of 14 (16-2=14) (608). Again, the mathematical operations required to convert the target physical address to an unadjusted target logical address and to apply the compensation value to the unadjusted target logical address may vary depending upon the specific implementation of the interlaced even and odd mapping scheme (for example, the number of disc sectors mapped to each LBA, the number of orphan sectors, etc.) and it shall be understood that the specific embodiments described herein are for exemplary purposes only.
Address translator 240 is shown for conceptual purposes in
The instructions and the media are not necessarily associated with any particular computer or other apparatus, but may be carried out by various general-purpose or specialized machines. The instructions may be distributed among two or more media and may be executed by two or more machines. The machines may be coupled to one another directly, or may be coupled through a network, such as a local access network (LAN), or a global network such as the Internet.
The invention may be embodied as one or more devices that include logic circuitry to carry out the functions or methods as described herein. The logic circuitry may include a processor that may be programmable for a general purpose or may be dedicated, such as microcontroller, a microprocessor, a Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), and the like.
The invention may be capable of providing one or more advantages. For example, the techniques described herein provide for larger disc sector sizes while minimizing sector misalignment that may result from mismatched host and disc sector sizes. The interlaced even and odd mapping scheme of the present invention provides a distribution of even and odd mappings throughout the logical address space, thus reducing sector misalignment and minimizing any concomitant deterioration in disk drive write performance.
Various embodiments of the invention have been described. These and other embodiments are within the scope of the following claims.