# US 2003/0212855 A1 · Disk drive system and method for controlling a cache memory

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2003/0212855 A1
- Document ID: US20030212855A1
- Status: Published application
- Kind: A1
- Application number: 10/222,828
- Filed: 2002-08-19
- Published: 2003-11-13
- Earliest claimed: 2002-05-10
- Assignees: Hitachi, Ltd.
- Inventors: Akihiko Sakaguchi; Shinji Fujiwara
- Web page: https://patentgrep.com/patent/US20030212855A1

## CPC

- G06F 12/0871: Allocation or management of cache space
- G06F 12/121: using replacement algorithms
- G06F 12/127: using additional replacement algorithms
- G06F 2212/312: In storage controller
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Disclosed is a disk system for controlling divided areas of a cache memory, which improves the cache hit percentage by preventing data to be accessed so frequently from being swapped out from the cache memory by data not to be accessed so frequently. Identification information is added to each I/O command issued from a CPU. The identification information denotes whether data to be accessed is user data or meta data. A disk controller, when receiving such an I/O command, selects a target virtual area from among a plurality of virtual areas set in the cache memory according to the identification information added to the received I/O command. When new data is to be stored in the cache memory upon the execution of the I/O command, the disk controller records the number of the selected virtual area in the cache memory in correspondence with the new data. Consequently, it is determined which area includes the new data stored segment. A cache data replacement is executed independently for each cache area, thereby a predetermined upper limit size of each cache memory area can be kept.

## Claims

### Claim 1

A disk system, comprising:
a CPU for issuing an I/O command;
a disk drive;
a disk cache memory for storing disk data in each of its segments selectively; and
a disk controller for controlling said disk drive and said disk cache memory;
wherein each segment of said cache memory includes a field for storing an area number; and
wherein said disk controller includes means for recording a value corresponding to a type of said I/O command in said area number field when storing disk data in said cache memory according to said I/O command issued from said CPU, updating said segment area number to a value corresponding to a type of said I/O command each time it accesses data in said cache memory according to said issued I/O command, and controlling swapping out of data from each area of said cache memory according to a predetermined upper limit size set for said area partitioned by said area number in said cache memory.

### Claim 2

A method for controlling a cache memory that stores data selectively in each segment of a disk, said method comprising the steps of:
(a) setting an upper limit size for each of a plurality of virtual areas in said cache memory;
(b) issuing an I/O command that includes identification information for identifying a type of data to be accessed;
(c) selecting a virtual area to be accessed from among said plurality of virtual areas according to said identification information included in said issued I/O command;
(d) determining whether to perform a cache replace processing so as to store new data when said data to be accessed by said issued I/O command is not found in said cache memory; and
(e) selecting cache data to be replaced with new data, said cache data having the same virtual area number as that of said virtual area when said cache replace processing is to be performed, then replacing said data with new data, storing said new data when said cache replace processing is not to be performed, and recording the number of said selected virtual area corresponding to said new data in any of said above cases.

### Claim 3 (depends on 2)

The method according to claim 2;
wherein whether to perform said cache replace processing is determined according to whether or not the size of the stored cache data has reached a predetermined upper limit size set for said virtual area, said cache memory having the same virtual area number as that of said selected virtual area.

### Claim 4 (depends on 2)

The method according to claim 2;
wherein said method further includes a step of accessing said data and determining whether or not the number of a virtual area corresponding to said data matches with the number of said selected virtual area when said data to be accessed by said issued I/O command is found in said cache memory, as well as updating said number of said virtual area corresponding to said data to the number of said selected virtual area when said determination result is NO.

### Claim 5 (depends on 4)

The method according to claim 4;
wherein said method further includes a step of swapping out one of cache memory data items having said same virtual area number from said cache memory upon updating of said virtual area number when the total size of cache data items having the same virtual area number as that of said selected virtual area has reached a predetermined upper limit size set for said virtual area.

### Claim 6 (depends on 2)

The method according to claim 2;
wherein an algorithm for selecting one of said plurality of virtual areas subjected to said cache replace processing differs from others for selecting any of the rest virtual areas subjected to cache replace processings.

### Claim 7 (depends on 2)

The method according to claim 2;
wherein one of said plurality of virtual areas is a default area and the number of said default area is recorded in correspondence with each segment of said cache memory before data is stored therein.

### Claim 8 (depends on 7)

The method according to claim 7;
wherein, when said selected area is said default area, whether to perform said cache replace processing is determined by whether or not any empty area is found in said cache memory; and
wherein, when said selected virtual area is not said default area, said determination is done according to whether or not the size of the stored cache data having the virtual area number has reached an upper limit size set for said virtual area.

### Claim 9 (depends on 7)

The method according to claim 7;
wherein said method further includes a step of determining whether or not the number of a virtual area corresponding to the data to be accessed by said issued I/O command matches with that of said selected virtual area when said data is found in said cache memory and accessing said data to update the number of said virtual area corresponding to said data to the number of said selected virtual area when said determination result is NO.

### Claim 10 (depends on 9)

The method according to claim 9;
wherein said method further includes a step of swapping out one of cache data items having said same area number upon updating said virtual area number when the total size of cache data items having the same virtual area number as that of said selected virtual area has already reached a predetermined upper limit size.

### Claim 11 (depends on 7)

The method according to claim 7;
wherein said method further includes a step of updating numbers of all the specified virtual areas except for said default area to the number of said default area, thereby saving all of said data in said default area.

### Claim 12 (depends on 2)

The method according to claim 2;
wherein said method further includes a step of purging all the cache data items having a specified virtual area number from said cache memory.

### Claim 13 (depends on 2)

The method according to claim 2;
wherein said identification information is used at least to identify whether the data to be accessed is user data or meta data and accordingly, one of said plurality of virtual areas is used to store user data.

### Claim 14 (depends on 9)

The method according to claim 9;
wherein whether to perform said cache replace processing is determined by the determination result of whether or not said cache memory includes any empty area when said selected virtual area is used to store user data, and by the determination result of whether or not the size of the stored cache memory data having said virtual area number has reached an upper limit size set for said virtual area when said selected virtual area is not used to store user data.
