# US 2013/0297967 A1 · Hybrid transactional memory (hybrid tm)

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

- Number: US 2013/0297967 A1
- Document ID: US20130297967A1
- Status: Published application
- Kind: A1
- Application number: 13/939,753
- Filed: 2013-07-11
- Published: 2013-11-07
- Earliest claimed: 2009-11-16
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Thomas J. Heller, Jr.
- Web page: https://patentgrep.com/patent/US20130297967A1

## CPC

- G06F 11/0793: {Remedial or corrective actions (recovery from an exception in an instruction pipeline G06F9/3861; by retry G06F11/1402; for recovering from a failure of a protocol instance or entity H04L69/40)}
- G06F 9/467: {Transactional memory (G06F9/528 takes precedence)}
- G06F 11/0766: {Error or fault reporting or storing}
- G06F 9/3004: {to perform operations on memory}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments related to a hardware transactional memory (HTM). An aspect includes setting a mode register of a processor core of a computer to indicate a HTM mode. Another aspect includes executing a plurality of transactions by the processor core in the HTM mode based on the mode register. Another aspect includes determining whether a first transaction of the plurality of transactions exceeds a failure limit of the processor core in the HTM mode. Yet another aspect includes, based on determining that the first transaction exceeds the failure limit of the processor core in the HTM mode, transitioning the processor to an assisted transaction mode by setting the mode register of the processor core to indicate the assisted transaction mode.

## Claims

### Claim 1

A computer system for a hardware transactional memory (HTM), the system comprising:
a processor core configured to:
set a mode register of the processor core of a computer to indicate a HTM mode;
execute a plurality of transactions by the processor core in the HTM mode based on the mode register;
determine whether a first transaction of the plurality of transactions exceeds a failure limit of the processor core in the HTM mode; and
based on determining that the first transaction exceeds the failure limit of the processor core in the HTM mode, transition the processor to an assisted transaction mode by setting the mode register of the processor core to indicate the assisted transaction mode.

### Claim 2 (depends on 1)

The system of claim 1, wherein determining that the first transaction exceeds the failure limit of the processor core in the HTM mode comprises:
initializing a failure counter; and
based on detecting an error during execution the first transaction:
aborting and discarding the results of the first transaction;
incrementing the failure counter based on the aborting of the first transaction;
comparing the failure counter to a failure count limit of the processor core; and
based on determining that the failure counter exceeds the failure count limit, determining that the first transaction exceeds the failure limit.

### Claim 3 (depends on 2)

The system of claim 2, further comprising, based on determining that the failure counter does not exceed the failure count limit:
determining that the first transaction does not exceed the failure limit of the processor core in the HTM mode; and
retrying execution of the first transaction in the HTM mode.

### Claim 4 (depends on 2)

The system of claim 2, wherein the error comprises one of a cache overflow and an unsupported operation.

### Claim 5 (depends on 1)

The system of claim 1, wherein transitioning the processor to the assisted transaction mode further comprises:
aborting the plurality of transactions;
starting an assist thread;
retrying execution of the first transaction in the assisted transaction mode based on the mode register; and
starting execution of any further transactions in the processor core in the assisted transaction mode based on the mode register.

### Claim 6 (depends on 1)

The system of claim 1, wherein execution of a current transaction in the assisted transaction mode comprises:
determining an address for the current transaction in an address history table;
determining whether an entry exists in a transaction conflict detection table for the address;
based on determining that no entry exists in the transaction conflict detection table for the address, adding a new entry for the address to the transaction conflict detection table.

### Claim 7 (depends on 6)

The system of claim 6, further comprising:
based on determining that the entry exists in the transaction conflict detection table for the address:
determining whether the current transaction is marked as favored;
based on determining that the current transaction is not marked as favored:
determining whether the address is from a write;
based on the address being from a write, determining whether there is another entry in the transaction conflict detection table for the address for another transaction;
based on determining that there is another entry in the transaction conflict detection table for the address for another transaction, aborting the current transaction;
based on determining that there is not another entry in the transaction conflict detection table for the address for another transaction, adding a process identifier of the current transaction to the entry in the transaction conflict detection table.

### Claim 8 (depends on 7)

