EP1966697B1

Software assisted nested hardware transactions

Abstract

A method and apparatus for efficiently executing nested transactions is herein described. Hardware support for execution of transactions is provided. Additionally, through the use of logging previous values immediately before a current nested transaction in a local memory and storage of a stack of handlers associated with a hierarchy of transactions, nested transactions are potentially efficiently executed. Upon a failure, abort, or invalidating event/access within a nested transaction, the state of variables or memory locations written to during execution of the nested transaction are rolled-back to immediately before the nested transaction, instead of all the way back to an original state of the variables or memory locations before an enclosing transaction. As a result, nested transactions may be re-executed within enclosing transactions, without flattening the enclosing and nested transactions to re-execute everything.

EP1966697B1, drawing sheet 1
Sheet 1 of 5

Term

0.2 yearsleft in the term

Expires 15 December 2026.

  1. Priority
  2. Filed
  3. Granted
  4. Today
  5. Expires

16 claims: 3 independent, 13 dependent

  1. 1
    An apparatus comprising a processor (100) including:execution resources (105, 305) to execute in hardware a first transaction and a second transaction nested within the first transaction;and a monitoring module (110) capable of detecting an invalidating access associated with execution of the first transaction and an invalidating access associated with execution of the second transaction;characterized by : hardware managed storage logic (115, 200, 320), coupled to the execution resources (105, 305), and which is arranged to hold a log entry (325) associated with the memory location, wherein the entry provides: a first checkpoint value (211, 328) of the memory location before a first write operation (213) to the memory location within the first transaction (212) is executed;a second checkpoint value (216, 327) of the memory location before a second write operation (218) to the memory location within the second transaction (217) is executed;and a roll-back module (120) to roll-back the memory location to the first checkpoint value in response to the monitor module detecting the invalidating access associated with execution of the first transaction and to roll-back the memory location to the second checkpoint value in response to the monitor module detecting the invalidating access associated with execution of the second transaction.
  2. 11
    A method of executing, in hardware, a current level critical section of code nested within a previous level critical section of code on a processor; characterized by steps of:maintaining a log (325) in hardware within the processor, the log to hold a current checkpoint value (326) of a cache memory location (126-128;316-318), which is to be modified in the current level critical section of code and a previous checkpoint value (327) of the cache memory location (126-128;316-318), which is to be modified in the previous level critical section of code;and restoring the current checkpoint value (326) to the cache memory location (126-128;316-318) in response to an abort of the current level critical section of code.
  3. 16
    An article of manufacture including program code which, when executed by a processor, causes the processor to perform the method of any one of claims 11 to 15.