# US 8,788,757 B2 · Dynamic inclusive policy in a hybrid cache hierarchy using hit rate

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

- Number: US 8,788,757 B2
- Document ID: US8788757B2
- Status: Granted
- Kind: B2
- Application number: 13/315,381
- Filed: 2011-12-09
- Published: 2013-06-13
- Granted: 2014-07-22
- Earliest claimed: 2011-12-09
- Assignees: International Business Machines Corporation
- Applicants: David M. Daly; Benjiman L. Goodman; Stephen J. Powell; Aaron C. Sawdey; Jeffrey A. Stuecheli
- Inventors: David M. Daly; Benjiman L. Goodman; Stephen J. Powell; Aaron C. Sawdey; Jeffrey A. Stuecheli
- Web page: https://patentgrep.com/patent/US8788757B2

## CPC

- G06F 12/0888: using selective caching, e.g. bypass
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A mechanism is provided for dynamic cache allocation using a cache hit rate. A first cache hit rate is monitored in a first subset utilizing a first allocation policy of N sets of a lower level cache. A second cache hit rate is also monitored in a second subset utilizing a second allocation policy different from the first allocation policy of the N sets of the lower level cache. A periodic comparison of the first cache hit rate to the second cache hit rate is made to identify a third allocation policy for a third subset of the N-sets of the lower level cache. The third allocation policy for the third subset is then periodically adjusted to at least one of the first allocation policy or the second allocation policy based on the comparison of the first cache hit rate to the second cache hit rate.

## Claims

### Claim 1

A method, in a data processing system, for dynamic cache allocation using a cache hit rate, the method comprising:
monitoring a first cache hit rate in a first subset of N sets of a lower level cache, wherein the first subset is utilizing a first allocation policy;
monitoring a second cache hit rate in a second subset of the N sets of the lower level cache, wherein the second subset is utilizing a second allocation policy different from the first allocation policy;
periodically comparing the first cache hit rate to the second cache hit rate to identify a third allocation policy for a third subset of the N-sets of the lower level cache, wherein the third allocation policy is at least one of the first allocation policy or the second allocation policy; and
periodically adjusting the third allocation policy for the third subset of the N-sets of the lower level cache based on the comparison of the first cache hit rate to the second cache hit rate.

### Claim 2 (depends on 1)

The method of claim 1, wherein, responsive to the first cache hit rate being greater than the second cache hit rate, the third allocation policy is adjusted to the first allocation policy.

### Claim 3 (depends on 1)

The method of claim 1, wherein, responsive to the second cache hit rate being greater than the first cache hit rate, the third allocation policy is adjusted to the second allocation policy.

### Claim 4 (depends on 1)

The method of claim 1, wherein the periodic comparison and the periodic adjustment is performed when a maximum number of references to the lower level cache have occurred.

### Claim 5 (depends on 1)

The method of claim 1, wherein he periodic comparison and the periodic adjustment is performed when a maximum number of cycles have occurred.

### Claim 6 (depends on 1)

The method of claim 1, wherein the first allocation policy is an inclusive policy where modified data and unmodified data are allocated to the lower level cache from an adjacent higher level cache.

### Claim 7 (depends on 1)

The method of claim 1, wherein the second allocation policy is an exclusive policy where modified data is allocated to the lower level cache from an adjacent higher level cache but unmodified data is never allocated to the lower level cache from the adjacent higher level cache.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first cache hit rate and the second cache hit rate are periodically adjusted by dividing each of the first cache hit rate and the second cache hit rate by a predetermined value in order to weigh current hit rates higher than past hit rates.

### Claim 9 (depends on 1)

The method of claim 1, wherein prior to periodically comparing the first cache hit rate to the second cache hit rate, the first cache hit rate is normalized based on a number of members in first subset and the second cache hit rate is normalized based on a number of members in second subset.

### Claim 10

A computer program product comprising a non-transitory computer readable storage medium having a computer readable program stored therein, wherein the computer readable program, when executed on a computing device, causes the computing device to:
monitor a first cache hit rate in a first subset of N sets of a lower level cache, wherein the first subset is utilizing a first allocation policy;
monitor a second cache hit rate in a second subset of the N sets of the lower level cache, wherein the second subset is utilizing a second allocation policy different from the first allocation policy;
periodically compare the first cache hit rate to the second cache hit rate to identify a third allocation policy for a third subset of the N-sets of the lower level cache, wherein the third allocation policy is at least one of the first allocation policy or the second allocation policy; and
periodically adjust the third allocation policy for the third subset of the N-sets of the lower level cache based on the comparison of the first cache hit rate to the second cache hit rate.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein, responsive to the first cache hit rate being greater than the second cache hit rate, the third allocation policy is adjusted to the first allocation policy.

### Claim 12 (depends on 10)

The computer program product of claim 10, wherein, responsive to the second cache hit rate being greater than the first cache hit rate, the third allocation policy is adjusted to the second allocation policy.

### Claim 13 (depends on 10)

The computer program product of claim 10, wherein the periodic comparison and the periodic adjustment is performed when a maximum number of references to the lower level cache have occurred.

### Claim 14 (depends on 10)

The computer program product of claim 10, wherein the, periodic comparison and the periodic adjustment is performed when a maximum number of cycles have occurred.

### Claim 15 (depends on 10)

The computer program product of claim 10, wherein the first allocation policy is an inclusive policy where modified data and unmodified data are allocated to the lower level cache from an adjacent higher level cache.

### Claim 16 (depends on 10)

The computer program product of claim 10, wherein the second allocation policy is an exclusive policy where modified data is allocated to the lower level cache from an adjacent higher level cache but unmodified data is never allocated to the lower level cache from the adjacent higher level cache.

### Claim 17

An apparatus, comprising:
a processor; and
a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to:
monitor a first cache hit rate in a first subset of N sets of a lower level cache, wherein the first subset is utilizing a first allocation policy;
monitor a second cache hit rate in a second subset of the N sets of the lower level cache, wherein the second subset is utilizing a second allocation policy different from the first allocation policy;
periodically compare the first cache hit rate to the second cache hit rate to identify a third allocation policy for a third subset of the N-sets of the lower level cache, wherein the third allocation policy is at least one of the first allocation policy or the second allocation policy; and
periodically adjust the third allocation policy for the third subset of the N-sets of the lower level cache based on the comparison of the first cache hit rate to the second cache hit rate.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein, responsive to the first cache hit rate being greater than the second cache hit rate, the third allocation policy is adjusted to the first allocation policy.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein, responsive to the second cache hit rate being greater than the first cache hit rate, the third allocation policy is adjusted to the second allocation policy.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein the periodic comparison and the periodic adjustment is performed when a maximum number of references to the lower level cache have occurred.

### Claim 21 (depends on 17)

The apparatus of claim 17, wherein the periodic comparison and the periodic adjustment is performed when a maximum number of cycles have occurred.

### Claim 22 (depends on 17)

The apparatus of claim 17, wherein the first allocation policy is an inclusive policy where modified data and unmodified data are allocated to the lower level cache from an adjacent higher level cache.

### Claim 23 (depends on 17)

The apparatus of claim 17, wherein the second allocation policy is an exclusive policy where modified data is allocated to the lower level cache from an adjacent higher level cache but unmodified data is never allocated to the lower level cache from the adjacent higher level cache.
