# US 2023/0418765 A1 · Cache replacement control

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

- Number: US 2023/0418765 A1
- Document ID: US20230418765A1
- Status: Published application
- Kind: A1
- Application number: 17/850,072
- Filed: 2022-06-27
- Published: 2023-12-28
- Earliest claimed: 2022-06-27
- Assignees: Arm Limited
- Applicants: Arm Limited
- Inventors: Andrew David TUNE; Andrew Brookfield SWAINE
- Web page: https://patentgrep.com/patent/US20230418765A1

## CPC

- G06F 12/121: using replacement algorithms
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F 12/0646: {Configuration or reconfiguration}
- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 12/128: adapted to multidimensional cache systems, e.g. set-associative, multicache, multiset or multilevel
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus comprises a cache comprising a plurality of cache entries, and cache replacement control circuitry to select, in response to a cache request specifying a target address missing in the cache, a victim cache entry to be replaced with a new cache entry. The cache request specifies a partition identifier indicative of an execution environment associated with the cache request. The victim cache entry is selected based on re-reference interval prediction (RRIP) values for a candidate set of cache entries. The RRIP value for a given cache entry is indicative of a relative priority with which the given cache entry is to be selected as the victim cache entry. Configurable replacement policy configuration data is selected based on the partition identifier, and the RRIP value of the new cache entry is set to an initial value selected based on the selected configurable replacement policy configuration data. [FIG. 1]

## Claims

### Claim 1

An apparatus comprising:
a cache comprising a plurality of cache entries; and
cache replacement control circuitry to select, in response to a cache request specifying a target address missing in the cache, a victim cache entry to be replaced with a new cache entry, the cache request specifying a partition identifier indicative of an execution environment associated with the cache request; in which:
the cache replacement control circuitry is configured to:
select the victim cache entry based on re-reference interval prediction (RRIP) values for a candidate set of cache entries, the RRIP value for a given cache entry being indicative of a relative priority with which the given cache entry is to be selected as the victim cache entry;
select, based on the partition identifier specified by the cache request, configurable replacement policy configuration data associated with the partition identifier; and
set the RRIP value of the new cache entry to an initial value selected based on the selected configurable replacement policy configuration data associated with the partition identifier.

### Claim 2 (depends on 1)

The apparatus according to claim 1, comprising partition identifier selection circuitry to select the partition identifier associated with the cache request based on information specified in at least one register.

### Claim 3 (depends on 2)

The apparatus according to claim 2, in which the at least one register is configurable in response to instructions processed by processing circuitry.

### Claim 4 (depends on 1)

The apparatus according to claim 1, comprising a replacement policy configuration data programming interface to program the configurable replacement policy configuration data associated with a given partition identifier in response to instructions processed by processing circuitry.

### Claim 5 (depends on 1)

The apparatus according to claim 1, in which the selected configurable replacement policy configuration data specifies the initial value for the RRIP value of the new cache entry.

### Claim 6 (depends on 1)

The apparatus according to claim 1, in which the selected configurable replacement policy configuration data specifies which of a plurality of RRIP modes to use for selecting the initial value for the RRIP value of the new cache entry.

### Claim 7 (depends on 6)

The apparatus according to claim 6, in which the plurality of RRIP modes include:
a static RRIP mode which uses a static initial value for the RRIP value of the new cache entry; and
a bimodal RRIP mode which selects, based on an outcome of a chance-dependent test having a given probability of resulting in a first outcome, a first initial value for the RRIP value of the new cache entry when the chance-dependent test provides the first outcome and a second initial value for the RRIP value of the new cache entry when the chance-dependent test provides the second outcome.

### Claim 8 (depends on 7)

The apparatus according to claim 7, in which at least one of the static initial value, the first initial value and the second initial value is configurable based on the selected configurable replacement policy configuration data.

### Claim 9 (depends on 1)

