# US 10,310,981 B2 · Method and apparatus for performing memory prefetching

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

- Number: US 10,310,981 B2
- Document ID: US10310981B2
- Status: Granted
- Kind: B2
- Application number: 15/268,953
- Filed: 2016-09-19
- Published: 2017-10-12
- Granted: 2019-06-04
- Earliest claimed: 2016-04-07
- Assignees: Advanced Micro Devices, Inc.
- Applicants: Advanced Micro Devices, Inc.
- Inventors: Yasuko Eckert; Nuwan Jayasena; Reena Panda; Onur Kayiran; Michael W. Boyer
- Web page: https://patentgrep.com/patent/US10310981B2

## CPC

- G06F 12/0862: with prefetch
- G06F 2212/1016: Performance improvement
- G06F 2212/6022: Using a prefetch buffer or dedicated prefetch cache
- G06F 2212/6024: History based prefetching
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for performing memory prefetching includes determining whether to initiate prefetching. Upon a determination to initiate prefetching, a first memory row is determined as a suitable prefetch candidate, and it is determined whether a particular set of one or more cachelines of the first memory row is to be prefetched.

## Claims

### Claim 1

A method for performing memory prefetching, to improve memory access performance of a processor, the method comprising:
determining, by a prefetch logic of a memory controller communicatively coupled to a memory and a prefetch buffer, whether to initiate prefetching;
upon a determination to initiate prefetching, determining, by the prefetch logic, a first memory row as a suitable prefetch candidate;
assigning, by the prefetch logic, a score to a criteria used to determine that a particular one or more cachelines of the first row is to be prefetched, wherein when the score of a first criteria exceeds the score of a second criteria, a row determined to be a prefetch candidate by the first criteria is prioritized for prefetching over a row determined to be a prefetch candidate by the second criteria;
determining, by the prefetch logic, whether the particular set of one or more cachelines of the first memory row is to be prefetched based on the score; and
retrieving, by the processor, data from the particular set of one or more cachelines.

### Claim 2 (depends on 1)

The method of claim 1 wherein determining to initiate prefetching includes any one of: determining there is storage space in the prefetch buffer to store one or more prefetched cachelines, or determining that an open memory row is to be closed.

### Claim 3 (depends on 1)

The method of claim 1 wherein determining to not initiate prefetching includes any one of: determining a number of outstanding demand requests to a same memory bank that contains the first memory row exceeds a threshold, or determining a demand fetch that has been waiting a number of time cycles that exceeds a threshold requires closing the first memory row.

### Claim 4 (depends on 1)

The method of claim 1 wherein determining whether the first row is a suitable prefetch candidate includes determining whether the accessing of unique cachelines from the first row exceeds a predetermined threshold.

### Claim 5 (depends on 1)

The method of claim 1 wherein determining whether the first row is a suitable prefetch candidate includes determining that a number of outstanding demand requests to the first row meets or exceeds a threshold.

### Claim 6 (depends on 1)

The method of claim 1 wherein determining whether the first row is a suitable prefetch candidate includes whether the number of times the first row has been accessed exceeds a threshold.

### Claim 7 (depends on 1)

The method of claim 1, further comprising increasing the assigned score of the criteria if the prefetched particular cacheline satisfies a subsequent demand request.

### Claim 8 (depends on 1)

The method of claim 1, further comprising decreasing the score of the criteria if the particular cacheline is evicted from the prefetch buffer without satisfying a demand request.

### Claim 9 (depends on 1)

The method of claim 1 wherein when the score of a first criteria is less than a threshold, a row determined to be a prefetch candidate by the first criteria is not prefetched.

### Claim 10

A computer system to improve memory access performance, comprising:
a processor;
a memory; and
a memory controller communicatively coupled with the memory and the processor, the memory controller including a prefetch logic and a prefetch buffer communicatively coupled with one another, wherein the prefetch logic is configured to determine whether to initiate prefetching, and upon a determination to initiate prefetching, determine a first memory row as a suitable prefetch candidate, assign a score to a criteria used to determine that a particular one or more cachelines of the first row is to be prefetched wherein when the score of a first criteria exceeds the score of a second criteria, a row determined to be a prefetch candidate by the first criteria is prioritized for prefetching over a row determined to be a prefetch candidate by the second criteria, determine whether the particular set of one or more cachelines of the first memory row is to be prefetched based on the score, and
wherein the processor retrieves data from the particular set of one or more cachelines.

### Claim 11 (depends on 10)

The computer system of claim 10 wherein the prefetch logic is further configured to initiate prefetching upon a determination of any one of: determining there is storage space in the prefetch buffer to store one or more prefetched cachelines, or determining that an open memory row is to be closed.

### Claim 12 (depends on 10)

The computer system of claim 10 wherein the prefetch logic is further configured to not initiate prefetching upon a determination of any one of: determining a number of outstanding demand requests to a same memory bank that contains the first memory row exceeds a threshold, or determining a demand fetch that has been waiting a number of time cycles that exceeds a threshold requires closing the first memory row.

### Claim 13 (depends on 10)

The computer system of claim 10 wherein the prefetch logic is further configured to determine whether the first row is a suitable prefetch candidate by determining whether the accessing of unique cachelines from the first row exceeds a predetermined threshold.

### Claim 14 (depends on 10)

The computer system of claim 10 wherein the score of the criteria is increased if the prefetched particular cacheline satisfies a subsequent demand request.

### Claim 15 (depends on 10)

The computer system of claim 10 wherein the score of the criteria is decreased if the particular cacheline is evicted from the prefetch buffer without satisfying a demand request.

### Claim 16 (depends on 10)

The computer system of claim 10 wherein when the score of a first criteria is less than a threshold, a row determined to be a prefetch candidate by the first criteria is not prefetched.
