Embodiments described herein relate generally to a storage device, a storage system, and a background processing execution method.
A technique of providing a plurality of storage devices (for example, hard disk drives) and distributing and storing data in the storage devices is known. This technique is called RAID (Redundant Array of Inexpensive Disks), and reliability improvement is implemented by writing data received from a host device into two or more storage devices and managing the data. A system to which this technique is applied includes a plurality of storage devices and a control device (controller) which executes data relay and the like between the respective storage devices and the host device. Upon receiving an order from the control device, each storage device executes processing indicated by contents of the order, for example, data write processing or read processing.
In processing executed by the storage device, processing executed autonomously at predetermined timing (hereafter this processing is referred to as background processing) exists besides processing executed when ordered by another device. For example, in case of a hard disk drive (hereafter referred to as HDD), there are processing executed to store disk statistics information, LBA (Logical Block Addressing) address management information, cache data, and the like onto a disk, and processing executed to check and rewrite user data for the quality keeping of a user data area (BMS (Background Media Scan), an ATI (Adjacent Track Interference) countermeasure, and write off track retry), as background processing involving disk access. In a case where the HDD executes these kinds of background processing, the start timing was determined by the HDD alone in the conventional system.
If a request involving access to data, such as data reading or data writing, is received from the host device in a configuration in which data is distributed to and recorded in a plurality of storage devices, such as the RAID, therefore, data access processing is delayed by a cause of the background processing and data access performance of the whole system was degraded. In other words, if a request involving access to data is received while a storage device is executing background processing involving access to a storage medium, it is necessary to execute data access processing depending upon the request after finishing the background processing and a delay is caused until data access processing is started. In the conventional system in which a plurality of storage devices execute background processing at unique timing, the possibility that some storage device will be executing background processing at a time when a request of data access processing is received is high. As a result, there is a problem that delays are caused frequently and the data access performance of the whole system is degraded.
Furthermore, there is a case where the plurality of storage devices execute background processing in a concentrative manner during a certain period. Or conversely, there is a case where any storage devices do not execute background processing. There is also a problem that variation occurs in the command processing performance of the system and the command processing function of the system becomes unstable.
According to an embodiment, a storage device includes a storage medium and a controller. The controller manages a local clock, adjusts the local clock in accordance with an order for adjustment of the managed local clock, and executes background processing involving access to the storage medium on the basis of the adjusted local clock.
Hereafter, a storage device, a storage system, and a background processing execution method according to each of embodiments will be described in detail with reference to accompanying drawings. However, the present invention is not limited to the embodiments.
In the storage system illustrated in
By the way, in the present embodiment, a case where the storage device 2 is a hard disk drive will be described. However, the storage device may be, for example, an SSD (Solid State Drive).
In the HDC 21, the I/F control module 211 executes delivery of various commands and data with the controller 1. The command control module 212 transmits/receives various commands to/from the command processing module 10 in the controller 1, and executes processing according to a command received from the controller 1. For example, if a command (data write command) ordering data writing is received, the command control module 212 writes data received together with the data write command onto the disk 23 via the disk control module 214. If background processing involving access to the disk 23 is being executed at a time when a command ordering processing involving access to the disk 23, however, the command control module 212 executes the processing ordered by the command after waiting for end of the background processing. The buffer control module 213 executes data writing, reading and erasing with respect to the buffer 22. The disk control module 214 executes data writing, reading and erasing with respect to the disk 23 in accordance with an order from the command control module 212 or the background processing control module 215. The background processing control module 215 controls background processing on the basis of the local clock managed by the timing module 20. Furthermore, if the background processing control module 215 is ordered to adjust the local clock by the controller 1, the background processing control module 215 adjusts the local clock managed by the timing module 20.
The MPU 24 controls the control modules in the HDC 21 by developing a program stored in the ROM 25 into the RAM 26 and executing the program. The ROM 25 retains programs and various kinds of information for operating the storage device 2. The RAM 26 is used as a developing memory and a working memory of the programs and information stored in the ROM 25.
The control programs 261 include an I/F control program configured to implement the I/F control module 211, a command control program configured to implement the command control module 212, a buffer control program configured to implement the buffer control module 213, a disk control program configured to implement the disk control module 214, and a background processing control program configured to implement the background processing control module 215. The control information 262 includes a time table in which background processing start timing information described later is registered.
Upon determining that the local clocks in the storage devices 2 are in a state in which synchronization is not attained, in the storage system configured to include a plurality of storage devices 2 each having the above-described configuration, the controller 1 issues a command to order each storage device 2 to adjust the local clock and causes the local clocks of the storage devices 2 to synchronize with each other. Each storage device 2 executes background processing in accordance with the local clock and preset schedule. Upon receiving a command from the controller 1, the storage device 2 executes processing indicated by the command. For example, upon receiving a data write command, the storage device 2 stores data received from the controller 1 into a specified area on the disk 23. Upon receiving an order (command) to adjust the local clock, the storage device 2 adjusts the local clock managed by the timing module 20. In a case where the storage device receives a command while background processing is being executed, the storage device 2 executes processing corresponding to the command after the background processing is finished, depending upon a kind of the background processing under execution. Specifically, in a case where the storage device 2 receives a command ordering processing (such as data reading or data writing) involving access to the disk 23 in a state in which the storage device 2 is executing background processing involving access to the disk 23, the storage device 2 executes processing corresponding to the received command after finishing the background processing under execution.
Operation of the background processing control module 215 in the storage device 2 will now be described with reference to
If the power supply is turned on, the background processing control module 215 first refers to a time table included in the control information 262, and acquires background processing start timing information (step S1). Here, the background processing start timing information is information which indicates execution times respectively of a plurality of kinds of background processing. For example, identification information of background processing to be executed and execution time are registered in an associated state in the time table. An execution repetition period may be registered instead of the execution time. If time indicated by the background processing start timing information is reached, the background processing control module 215 executes the corresponding background processing. The background processing is, for example, processing of storing disk statistics information, LBA address management information, cache data and the like on a disk, processing of checking or rewriting user data in order to maintain the quality of the user data area, and the like.
Upon acquiring the background processing start timing information, the background processing control module 215 then determines whether a clock adjustment ordering command is received (step S2). If the adjustment ordering command is received (step S2: Yes), the background processing control module 215 adjusts the local clock in accordance with contents of the order (step S3). In other words, the background processing control module 215 orders the timing module 20 to adjust the local clock. Unless the adjustment ordering command is received (step S2: No), the background processing control module 215 determines whether the background processing start time is reached on the basis of the background processing start timing information and the local clock (step S4). If the background processing start time is reached (step S4: Yes), the background processing control module 215 starts corresponding background processing (step S5). At this time, it is made possible for the command control module 212 to know that processing is being executed by, for example, setting a flag to indicate that background processing is being executed. By the way, in a case where background processing cannot be started for the reason, for example, that different processing involving access to the disk 23 is being executed, for example, the background processing is started after the processing under execution completes or start of the background processing is suspended (the background processing is not executed), according to the degree of importance of the background processing. On the other hand, in a case where the background processing start time is not reached (step S4: No), the background processing control module 215 returns to the step S2 and determines whether the clock adjustment ordering command is received.
As described heretofore, the background processing control module 215 monitors reception of the clock adjustment ordering command and arrival of the background processing start timing. And in a case where the clock adjustment ordering command is received, the background processing control module 215 adjusts the local clock. In a case where the background processing start timing is detected, the background processing control module 215 executes background processing.
Operation of the storage system according to the present embodiment will now be described with reference to
Upon detecting that the power supply of the storage system is turned on (step S11) in the operation according to the sequence illustrated in
In a case where the controller 1 and the storage devices 2A and 2B are SCSI (Small Computer System Interface)-connected, the controller 1 can give a clock adjustment order to the storage devices 2A and 2B by utilizing SET TIMESTAMP command defined as an SCSI command. Furthermore, in a case where the controller 1 and the storage devices 2A and 2B are SAS (Serial Attached SCSI)-connected, the controller 1 can give a clock adjustment order to the storage devices 2A and 2B by utilizing BROADCAST primitive defined as an SCSI command. It is also possible to newly define a command or a primitive for clock adjustment ordering and use it.
Referring back to
By the way, the clock adjustment order (the steps S12A and S12B) and the start operation (the steps S13A to S15A and the steps S13B to S15B) may be reversed in execution order.
Upon detecting the start completion of the storage devices 2A and 2B, the controller 1 then executes data reading or data writing in accordance with a request from the host device 3 (steps S16A to S18A and steps S16B to S18B, steps S20A to S22A and steps S20B to S22B). Although an example of data reading is illustrated in
In the operation example illustrated in
In a case where the local clocks synchronize with each other, the storage devices 2A and 2B retaining background processing start timing information having the same contents execute background processing (illustrated as BG processing in
On the other hand, in a case where the local clocks do not synchronize with each other, two storage devices (represented as storage devices 2C and 2D) execute background processing at different timing as illustrated in
In a case where the local clocks in the storage devices do not synchronize with each other in this way, the number of command processing which can be executed in 18 clocks becomes nine commands (see
In the storage system in the present embodiment, the storage devices 2 retain the background processing start timing information having the same contents as described heretofore. Upon receiving the local clock adjustment order, the storage devices 2 adjust the local clocks. As a result, it becomes possible for each of the storage devices 2 to execute background processing at the same timing as other storage devices 2, and processing delays caused by background processing in the storage devices 2 can be reduced.
By the way, the background processing for which the storage devices 2 align start timing may be restricted to background processing that remarkably delay start timing of processing requested by a command (processing requested by the controller 1). For example, (1) BMS (Background Media Scan), (2) ATI (Adjacent Track Interference) countermeasure processing, (3) log save (internal log information update), and (4) media cache update may be specified as background processing to be synchronized, and the storage devices 2 may retain start timing of these kinds of background processing as the background processing start timing information.
In the foregoing description, control for synchronizing the local clocks in the storage devices 2 (the steps S12A and S12B in
In the first embodiment, the controller 1 orders the storage devices 2 in the system to execute clock adjustment, and thereby causes local clocks in the storage devices 2 to synchronize with each other (see
For example, in case of a system configuration in which the storage devices 2 can communicate with each other, control illustrated in
In the operation illustrated in
In other words, in the storage system according to the present second embodiment, operation is the same as that in the first embodiment except that one storage device 2 orders other storage devices 2 to execute clock adjustment. In a case where the local clocks are adjusted according to a procedure in the present embodiment, effects similar to those in the first embodiment can also be obtained.
In the foregoing description, the processing (the step S31 in
In the first and second embodiments, the local clocks are adjusted when the power supply of the storage system is turned on and the storage devices 2 are started. On the other hand, in the present embodiment, a case where the local clocks are adjusted at arbitrary timing after starting will be described. Configurations of the storage system and the storage devices are the same as those in the first embodiment.
In a state in which there is a deviation between the local clocks, background processing in the storage device 2A and background processing in the storage device 2B are executed at different timing (steps S41A and S41B). At a time when, in such a state, the controller 1 gives an order of processing (for example, data reading) that needs disk access, one of the storage devices 2 is executing background processing. As a result, there is a possibility that processing of the whole system will delay. In other words, if the controller 1 orders the storage devices 2A and 2B to read data in a state in which the storage device 2A is not executing background processing and the storage device 2B is executing background processing as in the example illustrated in
If a difference between the data output timing from the storage device 2A and the data output timing from the storage device 2B is at least a predetermined value, the controller 1 determines that there is a deviation between the local clock in the storage device 2A and the local clock in the storage device 2B (step S45), and orders the storage devices 2A and 2B to execute clock adjustment (steps S46A and S46B). In the clock adjustment order, for example, the storage devices 2A and 2B are notified of the time managed by the controller 1 and the storage devices 2A and 2B are ordered to set the local clocks to the notified time, in the same way as the steps S12A and S12B illustrated in
Upon detecting occurrence of a deviation between the local clocks in the storage devices 2 in the storage system in the present embodiment, the controller 1 orders the storage devices 2 to execute local clock adjustment in this way. In a case where a deviation occurs in the local clocks in the storage devices 2 because of, for example, elapse of a long time after the local clocks are adjusted once, therefore, resynchronization can also be attained.
The present embodiment can be combined with the first embodiment or the second embodiment.
While certain embodiments 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 embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments 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 based upon and claims the benefit of priority from U.S. Provisional Application No. 61/847435, filed on Jul. 17, 2013; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61847435 | Jul 2013 | US |