# US 2017/0293561 A1 · Reducing memory access bandwidth based on prediction of memory request size

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

- Number: US 2017/0293561 A1
- Document ID: US20170293561A1
- Status: Published application
- Kind: A1
- Application number: 15/270,331
- Filed: 2016-09-20
- Published: 2017-10-12
- Earliest claimed: 2016-04-08
- Assignees: QUALCOMM Incorporated
- Applicants: QUALCOMM Incorporated
- Inventors: Brandon Harley Anthony DWIEL; Harold Wade CAIN, III; Shivam PRIYADARSHI
- Web page: https://patentgrep.com/patent/US20170293561A1

## CPC

- G06F 12/0862: with prefetch
- G06F 12/0811: with multilevel cache hierarchies
- G06F 12/084: with a shared cache
- G06F 12/0886: Variable-length word access
- G06F 13/1668: {Details of memory controller}
- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 2212/1021: Hit rate improvement
- G06F 2212/602: Details relating to cache prefetching
- G06F 2212/6024: History based prefetching
- G06F 2212/62: Details of cache specific to multiprocessor cache arrangements
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for managing memory access bandwidth include a spatial locality predictor. The spatial locality predictor includes a memory region table with prediction counters associated with memory regions of a memory. When cache lines are evicted from a cache, the sizes of the cache lines which were accessed by a processor are used for updating the prediction counters. Depending on values of the prediction counters, the sizes of cache lines which are likely to be used the processor predicted for the corresponding memory regions. Correspondingly, the memory access bandwidth between the processor and the memory may be reduced to fetch a smaller size data than a full cache line if the size of the cache line likely to be used is predicted to be less than that of the full cache line.

## Claims

### Claim 1

A method of managing memory access bandwidth, the method comprising:
determining a size of a used portion of a first cache line stored in a first cache which is accessed by a processor;
for a first memory region in a memory comprising the first cache line, updating a prediction counter for making predictions of sizes of cache lines to be fetched from the first memory region, based on the size of the used portion; and
adjusting a memory access bandwidth between the processor and the memory to correspond to the sizes of the cache lines to be fetched.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first cache is a level-two (L2) cache comprising at least a first accessed bit corresponding to a first half cache line size data of the first cache line and a second accessed bit corresponding to a second half cache line size data of the first cache line, wherein determining the size of the used portion of the first cache line is based on which one or more of the first accessed bit or second accessed bit are set.

### Claim 3 (depends on 2)

The method of claim 2, comprising determining which one or more of the first accessed bit or the second accessed bit is set when the first cache line is evicted from the L2 cache.

### Claim 4 (depends on 3)

The method of claim 3, wherein updating the prediction counter comprises:
incrementing the prediction counter by a first amount when only one of the first accessed bit or the second accessed bit is set when the first cache line is evicted from the L2 cache;
decrementing the prediction counter by a second amount when both the first accessed bit and the second accessed bit are set when the first cache line is evicted from the L2 cache; and
decrementing the prediction counter by a third amount when a request is received from the processor at the first cache for a portion of the first cache line which was not fetched.

### Claim 5 (depends on 4)

The method of claim 4, comprising adjusting the memory access bandwidth for fetching a second cache line from the first memory region to correspond to the half cache line size if the value of the prediction counter is greater than zero.

### Claim 6 (depends on 4)

The method of claim 4 comprising adjusting the memory access bandwidth for fetching a second cache line from the first memory region to correspond the full cache line size if the value of the prediction counter is less than or equal to zero.

### Claim 7 (depends on 1)

The method of claim 1, comprising storing the prediction counter for the first memory region in a first entry of a memory region table comprising one or more entries for one or more memory regions, and tagging the first entry with a first tag corresponding to memory addresses in the first memory region.

### Claim 8 (depends on 7)

The method of claim 7, comprising accessing the memory region table with a second memory address of a second cache line and if a second entry with a second tag corresponding to the second memory address is present in the memory region table, determining a prediction for the size of the second cache line to be fetched from the second memory region, based on a second prediction counter stored in the second entry.

### Claim 9 (depends on 8)

The method of claim 8, wherein if the second entry is not present in the memory region table, using a global prediction counter for determining a prediction for the size of the second cache line to be fetched from the second memory region.

### Claim 10 (depends on 1)

The method of claim 1, comprising tracking a number of mispredictions of sizes of cache lines to be fetched based on the prediction counter and determining whether to flexibly enable or disable adjusting the memory access bandwidth based on the number of mispredictions.

### Claim 11 (depends on 1)

The method of claim 1, comprising flexibly enabling or disabling adjusting the memory access bandwidth based on bandwidth contention.

### Claim 12 (depends on 11)

The method of claim 11, comprising measuring bandwidth contention by comparing latencies of servicing requests to the memory against expected latencies.

### Claim 13 (depends on 1)

The method of claim 1, further comprising storing the cache lines fetched from the first memory region based on the adjusted memory access bandwidth in a second cache.