The system of claim 7, further comprising, based on the address not being from a write, adding the process identifier of the current transaction to the entry in the transaction conflict detection table.

### Claim 9 (depends on 7)

The system of claim 7, further comprising, based on the current transaction being marked as favored:
marking the entry in the transaction conflict detection table as favored;
adding the process identifier of the current transaction to the entry in the transaction conflict detection table; and
aborting any other transactions that are associated with the entry in the transaction conflict detection table.

### Claim 10

A computer program product for a hardware transactional memory (HTM), the computer program product comprising a tangible storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
setting a mode register of a processor core of a computer to indicate a HTM mode;
executing a plurality of transactions by the processor core in the HTM mode based on the mode register;
determining whether a first transaction of the plurality of transactions exceeds a failure limit of the processor core in the HTM mode;
based on determining that the first transaction exceeds the failure limit of the processor core in the HTM mode, transitioning the processor to an assisted transaction mode by setting the mode register of the processor core to indicate the assisted transaction mode.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein determining that the first transaction exceeds the failure limit of the processor core in the HTM mode comprises:
initializing a failure counter; and
based on detecting an error during execution the first transaction:
aborting and discarding the results of the first transaction;
incrementing the failure counter based on the aborting of the first transaction;
comparing the failure counter to a failure count limit of the processor core; and
based on determining that the failure counter exceeds the failure count limit, determining that the first transaction exceeds the failure limit.

### Claim 12 (depends on 11)

The computer program product of claim 11, further comprising, based on determining that the failure counter does not exceed the failure count limit:
determining that the first transaction does not exceed the failure limit of the processor core in the HTM mode; and
retrying execution of the first transaction in the HTM mode.

### Claim 13 (depends on 11)

The computer program product of claim 11, wherein the error comprises one of a cache overflow and an unsupported operation.

### Claim 14 (depends on 10)

The computer program product of claim 10, wherein transitioning the processor to the assisted transaction mode further comprises:
aborting the plurality of transactions;
starting an assist thread;
retrying execution of the first transaction in the assisted transaction mode based on the mode register; and
starting execution of any further transactions in the processor core in the assisted transaction mode based on the mode register.

### Claim 15 (depends on 10)

The computer program product of claim 10, wherein execution of a current transaction in the assisted transaction mode comprises:
determining an address for the current transaction in an address history table;
determining whether an entry exists in a transaction conflict detection table for the address;
based on determining that no entry exists in the transaction conflict detection table for the address, adding a new entry for the address to the transaction conflict detection table.

### Claim 16

A computer implemented method for a hardware transactional memory (HTM), comprising:
setting a mode register of a processor core of a computer to indicate a HTM mode;
executing a plurality of transactions by the processor core in the HTM mode based on the mode register;
determining whether a first transaction of the plurality of transactions exceeds a failure limit of the processor core in the HTM mode; and
based on determining that the first transaction exceeds the failure limit of the processor core in the HTM mode, transitioning the processor to an assisted transaction mode by setting the mode register of the processor core to indicate the assisted transaction mode.

### Claim 17 (depends on 16)

The method of claim 16, wherein determining that the first transaction exceeds the failure limit of the processor core in the HTM mode comprises:
initializing a failure counter; and
based on detecting an error during execution the first transaction:
aborting and discarding the results of the first transaction;
incrementing the failure counter based on the aborting of the first transaction;
comparing the failure counter to a failure count limit of the processor core; and
based on determining that the failure counter exceeds the failure count limit, determining that the first transaction exceeds the failure limit.

### Claim 18 (depends on 17)

The method of claim 17, further comprising, based on determining that the failure counter does not exceed the failure count limit:
determining that the first transaction does not exceed the failure limit of the processor core in the HTM mode; and
retrying execution of the first transaction in the HTM mode.

### Claim 19 (depends on 17)

The method of claim 17, wherein the error comprises one of a cache overflow and an unsupported operation.

### Claim 20 (depends on 16)

The method of claim 16, wherein transitioning the processor to the assisted transaction mode further comprises:
aborting the plurality of transactions;
starting an assist thread;
retrying execution of the first transaction in the assisted transaction mode based on the mode register; and
starting execution of any further transactions in the processor core in the assisted transaction mode based on the mode register.
