1. Field
One embodiment of the invention relates to a storage device, a storage control device, and a control method, which use a magnetic disk and a non-volatile memory as storage media.
2. Description of the Related Art
In recent years, with increase in storage capacities of flash memories, which are non-volatile memories and reduction in costs, hybrid storage devices have been proposed in which flash memories are provided as storage media in magnetic disk devices (see Japanese Patent Application Publication (KOKAI) Nos. 2005-209119 and 2003-233529).
In such a hybrid storage device, since read and write access times for a flash memory are shorter than those for a magnetic disk, random data that need to be processed at a high speed by an OS of a host are stored in the non-volatile memory and stream data that need to be continuously processed are stored in a magnetic disk.
Upon receiving at the hybrid storage device from the host a read command directed to the non-volatile memory, the firmware of the device controls data transfer as illustrated in a timing chart of
As such, for the conventional read request with respect to the nonvolatile memory, the reading speed from the non-volatile memory is different from the transfer speed to the host, and thus the data are asynchronously transferred via the buffer memory.
As illustrated at (A) in
Sometimes, the data stored in the non-volatile memory may be written back to the magnetic disk. The write-back operation is performed according to a write-back command from the host or a write-back request by the firmware to reserve a free space region in the non-volatile memory.
As illustrated in
In the write-back operation, since a reading speed from the non-volatile memory is different from a writing speed to the magnetic disk, data are asynchronously transferred via the buffer memory.
However, in such a conventional hybrid storage device, data read from a non-volatile memory are transferred to a host via a buffer memory. Therefore, it takes more time to transfer the read data to the host for the transfer via the buffer memory.
Further, data are written back from the non-volatile memory to the magnetic disk via the buffer memory. Therefore, it takes more time to transfer the write-back data to the magnetic disk for the transfer via the buffer memory.
A general architecture that implements the various features of the invention will now be described with reference to the drawings. The drawings and the associated descriptions are provided to illustrate embodiments of the invention and not to limit the scope of the invention.
Various embodiments according to the invention will be described hereinafter with reference to the accompanying drawings. In general, according to one embodiment of the invention, a storage device comprises: a head actuator configured to move a head to an arbitrary position on a disk medium; a disk recording/reproducing module configured to record or reproduce data to or from the disk medium using the head; a non-volatile memory controller configured to write or read information to or from a non-volatile memory; a buffer controller configured to write or read information to or from a buffer memory; an upper interface controller configured to transmit and receive a command and data to or from an upper device; a transfer path switching module configured to switch data transfer paths among the disk recording/reproducing module, the non-volatile memory controller, and the upper interface controller; and an access controller configured to control the transfer path switching module to transfer data read from the non-volatile memory to the upper device concurrently with transferring and storing the read data in a cache region of the buffer memory, upon receiving from the upper device a data read command to read the data from the non-volatile memory.
According to another embodiment of the invention, a storage control device comprises: a disk recording/reproducing module configured to record or reproduce data to or from a disk medium using a head; a non-volatile memory controller configured to write or read information to or from a non-volatile memory; a buffer controller configured to write or read information to or from a buffer memory; an upper interface controller configured to transmit and receive a command and data to or from an upper device; a transfer path switching module configured to switch data transfer paths among the disk recording/reproducing module, the non-volatile memory controller, and the upper interface controller; and an access controller configured to control the transfer path switching module to transfer data read from the non-volatile memory to the upper device concurrently with transferring and storing the read data in a cache region of the buffer memory, upon receiving from the upper device a data read command to read the data from the non-volatile memory.
According to still another embodiment of the invention, a method controls a storage device that comprises: a head actuator configured to move a head to an arbitrary position on a disk medium; a disk recording/reproducing module configured to record or reproduce data to or from the disk medium using the head; a non-volatile memory controller configured to write or read information to or from a non-volatile memory; a buffer controller configured to write or read information to or from a buffer memory; an upper interface controller configured to transmit and receive a command and data to or from an upper device; and a transfer path switching module configured to switch data transfer paths among the disk recording/reproducing module, the non-volatile memory controller, and the upper interface controller. The method comprises: controlling the transfer path switching module to transfer data read from the non-volatile memory to the upper device concurrently with transferring and storing the read data in a cache region of the buffer memory, upon receiving from the upper device a data read command to read the data from the non-volatile memory.
According to still another embodiment of the invention, a controller is provided for a storage device that comprises at least: a head actuator configured to move a head to an arbitrary position on a disk medium; a disk recording/reproducing module configured to record or reproduce data to or from the disk medium using the head; a non-volatile memory controller configured to write or read information to or from a non-volatile memory; a buffer controller configured to write or read information to or from a buffer memory; and an upper interface controller configured to transmit and receive a command and data to or from an upper device. The controller comprises: a transfer path switching controller configured to perform control of switching data transfer paths among the disk recording/reproducing module, the non-volatile memory controller, and the upper interface controller; and an access controller configured to control the transfer path switching module to transfer data read from the non-volatile memory to the upper device concurrently with transferring and storing the read data in a cache region of the buffer memory, upon receiving from the upper device a data read command to read the data from the non-volatile memory.
The disk enclosure 14 is provided with a spindle motor 18. Magnetic disks 24-1 and 24-2 are attached to a rotating shaft of the spindle motor 18 and are rotated at a constant speed of, for example, 4200 rpm.
In addition, the disk enclosure 14 is provided with a voice coil motor 20. The voice coil motor 20 supports heads 26-1 to 26-4 at the leading end of an arm of a head actuator 22 and determines the positions of the heads relative to the recording surfaces of the magnetic disks 24-1 and 24-2.
The heads 26-1 to 26-4 are hybrid heads in which a recording element and a read element are integrated with each other. An in-plane recording element or a vertical magnetic recording element is used as the recording element. When the vertical magnetic recording element is used, vertical recording media each having a recording layer and a soft magnetic underlying layer are used as the magnetic disks 24-1 and 24-2. A GMR element or a TMR element is used as the read element.
The heads 26-1 to 26-4 are connected to a head IC 28 through signal lines, and the head IC 28 selects one of the heads in response to a head selection signal and performs a write or read operation based on a write command (write request) or a read command (read request) from the host 12. The head IC 28 comprises a write drive provided for a write system and a pre-amplifier provided for a read system.
The control board 16 is provided with an MPU 30 and reads a control program and control data from a RAM through a bus of the MPU 30. The control board 16 is also provided with a memory 34 and a motor driving controller 35 that controls the driving of the spindle motor 18 and the voice coil motor 20.
A non-volatile memory 38 is connected to the MPU 30 through a memory interface 42 serving as a memory controller. Similarly, a buffer memory 40 is connected to the MPU 30 through a memory interface 56 serving as a memory controller.
In this embodiment, firmware, which is a control program of the magnetic disk device 10 executed by the MPU 30, is recorded on the non-volatile memory 38 and data are also stored in the non-volatile memory 38. Therefore, the magnetic disk device 10 according to this embodiment is a hybrid storage device that comprises the non-volatile memory 38, serving as a data storage destination, in addition to the magnetic disks 24-1 and 24-2.
For example, a flash memory is used as the non-volatile memory 38. Data are written to or read from the flash memory in units of a predetermined data size, for example, in units of 8-kilobyte or 64-kilobyte block.
A RAM is used as the buffer memory 40, and data are written to or read from the buffer memory 40 in units of a predetermined burst length.
The non-volatile memory 38 used to store data in this embodiment actually requires a storage capacity of about 1 GB. In contrast, the buffer memory 40 requires a storage capacity of, for example, about 64 MB.
A sector buffer 60, a hard disk controller 62, and a read channel 64 are provided for the bus of the MPU 30 such that the heads 26-1 to 26-4 record or reproduce data on or from the magnetic disks 24-1 and 24-2. Circuit modules from the sector buffer 60 to the head IC 28 form a disk recording/reproducing module.
A host interface controller 50, serving as an upper interface controller, is provided between the host 12 and the bus of the MPU 30 and transmits commands and data therebetween. For example, a serial ATA interface is used as the host interface controller 50.
In this embodiment, transfer path switching modules for switching data transfer paths are provided between the disk recording/reproducing module comprising the head IC 28, and the host interface controller 50 close to the host 12, the memory interface 42 close to the non-volatile memory 38, the memory interface 56 close to the buffer memory 40, and the sector buffer 60 close to the heads 26-1 to 26-4 that record or reproduce data on or from the magnetic disks 24-1 and 24-2.
In the transfer path switching module, a branch path controller 46 and a FIFO (first FIFO) 48 are provided from the memory interface 42 close to the non-volatile memory 38, and a FIFO (second FIFO) 52 and an arbiter 54 are provided between the branch path controller 46 and the memory interface 56 close to the buffer memory 40. The FIFO 48 and the sector buffer 60 are connected to the arbiter 54. The FIFO means a first-in-first-out memory.
The MPU 30 is provided with an access controller 65 that is implemented by reading firmware recorded on the non-volatile memory 38 to the memory 34 and executing the read firmware. The access controller 65 comprises the functions of a read processor 66, a write processor 68, a write-back processor 70, and a cache controller 72.
In this embodiment, the buffer memory 40 is provided with a primary cache 74, and the non-volatile memory 38 is provided with a secondary cache 73. Data read from the non-volatile memory 38 and data read from the magnetic disks 24-1 and 24-2 in response to a read request from the host 12 are stored in the primary cache 74 of the buffer memory 40. Then, when a read request to read the data is issued, write data are read from the buffer memory 40 by a cache hit of the primary cache 74 and the read data are transferred to the host 12.
Data that has been read from the magnetic disks 24-1 and 24-2, cached in the primary cache 74, and output from the primary cache 74 by LRU management are stored in the secondary cache 73 of the non-volatile memory 38.
When receiving a command to read data from the non-volatile memory 38, that is, a read command from the host 12, the read processor 66 provided in the MPU 30 according to this embodiment controls the branch path controller 46 (a transfer path switching control function) to transfer the data read from the non-volatile memory 38 by the memory interface 42 to the host 12 through the FIFO 48 and the host interface controller 50. In addition, the read processor 66 controls the branch path controller 46 to transfer the read data to the buffer memory 40 through the FIFO 52, the arbiter 54, and the memory interface 56, and stores the data in the primary cache 74.
The write speed of the FIFO 48 and the FIFO 52 provided on the branch side of the branch path controller 46 is sufficient higher than the read speed of the non-volatile memory 38. Therefore, the FIFO 48 and the FIFO 52 are maintained in an empty state all the time while data read from the non-volatile memory 38 are being transferred. Therefore, data are continuously read from the non-volatile memory 38 and is then processed in a first-out-manner. Then, the processed data are transferred from the FIFO 48 to the host interface controller 50 and from the FIFO 52 to the buffer memory 40 through the arbiter 54.
When one of the FIFO 48 and the FIFO 52 is out of the empty state due to a certain cause and stops its operation, the write operation on the other FIFO also stops.
In the FIFO 52 that transfers the read data to the buffer memory 40, since data are written to the buffer memory 40 in units of burst length, the storage capacity of the FIFO 52 may be at least twice the burst length of the buffer memory 40. In this case, it is possible to continuously transfer the data read from the non-volatile memory 38 to the buffer memory 40. In this way, the transmission of data from the host interface controller 50 to the host 12 through the FIFO 48 is not prevented.
When the read processor 66 provided in the MPU 30 stores the data read from the non-volatile memory 38 in the primary cache 74 of the buffer memory 40 and receives a command to re-read the same data from the non-volatile memory 38 from the host 12, the cache controller 72 provided in the MPU 30 determines that there is a cache hit with reference to management data of the primary cache 74. In this case, the read processor 66 reads the corresponding data from the primary cache 74 of the buffer memory 40, not the non-volatile memory 38, and transfers the data read from the primary cache 74 to the host 12 through the memory interface 56, the arbiter 54, the FIFO 48, and the host interface controller 50.
For the transfer of data from the non-volatile memory 38 to the host 12 by the hit of the primary cache 74 of the buffer memory 40, data are transferred to the host 12 through the FIFO 48 by the buffer memory 40 in units of burst length. Therefore, as long as the space of the FIFO 48 is more than the burst length, the buffer memory 40 repeatedly performs a process of continuously transferring the read data.
In the transfer of data from the primary cache 74 of the buffer memory 40 to the host, when the storage capacity of the FIFO 48 is at least twice the burst length, which is a read unit of the buffer memory 40, it is possible to transfer data at a maximum transfer rate without interrupting the reading of data from the buffer memory 40.
When the write-back processor 70 provided in the MPU 30 receives a write-back command to write back data from the non-volatile memory 38 to the magnetic disks 24-1 and 24-2, or when the cache controller 72 implemented by the firmware generates a write-back request to write back data from the non-volatile memory 38 to the magnetic disks 24-1 and 24-2, the cache controller 72 searches whether there are corresponding data in the primary cache 74 of the buffer memory 40. When there are corresponding data in the primary cache 74 and a cache hit occurs, the write-back processor 70 read data from the primary cache 74 and writes back the read data to the magnetic disks 24-1 and 24-2.
In the write-back operation of writing back data in the primary cache 74 of the buffer memory 40 to the magnetic disk, a write-back process through the buffer memory 40 in which data are read from the non-volatile memory 38 and is then stored in the buffer memory 40 and the data are read from the buffer memory 40 can reduce the process time.
In this embodiment, in some cases, the host 12 issues a command to store data of the secondary cache 73 of the non-volatile memory 38 in the magnetic disk as a write-back request to write back data from the non-volatile memory 38 to the magnetic disks 24-1 and 24-2.
In the write-back process of the host 12 that writes back data from the non-volatile memory 38 to the magnetic disk, when the host 12 writes data to the non-volatile memory 38, a PIN flag, which is a mark indicating the storage of data in the non-volatile memory 38, is set and stored.
The setting of the PIN flag to write data from the host 12 means that data are stored in the non-volatile memory 38. In this state, the host 12 can reset the PIN flag of the data in the non-volatile memory 38, if necessary.
When the PIN flag of the data stored in the non-volatile memory 38 is reset by the host 12, an operation of writing back the reset data to the magnetic disk is performed.
Therefore, when the host 12 resets the PIN flag of the data stored in the non-volatile memory 38, the write-back processor 70 of the MPU 30 performs a process of writing back the data of the non-volatile memory 38 having the reset PIN flag to the magnetic disk.
There is a write-back process performed by the cache controller 72 as the write-back process executed by the firmware of the magnetic disk device that writes backs the data of the non-volatile memory 38 to the magnetic disk.
In the write-back process performed by the cache controller 72, LRU (Least Recently Used) management is performed on the primary cache 74 of the buffer memory 40 and the secondary cache 73 of the non-volatile memory 38.
First, data of the primary cache 74 to be evicted by the LRU management are written back to the non-volatile memory 38. In this case, when write-back data are cache data of the magnetic disk, the data are written back to the secondary cache 73. When the write-back data are data of the non-volatile memory 38, the data are overwritten on the corresponding data of the non-volatile memory 38.
Data of the secondary cache 73 of the non-volatile memory 38 to be read by the LRU management are written back to the magnetic disks 24-1 and 24-2. In this case, the write-back processor 70 searches whether the data of the secondary cache 73 to be written back are stored in the primary cache 74 of the buffer memory 40. When a cache hit occurs, the write-back processor 70 writes back data from the primary cache 74 of the buffer memory 40 to the magnetic disk.
When the data of the secondary cache 73 are miss-hit by the primary cache 74, the data of the secondary cache 73 are transferred to the buffer memory 40 and is then stored therein. Then, the data are read from the buffer memory 40 and is written back to the magnetic disks 24-1 and 24-2.
When the host interface controller 50 receives a write command, which is a write request, from the host 12, the write processor 68 provided in the MPU 30 writes write data to the buffer memory 40 through the FIFO 48, the arbiter 54, and the memory interface 56, and then transfers and writes the data to the non-volatile memory 38 or the magnetic disks 24-1 and 24-2 designated by the write command.
In this case, when the write data are update data for the primary cache 74 of the buffer memory 40, the write data are overwritten on the data of the primary cache 74 to update the data. Therefore, the updated data are different from that of the non-volatile memory 38 or the magnetic disks 24-1 and 24-2. In this way, a write-back flag is set.
As such, when the data of the primary cache 74 is updated with the write data and the write-back flag is set, the cache controller 72 writes back the data of the primary cache 74 whose write-back flag is set to the non-volatile memory 38 or the magnetic disks 24-1 and 24-2 during the time for which there is no access request from the host 12 such that the data are identical to each other.
When the write command from the host 12 is for the magnetic disks 24-1 and 24-2 and there is a miss hit in the search operation of the primary cache 74 of the buffer memory 40, the secondary cache 73 of the non-volatile memory 38 is searched. When there is a cache hit in the secondary cache 73, the write data are transferred from the buffer memory 40 to the non-volatile memory 38 to update the corresponding data of the secondary cache 73.
In this case, similarly, the write-back flag of the updated data of the secondary cache 73 is set, and in an idle state, the write-back processor 70 reads the data of the secondary cache 73 whose write-back flag is set and writes backs the read data to the magnetic disks 24-1 and 24-2 through the buffer memory 40 such that the data of the secondary cache 73 is identical to the data of the magnetic disks 24-1 and 24-2.
As illustrated in
When receiving the load command 76, the memory interface 42 is operated such that data can be read from the non-volatile memory 38. Then, when an enable signal is obtained, a load command completion 77 is performed. When the load command completion 77 is performed, transfer data 78-11 is read from the non-volatile memory 38 and is then output to the memory interface 42.
The transfer data 78-11 output from the non-volatile memory 38 is input to the branch path controller 46, and is then branched to the FIFO 48 and the FIFO 52.
As illustrated in
At the same time, the transfer data 78-11 output from the branch path controller 46 is transferred as transfer data 78-21 to the host interface controller 50 through the FIFO 48, as illustrated in
As such, in this embodiment, the transfer data 78-11 read from the non-volatile memory 38 is simultaneously transferred to the buffer memory 40 and the host 12 in parallel. As illustrated in
That is, when receiving a read command 75 as the output of the host 12 in
When the transfer data 78-11 is read from the non-volatile memory 38 and is then output, the FIFO 48 is enabled, as illustrated in
Since the transmission speed of data written to or read from the FIFO 48 is higher than the read speed of the non-volatile memory 38, as illustrated in
The transfer data read from the FIFO 48 is continuously transferred to the host 12 as long as the host interface controller 50 inputs data to the FIFO 48, as illustrated in
Meanwhile, the transfer data 78-11 read from the non-volatile memory 38 is written to the FIFO 52 since the FIFO 52 illustrated in
When the transmission of the transfer data 78-11 from the non-volatile memory 38 to the host 12 and the buffer memory 40 is completed, a load command 76-2 corresponding to the next read command is completed (77-2). When there is the next read command, a load command 76-3 is issued. Then, the next transfer data are read from the non-volatile memory 38 and is then transferred to the host 12 and the buffer memory 40.
As illustrated in
When a cache hit occurs in the primary cache 74 in response to the re-read request 80 from the host 12 to the non-volatile memory 38, it is possible to reduce a process time corresponding to a period T, as compared to when transfer data 106-1 is read from the non-volatile memory 38 without any cache hit and is then transferred as transfer data 106-2 to the host 12, as represented by a dashed line.
In this case, the FIFO 48 receives initial transfer data with a burst length from the buffer memory 40, as illustrated in
At the same time, as illustrated in
The first half of
In the write-back process for the write-back request 84 illustrated in
As such, when a cache hit occurs in the primary cache 74 of the buffer memory 40 in response to a write-back request to write back the data read from the non-volatile memory 38 to the magnetic disk, it is possible to reduce a process time corresponding to the period T, as compared to the write process according to the related art in which transfer data 106-1 is read from the non-volatile memory 38 and is then stored as transfer data 106-2 in the buffer memory 40, and the stored data are read as transfer data 106-3 and is then written as transfer data 106-4 to the magnetic disk 24.
The first half of
The time for which the transfer data 78-31 is written to the buffer memory 40 is shorter than the time for which the transfer data 78-32 is written to the magnetic disk 24. Therefore, after the transfer data 78-31 is read from the buffer memory 40, an idle time occurs. Therefore, after the transfer data 78-32 is completely written to the magnetic disk 24, the next transfer data 78-41 is read from the buffer memory 40.
In this embodiment, at the read idle time between the transfer data 78-31 and the transfer data 78-41 from the buffer memory 40, another transfer data 92-11 is read from the non-volatile memory 38 and the read data are transferred as transfer data 92-11 from the FIFO 52 to the buffer memory 40 and is then written as transfer data 92-13 to the primary cache 74 of the buffer memory 40.
Specifically, when a write-back request 88 is issued, the load command 76-1 is issued to the non-volatile memory 38, as illustrated in
As the data written from the non-volatile memory 38 to the primary cache 74 of the buffer memory 40 during the read idle time of the buffer memory 40, data to be subjected to the MRU (Most Recently Used) management of the primary cache 74, that is, data of the non-volatile memory 38 subsequent to the latest data are read, transferred, and stored in the primary cache 74.
As such, during the idle time after the transfer data 78-31 is read from the buffer memory 40, the transfer data 92-13 that has been read and transferred from the non-volatile memory 38 is stored and the subsequent transfer data 78-41 is read and written as transfer data 78-42 to the magnetic disk 24.
In this case, during the next idle time, the load command 76-2 is issued to the non-volatile memory 38 such that data can be read therefrom, and issuance of the load command is completed (77-2). Then, transfer data 92-21 is read and the read data are written as transfer data 92-23 to the primary cache 74 of the buffer memory 40.
As such, when data are written back from the non-volatile memory 38 to the magnetic disk 24 and there is a cache hit in the buffer memory 40, during the buffer idle time in the reading and transmission of data from the buffer memory 40 to the magnetic disk 24, it is possible to transfer another data item read from the non-volatile memory 38 to the buffer memory 40 and store the data item as prefetch cache data in the primary cache 74. In addition, it is possible to make the cache data of the primary cache 74 provided in the buffer memory 40 in a data state in which a cache hit occurs easily in response to an access request from the host. Therefore, a cache hit is more likely to occur in the primary cache 74. As a result, it is possible to improve the overall access performance of a magnetic disk device.
In
Then, in S4, the magnetic disk device 10 checks whether a command is received from the host 12 and proceeds to S5 to receive a command. When it is determined in S5 that a write command is received, the magnetic disk device 10 proceeds to S6 and performs a write process.
When it is determined in S7 that a read command is received, the magnetic disk device 10 proceeds to S8 and performs a read process. When it is determined in S9 that a write-back command is received, the magnetic disk device 10 proceeds to S11 and performs a write-back process.
When it is determined in S10 that the access controller 65, which is the firmware of the magnetic disk device, issues a write-back request, the magnetic disk device 10 performs the write-back process in S11. S4 to S11 are repeatedly performed until a stop instruction to log off the host 12 is issued in S12.
In
Then, in S102, the cache controller 72 searches whether there is corresponding data in the primary cache 74 based on the management data of the primary cache 74 in the buffer memory 40.
If it is determined in S103 that there is a cache hit in the primary cache 74, in S104, the write data received from the host 12 is overwritten on the corresponding data of the primary cache 74 to update the data. For the data update of the primary cache 74, the write-back flag of the updated data are set.
On the other hand, if it is determined in S103 that there is a cache miss hit, the process proceeds to S105 to check whether data are written to the non-volatile memory 38. When a write destination is the non-volatile memory, write data are read from the buffer memory 40 and is then written to the non-volatile memory 38 through the arbiter 54, the FIFO 52, the branch path controller 46, and the memory interface 42 (S106).
In this case, the cache controller 72 searches whether there is corresponding data in the secondary cache 73 of the non-volatile memory 38. When there is a cache hit in the secondary cache 73, the cache controller 72 overwrites the write data transferred from the buffer memory 40 on the data of the secondary cache 73 to update the data, and sets the write-back flag to the updated data. When there is a cache miss hit in the secondary cache 73, the write data are written in an empty region of the non-volatile memory 38.
When the write destination is not the non-volatile memory 38 in S105, it is determined in S107 whether data are written to the magnetic disk. In S108, the write data are read from the buffer memory 40, and the read data are transmitted to the sector buffer 60 through the arbiter 54. Then, the data are transmitted to the read channel 64 through the hard disk controller 62, and the read channel 64 modulates the data. The modulated data are transmitted to the head 26-1 that has been selected by the head IC 28, and the head 26-1 writes the write data to a target track of the magnetic disk 24-1.
If it is determined in S202 that there is a cache hit in the primary cache 74, in S203, the read processor 66 reads data from the primary cache 74 and transmits the read data to the host interface controller 50 through the arbiter 54 and the FIFO 48. Then, the host interface controller 50 transfers the data to the host 12.
On the other hand, if it is determined in S202 that there is a cache miss hit, the read processor 66 proceeds to S204 and checks whether there is corresponding data in the non-volatile memory 38. If it is determined that there is corresponding data in the non-volatile memory 38, the read processor 66 proceeds to S205. Then, the read processor 66 reads the corresponding data from the non-volatile memory 38 and transmits the read data to the host interface controller 50 through the branch path controller 46 and the FIFO 48. The host interface controller 50 transfers the data to the host 12.
At the same time, the data are transferred from the branch path controller 46 to the buffer memory 40 through the FIFO 52 and the arbiter 54 and is then written to the primary cache 74 (S206).
If it is determined in S204 that there is no corresponding data in the non-volatile memory (miss hit) and it is determined in S207 that there is the corresponding data in the magnetic disk, in S208, the data are read from the magnetic disk and is then written to the buffer memory 40.
Then, in S209, data are read from the buffer memory 40 and the read data are transferred to the host interface controller 50 through the arbiter 54 and the FIFO 48. Then, the host interface controller 50 transfers the data to the host 12. In S210, the data transferred to the buffer memory 40 is written to the primary cache 74.
In
Then, if it is determined in S303 that there is corresponding data in the primary cache 74 (cache hit), in S304, the data are read from the primary cache 74 and the read data are transferred and written to the corresponding magnetic disk.
In the write-back process in which data are read from the primary cache 74 of the buffer memory 40 and the read data are transferred and written to the magnetic disk, as illustrated in the timing chart of
If it is determined in S303 that there is no data to be written back from the non-volatile memory to the magnetic disk in the primary cache 74 (cache miss hit), in S306, data are read from the non-volatile memory 38 and the read data are transferred and written to the buffer memory 40. Then, in S307, the data are read from the buffer memory 40 and the read data are transferred and written to the magnetic disk.
If it is determined in S308 that there is a write-back request or command to write back data from the primary cache 74 of the buffer memory 40 to the non-volatile memory 38, that is, there is a write-back request or command by cache eviction from the primary cache 74 by LRU management, in S309, data are read from the primary cache 74 and is then transferred to the non-volatile memory 38. Then, the data are written to the non-volatile memory 38.
The write-back operation of writing back data from the buffer memory 40 to the non-volatile memory 38 comprises an operation of overwriting data read from the primary cache 74 on the data stored in the non-volatile memory 38 and an operation of overwriting data read from the primary cache 74 on the data stored in the secondary cache 73 of the non-volatile memory 38.
Since the original data of the data stored in the secondary cache 73 is recorded on the magnetic disk, the write-back flag of the updated data are set by the writing-back of data to the secondary cache 73.
In
If it is determined in S406 that there is a load request, in S407, the access controller 65 issues a load command to the memory interface 42. If it is determined in S408 that a read operation is enabled, in S409, issuance of the load command is completed.
If it is determined in S410 that there is a subsequent load request, the access controller 65 repeatedly performs the process after S407. S401 to S410 are repeatedly performed until an instruction to log off the host 12 is issued in S411.
The invention also provides a firmware program serving as the access controller of the MPU 30 illustrated in
The invention also provides a controller of a storage device. The controller of the storage device corresponds to a control circuit module 36 according to the embodiment illustrated in
In this embodiment, the control circuit module 36 is configured by one LSI. However, the hard disk controller and the read channel may be configured by separate LSIs, and the controller of the storage device may be composed of a control circuit comprising at least an MPU.
In addition, in this embodiment, the primary cache 74 is provided in the buffer memory 40. Therefore, when the host 12 is logged off and the magnetic disk device 10 is turned off, the primary cache 74 is erased.
A process of turning off power is performed after a write-back process is completed which writes back the data of the primary cache 74 whose write-back flag is set by the cache controller 72 to the corresponding data of the non-volatile memory 38 and the corresponding data of the secondary cache 73 provided in the non-volatile memory 38.
In this way, even when the primary cache 74 is provided in the buffer memory 40, which is a volatile memory, it is possible to prevent the damage of cache data in the primary cache 74 when power is turned off.
According to an embodiment of the invention, upon a read request from a host with respect to a nonvolatile memory, data read from the nonvolatile memory are transferred to the host concurrently with transferring of the read data to a buffer memory to be cached. Therefore, it is possible to transfer the data to the host without transferring the data via a buffer memory and thus to shorten the time to carry out the data transfer.
Further, since it is possible to cache the data to the buffer memory concurrently with the data transfer to the host by the reading from the nonvolatile memory, upon a subsequent read request for the same data with respect to the nonvolatile memory, it is possible to transfer the data from the buffer memory to the host and thus shorten the time to carry out the data transfer.
Further, upon generation of a request to write back from the nonvolatile memory to a disk medium, by transferring and writing back the data cached in the buffer memory to the disk medium, it is possible to shorten the time for the write-back as compared with the writing back to the disk medium from the nonvolatile memory via the buffer memory.
Further, if there is a request to write back from the nonvolatile memory to the disk medium, and the data are to be transferred from the buffer memory to the disk medium, the writing speed to the disk medium is slower than the reading speed from the buffer memory and thus a read idle time is generated in the buffer memory. By utilizing this idle time to read data that have not been cached from the nonvolatile memory and prefetch the read data to a cache, it is possible to increase a cache hit rate in the buffer memory for the data in the nonvolatile memory, and thus to shorten the access time for the overall storage device and improve the processing performance.
Various modifications and changes of the invention can be made without departing from the scope and spirit of the invention, and the invention is not limited to the numerical values of the above-described embodiment.
The various modules of the systems described herein can be implemented as software applications, hardware and/or software modules, or components on one or more computers, such as servers. While the various modules are illustrated separately, they may share some or all of the same underlying logic or code.
While certain embodiments of the inventions have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel methods and systems described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the methods and systems described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is a continuation of PCT international application Ser. No. PCT/JP2007/061606 filed on Jun. 8, 2007 which designates the United States, the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP2007/061606 | Jun 2007 | US |
Child | 12633699 | US |