### Claim 14

An apparatus comprising:
a processor configured to access a first cache;
a memory;
a predictor comprising a prediction counter configured to make predictions of sizes of cache lines to be fetched from a first memory region of the memory, based on a size of a used portion of a first cache line stored in the first cache; and
a memory controller configured to adjust a memory access bandwidth between the processor and the memory, to correspond to the sizes of the cache lines to be fetched.

### Claim 15 (depends on 14)

The apparatus of claim 14, wherein the first cache is a level-two (L2) cache comprising at least a first accessed bit corresponding to a first half cache line size data of the first cache line and a second accessed bit corresponding to a second half cache line size data of the first cache line, wherein the predictor is configured to determine the size of the used portion of the first cache line based on which one or more of the first accessed bit or second accessed bit are set.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the predictor is configured to determine which one or more of the first accessed bit or the second accessed bit is set when the first cache line is evicted from the L2 cache.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein predictor is configured to:
increment the prediction counter by a first amount when only one of the first accessed bit or the second accessed bit is set when the first cache line is evicted from the L2 cache;
decrement the prediction counter by a second amount when both the first accessed bit and the second accessed bit are set when the first cache line is evicted from the L2 cache; and
decrement the prediction counter by a third amount when a request is received from the processor at the first cache for a portion of the first cache line which was not fetched.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein the memory controller is configured to adjust the memory access bandwidth for fetching a second cache line from the first memory region to correspond to the half cache line size if the value of the prediction counter is greater than zero.

### Claim 19 (depends on 17)

The apparatus of claim 17, wherein the memory controller is configured to adjust the memory access bandwidth for fetching a second cache line from the first memory region to correspond the full cache line size if the value of the prediction counter is less than or equal to zero.

### Claim 20 (depends on 17)

The apparatus of claim 17, wherein the predictor comprises a memory region table comprising: one or more entries configured to store prediction counters for one or more memory regions and corresponding one or more tags for the one or more entries.

### Claim 21 (depends on 17)

The apparatus of claim 17, wherein the predictor comprises a global prediction counter configured to predict a size of a second cache line to be fetched from a second memory region if a second entry with a second tag corresponding to the second memory address is not present in the memory region table.

### Claim 22 (depends on 14)

The apparatus of claim 14, comprising a bandwidth contention detector configured to determine bandwidth contention and flexibly enable or disable adjustments to the memory access bandwidth based on the predictor.

### Claim 23 (depends on 14)

The apparatus of claim 14, further comprising a second cache configured to store the cache lines fetched from the first memory region based on the adjusted memory access bandwidth.

### Claim 24 (depends on 14)

The apparatus of claim 14 integrated into a device selected from the group consisting of a set top box, a music player, a video player, an entertainment unit, a navigation device, a personal digital assistant (PDA), a fixed location data unit, a computer, a laptop, a tablet, a communications device, and a mobile phone.

### Claim 25

An apparatus comprising:
means for determining a size of a used portion of a first cache line stored in a first cache which is accessed by a processor;
for a first memory region in a memory comprising the first cache line, means for updating a prediction of sizes of cache lines to be fetched from the first memory region, based on the size of the used portion; and
means for adjusting a memory access bandwidth between the processor and the memory to correspond to the sizes of the cache lines to be fetched.

### Claim 26 (depends on 25)

The apparatus of claim 25, comprising at least a first means for indicating access of a first half cache line size data of the first cache line and a second means for indicating access of a second half cache line size data of the first cache line, and means for determining the size of the used portion of the first cache line based on the first and second means for indicating access.

### Claim 27 (depends on 25)

The apparatus of claim 25 comprising means for flexibly enabling or disabling adjusting the memory access bandwidth based on bandwidth contention.

### Claim 28

A non-transitory computer readable storage medium comprising code, which, when executed by a computer, causes the computer to perform operations for managing memory access bandwidth, the non-transitory computer readable storage medium comprising:
code for determining a size of a used portion of a first cache line stored in a first cache which is accessed by a processor;
for a first memory region in a memory comprising the first cache line, code for updating a prediction counter for making predictions of sizes of cache lines to be fetched from the first memory region, based on the size of the used portion; and
code for adjusting a memory access bandwidth between the processor and the memory to correspond to the sizes of the cache lines to be fetched.

### Claim 29 (depends on 28)

The non-transitory computer readable storage medium of claim 28, wherein the first cache is a level-two (L2) cache comprising at least a first accessed bit corresponding to a first half cache line size data of the first cache line and a second accessed bit corresponding to a second half cache line size data of the first cache line, and code for determining the size of the used portion of the first cache line based on which one or more of the first accessed bit or second accessed bit are set.

### Claim 30 (depends on 27)

The non-transitory computer readable storage medium of claim 27 comprising code for flexibly enabling or disabling adjusting the memory access bandwidth based on bandwidth contention.
