# US 2017/0293565 A1 · Selective bypassing of allocation in a cache

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

- Number: US 2017/0293565 A1
- Document ID: US20170293565A1
- Status: Published application
- Kind: A1
- Application number: 15/273,270
- Filed: 2016-09-22
- Published: 2017-10-12
- Earliest claimed: 2016-04-08
- Assignees: QUALCOMM Incorporated
- Applicants: QUALCOMM Incorporated
- Inventors: Shivam PRIYADARSHI; Brandon Harley Anthony DWIEL; Rami Mohammad A. AL SHEIKH; Harold Wade CAIN III
- Web page: https://patentgrep.com/patent/US20170293565A1

## CPC

- G06F 12/0888: using selective caching, e.g. bypass
- G06F 12/0811: with multilevel cache hierarchies
- G06F 12/126: with special data handling, e.g. priority of data or instructions, handling errors or pinning
- G06F 12/128: adapted to multidimensional cache systems, e.g. set-associative, multicache, multiset or multilevel
- G06F 12/084: with a shared cache
- G06F 12/12: Replacement control
- G06F 2212/1021: Hit rate improvement
- G06F 2212/1028: Power efficiency
- G06F 2212/283: Plural cache memories
- G06F 2212/502: using adaptive policy
- G06F 2212/6046: Using a specific cache allocation policy other than replacement policy
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

Systems and methods are directed to selectively bypassing allocation of cache lines in a cache. A bypass predictor table is provided with reuse counters to track reuse characteristics of cache lines, based on memory regions to which the cache lines belong in memory. A contender reuse counter provides an indication of a likelihood of reuse of a contender cache line in the cache pursuant to a miss in the cache for the contender cache line, and a victim reuse counter provides an indication of a likelihood of reuse for a victim cache line that will be evicted if the contender cache line is allocated in the cache. A decision whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache is based on the contender reuse counter value and the victim reuse counter value.

## Claims

### Claim 1

A method of managing allocation in a cache, the method comprising:
pursuant to a miss in the cache for a contender cache line, determining a contender reuse counter value indicative of a likelihood of reuse of the contender cache line in the cache;
determining a victim reuse counter value indicative of a likelihood of reuse for a victim cache line that will be evicted if the contender cache line is allocated in the cache; and
determining whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache, based on the contender reuse counter value and the victim reuse counter value.

### Claim 2 (depends on 1)

The method of claim 1, organizing, in entries of a bypass predictor table, reuse counter values for memory regions comprising cache lines.

### Claim 3 (depends on 2)

The method of claim 2, wherein if the bypass predictor table does not comprise the contender reuse counter value in a first entry corresponding to a first memory region comprising the contender cache line, creating the first entry and incrementing the contender reuse counter value by a first amount.

### Claim 4 (depends on 2)

The method of claim 2, wherein if the bypass predictor table does not comprise the victim reuse counter value in a second entry corresponding to a second memory region comprising the victim cache line, determining the victim reuse counter value based on a global eviction counter.

### Claim 5 (depends on 4)

The method of claim 4, wherein the global eviction counter comprises a running average of reuse counters of evicted memory regions comprising evicted cache lines.

### Claim 6 (depends on 2)

The method of claim 2, further comprising tagging each entry of the bypass predictor table with at least a portion of memory addresses belonging to the memory region corresponding to the entry.

### Claim 7 (depends on 2)

The method of claim 2, wherein the bypass predictor table is an untagged structure and two or more memory regions have interference with a single entry of the bypass predictor table.

### Claim 8 (depends on 7)

The method of claim 7, wherein the interference is one of constructive or destructive.

### Claim 9 (depends on 2)

The method of claim 2, wherein the memory region comprises two or more contiguous physical addresses.

### Claim 10 (depends on 2)

The method of claim 2, further comprising tracking, in a miss counter associated with each entry, a number of consecutive misses to a memory region corresponding to the entry, and if the number of consecutive misses is greater than a pre-specified threshold, preventing bypassing allocation in the cache of the contender cache line of the memory region until a hit is observed in the cache for the memory region.

### Claim 11 (depends on 1)

The method of claim 1, comprising determining to bypass allocation of the contender cache line in the cache if the contender reuse counter value is less than the victim reuse counter value.

### Claim 12 (depends on 1)

The method of claim 1, comprising decrementing the victim reuse counter value by a second amount to generate a decremented victim reuse counter value, and determining to bypass allocation of the contender cache line in the cache if the contender reuse counter value is less than the decremented victim reuse counter value multiplied by a third amount.

### Claim 13 (depends on 12)

The method of claim 12, comprising decreasing the third amount to increase restriction on bypassing allocation of the contender cache line in the cache.

### Claim 14 (depends on 13)