The apparatus according to claim 1, in which the selected configurable replacement policy configuration data specifies whether the cache replacement control circuitry is to select the initial value for the new cache entry based on RRIP information provided by a higher-level cache from which information is capable of being evicted to the cache.

### Claim 10 (depends on 1)

The apparatus according to claim 1, in which, in response to the cache request hitting in a matching cache entry of the cache, the cache replacement control circuitry is configured to determine how to adjust the RRIP value of the matching cache entry based on the selected configurable replacement policy configuration data associated with the partition identifier specified by the cache request.

### Claim 11 (depends on 10)

The apparatus according to claim 10, in which, based on the selected configurable replacement policy configuration data associated with the partition identifier specified by the cache request, the cache replacement control circuitry is configured to determine whether to:
set the RRIP value of the matching cache entry to a predetermined value; or
adjust the RRIP value of the matching cache entry from its current value indicating a given priority for selection as the victim cache entry to a next value indicating a next lowest priority for selection as the victim cache entry.

### Claim 12 (depends on 1)

The apparatus according to claim 1, comprising performance monitoring circuitry to maintain a plurality of instances of performance monitoring information associated with respective partition identifiers, a given instance of performance monitoring information for a given partition identifier specifying information indicative of performance detected for the execution environment associated with the given partition identifier.

### Claim 13 (depends on 1)

The apparatus according to claim 1, in which the cache request also specifies a security state identifier indicative of a security state associated with the cache request; and
the cache replacement control circuitry is configured to select the configurable replacement policy configuration data based on the partition identifier and the security state identifier.

### Claim 14 (depends on 1)

The apparatus according to claim 1, in which, in a lookup of the cache based on the target address of the cache request, whether the lookup detects a hit or miss is independent of the partition identifier specified by the cache request.

### Claim 15 (depends on 1)

The apparatus according to claim 1, comprising:
at least one central processing unit; and
at least one graphics processing unit;
where the cache is a shared cache accessible to the at least one central processing unit and also accessible to the at least one graphics processing unit.

### Claim 16

A method comprising:
in response to a cache request specifying a target address missing in the cache, selecting a victim cache entry to be replaced with a new cache entry, the cache request specifying a partition identifier indicative of an execution environment associated with the cache request, and the victim cache entry being selected based on re-reference interval prediction (RRIP) values for a candidate set of cache entries, the RRIP value for a given cache entry being indicative of a relative priority with which the given cache entry is to be selected as the victim cache entry;
selecting, based on the partition identifier specified by the cache request, configurable replacement policy configuration data associated with the partition identifier; and
setting the RRIP value of the new cache entry to an initial value selected based on the selected configurable replacement policy configuration data associated with the partition identifier.

### Claim 17 (depends on 16)

The method of claim 16, comprising selecting the partition identifier associated with the cache request based on information specified in at least one register.

### Claim 18 (depends on 17)

The method of claim 17, in which the at least one register is configurable in response to instructions processed by processing circuitry.

### Claim 19 (depends on 16)

The method according to claim 16, comprising programming the configurable replacement policy configuration data associated with a given partition identifier in response to instructions processed by the processing circuitry.

### Claim 20

A non-transitory computer-readable medium to store computer-readable code for fabrication of an apparatus comprising:
a cache comprising a plurality of cache entries; and
cache replacement control circuitry to select, in response to a cache request specifying a target address missing in the cache, a victim cache entry to be replaced with a new cache entry, the cache request specifying a partition identifier indicative of an execution environment associated with the cache request; in which:
the cache replacement control circuitry is configured to:
select the victim cache entry based on re-reference interval prediction (RRIP) values for a candidate set of cache entries, the RRIP value for a given cache entry being indicative of a relative priority with which the given cache entry is to be selected as the victim cache entry;
select, based on the partition identifier specified by the cache request, configurable replacement policy configuration data associated with the partition identifier; and
set the RRIP value of the new cache entry to an initial value selected based on the selected configurable replacement policy configuration data associated with the partition identifier.
