# US 7,613,908 B2 · Selective hardware lock disabling

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

- Number: US 7,613,908 B2
- Document ID: US7613908B2
- Status: Granted
- Kind: B2
- Application number: 11/710,028
- Filed: 2007-02-23
- Published: 2008-08-28
- Granted: 2009-11-03
- Earliest claimed: 2007-02-23
- Assignees: Intel Corporation
- Inventors: Shlomo Raikin; Gad Sheaffer; Doron Orenstien
- Web page: https://patentgrep.com/patent/US7613908B2

## CPC

- G06F 9/3004: {to perform operations on memory}
- G06F 9/30087: {Synchronisation or serialisation instructions}
- G06F 9/3017: {Runtime instruction translation, e.g. macros}
- G06F 9/30181: {Instruction operation extension or modification}
- G06F 9/3834: {Maintaining memory consistency}
- G06F 9/3854: {Instruction completion, e.g. retiring, committing or graduating}
- G06F 9/3856: {Reordering of instructions, e.g. using queues or age tags}
- G06F 9/3858: {Result writeback, i.e. updating the architectural state or memory}
- G06F 9/38585: {with result invalidation, e.g. nullification}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Controlling a reorder buffer (ROB) to selectively perform functional hardware lock disabling (HLD) is described. One apparatus embodiment includes a unit to enable an ROB to selectively disable a lock upon Identifying a lock acquire operation (LAO) associated with a critical section (CS) entry point, a unit to selectively retire the LAO, a unit to cause the ROB to selectively disable the lock, and a unit to snoop a buffer. The apparatus may, based on the snooping, selectively abort a transaction associated with the CS.

## Claims

### Claim 1

An apparatus, comprising:
a processor having a pipelined architecture and including:
a first unit to enable a reorder buffer (ROB) to selectively disable a lock after identifying a lock acquire operation (LAO) associated with a critical section (CS) entry point, the LAO being a load and store intent (LSI) operation, and the first unit to identify the LSI as the CS entry point, to mark the LSI as a predicted CS entry point, to set a transaction active flag to indicate that a transaction to be performed in the CS is active, and to selectively set a hardware lock disabling (HLD) flag to indicate that lock disabling is in progress;
a second unit to store an address associated with the LAO and a value associated with the LAO, where, at a time associated with dispatching the LSI, the second unit is to prevent the LSI from issuing a read for ownership (RFO), to store in a first register an address associated with a store address (STA) micro-operation (uop) associated with the LSI, and to store in a second register a value associated with a store data (STD) micro-operation associated with the LSI;
a third unit to selectively retire the LAO, where the third unit is to cause the ROB to retire the LSI upon determining that the LSI is ready to retire and that no lock release instruction (LRI) related to the LSI has been dispatched, the third unit to clear the HLD prediction flag associated with the LSI to indicate that this LSI should not be disabled in the future, and the third unit to clear the HLD flag to indicate that HLD is no longer in progress;
a fourth unit to cause the ROB to selectively disable the lock, where the fourth unit is, upon determining that the LSI is ready to retire and that an LRI related to the LSI has been dispatched, to cause the ROB to not retire the LSI, to cause the ROB to not retire the LRI, to cause the ROB to selectively stall retirement of instructions in the CS, and then, upon determining that all instructions in the CS are ready to retire and that all memory accesses associated with instructions in the CS are completed, to bulk retire instructions in the CS and to set the HLD prediction to indicate that the LSI should be disabled in the future;
a fifth unit to selectively cause the ROB to commit an instruction in the CS;
a sixth unit to identify a store instruction whose store address matches the address associated with the LAO; and
a seventh unit to snoop a buffer and, based, at least in part, on the snooping, to selectively abort a transaction associated with the CS.

### Claim 2 (depends on 1)

The apparatus of claim 1, the LSI operation comprising one of, a test and set operation, and a test and test and set operation.

### Claim 3 (depends on 1)

The apparatus of claim 1, the apparatus being incorporated into the ROB.

### Claim 4 (depends on 1)

The apparatus of claim 1, where the first unit is to set the HLD flag to indicate that lock disabling is in progress upon determining that an HLD prediction flag associated with the LSI holds a value that indicates that the lock can be disabled.

### Claim 5 (depends on 1)

The apparatus of claim 1, where the sixth unit is to set an address match flag to indicate that a matching store address has been encountered upon determining that a store instruction has been encountered, that the transaction active flag indicates that a transaction is active, that the HLD flag indicates that HLD is active, and that an STA address associated with the store instruction matches the STA address associated with the LSI.

### Claim 6 (depends on 5)

The apparatus of claim 5, where the sixth unit is to issue an RFO associated with the store instruction upon determining that the store instruction is experiencing its first dispatch from a uop buffer (MOB) in the processor, and
where the seventh unit is, upon detecting an external snoop, to snoop a load buffer in the processor and to snoop a store buffer in the processor, and
where the seventh unit is to cause the transaction to be aborted upon detecting a snoop hit.

### Claim 7 (depends on 1)

The apparatus of claim 1, where the fourth unit is to monitor and manipulate a counter that stores a number of operations for which the LSI has been waiting to see the LRI be dispatched and, upon determining that a pre-determined number of operations has occurred, to cause the ROB 110 to retire the LSI, and
where interrupts are to be blocked and external snoops are to be deferred while CS instructions are bulk retired and while CS instructions are committed.

### Claim 8

A computer system, comprising:
a memory to store a hardware lock disabling (HLD) instruction; and
a processor to execute the HLD instruction, the processor being coupled to the memory, the processor including a reorder buffer (ROB) to be controlled to perform HLD in response to receiving the HLD instruction and to be enabled based on a HLD prediction flag to indicate that a load acquire operation (LAO) is a candidate for being disabled, and to mark the LAO as a predicted critical section (CS) entry point, set a transaction active flag to indicate that a transaction to be performed in the CS is active, and to set a HLD flag to indicate that lock disabling is in progress.

### Claim 9 (depends on 8)

The computer system of claim 8, where performing HLD comprises:
identifying the LAO as a lock and store intent (LSI) operation associated with a lock associated with the predicted CS entry point;
storing an address and a value associated with the LSI;
selectively retiring the LSI;
selectively disabling the lock;
selectively causing the ROB to commit an instruction in the CS;
identifying a store instruction whose store address matches the address associated with the LSI; and
selectively aborting a transaction associated with the CS.

### Claim 10 (depends on 9)

The computer system of claim 9, where selectively retiring the LSI includes:
retiring the LSI upon determining that the LSI is ready to retire and that no lock release instruction (LRI) related to the LSI has been dispatched; and
not retiring the LSI and the LRI upon determining that the LSI is ready to retire and that an LRI related to the LSI has been dispatched.

### Claim 11

An apparatus comprising:
a processor having a reorder buffer (ROB) to retire instructions; and
a unit coupled to the ROB to control the ROB to selectively perform hardware lock disabling (HLD) without use of a speculative versioning cache and a checkpoint register and responsive to a lock acquire operation (LAO) associated with a critical section (CS) entry point, wherein the LAO is converted to a load without a read for ownership.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the unit is to enable the ROB to perform the HLD based on an HLD prediction flag that indicates that a load acquire operation (LAO) is a candidate for being disabled, mark the LAO as a predicted critical section (CS) entry point, set a transaction active flag to indicate that a transaction to be performed in the CS is active, and to set a HLD flag to indicate that lock disabling is in progress.