The method of claim 13, comprising setting the third amount to a low value if the contender cache line is a prefetch cache line.

### Claim 15 (depends on 1)

The method of claim 1, further comprising determining whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache based on whether the miss in the cache for the contender cache line is an instruction cache miss, demand load miss, or prefetch miss.

### Claim 16 (depends on 1)

The method of claim 1 comprising dividing sets of the cache into groups and flexibly enabling or disabling bypassing of allocation in the cache based on set dueling among the groups, with a first leader group having bypassing enabled, a second leader group having bypassing disabled, and follower groups assigned one of the bypassing policies of the first leader group or the second leader group based on respective performances of the first and second leader groups.

### Claim 17

An apparatus comprising:
a cache;
a bypass predictor table, wherein the bypass predictor table comprises:
a contender reuse counter configured to indicate of a likelihood of reuse of a contender cache line in the cache pursuant to a miss in the cache for the contender cache line; and
a victim reuse counter configured to indicate a likelihood of reuse for a victim cache line that will be evicted if the contender cache line is allocated in the cache; and
a cache controller configured to determine whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache, based on the contender reuse counter value and the victim reuse counter value.

### Claim 18 (depends on 17)

The apparatus of claim 17 wherein entries of the bypass predictor table comprise reuse counter values for memory regions comprising cache lines.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein if the bypass predictor table does not comprise the contender reuse counter value in a first entry corresponding to a first memory region comprising the contender cache line, the cache controller is configured to insert the first entry in the bypass predictor table and increment the contender reuse counter value by a first amount.

### Claim 20 (depends on 19)

The apparatus of claim 19, further comprising a global eviction counter, wherein the cache controller is configured to determine the victim reuse counter value if the bypass predictor table does not comprise the victim reuse counter value in a second entry corresponding to a second memory region comprising the victim cache line.

### Claim 21 (depends on 20)

The apparatus of claim 20, wherein the global eviction counter comprises a running average of reuse counters of evicted memory regions comprising evicted cache lines.

### Claim 22 (depends on 18)

The apparatus of claim 18, wherein each entry of the bypass predictor table further comprises a tag, wherein the tag comprises at least a portion of memory addresses belonging to the memory region corresponding to the entry.

### Claim 23 (depends on 18)

The apparatus of claim 18, wherein the bypass predictor table is an untagged structure and two or more memory regions have interference with a single entry of the bypass predictor table.

### Claim 24 (depends on 18)

The apparatus of claim 18, wherein each entry further comprises a miss counter configured to track a number of consecutive misses to a memory region corresponding to the entry, and wherein if the number of consecutive misses is greater than a pre-specified threshold, the cache controller is configured to prevent bypassing allocation in the cache of the contender cache line of the memory region until a hit is observed in the cache for the memory region.

### Claim 25 (depends on 18)

The apparatus of claim 18, wherein the cache controller is configured to bypass allocation of the contender cache line in the cache if the contender reuse counter value is less than the a third amount multiplied with the victim reuse counter value decremented by a second amount.

### Claim 26 (depends on 25)

The apparatus of claim 25, wherein the cache controller is configured to decrease the third amount to increase restriction on bypassing allocation of the contender cache line in the cache.

### Claim 27 (depends on 17)

The apparatus of claim 17, wherein the cache controller is further configured to determine whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache based on whether the miss in the cache for the contender cache line is an instruction cache miss, demand load miss, or prefetch miss.

### Claim 28 (depends on 17)

The apparatus of claim 17, wherein the cache controller is configured to apply set dueling among sets of the cache divided into groups, with a first leader group having bypassing enabled, a second leader group having bypassing disabled, and follower groups assigned one of the bypassing policies of the first leader group or the second leader group based on respective performances of the first and second leader groups.

### Claim 29

An apparatus comprising
a cache;
means for indicating of a likelihood of reuse of a contender cache line in the cache, pursuant to a miss in the cache for the contender cache line;
means for indicating a likelihood of reuse of a victim cache line that will be evicted if the contender cache line is allocated in the cache; and
means for determining whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache, based on the means for indicating of the likelihood of reuse of the contender cache line and the means for indicating the likelihood of reuse of the victim cache line.

### Claim 30

A non-transitory computer readable storage medium comprising code, which, when executed by a processor, causes the processor to perform operations for managing allocation in a cache, the non-transitory computer readable storage medium comprising:
code for determining a contender reuse counter value indicative of a likelihood of reuse of the contender cache line in the cache pursuant to a miss in the cache for the contender cache line;
code for determining a victim reuse counter value indicative of a likelihood of reuse for a victim cache line that will be evicted if the contender cache line is allocated in the cache; and
code for determining whether to allocate the contender cache line in the cache or bypass allocation of the contender cache line in the cache, based on the contender reuse counter value and the victim reuse counter value.
