# US 2013/0297910 A1 · Mitigation of thread hogs on a threaded processor using a general load/store timeout counter

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

- Number: US 2013/0297910 A1
- Document ID: US20130297910A1
- Status: Published application
- Kind: A1
- Application number: 13/463,319
- Filed: 2012-05-03
- Published: 2013-11-07
- Earliest claimed: 2012-05-03
- Inventors: Jared C. Smolens; Robert T. Golla; Mark A. Luttrell; Paul J. Jordan
- Web page: https://patentgrep.com/patent/US20130297910A1

## CPC

- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F 9/3851: {from multiple instruction streams, e.g. multistreaming}
- G06F 9/5016: {the resource being the memory}
- G06F 2209/507: Low-level
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for efficient thread arbitration in a threaded processor with dynamic resource allocation. A processor includes a resource shared by multiple threads. The resource includes entries which may be allocated for use by any thread. Control logic detects long latency instructions. Long latency instructions have a latency greater than a given threshold. One example is a load instruction that has a read-after-write (RAW) data dependency on a store instruction that misses a last-level data cache. The long latency instruction or an immediately younger instruction is selected for replay for an associated thread. A pipeline flush and replay for the associated thread begins with the selected instruction. Instructions younger than the long latency instruction are held at a given pipeline stage until the long latency instruction completes. During replay, this hold prevents resources from being allocated to the associated thread while the long latency instruction is being serviced.

## Claims

### Claim 1

A processor comprising:
control logic; and
one or more resources shared by a plurality of software threads, wherein each of the one or more resources comprises a plurality of entries;
wherein in response to detecting a given instruction remains an oldest instruction in a pipeline for an amount of time greater than a given threshold, the control logic is configured to:
select a candidate instruction from the given instruction and one or more younger instructions of the given thread in the pipeline; and
deallocate entries within the one or more resources corresponding to the candidate instruction and instructions younger than the candidate instruction.

### Claim 2 (depends on 1)

The processor as recited in claim 1, wherein the control logic is further configured to select as the candidate instruction an oldest instruction of the one or more younger instructions.

### Claim 3 (depends on 1)

The processor as recited in claim 1, wherein the logic is further configured to:
select the given instruction as the candidate instruction, in response to determining the given instruction qualifies for instruction replay; and
select an oldest instruction of the one or more younger instructions as the candidate instruction, in response to determining the given instruction does not qualify for instruction replay.

### Claim 4 (depends on 3)

The processor as recited in claim 3, wherein to determine the given instruction qualifies for instruction replay, the control logic is configured to determine the given instruction is permitted to be interrupted once started.

### Claim 5 (depends on 1)

The processor as recited in claim 1, wherein the threshold is programmable.

### Claim 6 (depends on 1)

The processor as recited in claim 1, wherein the control logic is further configured to re-fetch the candidate instruction and instructions younger than the candidate instruction.

### Claim 7 (depends on 6)

The processor as recited in claim 6, wherein the control logic is further configured to hold at a given pipeline stage re-fetched instructions younger than the given instruction until the given instruction is completed.

### Claim 8 (depends on 7)

The processor as recited in claim 7, wherein the control logic is further configured to allow the given instruction to proceed past the given pipeline stage.

### Claim 9

A method for use in a processor, the method comprising:
sharing one or more resources by a plurality of software threads, wherein each of the one or more resources comprises a plurality of entries;
in response to detecting a given instruction remains an oldest instruction in a pipeline for an amount of time greater than a given threshold:
selecting a candidate instruction from the given instruction and one or more younger instructions of the given thread in the pipeline; and
deallocating entries within the one or more resources corresponding to the candidate instruction and instructions younger than the candidate instruction.

### Claim 10 (depends on 9)

The method as recited in claim 9, further comprising selecting as the candidate instruction an oldest instruction of the one or more younger instructions.

### Claim 11 (depends on 9)

The method as recited in claim 9, further comprising:
selecting the given instruction as the candidate instruction, in response to determining the given instruction qualifies for instruction replay; and
selecting an oldest instruction of the one or more younger instructions as the candidate instruction, in response to determining the given instruction does not qualify for instruction replay.

### Claim 12 (depends on 11)

The method as recited in claim 11, wherein to determine the given instruction qualifies for instruction replay, the method further comprises determining the given instruction is permitted to be interrupted once started.

### Claim 13 (depends on 9)

The method as recited in claim 9, wherein the threshold is programmable.

### Claim 14 (depends on 9)

The method as recited in claim 9, further comprising re-fetching the candidate instruction and instructions younger than the candidate instruction.

### Claim 15 (depends on 14)

The method as recited in claim 14, further comprising holding at a given pipeline stage re-fetched instructions younger than the given instruction until the given instruction is completed.

### Claim 16 (depends on 15)

The method as recited in claim 15, further comprising allowing the given instruction to proceed past the given pipeline stage.

### Claim 17

A non-transitory computer readable storage medium storing program instructions operable to efficiently arbitrate threads in a multi-threaded resource, wherein the program instructions are executable by a processor to:
share one or more resources by a plurality of software threads, wherein each of the one or more resources comprises a plurality of entries;
in response to detecting a given instruction remains an oldest instruction in a pipeline for an amount of time greater than a given threshold:
select a candidate instruction from the given instruction and one or more younger instructions of the given thread in the pipeline; and
deallocate entries within the one or more resources corresponding to the candidate instruction and instructions younger than the candidate instruction.

### Claim 18 (depends on 17)

The storage medium as recited in claim 17, wherein the program instructions are further executable to select as the candidate instruction an oldest instruction of the one or more instructions younger than the given instruction.

### Claim 19 (depends on 17)

The storage medium as recited in claim 17, wherein the program instructions are further executable to:
select the given instruction as the candidate instruction, in response to determining the given instruction qualifies for instruction replay; and
select an oldest instruction of the one or more younger instructions as the candidate instruction, in response to determining the given instruction does not qualify for instruction replay.

### Claim 20 (depends on 19)

The storage medium as recited in claim 19, wherein to determine the given instruction qualifies for instruction replay, the program instructions are further configured to determine the given instruction is permitted to be interrupted once started.
