A transactional memory system determines whether to pass control of a transaction to an about-to-run-out-of-resource handler. A processor of the transactional memory system determines information about an about-to-run-out-of-resource handler for transaction execution of a code region of a hardware transaction. The processor dynamically monitors an amount of available resource for the currently running code region of the hardware transaction. The processor detects that the amount of available resource for transactional execution of the hardware transaction is below a predetermined threshold level. The processor, based on the detecting, saves speculative state information of the hardware transaction, and executes the about-to-run-out-of-resource handler, the about-to-run-out-of-resource handler determining whether the hardware transaction is to be aborted or salvaged.
Drawings
Claims14
A computer system for determining whether to pass control of a transaction, executing in a transactional memory environment, to an about-to-run-out-of-resource handler, the computer system comprising:
a memory;
and
a processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
determining, by the processor, information about an about-to-run-out-of-resource handler for transaction execution of a code region of a hardware transaction;
dynamically monitoring, by the processor, an amount of available resource for the currently running code region of the hardware transaction;
detecting, by the processor, that the amount of available resource for transactional execution of the hardware transaction is below a predetermined threshold level, wherein the threshold level is a level that is greater than exhaustion of available resources;
based on detecting the amount of available resource is below the predetermined threshold level, saving, by the processor, speculative state information of the hardware transaction, wherein saving the speculative state information of the hardware transaction further comprises determining whether any of the transaction has been partially executed, and determining whether any of the partially executed transaction is salvageable;
and
based on detecting the amount of available resource is below the predetermined threshold level, executing, by the processor, the about-to-run-out-of-resource handler, wherein the about-to-run-out-of-resource handler determines whether the hardware transaction is to be aborted or salvaged.
6 more elements
A computer program product for determining whether to pass control of a transaction, executing in a transactional memory environment, to an about-to-run-out-of-resource handler, the computer program product comprising:
a computer readable storage device readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
determining, by a processor, information about an about-to-run-out-of-resource handler for transaction execution of a code region of a hardware transaction;
dynamically monitoring, by the processor, an amount of available resource for the currently running code region of the hardware transaction;
detecting, by the processor, that the amount of available resource for transactional execution of the hardware transaction is below a predetermined threshold level, wherein the threshold level is a level that is greater than exhaustion of available resources;
based on detecting the amount of available resource is below the predetermined threshold level, saving, by the processor, speculative state information of the hardware transaction, wherein saving the speculative state information of the hardware transaction further comprises determining whether any of the transaction has been partially executed, and determining whether any of the partially executed transaction is salvageable;
and
based on detecting the amount of available resource is below the predetermined threshold level, executing, by the processor, the about-to-run-out-of-resource handler, wherein the about-to-run-out-of-resource handler determines whether the hardware transaction is to be aborted or salvaged.
27 Feb 2034Estimated · howhide20 years from earliest known nonprovisional domestic filing plus recorded patent term adjustment. Maintenance-fee lapses, terminal disclaimers and statutory extensions have not been checked. The continuity chain may be incomplete; this is not an enforceability determination.
Error detection or correction of the data by redundancy in operations: in transactions
Life of this patent
About 7 years 4 months of term left · ends 27 Feb 2034 (estimated)
Priority27 Feb 2014
Filed18 Aug 2016
Granted5 Sep 2017
Today12 Oct 2026
Term ends27 Feb 2034
Priority27 Feb 2014
Granted5 Sep 2017
Term ends27 Feb 2034
Priority claimedParent application 14/191,517
Application filedUS 15/240,464
Assigned to International Business Machines Corporationassignment of assignor's interest
PublishedUS 2016/0004558 A1
GrantedUS 9,753,764 B2
TodayWithin its term
Term endsEstimated
Description18,444 words
Summary789 words
#This disclosure relates generally to transactional execution, and more specifically to committing hardware transactions that are about to run out of space in transactional memory.
#The number of central processing unit (CPU) cores on a chip and the number of CPU cores connected to a shared memory continues to grow significantly to support growing workload capacity demand. The increasing number of CPUs cooperating to process the same workloads puts a significant burden on software scalability; for example, shared queues or data-structures protected by traditional semaphores become hot spots and lead to sub-linear n-way scaling curves. Traditionally, this has been countered by implementing finer-grained locking in software, and with lower latency/higher bandwidth interconnects in hardware. Implementing fine-grained locking to improve software scalability can be very complicated and error-prone, and at today's CPU frequencies, the latencies of hardware interconnects are limited by the physical dimension of the chips and systems, and by the speed of light.
#Implementations of hardware Transactional Memory (HTM, or in this discussion, simply TM) have been introduced, wherein a group of instructions—called a transaction—operate in an atomic manner on a data structure in memory, as viewed by other central processing units (CPUs) and the I/O subsystem (atomic operation is also known as “block concurrent” or “serialized” in other literature). The transaction executes optimistically without obtaining a lock, but may need to abort and retry the transaction execution if an operation, of the executing transaction, on a memory location conflicts with another operation on the same memory location. Previously, software transactional memory implementations have been proposed to support software Transactional Memory (TM). However, hardware TM can provide improved performance aspects and ease of use over software TM.
Brief description of the drawings9 figures
#One or more aspects of the present disclosed embodiments are particularly pointed out and distinctly claimed as examples in the claims at the conclusion of the specification. The foregoing and other objects, features, and advantages of the disclosed embodiments are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
#FIGS. 1 and 2 depict block diagrams of an example multi-core Transactional Memory environment, in accordance with embodiments of the present disclosure.
#FIG. 3 depicts a block diagram including example components of an example CPU, in accordance with embodiments of the present disclosure.
Detailed description17,430 words
#Historically, a computer system or processor had only a single processor (aka processing unit or central processing unit). The processor included an instruction processing unit (IPU), a branch unit, a memory control unit and the like. Such processors were capable of executing a single thread of a program at a time. Operating systems were developed that could time-share a processor by dispatching a program to be executed on the processor for a period of time, and then dispatching another program to be executed on the processor for another period of time. As technology evolved, memory subsystem caches were often added to the processor as well as complex dynamic address translation including translation lookaside buffers (TLBs). The IPU itself was often referred to as a processor. As technology continued to evolve, an entire processor, could be packaged as a single semiconductor chip or die, such a processor was referred to as a microprocessor. Then processors were developed that incorporated multiple IPUs, such processors were often referred to as multi-processors. Each such processor of a multi-processor computer system (processor) may include individual or shared caches, memory interfaces, system bus, address translation mechanism and the like. Virtual machine and instruction set architecture (ISA) emulators added a layer of software to a processor, that provided the virtual machine with multiple “virtual processors” (aka processors) by time-slice usage of a single IPU in a single hardware processor. As technology further evolved, multi-threaded processors were developed, enabling a single hardware processor having a single multi-thread IPU to provide a capability of simultaneously executing threads of different programs; thus each thread of a multi-threaded processor appeared to the operating system as a processor. As technology further evolved, it was possible to put multiple processors (each having an IPU) on a single semiconductor chip or die. These processors were referred to processor cores or just cores. Thus the terms such as processor, central processing unit, processing unit, microprocessor, core, processor core, processor thread, and thread, for example, are often used interchangeably. Aspects of embodiments herein may be practiced by any or all processors including those shown supra, without departing from the teachings herein. Wherein the term “thread” or “processor thread” is used herein, it is expected that particular advantage of the embodiment may be had in a processor thread implementation.
#In “Intel® Architecture Instruction Set Extensions Programming Reference” 319433-012A, February 2012, incorporated herein by reference in its entirety, Chapter 8 teaches, in part, that multithreaded applications may take advantage of increasing numbers of CPU cores to achieve higher performance. However, the writing of multi-threaded applications requires programmers to understand and take into account data sharing among the multiple threads. Access to shared data typically requires synchronization mechanisms. These synchronization mechanisms are used to ensure that multiple threads update shared data by serializing operations that are applied to the shared data, often through the use of a critical section that is protected by a lock. Since serialization limits concurrency, programmers try to limit the overhead due to synchronization.
#Intel® Transactional Synchronization Extensions (Intel® TSX) allow a processor to dynamically determine whether threads need to be serialized through lock-protected critical sections, and to perform that serialization only when required. This allows the processor to expose and exploit concurrency that is hidden in an application because of dynamically unnecessary synchronization.