# US 2010/0169623 A1 · Method and System for Reducing Abort Rates in Speculative Lock Elision using Contention Management Mechanisms

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

- Number: US 2010/0169623 A1
- Document ID: US20100169623A1
- Status: Published application
- Kind: A1
- Application number: 12/345,162
- Filed: 2008-12-29
- Published: 2010-07-01
- Earliest claimed: 2008-12-29
- Assignees: Oracle America, Inc.
- Inventors: David Dice
- Web page: https://patentgrep.com/patent/US20100169623A1

## CPC

- G06F 9/3842: {Speculative instruction execution}
- G06F 9/526: {Mutual exclusion algorithms}
- G06F 9/528: {by using speculative mechanisms}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Hardware-based transactional memory mechanisms, such as Speculative Lock Elision (SLE), may allow multiple threads to concurrently execute critical sections protected by the same lock as speculative transactions. Such transactions may abort due to contention or due to misidentification of code as a critical section. In various embodiments, speculative execution mechanisms may be augmented with software and/or hardware contention management mechanisms to reduce abort rates. Speculative execution hardware may send a hardware interrupt signal to notify software components of a speculative execution event (e.g., abort). Software components may respond by implementing concurrency-throttling mechanisms and/or by determining a mode of execution (e.g., speculative, non-speculative) for a given section and communicating that determination to the hardware speculative execution mechanisms, e.g., by writing it into a lock predictor cache. Subsequently, hardware speculative execution mechanisms may determine a preferred mode of execution for the section by reading the corresponding entry from the lock predictor cache.

## Claims

### Claim 1

A computer-implemented method, comprising:
attempting to execute a section of code as a transaction using a hardware transactional memory system;
the hardware transactional memory system detecting that the transaction aborted or will abort; and
in response to said detecting:
the hardware transactional memory system sending an indication of said detecting to a software mechanism;
in response to receiving the indication, the software mechanism determining a mode of execution, wherein the mode of execution comprises speculative transaction mode or non-speculative mode;
the software mechanism communicating the determined mode of execution to the hardware transactional memory system; and
the hardware transactional memory system attempting to execute the section of code using the determined mode of execution.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
if the determined mode of execution comprises speculative transaction mode, the software mechanism executing a concurrency throttling mechanism over the section of code.

### Claim 3 (depends on 1)

The method of claim 1, wherein said communicating comprises updating a value in a lock predictor cache.

### Claim 4 (depends on 1)

The method of claim 1, wherein the indication comprises a hardware interrupt signal.

### Claim 5 (depends on 1)

The method of claim 1, wherein the software mechanism comprises an interrupt handler.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
in response to receiving the indication, the software mechanism sending a software interrupt signal to a signal handler; and
in response to receiving the software interrupt signal, the signal handler executing a contention management operation.

### Claim 7 (depends on 6)

The method of claim 6, wherein the signal handler is associated with a region of an application that includes the section of code.

### Claim 8

A system comprising:
one or more processors;
a memory coupled to the one or more processors and storing program instructions executable by one or more processors to implement a software contention management mechanism; and
a hardware transactional memory implementation;
wherein the hardware transactional memory implementation is configured to:
attempt to execute a given section of code as a respective transaction;
detect that the respective transaction aborted or will abort; and
in response to said detecting:
send an indication of said detecting to the software contention management mechanism;
wherein the software contention management mechanism is configured to:
in response to receiving an indication that a given transaction aborted or will abort, determine a mode of execution for a respective section of code, wherein the mode of execution comprises speculative transaction mode or non-speculative mode; and
communicate the determined mode of execution to the hardware transactional memory implementation;
wherein the hardware transactional memory implementation is further configured to:
in response to receiving a determined mode of execution for a given section of code, attempt to execute the section of code using the determined mode of execution.

### Claim 9 (depends on 8)

The system of claim 8, wherein the software contention management mechanism is further configured to:
in response to determining that the mode of execution of the respective section of code comprises speculative transaction mode, execute a concurrency throttling mechanism over the section of code.

### Claim 10 (depends on 8)

The system of claim 8, wherein said communicating comprises updating a value in a lock predictor cache.

### Claim 11 (depends on 8)

The system of claim 8, wherein the indication comprises a hardware interrupt signal.

### Claim 12 (depends on 8)

The system of claim 8, wherein the software contention management mechanism comprises an interrupt handler.

### Claim 13 (depends on 8)

The system of claim 8,
wherein the program instructions are further executable by the one or more processors to implement a signal handler;
wherein the software contention management mechanism is further configured to:
in response to receiving the indication, send a software interrupt signal to the software interrupt handler; and
wherein in response to receiving the software interrupt signal, the signal handler is configured to:
execute a contention management operation.

### Claim 14 (depends on 13)

The system of claim 13, wherein the signal handler is associated with a region of an application that includes the section of code.

### Claim 15

A computer-readable storage medium storing program instructions computer-executable to implement:
receiving an indication from a hardware transactional memory system that an attempt to execute a section of code as a transaction has been aborted or will be aborted;
in response to said receiving, determining a mode of execution for the section of code, wherein the mode of execution comprises speculative transaction mode or non-speculative mode; and
communicating the determined mode of execution to the hardware transactional memory system.

### Claim 16 (depends on 15)

The storage medium of claim 15, wherein the program instructions are further computer-executable to implement:
in response to determining that the mode of execution for the section of code comprises speculative transaction mode, executing a concurrency throttling mechanism over the section of code.

### Claim 17 (depends on 15)

The storage medium of claim 15, wherein said communicating comprises updating a value in a lock predictor cache.

### Claim 18 (depends on 15)

The storage medium of claim 15, wherein the program instructions are further computer-executable to implement an interrupt handler.

### Claim 19 (depends on 15)

The storage medium of claim 15, wherein the program instructions are further computer-executable to implement:
in response to said receiving, sending a software interrupt signal to a signal handler.

### Claim 20 (depends on 15)

The storage medium of claim 15, wherein the program instructions are further computer-executable to implement a signal handler configured to:
in response to said receiving a software interrupt signal, execute a contention management operation.
