Method and system for reducing abort rates in speculative lock elision using contention management mechanisms
First 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 contention management mechanism, wherein the software contention management mechanism is configured to reduce transaction abort rates, and wherein to reduce transaction abort rates the software contention management mechanism is configured to;
determine an amount by which to delay an attempt to execute a critical section of code, wherein the determined amount by which to delay the attempt to execute the critical section of code is configurable;
orlimit the number of threads permitted to elide a lock over a given critical section of code at any one time;
in response to receiving the indication, the software contention management mechanism determining a mode of execution to be used in one or more subsequent attempts to execute the section of code, wherein determining the mode of execution comprises determining whether to use a speculative transaction mode supported by the hardware transactional memory system or a non-speculative mode supported by the hardware transactional memory system;
the software contention management 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.
1 Assignment
0 Petitions
Accused Products
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.
32 Citations
20 Claims
-
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 contention management mechanism, wherein the software contention management mechanism is configured to reduce transaction abort rates, and wherein to reduce transaction abort rates the software contention management mechanism is configured to; determine an amount by which to delay an attempt to execute a critical section of code, wherein the determined amount by which to delay the attempt to execute the critical section of code is configurable;
orlimit the number of threads permitted to elide a lock over a given critical section of code at any one time; in response to receiving the indication, the software contention management mechanism determining a mode of execution to be used in one or more subsequent attempts to execute the section of code, wherein determining the mode of execution comprises determining whether to use a speculative transaction mode supported by the hardware transactional memory system or a non-speculative mode supported by the hardware transactional memory system; the software contention management 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. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
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, wherein the software contention management mechanism is configured to reduce transaction abort rates, and wherein to reduce transaction abort rates the software contention management mechanism is configured to; determine an amount by which to delay an attempt to execute a critical section of code, wherein the determined amount by which to delay the attempt to execute the critical section of code is configurable;
orlimit the number of threads permitted to elide a lock over a given critical section of code at any one time; 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 further configured to; in response to receiving an indication that a given transaction aborted or will abort, determine a mode of execution to be used in one or more subsequent attempts to execute a respective section of code, wherein determining the mode of execution comprises determining whether to use a speculative transaction mode supported by the hardware transactional memory implementation or a non-speculative mode supported by the hardware transactional memory implementation; 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 given section of code using the determined mode of execution. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A non-transitory, computer-readable storage medium storing program instructions computer-executable to implement a software contention management mechanism;
-
wherein the software contention management mechanism is configured to reduce transaction abort rates, and wherein to reduce transaction abort rates the software contention management mechanism is configured to; determine an amount by which to delay an attempt to execute a critical section of code, wherein the determined amount by which to delay the attempt to execute the critical section of code is configurable;
orlimit the number of threads permitted to elide a lock over a given critical section of code at any one time; wherein the software contention management mechanism is further configured to; receive 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, determine a mode of execution for the section of code, wherein determining the mode of execution comprises determining whether to use a speculative transaction mode supported by the hardware transactional memory system or a non-speculative mode supported by the hardware transactional memory system; and communicate the determined mode of execution to the hardware transactional memory system. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification