US7539820B2 - Disk device and control method for cache - Google Patents

Disk device and control method for cache Download PDF

Info

Publication number
US7539820B2
US7539820B2 US11/109,922 US10992205A US7539820B2 US 7539820 B2 US7539820 B2 US 7539820B2 US 10992205 A US10992205 A US 10992205A US 7539820 B2 US7539820 B2 US 7539820B2
Authority
US
United States
Prior art keywords
command
cache
data
cache area
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related, expires
Application number
US11/109,922
Other versions
US20050235108A1 (en
Inventor
Yukie Hiratsuka
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HGST Netherlands BV
Original Assignee
Hitachi Global Storage Technologies Netherlands BV
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Global Storage Technologies Netherlands BV filed Critical Hitachi Global Storage Technologies Netherlands BV
Assigned to HITACHI GLOBAL STORAGE TECHNOLOGIES NETHERLANDS B.V. reassignment HITACHI GLOBAL STORAGE TECHNOLOGIES NETHERLANDS B.V. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: HIRATSUKA, YUKIE
Publication of US20050235108A1 publication Critical patent/US20050235108A1/en
Application granted granted Critical
Publication of US7539820B2 publication Critical patent/US7539820B2/en
Expired - Fee Related legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • G06F12/0895Caches characterised by their organisation or structure of parts of caches, e.g. directory or tag array

Definitions

  • the present invention relates to cache control for transferring data from a hard disk to a cache efficiently, enhancing a hitting rate of the cache, shortening a command execution time, and enhancing a data transfer rate.
  • the efficiency of data transfer to a host is improved by providing a cache, then transferring data from the disk to the cache, and managing the data so that the data can be transferred from the cache directly to the host.
  • One cache area is further divided into several areas, and data to undergo a process of a different nature, or data of a different nature is written in a classified condition into each area. This improves the hitting rate of the cache, and enhances data transfer efficiency.
  • Patent Document 1 Japanese Patent Laid-Open No. Hei 7-105095
  • Patent Document 2 Japanese Patent Laid-Open No. Hei 10-301847
  • Patent Document 3 Japanese Patent Laid-Open No. Hei 10-254778
  • Patent Document 4 Japanese Patent Laid-Open No. Hei 5-189316
  • Patent Document 5 Japanese Patent Laid-Open No. 2001-101076
  • Patent Document 6 Japanese Patent Laid-Open No. 2000-56993.
  • Patent Documents 1, 2, and 3 have had the problem that in spite of cache areas being allocated and managed in accordance with the sequential, random, or other access patterns extracted by a control program, unequivocal access patterns must be extracted before cache data can be efficiently managed.
  • Patent Document 4 there has been the problem that effects can be obtained only by using an access pattern intended to concentrate access on specific data.
  • Patent Documents 5 and 6 have had the problem that although it is possible to manage a cache area for each program or thread and thus to enhance processing efficiency of the entire system that executes multiple application programs, the particular specifications of the system may not permit a new cache and/or its control device to be provided outside the disk for reasons such as costs. For these reasons, it is necessary to achieve, even in the disk device alone, more highly efficient control with the concept of processes or threads being kept in mind.
  • a first feature of the present invention is to allow cache control optimized for the processing characteristics of application programs each different in data-processing policy, by providing an independent cache area for each type of command for each of the application programs, and managing data.
  • the difference in data-processing policy here refers to the difference in type between, for example, real-time processing and non-real-time processing.
  • a second feature of the present invention is to ensure more effective use of cache areas by making it possible, in order to accommodate time-varying changes in a command issuance status, to release a cache area previously allocated to a specific command type and then integrate this cache area with a cache area previously allocated to another command type.
  • a third feature of the present invention is to improve the hitting rate of a cache and enhance the data transfer rate of the disk device, by utilizing accessibility with each type of command and efficiently conducting a read-ahead operation on a cache area allocated to a specific command type.
  • a disk device comprises: a disk; a cache memory for temporarily saving data that was read in from the disk, and data that was transferred from a host; and a controller for controlling data transfer between the cache memory and the host and between the cache memory and the disk.
  • the disk device sets, in the cache memory, an independent cache area for each command type for application programs each different in data-processing policy, and includes a cache data management table for managing, the data written into the cache area for each cache area.
  • the present invention it is possible to improve a cache-hitting rate, and enhance a data transfer rate, by setting a cache area for each type of command for application programs each different in data-processing policy, and further controlling the manner of read-ahead for each command type.
  • Highly efficient data transfer can therefore be realized, for example, when simultaneously executing on a personal computer (PC), an audio/visual (AV) application program for a purpose such as dynamic image reproduction, and a PC application program for a purpose such as documentation.
  • PC personal computer
  • AV audio/visual
  • FIG. 1 is a diagram showing a structural example of a disk device according to an embodiment of the present invention.
  • FIG. 2 is a diagram showing a structural example of a command issued from a host.
  • FIG. 3 is a diagram showing a structural example of a cache data management table.
  • FIG. 4 is a diagram showing an example of dividing a cache area.
  • FIG. 5 is a diagram showing a structural example of a cache area management table.
  • FIG. 6 a is a flowchart of a cache control scheme intended for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
  • FIG. 6 b is a flowchart showing one section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
  • FIG. 6 c is a flowchart showing another section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
  • FIG. 6 d is a flowchart showing yet another section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
  • FIG. 7 is a diagram showing another example of dividing a cache area.
  • FIG. 8 is a diagram showing yet another example of dividing a cache area.
  • FIG. 9 is a diagram showing an example of an ATA command intended for device operation setup.
  • FIG. 10 is a diagram showing a structural example of a command issuance interval registration table.
  • FIG. 11 is a diagram showing a structural example of a cache status management table.
  • FIG. 12 is a flowchart of processing in which one of two areas into which an original cache area was divided is to be integrated with the other cache area within a fixed time after receipt of the latest command according to an embodiment of the invention.
  • FIG. 13 is a flowchart of processing in which the two areas into which the original cache area was divided according to the type of command are to be integrated into one area by issuing an instruction from the host according to an embodiment of the invention.
  • FIG. 14 is a flowchart of the control intended to select independent read-ahead schemes for an AV command type and a PC command type each according to an embodiment of the invention.
  • FIG. 1 An example of a disk device applying the present invention is shown in FIG. 1 .
  • This disk device includes: a program ROM 101 in which a read-ahead control program is mounted; a RAM 102 for storing a management table of cache internal data and a management table of cache area data; a timer 103 for managing and setting the internal time-of-day of the disk device; a control processor (CPU) 104 having the above ROM 101 , RAM 102 , and timer 103 built thereinto, and for reading in and executing a control program stored within the ROM; a cache memory 105 for temporarily writing read request data/write request data; a hard disk controller (HDC) 106 that controls data transfer between a host and the cache memory 105 and between the cache memory 105 and a disk; a servo controller 107 that conducts control for moving a read/write head of the device to a specified position on the disk 114 when data is read/written; a voice coil motor (VCM) 108 for moving the
  • the command includes a command code 21 that indicates the type of command, a logic block address (LBA) 22 of the data read/written, and a host-requested data transfer size 23 indicating a size of host-requested data.
  • the command code 21 allows the disk device to distinguish between AV commands and PC commands.
  • the command code in ATA/ATAPI 7 (draft), for example, is 25h for a “READ DMA EXT” PC command or 2Ah for a “READ STREAM DMA EXT” AV command.
  • the cache data management table includes a starting LBA 31 of the data written into the cache memory 105 , a starting address 32 of a writing space on the cache memory, and a data size 33 . Since independent data is written into each of plural divided cache areas, the cache data management table is also set for each cache area.
  • FIG. 4 An example of dividing a cache area into an area 41 for AV commands and an area 42 for PC commands, is shown in FIG. 4 .
  • the direction of data writing into the areas is indicated by an arrow.
  • the starting address of the area for AV commands is 0, and the ending address is (maximum address+1)/2 ⁇ 1.
  • the starting address of the area for PC commands is (maximum address+1)/2, and the ending address is the maximum address.
  • wrap-around process is executed at the ending address.
  • the wrap-around process can be established by setting the starting address and the ending address in a register of the HDC 106 .
  • the cache area management table includes an area type 51 , a starting address 52 of the area, an ending address 53 , a size 54 of the area, and a another-area data management table check flag 55 indicating whether a cache data management table of an area relating to a command type other than AV or PC needs to be checked.
  • the another-area data management table check flag 55 identifies whether a cache data management table of an area relating to a command type other than AV or PC needs to be updated if, immediately after cache area division, data for each command type is not properly distributed to the cache area that was allocated to a specific command type.
  • the flag is set to have a value of 1 immediately after a new cache area has been set in an existing area previously allocated to a command type, and is set to have a value of 0 when the wrap-around process is performed on the new cache area twice.
  • FIGS. 6 a to 6 d The flow of cache control in the scheme where the area of the cache memory 105 is to be divided into two areas (one for AV commands, and one for PC commands) is shown in FIGS. 6 a to 6 d.
  • the disk device of the present embodiment After receiving a command in step 601 , the disk device of the present embodiment identifies the command type by the command code 21 in step 602 .
  • the device examines whether data is already registered in the cache area management table. If no data is registered, the device registers, in step 604 , the particular command type as the area type 51 , address 0 as the starting address 52 , and a maximum address 53 as the ending address, in the cache area management table.
  • step 605 the device sets address 0 as the starting address, the maximum address as the ending address, and address 0 as a current address, in a segment management register of the HDC. After this, the device sets the another-area data management table check flag 55 of that cache area to 0 in step 606 .
  • the device examines in step 607 whether a cache area that was allocated to the command type exists in the cache area management table. If a cache area allocated to the command type does not exist in the cache area management table, whether the current address of the existing cache area is in excess of the maximum address/2 is further examined in step 608 .
  • a cache-dividing state with the current address of the existing cache area being in excess of the maximum address/2 is shown in FIG. 7 and described below.
  • the command type is registered as the area type 51 , address 0 ( 72 ) as the starting address 52 , and (maximum address+1)/2 ⁇ 1 ( 73 ) as the ending address 53 , in the cache area management table in step 609 .
  • address 0 ( 72 ) is set as the starting address, (maximum address +1)/2 ⁇ 1 ( 73 ) as the ending address, and address 0 ( 72 ) as the current address, in the segment management register of the HDC in step 610 .
  • step 611 (maximum address+1)/2 ( 74 ) is re-registered in the cache area management table as a starting address 52 of a cache area for a command type independent of the particular command type.
  • step 612 the above-mentioned starting address 52 is re-set as (maximum address+1)/2 ( 74 ) in the segment management register of the HDC.
  • the area from address 0 ( 72 ) to the address of (maximum address+1)/2 ⁇ 1 ( 73 ) becomes a cache area ( 75 ) for the newly set command type.
  • the area from (maximum address+1)/2 ( 74 ) to a maximum address ( 76 ) becomes a cache area ( 77 ) for the command type existing before the division was conducted.
  • step 613 whether internal write data of the newly set cache area has already been written on the disk is examined in step 613 . If no such data is written on the disk, all write data within the cache area is written onto the disk in step 614 .
  • step 615 data is input from the current address of the cache area for the command type.
  • step 616 management information on input data is registered in the cache data management table of the cache area for the command type.
  • step 617 1 is set up in the another-area data management table check flag.
  • step 618 the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
  • step 613 if the internal write data of the newly set cache area has already been written on the disk, data is input from the current address of the cache area for the command type in step 615 .
  • step 616 management information on input data is registered in the cache data management table of the cache area for the command type.
  • step 617 1 is set up in the another-area data management table check flag.
  • step 618 the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
  • FIG. 8 A cache-dividing state with the current address of the existing cache area not being in excess of the maximum address/2 is shown in FIG. 8 .
  • a cache-dividing process with the current address of the existing cache area not being in excess of the maximum address/2 is described below with reference to FIG. 8 .
  • step 608 if a current address ( 81 ) of the existing cache area is not in excess of the maximum address/2, the command type is registered as the area type 51 , (maximum address+1)/2 ( 82 ) as the starting address 52 , and a maximum address ( 83 ) as the ending address 53 , in the cache area management table in step 619 .
  • (maximum address+1)/2 ( 82 ) is set as the starting address, the maximum address ( 83 ) as the ending address, and (maximum address+1)/2 ( 82 ) as the current address, in the segment management register of the HDC in step 620 .
  • step 621 (maximum address+1)/2 ⁇ 1 ( 84 ) is re-registered in the cache area management table as an ending address 53 of a cache area for a command type independent of the particular command type.
  • step 622 (maximum address+1)/2 ⁇ 1 ( 84 ) is re-set as the above-mentioned ending address 53 in the segment management register of the HDC.
  • the area from address 0 ( 85 ) to the address of (maximum address+1)/2 ⁇ 1 ( 84 ) becomes a cache area ( 86 ) for the command type existing before the division was conducted.
  • the area from (maximum address+1)/2 ( 82 ) to the maximum address ( 83 ) becomes a cache area ( 87 ) for the newly set command type.
  • step 613 whether internal write data of the newly set cache area has already been written on the disk is examined in step 613 . If no such data is written on the disk, all write data within the cache area is written onto the disk in step 614 .
  • step 615 data is input from the current address of the cache area for the command type.
  • step 616 management information on input data is registered in the cache data management table of the cache area for the command type.
  • step 617 1 is set up in the another-area data management table check flag.
  • step 618 the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
  • step 613 if internal write data of the newly set cache area has already been written on the disk, data is input from the current address of the cache area for the command type in step 615 .
  • step 616 management information on input data is registered in the cache data management table of the cache area for the command type.
  • step 617 1 is set up in the another-area data management table check flag.
  • step 618 the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
  • step 607 if the cache area that was allocated to the command type is present in the cache area management table, data is input, in step 623 , from the current address of the cache area for the command type.
  • step 624 management information on input data is registered in the cache data management table of the cache area for the command type.
  • step 625 whether 1 is set up in the another-area data management table check flag for the cache area is examined in step 625 . If 1 is set up in the check flag, the present data update status is also incorporated into the cache data management tables of the cache areas other than the particular cache area (step 626 ). Referring back to step 625 , if 1 is not set up in the check flag, the process is terminated.
  • FIG. 9 An example of an operation setup command for the device is shown in FIG. 9 .
  • a code that identifies the command type for device setup is assigned as a “Command Code” 91 .
  • “Features” 92 indicate details of the operation setup.
  • a code for cache area division is not present in the standard specifications of ATA commands, it is possible to newly set such a code. It is possible to assign a cache area division code in the “Features” and set a ratio between the PC command area and the AV command area by using a bit [ 7 : 4 ] 94 of a “Sector Count” 93 and a bit [ 3 : 0 ] 95 thereof, respectively.
  • FIG. 9 it is possible to set the ratio between both command areas to 1:1 by entering 0001 in both bits [ 7 : 4 ] 94 and [ 3 : 0 ] 95 .
  • FIG. 9 also makes it possible to divide the cache area on the basis of an AV command area PC command area ratio specified from the host.
  • FIGS. 6 a , 6 b , and 6 c show the process flow in which the cache area is divided into the PC command area and the AV command area at the ratio of 1:1, the dividing ratio can also be a ratio specified from the host by using such command as shown in FIG. 9 .
  • the ratio between the cache areas for each command type can be specified from the host
  • use of command issuance intervals for each command type also allows a suitable ratio to be calculated and set from the disk.
  • the cache area is not divided immediately after a new command type has been received. Instead, conventional cache control is executed for a while after receipt of a new command type. For example, a command issuance interval for the new command type is measured and then a suitable dividing ratio is determined on the basis of that value before the dividing process is executed.
  • the command issuance interval registration table includes a command type 1001 , issuance intervals 1002 of the latest five commands, and average issuance intervals 1003 .
  • the issuance intervals of the latest commands are registered for each command type. Calculation results relating to average issuance intervals, based on registered issuance intervals, are further registered. If, as in FIG. 10 , the average issuance interval of PC commands and that of AV commands are taken as 40 ms and 200 ms, respectively, the ratio between the PC command area and the AV command area can be set as 5:1, for example. Execution of the dividing process, based on this ratio, is also possible.
  • the following describes an example in which, if one of the two areas into which the original cache area was divided is not used within a fixed time (if no commands are issued within a fixed time that belong to the command type to which a cache area was allocated), the particular area is to be integrated with the other cache area.
  • the cache status management table includes an area type 1101 for each command type, latest-command receiving time 1102 for each area type, a write-data transfer completion check flag 1103 , latest-read-command termination check flag 1104 , and a cache area usage duration (ms) 1105 for each cache area.
  • the receiving time of the latest command is registered for each area type (command type) as the latest-command receiving time 1102 .
  • the time is acquired with reference to the built-in timer 103 of the CPU.
  • the write-data transfer completion check flag 1103 identifies whether the write data within the cache area set for each command type has already been transferred to the disk. If the data has already been transferred, 1 is input to the check flag 1103 .
  • FIG. 12 The flow of processing in which one of the two areas into which the original cache area was divided is to be integrated with the other cache area within a fixed time after receipt of the latest command is shown in FIG. 12 .
  • Processing shown in FIG. 12 assumes execution at fixed time intervals by firmware mounted in the ROM 101 .
  • step 1201 Whether multiple areas are registered in the cache area management table is examined in step 1201 , and if multiple areas are not registered, processing is terminated. If multiple areas are registered in the cache area management table, it is examined in step 1202 whether all registered data has been checked. If not all of the registered data has been checked, one registered cache area remaining unchecked is selected in step 1203 . Next, whether the write data within that cache area has already been transferred to the disk is examined in step 1204 using the cache status management table. If neither the write data within the cache area has been transferred (“No” in step 1204 ) nor has all registered data been checked (“No” in step 1202 ), another registered cache area remaining unchecked is selected in step 1203 .
  • step 1204 If the write data within the cache area has already been transferred (“Yes” in step 1204 ), whether the latest read command of the cache area type has already been processed to completion is examined in step 1205 using the cache status management table. If neither the latest read command of the cache area type has already been processed to completion (“No” in step 1205 ) nor has all registered data been checked (“No” in step 1202 ), yet another registered cache area remaining unchecked is selected in step 1203 .
  • step 1205 If the latest read command of the cache area type has already been processed to completion (“Yes” in step 1205 ), the current time is acquired with reference to the built-in timer 103 of the CPU 104 in step 1206 .
  • step 1207 the time that has elapsed since the latest command was received is calculated from the latest-command receiving time 1102 of the area type within the cache status management table, and from the current time.
  • step 1208 whether the time that has elapsed is in excess of the cache area usage duration 11 05 within the cache status management table is examined in step 1208 . If the time that has elapsed is not in excess of the cache area usage duration 1105 , it is examined back in step 1202 whether all registered data has been checked. If not all of the registered data has been checked, further another registered cache area remaining unchecked is selected in step 1203 .
  • the starting address 52 of the cache area is 0 is examined in the cache area management table in step 1209 . If the starting address 52 of the cache area is 0, the starting address 52 of the other cache area (the non-intended cache area) is set to be 0 in the cache area management table in step 1210 . If the starting address 52 of the intended cache area is not 0, the ending address 53 of the other cache area (the non-intended cache area) is set to be the maximum address in the cache area management table in step 1211 . Next, the starting address register, current address register, and ending address register of the HDC that were allocated to the intended cache area are all cleared to 0 in step 1212 . After this, data relating to the intended cache area is deleted from the cache area management table in step 1213 , and then all data of the intended cache area is deleted from the cache status management table in step 1214 .
  • the cache areas previously allocated to each command type can also be released and integrated by issuing an instruction from the host. More specifically, the release and the integration can be specified using such operation setup command for the device as shown in FIG. 9 . Assume, for example, that the data indicating the type of operation for releasing and integrating the cache area is set in “Features” 92 of the command in FIG. 9 , and that 0001 indicating the ratio of the PC command area or 0000 indicating the ratio of the AV command area is set in bit [ 7 : 4 ] 94 or bit [ 3 : 0 ] 95 , respectively. It is thus possible to specify releasing the area previously allocated for AV use, and integrating this area for PC use only.
  • FIG. 13 The flow of processing in which the two areas into which the original cache area was divided according to the type of command are to be integrated into one area by issuing an instruction from the host, is shown in FIG. 13 .
  • a command for releasing/integrating an allocated cache area has been received from the host in step 1301
  • whether the write data within the cache area to be released has already been transferred to the disk is examined in step 1302 .
  • whether the starting address 52 of the cache area is 0 is examined in step 1303 using the cache area management table. If the starting address 52 of the cache area is 0, the starting address 52 of the other cache area (the cache area not to be released) is set to be 0 in step 1304 using the cache area management table.
  • step 1305 the ending address 53 of the other cache area (the cache area not to be released) is set to be the maximum address by use of the cache area management table.
  • the starting address register, current address register, and ending address register of the HDC that were allocated to the intended cache area are all cleared to 0 in step 1306 .
  • data relating to the intended cache area is deleted from the cache area management table in step 1307 , and then all data of the intended cache area is deleted from the cache status management table in step 1308 .
  • the disk device of the present embodiment also allows the cache area within the disk device to be divided and integrated by issuing instructions from the host.
  • the flow of control for selecting independent read-ahead schemes for the AV command type and the PC command type each is shown in FIG. 14 .
  • the type of read command is identified in step 1401 , and whether host-requested data hits the cache is examined in step 1402 . If the data hits the cache, processing is terminated. If the data does not hit the cache, the type of command is identified in step 1403 . If the results indicating that the command type is AV are presented in step 1404 , whether an AV cache area exists is examined in step 1405 . If an AV cache area does not exist, the AV cache area is set in step 1406 . Next, data equivalent to (Size of the AV cache area—Host-requested data in the command) is pre-read in step 1407 .
  • step 1408 determines whether the write data within the AV cache area has been written on the disk. If the write data within the AV cache area has been written on the disk, a size of the cache area allocated for AV is examined in step 1409 using the cache area management table. Next, data equivalent to (Size of the AV command area—Host-requested data in the command) is pre-read in step 1410 .
  • step 1408 it is examined whether the write data within the AV cache area has been written on the disk. If the write data has not been written, data equivalent to a quarter of the size of the cache area or data up to the starting address of the unwritten write data closest to the current address is pre-read in step 1411 .
  • Control is further returned to step 1404 , and if the command is not an AV command, read-ahead that uses an idle/available time to its maximum is conducted in step 1412 as in the conventional technologies.

Abstract

Embodiments of the invention allow cache control optimized for the processing characteristics of application programs, and thus improve data transfer efficiency. In one embodiment, a disk device includes a disk; a cache for temporarily saving data that was read in from the disk, and data that was transferred from a host; and a controller for controlling data transfer between the cache and the host and between the cache and the disk; in which an independent cache area is set for each command type for application programs each different in data-processing policy can be set in the cache, and efficient read-ahead that utilizes the accessibility of the application programs each different in data-processing policy, can be realized by controlling the manner of read-ahead for each command type.

Description

CROSS-REFERENCES TO RELATED APPLICATIONS
This application claims priority from Japanese Patent Application No. JP2004-123913, filed Apr. 20, 2004, the entire disclosure of which is incorporated herein by reference.
BACKGROUND OF THE INVENTION
The present invention relates to cache control for transferring data from a hard disk to a cache efficiently, enhancing a hitting rate of the cache, shortening a command execution time, and enhancing a data transfer rate.
In a hard disk, the efficiency of data transfer to a host is improved by providing a cache, then transferring data from the disk to the cache, and managing the data so that the data can be transferred from the cache directly to the host. One cache area is further divided into several areas, and data to undergo a process of a different nature, or data of a different nature is written in a classified condition into each area. This improves the hitting rate of the cache, and enhances data transfer efficiency.
For example, there are schemes in which the hitting rate is improved by extracting random, sequential, or other access patterns, and allocating a cache area for each pattern. These cache control schemes are described in documents such as Patent Documents 1, 2, and 3. There is also a scheme in which data is distributed to two cache areas obtained by division based on statistical processing results relating to a data access status. Such a cache control scheme is described in Patent Document 4. In yet other schemes, cache areas are set and managed for each program or thread, for example, and these cache control schemes are described in documents such as Patent Documents 5 and 6. The Patent Documents are listed as follows:
Patent Document 1: Japanese Patent Laid-Open No. Hei 7-105095
Patent Document 2: Japanese Patent Laid-Open No. Hei 10-301847
Patent Document 3: Japanese Patent Laid-Open No. Hei 10-254778
Patent Document 4: Japanese Patent Laid-Open No. Hei 5-189316
Patent Document 5: Japanese Patent Laid-Open No. 2001-101076
Patent Document 6: Japanese Patent Laid-Open No. 2000-56993.
BRIEF SUMMARY OF THE INVENTION
To enhance the hitting rate of a cache, data most likely to hit needs to be read into the cache efficiently and to be preferentially left therein. The technologies described in Patent Documents 1, 2, and 3 have had the problem that in spite of cache areas being allocated and managed in accordance with the sequential, random, or other access patterns extracted by a control program, unequivocal access patterns must be extracted before cache data can be efficiently managed. For the technology described in Patent Document 4, there has been the problem that effects can be obtained only by using an access pattern intended to concentrate access on specific data. The technologies described in Patent Documents 5 and 6 have had the problem that although it is possible to manage a cache area for each program or thread and thus to enhance processing efficiency of the entire system that executes multiple application programs, the particular specifications of the system may not permit a new cache and/or its control device to be provided outside the disk for reasons such as costs. For these reasons, it is necessary to achieve, even in the disk device alone, more highly efficient control with the concept of processes or threads being kept in mind.
In view of the above problems, a first feature of the present invention is to allow cache control optimized for the processing characteristics of application programs each different in data-processing policy, by providing an independent cache area for each type of command for each of the application programs, and managing data. The difference in data-processing policy here refers to the difference in type between, for example, real-time processing and non-real-time processing.
A second feature of the present invention is to ensure more effective use of cache areas by making it possible, in order to accommodate time-varying changes in a command issuance status, to release a cache area previously allocated to a specific command type and then integrate this cache area with a cache area previously allocated to another command type.
A third feature of the present invention is to improve the hitting rate of a cache and enhance the data transfer rate of the disk device, by utilizing accessibility with each type of command and efficiently conducting a read-ahead operation on a cache area allocated to a specific command type.
In order to solve the above problems, the present invention has allowed a cache area to be set for each type of command for application programs each different in data-processing policy. More specifically, a disk device according to an embodiment of the present invention comprises: a disk; a cache memory for temporarily saving data that was read in from the disk, and data that was transferred from a host; and a controller for controlling data transfer between the cache memory and the host and between the cache memory and the disk. The disk device sets, in the cache memory, an independent cache area for each command type for application programs each different in data-processing policy, and includes a cache data management table for managing, the data written into the cache area for each cache area.
It has also been made possible to release a cache area previously allocated to each command type, and then integrate this cache area with a cache area allocated to another command type, according to the elapse of time from the latest command-receiving time for each command type or in accordance with an instruction from a host. In addition, selection of independent read-ahead methods for each command type has been made executable to allow efficient read-ahead that utilizes accessibility with each command type.
According to the present invention, it is possible to improve a cache-hitting rate, and enhance a data transfer rate, by setting a cache area for each type of command for application programs each different in data-processing policy, and further controlling the manner of read-ahead for each command type. Highly efficient data transfer can therefore be realized, for example, when simultaneously executing on a personal computer (PC), an audio/visual (AV) application program for a purpose such as dynamic image reproduction, and a PC application program for a purpose such as documentation.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a diagram showing a structural example of a disk device according to an embodiment of the present invention.
FIG. 2 is a diagram showing a structural example of a command issued from a host.
FIG. 3 is a diagram showing a structural example of a cache data management table.
FIG. 4 is a diagram showing an example of dividing a cache area.
FIG. 5 is a diagram showing a structural example of a cache area management table.
FIG. 6 a is a flowchart of a cache control scheme intended for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
FIG. 6 b is a flowchart showing one section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
FIG. 6 c is a flowchart showing another section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
FIG. 6 d is a flowchart showing yet another section in the above cache control scheme for dividing a cache area into two areas according to the type of command in an embodiment of the invention.
FIG. 7 is a diagram showing another example of dividing a cache area.
FIG. 8 is a diagram showing yet another example of dividing a cache area.
FIG. 9 is a diagram showing an example of an ATA command intended for device operation setup.
FIG. 10 is a diagram showing a structural example of a command issuance interval registration table.
FIG. 11 is a diagram showing a structural example of a cache status management table.
FIG. 12 is a flowchart of processing in which one of two areas into which an original cache area was divided is to be integrated with the other cache area within a fixed time after receipt of the latest command according to an embodiment of the invention.
FIG. 13 is a flowchart of processing in which the two areas into which the original cache area was divided according to the type of command are to be integrated into one area by issuing an instruction from the host according to an embodiment of the invention.
FIG. 14 is a flowchart of the control intended to select independent read-ahead schemes for an AV command type and a PC command type each according to an embodiment of the invention.
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention are described below using the accompanying drawings. These embodiments are described using, as typical types of commands, AV commands used mainly in audio/visual processing application programs, and PC commands used in document-processing application programs and program-developing application programs. The access tendency differs between the two types of commands: access with AV commands mainly tends to be sequential, and access with PC commands tends to be nonuniform.
An example of a disk device applying the present invention is shown in FIG. 1. This disk device includes: a program ROM 101 in which a read-ahead control program is mounted; a RAM 102 for storing a management table of cache internal data and a management table of cache area data; a timer 103 for managing and setting the internal time-of-day of the disk device; a control processor (CPU) 104 having the above ROM 101, RAM 102, and timer 103 built thereinto, and for reading in and executing a control program stored within the ROM; a cache memory 105 for temporarily writing read request data/write request data; a hard disk controller (HDC) 106 that controls data transfer between a host and the cache memory 105 and between the cache memory 105 and a disk; a servo controller 107 that conducts control for moving a read/write head of the device to a specified position on the disk 114 when data is read/written; a voice coil motor (VCM) 108 for moving the head in accordance with the instructions sent from the servo controller; a motor driver 109 for controlling disk rotation; a selector 110 for selecting only signals of a specified head, from the magnetic signals read in from the head; a signal processor 111 for converting the analog data sent from the selector 110, into digital data, or converting the digital data sent from the HDC 106, into analog data; a disk formatter 112 that opens/closes a reading gate and transfers the read data sent from the signal processor 111, to the cache memory 105, or that opens/closes a writing gate and transfers the write data transferred from the cache memory 105, to the signal processor 111; and an interface controller 113 for exchanging commands and data with the host.
A structural example of a command issued from the host is shown in FIG. 2. The command includes a command code 21 that indicates the type of command, a logic block address (LBA) 22 of the data read/written, and a host-requested data transfer size 23 indicating a size of host-requested data. The command code 21 allows the disk device to distinguish between AV commands and PC commands. The command code in ATA/ATAPI 7 (draft), for example, is 25h for a “READ DMA EXT” PC command or 2Ah for a “READ STREAM DMA EXT” AV command.
A structural example of a cache data management table is shown in FIG. 3. The cache data management table includes a starting LBA 31 of the data written into the cache memory 105, a starting address 32 of a writing space on the cache memory, and a data size 33. Since independent data is written into each of plural divided cache areas, the cache data management table is also set for each cache area.
An example of dividing a cache area into an area 41 for AV commands and an area 42 for PC commands, is shown in FIG. 4. The direction of data writing into the areas is indicated by an arrow. The starting address of the area for AV commands is 0, and the ending address is (maximum address+1)/2−1. The starting address of the area for PC commands is (maximum address+1)/2, and the ending address is the maximum address. In both cache areas, wrap-around process is executed at the ending address. The wrap-around process can be established by setting the starting address and the ending address in a register of the HDC 106.
A structural example of a cache area management table is shown in FIG. 5. The cache area management table includes an area type 51, a starting address 52 of the area, an ending address 53, a size 54 of the area, and a another-area data management table check flag 55 indicating whether a cache data management table of an area relating to a command type other than AV or PC needs to be checked. The another-area data management table check flag 55 identifies whether a cache data management table of an area relating to a command type other than AV or PC needs to be updated if, immediately after cache area division, data for each command type is not properly distributed to the cache area that was allocated to a specific command type. More specifically, when data is to be written into the cache memory 105, 1 is set up if the another-area data management table needs to be updated, and 0 is set up if the another-area data management table does not need to be updated. In other words, the flag is set to have a value of 1 immediately after a new cache area has been set in an existing area previously allocated to a command type, and is set to have a value of 0 when the wrap-around process is performed on the new cache area twice.
  • Another area data management table.:
  • When PC data is processed, the information about AV data is inputted.
  • When AV data is processed, the information about PC data is inputted.
The flow of cache control in the scheme where the area of the cache memory 105 is to be divided into two areas (one for AV commands, and one for PC commands) is shown in FIGS. 6 a to 6 d.
After receiving a command in step 601, the disk device of the present embodiment identifies the command type by the command code 21 in step 602. In step 603, the device examines whether data is already registered in the cache area management table. If no data is registered, the device registers, in step 604, the particular command type as the area type 51, address 0 as the starting address 52, and a maximum address 53 as the ending address, in the cache area management table. Next, in step 605, the device sets address 0 as the starting address, the maximum address as the ending address, and address 0 as a current address, in a segment management register of the HDC. After this, the device sets the another-area data management table check flag 55 of that cache area to 0 in step 606.
Referring back to step 603, if data is already registered in the cache area management table, the device examines in step 607 whether a cache area that was allocated to the command type exists in the cache area management table. If a cache area allocated to the command type does not exist in the cache area management table, whether the current address of the existing cache area is in excess of the maximum address/2 is further examined in step 608. A cache-dividing state with the current address of the existing cache area being in excess of the maximum address/2 is shown in FIG. 7 and described below.
If a current address 71 of the existing cache area is in excess of the maximum address/2, the command type is registered as the area type 51, address 0 (72) as the starting address 52, and (maximum address+1)/2−1 (73) as the ending address 53, in the cache area management table in step 609. Next, address 0 (72) is set as the starting address, (maximum address +1)/2−1 (73) as the ending address, and address 0 (72) as the current address, in the segment management register of the HDC in step 610. In step 611, (maximum address+1)/2 (74) is re-registered in the cache area management table as a starting address 52 of a cache area for a command type independent of the particular command type. In step 612, the above-mentioned starting address 52 is re-set as (maximum address+1)/2 (74) in the segment management register of the HDC. After the division, the area from address 0 (72) to the address of (maximum address+1)/2−1 (73) becomes a cache area (75) for the newly set command type. Also, the area from (maximum address+1)/2 (74) to a maximum address (76) becomes a cache area (77) for the command type existing before the division was conducted.
Next, whether internal write data of the newly set cache area has already been written on the disk is examined in step 613. If no such data is written on the disk, all write data within the cache area is written onto the disk in step 614. In step 615, data is input from the current address of the cache area for the command type. In step 616, management information on input data is registered in the cache data management table of the cache area for the command type. In step 617, 1 is set up in the another-area data management table check flag. Next, in step 618, the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
Referring back to step 613, if the internal write data of the newly set cache area has already been written on the disk, data is input from the current address of the cache area for the command type in step 615. In step 616, management information on input data is registered in the cache data management table of the cache area for the command type. In step 617, 1 is set up in the another-area data management table check flag. Next, in step 618, the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
A cache-dividing state with the current address of the existing cache area not being in excess of the maximum address/2 is shown in FIG. 8. A cache-dividing process with the current address of the existing cache area not being in excess of the maximum address/2 is described below with reference to FIG. 8.
Referring back to step 608, if a current address (81) of the existing cache area is not in excess of the maximum address/2, the command type is registered as the area type 51, (maximum address+1)/2 (82) as the starting address 52, and a maximum address (83) as the ending address 53, in the cache area management table in step 619. Next, (maximum address+1)/2 (82) is set as the starting address, the maximum address (83) as the ending address, and (maximum address+1)/2 (82) as the current address, in the segment management register of the HDC in step 620. In step 621, (maximum address+1)/2−1 (84) is re-registered in the cache area management table as an ending address 53 of a cache area for a command type independent of the particular command type. In step 622, (maximum address+1)/2−1 (84) is re-set as the above-mentioned ending address 53 in the segment management register of the HDC. After the division, the area from address 0 (85) to the address of (maximum address+1)/2−1 (84) becomes a cache area (86) for the command type existing before the division was conducted. Also, the area from (maximum address+1)/2 (82) to the maximum address (83) becomes a cache area (87) for the newly set command type.
Next, whether internal write data of the newly set cache area has already been written on the disk is examined in step 613. If no such data is written on the disk, all write data within the cache area is written onto the disk in step 614. In step 615, data is input from the current address of the cache area for the command type. In step 616, management information on input data is registered in the cache data management table of the cache area for the command type. In step 617, 1 is set up in the another-area data management table check flag. Next, in step 618, the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
Referring back to step 613, if internal write data of the newly set cache area has already been written on the disk, data is input from the current address of the cache area for the command type in step 615. In step 616, management information on input data is registered in the cache data management table of the cache area for the command type. In step 617, 1 is set up in the another-area data management table check flag. Next, in step 618, the present data update status is also incorporated into the cache data management tables of the cache areas other than the newly set cache area.
Referring back to step 607, if the cache area that was allocated to the command type is present in the cache area management table, data is input, in step 623, from the current address of the cache area for the command type. In step 624, management information on input data is registered in the cache data management table of the cache area for the command type. Next, whether 1 is set up in the another-area data management table check flag for the cache area is examined in step 625. If 1 is set up in the check flag, the present data update status is also incorporated into the cache data management tables of the cache areas other than the particular cache area (step 626). Referring back to step 625, if 1 is not set up in the check flag, the process is terminated.
An example of an operation setup command for the device is shown in FIG. 9. A code that identifies the command type for device setup is assigned as a “Command Code” 91. “Features” 92 indicate details of the operation setup. Although a code for cache area division is not present in the standard specifications of ATA commands, it is possible to newly set such a code. It is possible to assign a cache area division code in the “Features” and set a ratio between the PC command area and the AV command area by using a bit [7:4] 94 of a “Sector Count” 93 and a bit [3:0] 95 thereof, respectively. For example, as shown in FIG. 9. it is possible to set the ratio between both command areas to 1:1 by entering 0001 in both bits [7:4] 94 and [3:0] 95.
The use of such command as shown in FIG. 9 also makes it possible to divide the cache area on the basis of an AV command area PC command area ratio specified from the host. Although FIGS. 6 a, 6 b, and 6 c show the process flow in which the cache area is divided into the PC command area and the AV command area at the ratio of 1:1, the dividing ratio can also be a ratio specified from the host by using such command as shown in FIG. 9.
While, as described above, the ratio between the cache areas for each command type can be specified from the host, use of command issuance intervals for each command type also allows a suitable ratio to be calculated and set from the disk. In this case, however, the cache area is not divided immediately after a new command type has been received. Instead, conventional cache control is executed for a while after receipt of a new command type. For example, a command issuance interval for the new command type is measured and then a suitable dividing ratio is determined on the basis of that value before the dividing process is executed.
A structural example of a command issuance interval registration table is shown in FIG. 10. The command issuance interval registration table includes a command type 1001, issuance intervals 1002 of the latest five commands, and average issuance intervals 1003. In the command issuance interval registration table, the issuance intervals of the latest commands are registered for each command type. Calculation results relating to average issuance intervals, based on registered issuance intervals, are further registered. If, as in FIG. 10, the average issuance interval of PC commands and that of AV commands are taken as 40 ms and 200 ms, respectively, the ratio between the PC command area and the AV command area can be set as 5:1, for example. Execution of the dividing process, based on this ratio, is also possible.
The following describes an example in which, if one of the two areas into which the original cache area was divided is not used within a fixed time (if no commands are issued within a fixed time that belong to the command type to which a cache area was allocated), the particular area is to be integrated with the other cache area.
A structural example of a cache status management table is shown in FIG. 11. The cache status management table includes an area type 1101 for each command type, latest-command receiving time 1102 for each area type, a write-data transfer completion check flag 1103, latest-read-command termination check flag 1104, and a cache area usage duration (ms) 1105 for each cache area. The receiving time of the latest command is registered for each area type (command type) as the latest-command receiving time 1102. The time is acquired with reference to the built-in timer 103 of the CPU. The write-data transfer completion check flag 1103 identifies whether the write data within the cache area set for each command type has already been transferred to the disk. If the data has already been transferred, 1 is input to the check flag 1103. If the data is not yet transferred, 0 is input to the check flag. If the latest read command has already been processed to completion, 1 is set up in the latest-read-command termination check flag 1104. If the latest read command is not yet processed to completion, 0 is set up in the check flag.
The flow of processing in which one of the two areas into which the original cache area was divided is to be integrated with the other cache area within a fixed time after receipt of the latest command is shown in FIG. 12. Processing shown in FIG. 12 assumes execution at fixed time intervals by firmware mounted in the ROM 101.
Whether multiple areas are registered in the cache area management table is examined in step 1201, and if multiple areas are not registered, processing is terminated. If multiple areas are registered in the cache area management table, it is examined in step 1202 whether all registered data has been checked. If not all of the registered data has been checked, one registered cache area remaining unchecked is selected in step 1203. Next, whether the write data within that cache area has already been transferred to the disk is examined in step 1204 using the cache status management table. If neither the write data within the cache area has been transferred (“No” in step 1204) nor has all registered data been checked (“No” in step 1202), another registered cache area remaining unchecked is selected in step 1203. If the write data within the cache area has already been transferred (“Yes” in step 1204), whether the latest read command of the cache area type has already been processed to completion is examined in step 1205 using the cache status management table. If neither the latest read command of the cache area type has already been processed to completion (“No” in step 1205) nor has all registered data been checked (“No” in step 1202), yet another registered cache area remaining unchecked is selected in step 1203.
If the latest read command of the cache area type has already been processed to completion (“Yes” in step 1205), the current time is acquired with reference to the built-in timer 103 of the CPU 104 in step 1206. Next, in step 1207, the time that has elapsed since the latest command was received is calculated from the latest-command receiving time 1102 of the area type within the cache status management table, and from the current time. Next, whether the time that has elapsed is in excess of the cache area usage duration 11 05 within the cache status management table is examined in step 1208. If the time that has elapsed is not in excess of the cache area usage duration 1105, it is examined back in step 1202 whether all registered data has been checked. If not all of the registered data has been checked, further another registered cache area remaining unchecked is selected in step 1203.
If the time that has elapsed is in excess of the cache area usage duration 11 05 within the cache status management table, whether the starting address 52 of the cache area is 0 is examined in the cache area management table in step 1209. If the starting address 52 of the cache area is 0, the starting address 52 of the other cache area (the non-intended cache area) is set to be 0 in the cache area management table in step 1210. If the starting address 52 of the intended cache area is not 0, the ending address 53 of the other cache area (the non-intended cache area) is set to be the maximum address in the cache area management table in step 1211. Next, the starting address register, current address register, and ending address register of the HDC that were allocated to the intended cache area are all cleared to 0 in step 1212. After this, data relating to the intended cache area is deleted from the cache area management table in step 1213, and then all data of the intended cache area is deleted from the cache status management table in step 1214.
The cache areas previously allocated to each command type can also be released and integrated by issuing an instruction from the host. More specifically, the release and the integration can be specified using such operation setup command for the device as shown in FIG. 9. Assume, for example, that the data indicating the type of operation for releasing and integrating the cache area is set in “Features” 92 of the command in FIG. 9, and that 0001 indicating the ratio of the PC command area or 0000 indicating the ratio of the AV command area is set in bit [7:4] 94 or bit [3:0] 95, respectively. It is thus possible to specify releasing the area previously allocated for AV use, and integrating this area for PC use only.
The flow of processing in which the two areas into which the original cache area was divided according to the type of command are to be integrated into one area by issuing an instruction from the host, is shown in FIG. 13. After a command for releasing/integrating an allocated cache area has been received from the host in step 1301, whether the write data within the cache area to be released has already been transferred to the disk is examined in step 1302. After the transfer of the write data from the above cache area to the disk has been confirmed, whether the starting address 52 of the cache area is 0 is examined in step 1303 using the cache area management table. If the starting address 52 of the cache area is 0, the starting address 52 of the other cache area (the cache area not to be released) is set to be 0 in step 1304 using the cache area management table. If the starting address 52 of the intended cache area is not 0, then in step 1305, the ending address 53 of the other cache area (the cache area not to be released) is set to be the maximum address by use of the cache area management table. Next, the starting address register, current address register, and ending address register of the HDC that were allocated to the intended cache area are all cleared to 0 in step 1306. After this, data relating to the intended cache area is deleted from the cache area management table in step 1307, and then all data of the intended cache area is deleted from the cache status management table in step 1308.
In this way, the disk device of the present embodiment also allows the cache area within the disk device to be divided and integrated by issuing instructions from the host.
The flow of control for selecting independent read-ahead schemes for the AV command type and the PC command type each is shown in FIG. 14. The type of read command is identified in step 1401, and whether host-requested data hits the cache is examined in step 1402. If the data hits the cache, processing is terminated. If the data does not hit the cache, the type of command is identified in step 1403. If the results indicating that the command type is AV are presented in step 1404, whether an AV cache area exists is examined in step 1405. If an AV cache area does not exist, the AV cache area is set in step 1406. Next, data equivalent to (Size of the AV cache area—Host-requested data in the command) is pre-read in step 1407.
Referring back to step 1405, if an AV cache area exists, it is then examined in step 1408 whether the write data within the AV cache area has been written on the disk. If the write data within the AV cache area has been written on the disk, a size of the cache area allocated for AV is examined in step 1409 using the cache area management table. Next, data equivalent to (Size of the AV command area—Host-requested data in the command) is pre-read in step 1410.
Referring back to step 1408, it is examined whether the write data within the AV cache area has been written on the disk. If the write data has not been written, data equivalent to a quarter of the size of the cache area or data up to the starting address of the unwritten write data closest to the current address is pre-read in step 1411.
Control is further returned to step 1404, and if the command is not an AV command, read-ahead that uses an idle/available time to its maximum is conducted in step 1412 as in the conventional technologies.
It is to be understood that the above description is intended to be illustrative and not restrictive. Many embodiments will be apparent to those of skill in the art upon reviewing the above description. The scope of the invention should, therefore, be determined not with reference to the above description, but instead should be determined with reference to the appended claims alone with their full scope of equivalents.

Claims (13)

1. A disk device comprising:
a disk;
a cache memory for temporarily saving data read in from the disk and data transferred from a host; and
a controller configured to control data transfer between the cache memory and the host and between the cache memory and the disk;
wherein the controller is configured to set in the cache memory an independent cache area for each type of command for application programs each different in data-processing policy; and includes a cache data management table to manage the data written into the cache area for each of the cache areas,
wherein the cache data management table registers management information of the cache area based on the command type,
wherein the controller is configured to change a read-ahead method according to the type of command, and
wherein the read-ahead method differs between an AV data-processing command and a PC application program command;
wherein the controller is configured to determine a maximum allocated cache area for the AV data-processing command, and to change the data read-ahead method from pre-reading data over an entire space of said determined maximum allocated cache area using the AV data-processing command to pre-reading data into the cache memory over an entire period of a maximum usable pre-reading time interval using the PC application program command, and vice versa.
2. The disk device according to claim 1, wherein the controller is configured to set an independent cache area for an AV data-processing command and a PC application program command each.
3. The disk device according to claim 1, wherein the controller is configured to receive from the host an instruction on a ratio of the cache areas for the command types, and to set in the cache memory in accordance with the ratio, the cache area for each of the command types.
4. The disk device according to claim 1, wherein the controller is configured to determine, subject to frequency of command issuance for each of the command types, a ratio of the cache areas to be set for the command types.
5. The disk device according to claim 1, further comprising a table to hold a latest-command receiving time for each of the command types and a cache area usage duration previously set for each command type, wherein the controller is configured to release the cache area allocated to the command type whose elapsed time from the latest-command receiving time has exceeded the cache area usage duration and to integrate the cache area with the cache area allocated to any one of the other command types.
6. The disk device according to claim 1, wherein in accordance with an instruction from the host, the controller is configured to release the cache area previously allocated to a specific command type and to integrate the cache area with the cache area allocated to any one of the other command types.
7. A method of cache control in a disk drive having a disk and a cache memory for temporarily saving data read in from the disk and data transferred from a host, the method comprising:
identifying a type of command received;
checking a cache management table in the cache memory;
when, as a result of the checking, a cache area allocated to a first type of command identified in the identifying does not exist in the cache memory and a cache area allocated to a second type of command for an application program different from a cache area of the first type of command in terms of data-processing policy exists in the cache memory, determining whether a current address of the existing cache area is in excess of a required address; and
if, in the determining, the current address is in excess of the required address, setting an area from address 0 of the cache memory to the required address minus 1, as a cache area with respect to the first type of command, and setting an area from the required address to a maximum address, as a cache area with respect to the second type of command,
wherein the cache management table registers management information of the cache area based upon the command type; and
changing a data read-ahead method according to the particular command type, wherein the data read-ahead method is changed between an AV data-processing command and a PC application program command;
determining a maximum allocated cache area for the AV data-processing command; and
wherein changing the data read-ahead method comprises changing from pre-reading data over an entire space of said determined maximum allocated cache area using the AV data-processing command to pre-reading data into the cache memory over an entire period of a maximum usable pre-reading time interval using the PC application program command, and vice versa.
8. The method of cache control according to claim 7, wherein the first type of command is a command for AV data processing, and the second type of command is a command for an application program.
9. The method of cache control according to claim 7, further comprising:
receiving from the host an instruction on a dividing ratio of the cache areas; and
determining the required address in the basis of the instruction.
10. The method of cache control according to claim 7, further comprising:
collecting issuance intervals of commands of the first type and information on the issuance intervals of the commands of the first type; and
determining a required address on the basis of the information.
11. The method of cache control according to claim 7, further comprising:
determining for each of the command types whether an elapsed time from a latest-command receiving time has exceeded a previously set cache area usage duration; and
when there is present a command type whose elapsed time from the latest-command receiving time has exceeded the cache area usage duration, releasing the cache area allocated to the command type, and integrating the cache area with the cache area allocated to any one of the other command types.
12. A method of cache control in a disk drive having a disk, the method comprising:
providing a cache memory for temporarily saving data read in from the disk and data transferred from a host;
providing a controller to control data transfer between the cache memory and the host and between the cache memory and the disk;
setting in the cache memory an independent cache area for each type of command for application programs each different in data-processing policy;
providing a cache data management table to manage the data written into the cache area for each of the cache areas, and
changing a read-ahead method according to the particular command type, wherein the first type of command is a command for AV data processing, and the second type of command is a command for an application program;
determining a maximum allocated cache area for the AV data-processing command; and
wherein the step of changing a read-ahead method comprises changing from pre-reading data over an entire space of said determined maximum allocated cache area using the AV data-processing command to pre-reading data into the cache memory over an entire period of a maximum usable pre-reading time interval using the PC application program command, and vice versa.
13. The method of cache control according to claim 12,
determining for each of the command types whether an elapsed time from a latest-command receiving time has exceeded a previously set cache area usage duration; and
when there is present a command type whose elapsed time from the latest-command receiving time has exceeded the cache area usage duration, releasing the cache area allocated to the command type, and integrating the cache area with the cache area allocated to any one of the other command types.
US11/109,922 2004-04-20 2005-04-19 Disk device and control method for cache Expired - Fee Related US7539820B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2004-123913 2004-04-20
JP2004123913A JP2005309653A (en) 2004-04-20 2004-04-20 Disk device and cache control method

Publications (2)

Publication Number Publication Date
US20050235108A1 US20050235108A1 (en) 2005-10-20
US7539820B2 true US7539820B2 (en) 2009-05-26

Family

ID=35097657

Family Applications (1)

Application Number Title Priority Date Filing Date
US11/109,922 Expired - Fee Related US7539820B2 (en) 2004-04-20 2005-04-19 Disk device and control method for cache

Country Status (3)

Country Link
US (1) US7539820B2 (en)
JP (1) JP2005309653A (en)
CN (1) CN100378686C (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090106518A1 (en) * 2007-10-19 2009-04-23 International Business Machines Corporation Methods, systems, and computer program products for file relocation on a data storage device
US20110051275A1 (en) * 2009-08-25 2011-03-03 Samsung Electronics Co., Ltd. Computer system, disk storage device and method of controlling the same
US9471504B2 (en) * 2015-02-05 2016-10-18 International Business Machines Corporation Store forwarding cache
US20170083441A1 (en) * 2015-09-23 2017-03-23 Qualcomm Incorporated Region-based cache management

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070143536A1 (en) * 2005-06-07 2007-06-21 Maxtor Corporation Storage device that pre-fetches data responsive to host access stream awareness
US7966450B2 (en) 2005-09-01 2011-06-21 Micron Technology, Inc. Non-volatile hard disk drive cache system and method
TW200732913A (en) * 2006-02-24 2007-09-01 Benq Corp Memory allocation method and system
CN100426261C (en) * 2006-09-08 2008-10-15 华为技术有限公司 High-speed memory pre-read method and device
JP4432087B2 (en) 2006-12-26 2010-03-17 インターナショナル・ビジネス・マシーンズ・コーポレーション Database update management system, program and method
US8307180B2 (en) 2008-02-28 2012-11-06 Nokia Corporation Extended utilization area for a memory device
JP4992835B2 (en) * 2008-06-25 2012-08-08 ソニー株式会社 Disk storage device and program
CN101673188B (en) * 2008-09-09 2011-06-01 上海华虹Nec电子有限公司 Data access method for solid state disk
US8874824B2 (en) 2009-06-04 2014-10-28 Memory Technologies, LLC Apparatus and method to share host system RAM with mass storage memory RAM
WO2012081720A1 (en) * 2010-12-13 2012-06-21 日本電気株式会社 Data management device, system, program, and method
US9417998B2 (en) 2012-01-26 2016-08-16 Memory Technologies Llc Apparatus and method to provide cache move with non-volatile mass memory system
US9311226B2 (en) 2012-04-20 2016-04-12 Memory Technologies Llc Managing operational state data of a memory module using host memory in association with state change
US8886880B2 (en) 2012-05-29 2014-11-11 Dot Hill Systems Corporation Write cache management method and apparatus
US9552297B2 (en) 2013-03-04 2017-01-24 Dot Hill Systems Corporation Method and apparatus for efficient cache read ahead
US9684455B2 (en) 2013-03-04 2017-06-20 Seagate Technology Llc Method and apparatus for sequential stream I/O processing
US9053038B2 (en) 2013-03-05 2015-06-09 Dot Hill Systems Corporation Method and apparatus for efficient read cache operation
US8930619B2 (en) 2012-05-29 2015-01-06 Dot Hill Systems Corporation Method and apparatus for efficiently destaging sequential I/O streams
CN102880559B (en) * 2012-07-31 2015-01-21 中国人民解放军国防科学技术大学 Application sensation-based cache control method and device for microprocessor terminal
CN103838680B (en) * 2012-11-23 2018-03-23 北京四达时代软件技术股份有限公司 A kind of data cache method and device
CN103067467B (en) * 2012-12-21 2016-08-03 深圳市深信服电子科技有限公司 Caching method and device
US9158687B2 (en) 2013-03-04 2015-10-13 Dot Hill Systems Corporation Method and apparatus for processing fast asynchronous streams
US9152563B2 (en) 2013-03-04 2015-10-06 Dot Hill Systems Corporation Method and apparatus for processing slow infrequent streams
US9465555B2 (en) 2013-08-12 2016-10-11 Seagate Technology Llc Method and apparatus for efficient processing of disparate data storage commands
US9135179B2 (en) * 2013-05-01 2015-09-15 Qualcomm, Incorporated System and method of arbitrating cache requests
CN103699660B (en) * 2013-12-26 2016-10-12 清华大学 A kind of method of large scale network stream data caching write
WO2015145932A1 (en) * 2014-03-28 2015-10-01 パナソニックIpマネジメント株式会社 Non-volatile memory device
JP6424330B2 (en) * 2015-10-13 2018-11-21 株式会社アクセル INFORMATION PROCESSING APPARATUS AND INFORMATION PROCESSING METHOD
US10802712B2 (en) 2015-10-13 2020-10-13 Axell Corporation Information processing apparatus and method of processing information
JP6402432B2 (en) * 2016-09-06 2018-10-10 株式会社アクセル Information processing apparatus and information processing method
TWI639921B (en) * 2017-11-22 2018-11-01 大陸商深圳大心電子科技有限公司 Command processing method and storage controller using the same
US20190253357A1 (en) * 2018-10-15 2019-08-15 Intel Corporation Load balancing based on packet processing loads

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05189316A (en) 1992-01-10 1993-07-30 Fujitsu Ltd Disk cache control method
JPH07105095A (en) 1993-10-04 1995-04-21 Fuji Electric Co Ltd Cache control system of disk storage device
JPH10254778A (en) 1997-03-14 1998-09-25 Hitachi Ltd Magnetic disk cache control system
JPH10301847A (en) 1997-04-30 1998-11-13 Nec Corp Data storage device
JP2000056993A (en) 1998-08-10 2000-02-25 Hitachi Ltd Cache memory control method for external storage device controller
US6092149A (en) * 1997-05-28 2000-07-18 Western Digital Corporation Disk drive cache system using a dynamic priority sequential stream of data segments continuously adapted according to prefetched sequential random, and repeating types of accesses
JP2001101076A (en) 1999-10-04 2001-04-13 Alps Electric Co Ltd Disk controller
US20020078300A1 (en) * 1999-08-16 2002-06-20 Chanda Dharap Semantics-based caching policy to minimize latency
US20020116576A1 (en) * 2000-12-27 2002-08-22 Jagannath Keshava System and method for cache sharing
US6526225B1 (en) * 1992-09-21 2003-02-25 Grass Valley (Us), Inc. Disk-based digital video recorder
US6694407B1 (en) * 1999-01-28 2004-02-17 Univerisity Of Bristol Cache memory with data transfer control and method of operating same

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662272B2 (en) * 2001-09-29 2003-12-09 Hewlett-Packard Development Company, L.P. Dynamic cache partitioning
US6944715B2 (en) * 2002-08-13 2005-09-13 International Business Machines Corporation Value based caching

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05189316A (en) 1992-01-10 1993-07-30 Fujitsu Ltd Disk cache control method
US6526225B1 (en) * 1992-09-21 2003-02-25 Grass Valley (Us), Inc. Disk-based digital video recorder
JPH07105095A (en) 1993-10-04 1995-04-21 Fuji Electric Co Ltd Cache control system of disk storage device
JPH10254778A (en) 1997-03-14 1998-09-25 Hitachi Ltd Magnetic disk cache control system
JPH10301847A (en) 1997-04-30 1998-11-13 Nec Corp Data storage device
US6092149A (en) * 1997-05-28 2000-07-18 Western Digital Corporation Disk drive cache system using a dynamic priority sequential stream of data segments continuously adapted according to prefetched sequential random, and repeating types of accesses
JP2000056993A (en) 1998-08-10 2000-02-25 Hitachi Ltd Cache memory control method for external storage device controller
US6694407B1 (en) * 1999-01-28 2004-02-17 Univerisity Of Bristol Cache memory with data transfer control and method of operating same
US20020078300A1 (en) * 1999-08-16 2002-06-20 Chanda Dharap Semantics-based caching policy to minimize latency
JP2001101076A (en) 1999-10-04 2001-04-13 Alps Electric Co Ltd Disk controller
US20020116576A1 (en) * 2000-12-27 2002-08-22 Jagannath Keshava System and method for cache sharing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090106518A1 (en) * 2007-10-19 2009-04-23 International Business Machines Corporation Methods, systems, and computer program products for file relocation on a data storage device
US8112603B2 (en) * 2007-10-19 2012-02-07 International Business Machines Corporation Methods, systems, and computer program products for file relocation on a data storage device
US20110051275A1 (en) * 2009-08-25 2011-03-03 Samsung Electronics Co., Ltd. Computer system, disk storage device and method of controlling the same
US9471504B2 (en) * 2015-02-05 2016-10-18 International Business Machines Corporation Store forwarding cache
US9483409B2 (en) 2015-02-05 2016-11-01 International Business Machines Corporation Store forwarding cache
US9612963B2 (en) 2015-02-05 2017-04-04 International Business Machines Corporation Store forwarding cache
US9697132B2 (en) 2015-02-05 2017-07-04 International Business Machines Corporation Store forwarding cache
US20170083441A1 (en) * 2015-09-23 2017-03-23 Qualcomm Incorporated Region-based cache management

Also Published As

Publication number Publication date
CN1690985A (en) 2005-11-02
US20050235108A1 (en) 2005-10-20
JP2005309653A (en) 2005-11-04
CN100378686C (en) 2008-04-02

Similar Documents

Publication Publication Date Title
US7539820B2 (en) Disk device and control method for cache
US9830939B1 (en) Workload balancing for multiple actuators
US6842801B2 (en) System and method of implementing a buffer memory and hard disk drive write controller
US8639872B1 (en) Hybrid drive comprising write cache spanning non-volatile semiconductor memory and disk
USRE44128E1 (en) Adaptive resource controlled write-back aging for a data storage device
US20060253650A1 (en) Method and apparatus using hard disk drive for enhanced non-volatile caching
US9395934B1 (en) NVMHCI attached hybrid data storage
US7930480B2 (en) Data storage device, control method thereof, and magnetic disk storage device
US20090154000A1 (en) Method and apparatus for writing data with sequential access in a disk drive
JP2007304691A (en) Disk device and read-ahead control method for rotary type memory device
JPH1063578A (en) Information recording and reproducing device
KR101674015B1 (en) Data storage medium access method, data storage device and recording medium thereof
US6795264B2 (en) LBA tracking for system data management
US7487290B2 (en) Disk drive having real time performance improvement
US20040015878A1 (en) Reordering controller, reordering method and storage apparatus
JP2012138154A (en) Magnetic disk device and disk access method in the same device
US20010020260A1 (en) Method and system of reading and writing data by a disk drive apparatus
US7603517B2 (en) Disk storage device and cache control method for disk storage device
JP2006244455A (en) Method and system for accessing audiovisual data in personal computer
US7624228B2 (en) Disk drive and method of controlling cache memory therein
US5875453A (en) Apparatus for and method of information processing
US20030105919A1 (en) Reducing delay of command completion due to overlap condition
JP2003173294A (en) Disk device
JP2005309980A (en) Disk device, and simultaneous execution method of real-time processing and non-real-time processing
JPH064225A (en) Disk controller prereading stand-by sector

Legal Events

Date Code Title Description
AS Assignment

Owner name: HITACHI GLOBAL STORAGE TECHNOLOGIES NETHERLANDS B.

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HIRATSUKA, YUKIE;REEL/FRAME:016010/0008

Effective date: 20050415

FEPP Fee payment procedure

Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

CC Certificate of correction
REMI Maintenance fee reminder mailed
LAPS Lapse for failure to pay maintenance fees
STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Lapsed due to failure to pay maintenance fee

Effective date: 20130526