|Publication number||US7574588 B2|
|Application number||US 11/359,659|
|Publication date||Aug 11, 2009|
|Filing date||Feb 21, 2006|
|Priority date||May 31, 2000|
|Also published as||CN1650266A, CN100362474C, EP1559001A2, US20030188141, US20060149946, WO2003085520A2, WO2003085520A3|
|Publication number||11359659, 359659, US 7574588 B2, US 7574588B2, US-B2-7574588, US7574588 B2, US7574588B2|
|Inventors||Shailender Chaudhry, Marc Tremblay|
|Original Assignee||Sun Microsystems, Inc.|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (8), Non-Patent Citations (3), Referenced by (1), Classifications (16), Legal Events (3)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This application is a continuation of and hereby claims priority under 35 U.S.C. §120 to U.S. patent application Ser. No. 10/365,313, filed on 12 Feb. 2003 now abandoned, entitled “Time-Multiplexed Speculative Multi-Threading to Support Single-Threaded Applications,” by inventors Marc Tremblay and Shailender Chaudhry. Additionally, this application is a continuation-in-part of and hereby claims priority under 35 U.S.C. §120 to U.S. patent application Ser. No. 09/761,217, filed on 16 Jan. 2001 now U.S. Pat. No. 7,051,192, entitled “Facilitating Value Prediction to Support Speculative Program Execution,” by inventors Shailender Chaudhry and Marc Tremblay. This application also claims priority under 35 U.S.C. §119 to U.S. Provisional Patent Application No. 60/368,935, filed on 29 Mar. 2002, entitled “Speculative Time-Multiplexed Multi-Threading for Single Threaded Applications,” by inventors Marc Tremblay and Shailender Chaudhry and to U.S. Provisional Patent Application No. 60/208,429 filed on May 31, 2000, entitled “Facilitating Value Prediction to Support Speculative Program Execution,” by inventors Marc Tremblay and Shailender Chaudhry.
1. Field of the Invention
The present invention relates to techniques for improving computer system performance. More specifically, the present invention relates to a method and apparatus that supports interleaved execution of a non-speculative thread and related speculative threads within a single processor pipeline.
2. Related Art
As microprocessor clock speeds continue to increase at an exponential rate, it is becoming progressively harder to design processor pipelines to keep pace with these higher clock speeds, because less time is available at each pipeline stage to perform required computational operations. In order to deal with this problem, some designer have begun to investigate the possibility of statically interleaving the execution of unrelated processor threads in round-robin fashion within a single processor pipeline. In this way, if N unrelated threads are interleaved, instructions for a given thread only appear once for every N consecutive pipeline stages. Hence, the N threads each run at 1/Nth of the native clock rate of the processor. For example, four threads, each running at three GHz, can collectively run on a 12 GHz processor.
This interleaving technique relaxes latency requirements, which makes it significantly easier to design a high-speed processor pipeline. For example, if four unrelated threads are interleaved, a data cache access (or an addition operation) can take up to four pipeline stages without adversely affecting the performance of a given thread.
Interleaving the execution of multiple threads within a single pipeline has a number of advantages. It saves power and area in comparison to executing the threads in separate pipelines. It also provides a large aggregate throughput for the single pipeline.
However, an application or benchmark that cannot be multi-threaded will not benefit from this interleaving technique. This is a problem because single-threaded performance is important to a large number of customers who buy computer systems. Consequently, benchmarks that customers use to compare computer system performance generally measure single-threaded performance.
Hence, what is needed is a method and an apparatus that provides the advantages of static time-multiplexed execution of multiple threads for a single-threaded application.
One embodiment of the present invention provides a system that facilitates interleaved execution of a head thread and a speculative thread within a single processor pipeline. The system operates by executing program instructions using the head thread, and by speculatively executing program instructions in advance of the head thread using the speculative thread, wherein the head thread and the speculative thread execute concurrently through time-multiplexed interleaving in the single processor pipeline.
In a variation on this embodiment, the speculative thread includes one or more speculative threads.
In a variation on this embodiment, the system performs a join operation between the head thread and the speculative thread when the head thread reaches a point in the program where the speculative thread began executing.
In a further variation, the head thread operates on primary versions of memory elements, and the speculative thread operates on space-time dimensioned versions of the memory elements (as is done in U.S. Pat. No. 6,353,881, entitled “Supporting Space-Time Dimensional Program Execution by Selectively Versioning Memory Updates” by the same inventors as the instant application). In this variation, performing the join operation involves merging the space-time dimensioned versions of the memory elements into the primary versions of the memory elements, so that updates to the space-time dimensioned versions of the memory elements are incorporated into corresponding primary versions of memory elements.
In a further variation, if the speculative thread performs a read operation to a memory element, the system determines if the space-time dimensioned version of the memory element exists. If so, the system reads the space-time dimensioned version of the memory element. If not, the system reads the primary version of the memory element. The system also updates status information associated with the memory element to indicate the memory element has been read by the speculative thread.
In a further variation, if the speculative thread performs a write operation to a memory element, the system determines if the space-time dimensioned version of the memory element exists. If not, the system creates the space-time dimensioned version of the memory element, and performs the write operation to the space-time dimensioned version of the memory element.
In a further variation, if the head thread performs a read operation to a memory element, the system performs the read operation to the primary version of the memory element.
In a further variation, if the head thread performs a write operation to a memory element, the system performs the write operation to the primary version of the memory element. The system also checks status information associated with the memory element to determine if the memory element has been read by the speculative thread. If so, the system causes the speculative thread to roll back, so that the speculative thread can read a result of the write operation. If not, the system performs the write operation to the space-time dimensioned version of the memory element, if the space-time dimensioned version exists.
In a further variation, the memory elements include objects defined within an object-oriented programming system.
In a variation on this embodiment, the head thread and the speculative thread access separate hardware register files.
The following description is presented to enable any person skilled in the art to make and use the invention, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
The data structures and code described in this detailed description are typically stored on a computer readable storage medium, which may be any device or medium that can store code and/or data for use by a computer system. This includes, but is not limited to, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs) and DVDs (digital versatile discs or digital video discs), and computer instruction signals embodied in a transmission medium (with or without a carrier wave upon which the signals are modulated). For example, the transmission medium may include a communications network, such as the Internet.
CPU 102 includes instruction cache 112, containing instructions to be executed by CPU 102, and data cache 106, containing data to be operated on by CPU 102. In one embodiment of the present invention, data cache 106 is a 64K-byte 4-way set-associative data cache with 64-byte cache lines.
Data cache 106 and instruction cache 112 are coupled to level-two cache (L2) cache, which is coupled to memory controller 111. Memory controller 111 is coupled to dynamic random access memory (DRAM) 108, which is located off chip.
Instruction cache 112 feeds instructions into four separate instruction queues 114-117, which are associated with four separate threads of execution. Instructions from queues 114-117 feed through multiplexer 109, which interleaves instructions from instruction queues 114-117 in round-robin fashion before they feed into execution pipeline 107. As illustrated in
Because the pipeline slots rotate between different threads, latencies can be relaxed. For example, a load from data cache 106 can take up to four pipeline stages or an arithmetic operation can take up to four pipeline stages, without causes a pipeline stall. In one embodiment of the present invention, this interleaving is “static,” which means that each instruction queue is associated with every fourth instruction slot in execution pipeline 107, and this association is does not change dynamically over time.
Instruction queues 114-117 are associated with corresponding register files 118-121, respectively, which contain operands that are manipulated by instructions from instruction queues 114-117. Note that instructions in execution pipeline 107 can cause data to be transferred between data cache 106 and register files 118-119. (In another embodiment of the present invention, register files 118-121 are consolidated into a single large multi-ported register file that is partitioned between the separate threads associated with instruction queues 114-117.)
Note that the present invention generally applies to any computer system that supports concurrent interleaved execution of multiple threads in a single pipeline and is not meant to be limited to the illustrated computing system. For example, the present invention is not meant to be limited to the fixed interleaving round-robin scheduling scheme described above, but can generally be applied to any time-multiplexed scheduling scheme that interleaves instructions from the instruction queues.
Space-Time Dimensional Execution of Methods
As head thread 202 executes method B 206, speculative thread 203 executes method C 208 in a separate space-time dimension of the heap. If head thread 202 successfully executes method B 206, speculative thread 203 is joined with head thread 202. This join operation involves causing state associated with the speculative thread 203 to be merged with state associated with the head thread 202 and the collapsing of the space-time dimensions of the heap.
If speculative thread 203 for some reason encounters problems in executing method C 208, speculative thread 203 performs a rollback operation. This rollback operation allows speculative thread 203 to reattempt to execute method C 208. Alternatively, head thread 202 can execute method C 208 non-speculatively and speculative thread 203 can execute a subsequent method.
There are a number of reasons why speculative thread 203 may encounter problems in executing method C 208. One problem occurs when head thread 202 executing method B 206 writes a value to a memory element (object) after speculative thread 203 has read the same memory element. The same memory element can be read when the two space-time dimensions of the heap are collapsed at this memory element at the time of the read by speculative thread 203. In this case, speculative thread 203 should have read the value written by head thread 202, but instead has read a previous value. In this case, the system causes speculative thread 203 to roll back so that speculative thread 203 can read the value written by head thread 202.
Note that the term “memory element” generally refers to any unit of memory that can be accessed by a computer program. For example, the term “memory element” may refer to a bit, a byte or a word memory, as well as a data structure or an object defined within an object-oriented programming system.
In order to undo the results of speculatively executed operations, updates to memory need to be versioned. The overhead involved in versioning all updates to memory can be prohibitively expensive due to increased memory requirements, decreased cache performance and additional hardware required to perform the versioning.
Fortunately, not all updates to memory need to be versioned. For example, updates to local variables—such as a loop counter—on a system stack are typically only relevant to the thread that is updating the local variables. Hence, even for speculative threads versioning updates to these local variables is not necessary.
When executing programs written in conventional programming languages, such as C, it is typically not possible to determine which updates are related to the heap, and which updates are related to the system stack. These programs are typically compiled from a high-level language representation into executable code for a specific machine architecture. This compilation process typically removes distinctions between updates to heap and system stack.
The same is not true for new platform-independent computer languages, such as the JAVA™ programming language distributed by SUN Microsystems, Inc. of Palo Alto, Calif. (Sun, the Sun logo, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.) A program written in the Java programming language is typically compiled into a class file containing Java byte codes. This class file can be transmitted over a computer network to a distant computer system to be executed on the distant computer system. Java byte codes are said to be “platform-independent,” because they can be executed across a wide range of computing platforms, so long as the computing platforms provide a Java virtual machine.
A Java byte code can be executed on a specific computing platform by using an interpreter or a just in time (JIT) compiler to translate the Java bytecode into machine code for the specific computing platform. Alternatively, a Java byte code can be executed directly on a Java bytecode engine running on the specific computing platform.
Fortunately, a Java bytecode contains more syntactic information than conventional machine code. In particular, the Java bytecodes differentiate between accesses to local variables in the system stack and accesses to the system heap. Furthermore, programs written in the Java programming language do not allow conversion between primitive and reference types. Such conversion can make it hard to differentiate accesses to the system stack from accesses to the system heap at compile time.
Data Structures to Support Space-Time Dimensional Execution
Primary version of object 500 is referenced by object reference pointer 501. Like any object defined within an object-oriented programming system, primary version of object 500 includes data region 508, which includes one or more fields containing data associated with primary version of object 500. Primary version of object 500 also includes method vector table pointer 506. Method vector table pointer 506 points to a table containing vectors that point to the methods that can be invoked on primary version of object 500.
Primary version of object 500 also includes space-time dimensioned version pointer 502, which points to space-time dimensioned version of object 510, if the two space-time dimensions are not collapsed at this object. Note that in the illustrated embodiment of the present invention, space-time dimensioned version 510 is always referenced indirectly through space-time dimensioned version pointer 502. Primary version of object 500 additionally includes status word 504, which contains status information specifying which fields from data region 508 have been written to or read by speculative thread 203. Space-time dimensioned version of object 510 includes only data region 518.
Read bits 604 keep track of which fields within data region 508 have been read since the last join or rollback. Correspondingly, write bits 606 keep track of which fields within data region 508 have been written since the last join or rollback. In one embodiment of the present invention, read bits 604 includes one bit for each field within data region 508. In another embodiment, read bits includes fewer bits than the number of fields within data region 508. In this embodiment, each bit within read bits 604 corresponds to more than one field in data region 508. For example, if there are eight read bits, each bit corresponds to every eighth field. Write bits 606 similarly can correspond to one or multiple fields within data region 508.
Space-Time Dimensional Update Process
Space-time dimensioning occurs during selected memory updates. For local variable and operand accesses to the system stack, no space-time dimensioned versions exist and nothing special happens. During read operations by head thread 202 to objects in the heap 402, again nothing special happens.
Special operations are involved in write operations by head thread 202 as well as read and write operations by speculative thread 203. These special operations are described in more detail with reference to
If a rollback is required, the system causes speculative thread 203 to perform a rollback operation (step 706). This rollback operation allows speculative thread 203 to read from (or write to) the object after head thread 202 writes to the object.
Note that in the embodiment of the present invention illustrated in
Extension to Additional Speculative Threads
Although the present invention has been described for the case of a single speculative thread, the present invention can be extended to provide multiple speculative threads operating on multiple space-time dimensioned versions of a data object in parallel.
Note that instructions from these threads are time-multiplexed in round-robin fashion to execute in the same instruction pipeline 107. This effectively increases the speed of single-threaded execution on CPU 102, because head thread 202, speculative thread 203, and possibly other speculative threads, are concurrently executing on CPU 102, and are performing work for the same thread of execution.
Also note that the present invention is not limited to the precise form of speculative execution described with this specification. In general, the present invention can be applied any type of speculative execution that makes use of multiple threads.
The foregoing descriptions of embodiments of the present invention have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention. The scope of the present invention is defined by the appended claims.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US4991080 *||Mar 13, 1986||Feb 5, 1991||International Business Machines Corporation||Pipeline processing apparatus for executing instructions in three streams, including branch stream pre-execution processor for pre-executing conditional branch instructions|
|US5933627 *||Jul 1, 1996||Aug 3, 1999||Sun Microsystems||Thread switch on blocked load or store using instruction thread field|
|US6247027||May 17, 1999||Jun 12, 2001||Sun Microsystems, Inc.||Facilitating garbage collection during object versioning for space and time dimensional computing|
|US6353881 *||May 17, 1999||Mar 5, 2002||Sun Microsystems, Inc.||Supporting space-time dimensional program execution by selectively versioning memory updates|
|US6430649 *||Jun 7, 1999||Aug 6, 2002||Sun Microsystems, Inc.||Method and apparatus for enforcing memory reference dependencies through a load store unit|
|US6463526||Oct 18, 1999||Oct 8, 2002||Sun Microsystems, Inc.||Supporting multi-dimensional space-time computing through object versioning|
|US6658451||Oct 15, 1999||Dec 2, 2003||Sun Microsystems, Inc.||Parallel join operation to support space and time dimensional program execution|
|US20030005266 *||Jun 28, 2001||Jan 2, 2003||Haitham Akkary||Multithreaded processor capable of implicit multithreaded execution of a single-thread program|
|1||*||Patterson, David. Hennessy, John. "Computer Architecture: A Quantitative Approach". Morgan Kaufmann Publishers, Inc. Second Edition, 1996. p. 131.|
|2||Publication: "Computer Architecture a Quantitative Approach", by David A. Patterson and John L. Hennessy, Morgan Kaufmann Publishers, Inc. Second Edition, 1996, p. 125.|
|3||Publication: "The Oz Virtual Machine, Records, Transients and Deep Guards," 'Online!, by Michael Mehl, 1999, Universitat Des Saarlandes, Saarbrucken, XP002321958, Retrieved from the Internet: URL:http://www.ps.uni-sb.de/Papers/paper-info.php?label=mehl-thesis>'retrieved on Mar. 21, 2005, pp. 39, 44, 53-57 and 97-107.|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US9069782||Sep 30, 2013||Jun 30, 2015||The Research Foundation For The State University Of New York||System and method for security and privacy aware virtual machine checkpointing|
|International Classification||G06F9/45, G06F9/46, G06F9/38, G06F9/48, G06F9/00|
|Cooperative Classification||G06F9/485, G06F9/3851, G06F9/383, G06F9/466, G06F9/3842|
|European Classification||G06F9/46T, G06F9/48C4P, G06F9/38E2, G06F9/38E4, G06F9/38D2|
|Aug 14, 2006||AS||Assignment|
Owner name: SUN MICROSYSTEMS, INC., CALIFORNIA
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:CHAUDHRY, SHAILENDER;TREMBLAY, MARC;REEL/FRAME:018168/0205
Effective date: 20060801
|Jan 16, 2013||FPAY||Fee payment|
Year of fee payment: 4
|Dec 16, 2015||AS||Assignment|
Owner name: ORACLE AMERICA, INC., CALIFORNIA
Free format text: MERGER AND CHANGE OF NAME;ASSIGNORS:ORACLE USA, INC.;SUN MICROSYSTEMS, INC.;ORACLE AMERICA, INC.;REEL/FRAME:037304/0194
Effective date: 20100212