This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2008-249619, filed on Sep. 29, 2008, the entire contents of which are incorporated herein by reference.
A certain aspect of the embodiments described herein is related to a storage control method, a storage control unit, and a storage apparatus.
Recently, there has been a considerable activity in increasing the storage capacity of hard disk drives. A disk format having a high format efficiency called large sector has been proposed as means for realizing the large capacity.
According to the large sector format, one sector of the magnetic disk drives has a size greater than a conventional size of 512 bytes, which may be 1024 bytes or 4096 bytes. When the large sector format is employed, a host computer that controls the magnetic disk drives may not deal with the large sector format. In order to cope with this problem, an emulation using read modify write (RMW) may be executed for data requested to be written in a unit of 512 bytes (see Japanese Laid-Open Patent Publication No. 2002-15507).
The emulation operation using the read modify write has a sequence of reading data from a sector on a recording medium to store the data in a buffer, overwriting data in sectors requested by the host computer on the 512-byte base to thus modify the data with the read data, and writing the overwritten data in the original sectors on the recording medium. Thus, each command needs the time for reading and modifying. This degrades the performance of the magnetic disk drive, and more particularly, decreases the write speed.
According to an aspect of the present invention, there is provided a control method including: determining whether a size of write data specified by a command supplied from a host is smaller than a size of a physical sector of a recording medium; lowering priority of the write data when the size of the write data is smaller than the size of the physical sector; continuously reading, when a plurality of commands for write data having lowered priority are supplied, data in physical sectors specified in the plurality of commands; and executing a modify write process on the basis of a result of continuously reading the data.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
A description will now be given of a magnetic disk drive in accordance with a first embodiment with reference to
The disk enclosure 80 has a spindle motor (SPM) 14, a voice coil motor (VCM) 50, a head 16, and a head IC 52. The spindle motor 14 rotates a magnetic disk 12 at a revolution as high as 4200 to 15000 rpm. The magnetic disk 12 employs the large sector format capable of realizing a high format efficiency in order to secure a large storage capacity. More specifically, the magnetic disk 12 has a physical sector having a size greater than a conventional size of 512 bytes, and may, for example, be 4096 bytes. The voice coil motor 50 drives a head stack assembly (not illustrated), which holds the head 16 to change the relative positional relation between the head 16 and the magnetic disk 12. The head 16 includes a main body made of ceramic in which a write element and a read element are incorporated. The write element includes a write coil and a write core. The read element is arranged adjacent to the write core. The read element may, for example, be a GMR (Giant Magneto Resistance) element or a TMR (Tunneling Magneto Resistance) element. The head IC 52 selects one of heads based on a write command or a read command supplied from a host computer 82, and performs a write or read operation on the magnetic disk 12. In
The control board 90 includes a MPU (Micro Processing Unit) 84, a memory 86, a servo controller 92, a host interface controller 94, a buffer memory controller 96, a buffer memory 98, a hard disk controller 102, and a read channel 104. These structural elements are connected to a bus 28.
The memory 86 may include a volatile memory and a non-volatile memory. The volatile memory may temporarily store a table in which various parameters are stored. The non-volatile memory may store initial data. The servo controller 92 drives and controls the voice coil motor 50 and the spindle motor 14.
The buffer memory controller 96 controls a read/write operation on the buffer memory 98. As illustrated in
The determining part 72 performs various determinations. For example, the determining part 72 determines whether the size of write data supplied from the host compute 82 and stored in the buffer memory 98 is smaller than the physical sector of the magnetic disk 12 (equal to 4096 bytes). The order changing part 74 lowers the priority of data that is determined by the determining part 72 to have a size smaller than the physical sector of the magnetic disk 12. In practice, the priority of command may be lowered. The processing part 76 executes an emulation operation using a read modify write process. The accessing part 78 stores data supplied from the host computer 82 in the buffer memory 98 and reads data therefrom.
Turning back to
The magnetic disk drive 100 operates as described in
The host computer 82 issues a write request (command) to the magnetic disk drive 100. The host interface controller 94 creates a command management table used to manage the write request issued by the host computer 82, and registers the created command management table in the buffer memory 98. The buffer memory controller 96 confirms the command management table and checks whether a free area is available in the buffer memory 98. Then, the buffer memory controller 96 requests the host computer 82 to send write data. The buffer memory controller 96 receives write data from the host computer 82 and stores the received write data in the buffer memory 98. At this stage, the process illustrated in
At step S10 depicted in
When the answer of step S10 is YES, the process proceeds to step S12 at which the order changing part 74 lowers the priority of the data (the command corresponding to the data) supplied from the host computer 82.
At step S14, the determining part 72 determines whether there is another command of a low priority in the buffer memory 98. For example, as illustrated in
When the answer of step S14 is YES, the process proceeds to step S16 depicted in
In contrast, when the answer of sep S16 is NO, that is, when the physical sectors are located away from each other, the process returns to step S14 without combining the commands.
The determination of step S16 (and the process of step S18) is repeatedly carried out as long as data (command) designed to have the low priority remains in the buffer memory 98. When all of data (commands) assigned the low priority have been determined and processed, the answer of step S14 is NO, and the process proceeds to step S20. If there are three items of data having the low priority or more within the range of N sectors, three or more commands are combined. In the following description, as illustrated in
At step S20, the processing part 76 determines whether there are commands combined at step S18. When the answer of step S20 is NO, the process is terminated. In contrast, when the answer of step S20 is YES, the process proceeds to step S22.
At step S22, the processing part 76 reads the physical sectors specified in the combined commands (see the lower part of
At step S24, the processing part 76 modifies part of the data read from the physical sectors with data stored in the buffer, as illustrated in
At step S26, as illustrated in
When it is determined at step S10 that the data do not have any fraction, that is when it is determined that the size of the data supplied from the host computer 82 is equal to that of the physical sector (4096 bytes) of the magnetic disk 12, the answer of step S10 is NO, and the process proceeds to step S28. In this case, there is no data that needs the read modify write process. Thus, the data is written in the magnetic disk 12 by using the read channel 104, the head IC 52 and the head 16.
According to the first embodiment, when the size of the write data of the command supplied from the host computer 82 is smaller than the size of the physical sector of the magnetic disk 12, the priority order of the command is lowered. When there are commands having the lowered priority and the physical sectors thereof are close to each other (within the range of N sectors), the process of reading data from the physical sectors in which the data of the commands having the lowered priority should be written is continuously carried out over these physical sectors. It is thus possible to reduce the number of times that the seek operation is carried out. This advantage will now be described by referring to comparative examples illustrated in
As illustrated in
In the above description of the first embodiment, the commands are combined in the case where the physical sectors in which the data of low priority are written are located in the range of N sectors, and the read process in the read modify write process is continuously carried out by the combined commands. However, the present embodiment is limited to the above but may be varied. For example, commands may be combined even when physical sectors in which data of low priority are written are not in the range of N sectors, so that the read process in the read modify write process for the data can be carried out continuously.
The embodiment is not limited to the case where it is determined whether the continuous read process should be carried out on the basis of the number of sectors, but may be varied so as to employ another reference for determination. For example, it may be determined whether physical sectors in which data of low priority are written are in the range of an identical track. It may be determined whether physical sectors in which data of low priority are written are in the range of an adjacent track in addition to the identical track.
A description will now be given, with reference to
A description will now be given, with reference to
First, a process of queuing write data stored in the buffer memory 98 will now be described with reference to
At step S102 illustrated in
At subsequent step S104, the dividing part 73 divides write data W1 into a part W1-e that exceeds the size of the physical sector and another part W1-ne equal in size to the physical sector. The part W1-e may be referred to as excessive part or fraction part. The excessive part W1-e needs the read modify write process, and the remaining W1-ne does not need the read modify write process. The command is divided into two commands respectively associated with the data part W1-ne and the data part W1-e.
At step S106, the dividing part 73 queues the commands related to the data parts W1-e and W1-ne. In this queuing, the dividing part 73 lowers the priority of the data part W1-e.
When the answer of step S102 is NO, at step S108, the determining part 72 determines whether the write data has a fraction, that is, whether the size of the write data is smaller than that of the physical sector of the magnetic disk 12. When the answer of step S108 is YES, the process proceeds to step S110 at which the order changing part 74 lowers the priority of the write data (command). At subsequent step S112, the determining part 72 queues the write data (command). When the answer of step S108 is NO, the determining part 72 queues the write data without lowering the priority.
Further, according to the present embodiment, in parallel with the above-described queuing, a write process illustrated in
When the answer of step S120 is NO, at step S28, the data are written in the physical sector without any modification.
According to the second embodiment, it is possible to realize the efficient read modify write process like the first embodiment and to further improve the efficiency by lowering the priority of only a data part necessary for the read modify write process when write data of a size greater than that of the physical sector is supplied from the host computer.
A third embodiment will now be described with reference to
As illustrated in
The flowchart of
At subsequent step S206, the moving part 75 moves the data W1-e, W2-e and W3-e that needs the read modify write process to a specific area dedicated to the read-modify-write process. As illustrated in
At step S208, in association with the movement of the data to the read-modify-write dedicated area, the accessing part 78 or the MPU 84 illustrated in
When it is determined, at step S202, that there is no data that needs the read modify write process and the answer of step S204 is thus NO, the process illustrated in
According to the third embodiment, the moving part 75 moves the data that needs the read modify write process to the continuous area of the buffer memory 98, there is no possibility that data that needs the read modify write process may be intermittently stored in the buffer memory 98. It is thus possible to secure the continuous buffer area for subsequent data, as illustrated in
A fourth embodiment will now be described with reference to
At step S14 in
At step S306, the processing part 76 executes the read process in the read modify write process in accordance with the command queue. This read process differs from that in the first through third embodiments in that only the fractional sectors are read. That is, the overall physical sector is not read.
At step S308, the processing part 76 executes the modify process. At subsequent step S310, the processing part 76 rearranges the command queue on the basis of the leading address of the write data (obtained by combining data to be written and the fractional sectors). At step S312, the processing part 76 executes the write process in accordance with the rearranged command queue obtained at step S310.
According to the fourth embodiment, the command queue is rearranged on the basis of the addresses of the fractional sectors prior to the read process, and is rearranged on the basis of the address of data to be written prior to the write process. It is thus possible to execute the read process and the write process at the minimum movement distance (seek distance) regardless of whether the fractional sectors are located in a front portion of the physical sector or a rear portion thereof and to thus realize highly efficient read modify write process.
The fourth embodiment is not limited to the configuration in which only the fractional sectors are read but may include another configuration in sectors leading to and lagging behind the fractional sectors of concern.
A fifth embodiment will now be described with reference to
As illustrated in
When the answer of step S404 is NO, the process proceeds to step S410 at which the determining part 72 determines whether the size of the write data is smaller than that of the physical sector. When the answer of step S410 is YES, the determining part 72 assumes the write data as Wx-e and adds the command for the write data to the command queue at step S408. When the answer of step S410 is NO, the determining part 72 assumes the write data as Wx-ne and adds the command for the write data to the command queue at step S412.
When the answer of step S402 is NO, the determining part 72 assumes the write data as Wx-ne, and adds the command for the write data to the command queue. The reason why the write data is assumed as Wx-ne for commands other than the NCQ command is that the commands other than the NCQ command are not allowed to divide data and receive divided data and to be handled in the same manner as that for the NCQ command.
A description will now be given, with reference to
At step S420 in
When the answer of either step S420 or S422 is NO, the request part 77 requests the host computer 82 to send data without rearranging the command queue. More particularly, the host computer 82 is requested to send data when there is only a command involved in data Wx-e that is not needed to perform the read modify write process or when there is only a command involved in data Wx-ne that is needed to perform the read modify write process.
According to the fifth embodiment, the request for sending data that is not needed to perform the read modify write process is preferentially handled. Thus, the data that is not needed to perform the read modify write process is preferentially written in the magnetic disk 12 and the request for sending data needed to perform the read modify write process is issued later at a time. It is thus possible to reduce the quantity of data simultaneously stored in the buffer memory 98 and to efficiently utilize the buffer memory 98.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various change, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2008-249619 | Sep 2008 | JP | national |