WO2004075046A2 - Selectively unmarking of load-marked cache lines during t speculative thread execution - Google Patents

Selectively unmarking of load-marked cache lines during t speculative thread execution Download PDF

Info

Publication number
WO2004075046A2
WO2004075046A2 PCT/US2004/003668 US2004003668W WO2004075046A2 WO 2004075046 A2 WO2004075046 A2 WO 2004075046A2 US 2004003668 W US2004003668 W US 2004003668W WO 2004075046 A2 WO2004075046 A2 WO 2004075046A2
Authority
WO
WIPO (PCT)
Prior art keywords
load
marked
transactional execution
cache line
instruction
Prior art date
Application number
PCT/US2004/003668
Other languages
French (fr)
Other versions
WO2004075046A3 (en
Inventor
Marc Tremblay
Quinn A. Jacobson
Shaildender Chaudhry
Mark S. Moir
Maurice P. Herlihy
Original Assignee
Sun Microsystems Inc.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sun Microsystems Inc. filed Critical Sun Microsystems Inc.
Publication of WO2004075046A2 publication Critical patent/WO2004075046A2/en
Publication of WO2004075046A3 publication Critical patent/WO2004075046A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0862Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with prefetch
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3004Arrangements for executing specific machine instructions to perform operations on memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/30087Synchronisation or serialisation instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3824Operand accessing
    • G06F9/3834Maintaining memory consistency
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3842Speculative instruction execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • G06F9/3851Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution from multiple instruction streams, e.g. multistreaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3854Instruction completion, e.g. retiring, committing or graduating
    • G06F9/3858Result writeback, i.e. updating the architectural state or memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline, look ahead
    • G06F9/3861Recovery, e.g. branch miss-prediction, exception handling
    • G06F9/3863Recovery, e.g. branch miss-prediction, exception handling using multiple copies of the architectural state, e.g. shadow registers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • G06F9/467Transactional memory

Definitions

  • the present invention relates to techniques for improving the performance of computer systems. More specifically, the present invention relates to a method and an apparatus for selectively unmarking load-marked cache lines during transactional program execution.
  • synchronization is generally accomplished through the use of locks.
  • a lock is typically acquired before a thread enters a critical section of code, and is released after the thread exits the critical section. If another thread wants to enter a critical section protected by the same lock, it must acquire the same lock. If it is unable to acquire the lock, because a preceding thread has grabbed the lock, the thread must wait until the preceding thread releases the lock. (Note that a lock can be implemented in a number of ways, such as through atomic operations or semaphores.)
  • committing changes can involve, for example, committing store buffer entries to the memory system by ungating the store buffer.
  • load and store operations are modified so that they mark cache lines that are accessed during the transactional execution.
  • One embodiment of the present invention provides a system that facilitates selectively unmarking load-marked cache lines during transactional program execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads.
  • the system encounters a release instruction during transactional execution of a block of instructions, wherein changes made during the transactional execution are not committed to the architectural state of the processor until the transactional execution completes without encountering an interfering data access from another thread.
  • the system modifies the state of cache lines, which are specially load-marked to indicate they can be released from monitoring, to account for the release instruction being encountered. In doing so, the system can potentially cause the specially load-marked cache lines to become unmarked.
  • a specially load-marked cache line contains a release value indicating how many release instructions need to be encountered before the cache line can become unmarked.
  • modifying the specially load-marked cache line involves decrementing the release value, wherein if the release value becomes zero, the cache line becomes unmarked.
  • the system when the system encounters a load instruction during the transactional execution, the system performs the corresponding load operation. If the load instruction is a monitored load instruction, the system also load-marks a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread. If the load instruction additionally specifies that the corresponding cache line can be released from monitoring during transactional execution, the system specially load-marks the cache line to indicate that the cache line can be released from monitoring after either an explicit or implicit number of release instructions have been encountered.
  • an interfering data access (which can potentially cause an eviction of a marked line from cache, and thus a failure of a transaction) can include a store by another thread to a cache line that has been load- marked by a thread, or a load or a store by another thread to a cache line that has been store-marked by the thread.
  • One embodiment of the present invention provides a system that selectively unmarks load-marked cache lines during transactional program execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads.
  • the system encounters a commit-and-start-new-transaction instruction during transactional execution of a block of instructions within a program.
  • the system modifies load-marked cache lines to account for the commit-and-start-new-transaction instruction being encountered. In doing so, the system causes normally load-marked cache lines to become unmarked, while other specially load-marked cache lines remain load-marked past the commit- and-start-new-transaction instruction.
  • a specially load-marked cache line contains a checkpoint value indicating how many checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked.
  • modifying the specially load-marked cache line involves decrementing the checkpoint value, wherein if the checkpoint value becomes zero, the cache line becomes unmarked.
  • the system when the system encounters a load instruction during the transactional execution, the system performs the corresponding load operation. If the load instruction is a monitored load instruction, the system also load-marks a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread. If the load instruction additionally specifies that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked, the system specially load- marks the cache line to indicate that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked.
  • FIG. 1 illustrates a computer system in accordance with an embodiment of the present invention.
  • FIG. 2A illustrates how a critical section is executed in accordance with an embodiment of the present invention.
  • FIG. 2B illustrates another example of how a critical section is executed in accordance with an embodiment of the present invention.
  • FIG. 3 presents a flow chart illustrating the transactional execution process in accordance with an embodiment of the present invention.
  • FIG. 4 presents a flow chart illustrating a start transactional execution (STE) operation in accordance with an embodiment of the present invention.
  • FIG. 5 presents a flow chart illustrating how load-marking is performed during transactional execution in accordance with an embodiment of the present invention.
  • FIG. 6 presents a flow chart illustrating how store-marking is performed during transactional execution in accordance with an embodiment of the present invention.
  • FIG. 7 presents a flow chart illustrating how a commit operation is performed in accordance with an embodiment of the present invention.
  • FIG. 8 presents a flow chart illustrating how changes are discarded after transactional execution completes unsuccessfully in accordance with an embodiment of the present invention.
  • FIG. 9A presents a flow chart illustrating how monitored and unmonitored load instructions are generated in accordance with an embodiment of the present invention.
  • FIG. 9B presents a flow chart illustrating how monitored and unmonitored load instructions are executed in accordance with an embodiment of the present invention.
  • FIG. 10A presents a flow chart illustrating how monitored and unmonitored store instructions are generated in accordance with an embodiment of the present invention.
  • FIG. 10B presents a flow chart illustrating how monitored and unmonitored store instructions are executed in accordance with an embodiment of the present invention.
  • FIG. 11 presents a flow chart illustrating how a cache line is load- marked in accordance with an embodiment of the present invention.
  • FIG. 12 presents a flow chart illustrating how a release instruction operates in accordance with an embodiment of the present invention.
  • FIG. 13 presents a flow chart illustrating how a commit-and-start-new- transaction instruction operates in accordance with an embodiment of the present invention.
  • FIG. 14 presents a flow chart illustrating how a regular commit instruction operates in accordance with an embodiment of the present invention.
  • 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.
  • the transmission medium may include a communications network, such as the Internet.
  • FIG. 1 illustrates a computer system 100 in accordance with an embodiment of the present invention.
  • Computer system 100 can generally include any type of computer system, including, but not limited to, a computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a personal organizer, a device controller, and a computational engine within an appliance.
  • computer system 100 includes processors 101 and level 2 (L2) cache 120, which is coupled to main memory (not shown).
  • L2 cache 120 which is coupled to main memory (not shown).
  • Processor 102 is similar in structure to processor 101, so only processor 101 is described below.
  • Processor 101 has two register files 103 and 104, one of which is an "active register file” and the other of which is a backup "shadow register file.”
  • processor 101 provides a flash copy operation that instantly copies all of the values from register file 103 into register file 104. This facilitates a rapid register checkpointing operation to support transactional execution.
  • Processor 101 also includes one or more functional units, such as adder 107 and multiplier 108. These functional units are used in performing computational operations involving operands retrieved from register files 103 or 104. As in a conventional processor, load and store operations pass through load buffer 111 and store buffer 112. [0046] Processor 101 additionally includes a level one (LI) data cache 115, which stores data items that are likely to be used by processor 101. Note that lines in LI) data cache 115, which stores data items that are likely to be used by processor 101. Note that lines in
  • LI data cache 115 include load-marking bits 116, which indicate that a data value from the line has been loaded during transactional execution. These load-marking bits 116 are used to determine whether any interfering memory references take place during transactional execution as is described below with reference to FIGs. 3-8.
  • Processor 101 also includes an LI instruction cache (not shown).
  • load-marking does not necessarily have to take place in LI data cache 115.
  • load-marking can take place at any level cache, such as L2 cache 120, or even in an independent structure.
  • the load-marking will likely take place at the cache level that is as close to the processor as possible, which in this case is LI data cache 115. Otherwise, loads would have to go to L2 cache 120 even on an LI hit.
  • L2 cache 120 operates in concert with LI data cache 115 (and a corresponding LI instruction cache) in processor 101, and with LI data cache 117 (and a corresponding LI instruction cache) in processor 102.
  • L2 cache 120 is associated with a coherency mechanism 122, such as the reverse directory structure described in U.S. Patent Application No. 10/186,118, entitled, "Method and Apparatus for Facilitating Speculative Loads in a Multiprocessor System," filed on June 26, 2002, by inventors Shailender Chaudhry and Marc Tremblay (Publication No. US-2002-0199066-A1).
  • This coherency mechanism 122 maintains "copyback information" 121 for each cache line.
  • This copyback information 121 facilitates sending a cache line from L2 cache 120 to a requesting processor in cases where a cache line must be sent to another processor.
  • Each line in L2 cache 120 includes a "store-marking bit,” which indicates that a data value has been stored to the line during transactional execution. This store-marking bit is used to determine whether any interfering memory references take place during transactional execution as is described below with reference to FIGs. 3-8. Note that store-marking does not necessarily have to take place in L2 cache 120.
  • the store-marking takes place in the cache level closest to the processor where cache lines are coherent. For write-through LI data caches, writes are automatically propagated to L2 cache 120. However, if an LI data cache is a write-back cache, we perform store-marking in the LI data cache. (Note that the cache coherence protocol ensures that any other processor that subsequently modifies the same cache line will retrieve the cache line from the LI cache, and will hence become aware of the store-mark.)
  • FIG. 2A illustrates how a critical section is executed in accordance with an embodiment of the present invention.
  • a thread that executes a critical section typically acquires a lock associated with the critical section before entering the critical section. If the lock has been acquired by another thread, the thread may have to wait until the other thread releases the lock. Upon leaving the critical section, the thread releases the lock.
  • a lock can be associated with a shared data structure. For example, before accessing a shared data structure, a thread can acquire a lock on the shared data structure. The thread can then execute a critical section of code that accesses the shared data structure.
  • the thread After the thread is finished accessing the shared data structure, the thread releases the lock. [0053] In contrast, in the present invention, the thread does not acquire a lock, but instead executes a start transactional execution (STE) instruction before entering the critical section. If the critical section is successfully completed without interference from other threads, the thread performs a commit operation, to commit changes made during transactional execution. This sequence of events is described in more detail below with reference to FIGs. 3-8.
  • STE start transactional execution
  • a compiler replaces lock-acquiring instructions with STE instructions, and also replaces corresponding lock releasing instructions with commit instructions. Note that there may not be a one-to-one correspondence between replaced instructions. For example, a single lock acquisition operation comprised of multiple instructions may be replaced by a single STE instruction (see FIG. 2B). [0055] Note that in many cases we will want to maintain the ability to fall back on the lock in case we cannot make progress for some reason. Also, from a software engineering standpoint, it will often be desirable to transform the code only in common paths, and leave locking code intact in uncommon paths. To facilitate this, in transforming one critical section to execute transactionally, we can replace the lock-acquire with an STE instruction followed by code that reads the lock state transactionally and checks that the lock is not held.
  • FIG. 3 presents a flow chart illustrating how transactional execution takes place in accordance with an embodiment of the present invention.
  • a thread first executes an STE instruction prior to entering of a critical section of code (step 302).
  • the system transactionally executes code within the critical section, without committing results of the transactional execution (step 304).
  • the system continually monitors data references made by other threads, and determines if an interfering data access (or other type of failure) takes place during transactional execution. If not, the system atomically commits all changes made during transactional execution (step 308) and then resumes normal non-transactional execution of the program past the critical section (step 310).
  • step 312 the system discards changes made during the transactional execution (step 312), and attempts to re-execute the critical section (step 314).
  • the system attempts to transactionally re-execute the critical section zero, one, two or more times. If these attempts are not successful, the system executes an alternative block of code in normal execution mode. This alternative code may additionally attempt to perform the transaction and will likely have the ability to revert back to the conventional technique of acquiring a lock on the critical section before entering the critical section, and then releasing the lock after leaving the critical section.
  • an interfering data access can include a store by another thread to a cache line that has been load-marked by the thread. It can also include a load or a store by another thread to a cache line that has been store-marked by the thread.
  • circuitry to detect interfering data accesses can be easily implemented by making minor modifications to conventional cache coherence circuitry.
  • This conventional cache coherence circuitry presently generates signals indicating whether a given cache line has been accessed by another processor. Hence, these signals can be used to determine whether an interfering data access has taken place.
  • FIG.4 presents a flow chart illustrating a start transactional execution
  • FIG. 3 This flow chart illustrates what takes place during step 302 of the flow chart in FIG. 3.
  • the system starts by checkpointing the register file (step 402). This can involve performing a flash copy operation from register file 103 to register file 104 (see FIG. 1). In addition to checkpointing register values, this flash copy can also checkpoint various state registers associated with the currently executing thread. In general, the flash copy operation checkpoints enough state to be able to restart the corresponding thread.
  • the STE operation also causes store buffer 112 to become "gated" (step 404). This allows existing entries in store buffer to propagate to the memory sub-system (and to thereby become committed to the architectural state of the processor), but prevents new store buffer entries generated during transactional execution from doing so.
  • step 406 The system then starts transactional execution (step 406), which involves load-marking and store-marking cache lines, if necessary, as well as monitoring data references in order to detect interfering references.
  • FIG. 5 presents a flow chart illustrating how load-marking is performed during transactional execution in accordance with an embodiment of the present invention.
  • the system performs a load operation. In performing this load operation if the load operation has been identified as a load operation that needs to be load-marked, the system first attempts to load a data item from LI data cache 115 (step 502). If the load causes a cache hit, the system "load-marks" the corresponding cache line in LI data cache 115 (step 506).
  • step 508 the system retrieves the cache line from further levels of the memory hierarchy (step 508), and proceeds to step 506 to load-mark the cache line in
  • FIG. 6 presents a flow chart illustrating how store-marking is performed during transactional execution in accordance with an embodiment of the present invention.
  • the system performs a store operation. If this store operation has been identified as a store operation that needs to be store-marked, the system first prefetches a corresponding cache line for exclusive use (step 602). Note that this prefetch operation will do nothing if the line is already located in cache and is already in an exclusive use state.
  • LI data cache 115 is a write-through cache
  • the store operation propagates through LI data cache 115 to L2 cache 120.
  • the system attempts to lock the cache line corresponding to the store operation in L2 data cache 115 (step 604). If the corresponding line is in L2 cache 120 (cache hit), the system "store-marks" the corresponding cache line in L2 cache 120 (step 610). This involves setting the store-marking bit for the cache line. Otherwise, if the corresponding line is not in L2 cache 120 (cache miss), the system retrieves the cache line from further levels of the memory hierarchy (step 608) and then proceeds to step 610 to store-mark the cache line in L2 cache 120.
  • step 610 the system enters the store data into an entry of the store buffer 112 (step 612). Note that this store data will remain in store buffer 112 until a subsequent commit operation takes place, or until changes made during the transactional execution are discarded.
  • a cache line that is store marked by a given thread can be read by other threads. Note that this may cause the given thread to fail while the other threads continue.
  • FIG. 7 presents a flow chart illustrating how a commit operation is performed after transactional execution completes successfully in accordance with an embodiment of the present invention. This flow chart illustrates what takes place during step 308 of the flow chart in FIG. 3.
  • the system starts by treating store-marked cache lines as though they are locked (step 702). This means other threads that request a store-marked line must wait until the line is no longer locked before they can access the line. This is similar to how lines are locked in conventional caches.
  • the system clears load-marks from LI data cache 115 (step 704).
  • the system then commits entries from store buffer 112 for stores that are identified as needing to be marked, which were generated during the transactional execution, into the memory hierarchy (step 706). As each entry is committed, a corresponding line in L2 cache 120 is unlocked.
  • the system also commits register file changes (step 708). For example, this can involve functionally performing a flash copy between register file 103 and register file 104 in the system illustrated in FIG. 1.
  • FIG. 8 presents a flow chart illustrating how changes are discarded after transactional execution completes unsuccessfully in accordance with an embodiment of the present invention.
  • This flow chart illustrates what takes place during step 312 of the flow chart in FIG. 3.
  • the system first discards register file changes made during the transactional execution (step 802). This can involve either clearing or simply ignoring register file changes made during transactional execution. This is easy to accomplish because the old register values were checkpointed prior to commencing transactional execution.
  • the system also clears load-marks from cache lines in LI data cache 115 (step 804), and drains store buffer entries generated during transactional execution without committing them to the memory hierarchy (step 806). At the same time, the system unmarks corresponding L2 cache lines.
  • the system branches to a target location specified by the STE instruction (step 808). The code at this target location optionally attempts to re-execute the critical section (as is described above with reference to step
  • FIG. 9A presents a flow chart illustrating how monitored and unmonitored load instructions are generated in accordance with an embodiment of the present invention. This process takes place when a program is being generated to support transactional execution.
  • a compiler or virtual machine automatically generates native code to support transactional execution.
  • a programmer manually generates code to support transactional execution.
  • the system first determines whether a given load operation within a block of instructions to be transactionally executed needs to be monitored (step 902).
  • the system determines whether a load operation needs to be monitored by determining whether the load operation is directed to a heap.
  • a heap contains data that can potentially be accessed by other threads. Hence, loads from the heap need to be monitored to detect interference.
  • loads from outside the heap are not directed to data that is shared by other threads, and hence do not need to be monitored to detect interference.
  • One embodiment of the present invention determines whether a load operation needs to be monitored at the programming-language level, by examining a data structure associated with the load operation to determine whether the data structure is a "protected" data structure for which loads need to be monitored, or an
  • the system allows a programmer to determine whether a load operation needs to be monitored. [0081] If the system determines that a given load operation needs to be monitored, the system generates a "monitored load" instruction (step 904).
  • the system can use the op code to differentiate a monitored load instruction from an unmonitored load instruction.
  • the system can use the address of the load instruction to differentiate between the two types of instructions. For example, loads directed to a certain range of addresses can be monitored load instructions, whereas loads directed to other address can be unmonitored load instructions.
  • loads directed to a certain range of addresses can be monitored load instructions, whereas loads directed to other address can be unmonitored load instructions.
  • an unmonitored load instruction can either indicate that no other thread can possibly interfere with the load operation, or it can indicate that interference is possible, but it is not a reason to fail. (Note that in some situations, interfering accesses to shared data can be tolerated.)
  • FIG. 9B presents a flow chart illustrating how monitored and unmonitored load instructions are executed in accordance with an embodiment of the present invention.
  • the system first determines whether the load instruction is a monitored load instruction or an unmonitored load instruction (step 910). This can be accomplished by looking at the op code of the load instruction, or alternatively, looking at the address for the load instruction. Note that the address can be examined by comparing the address against boundary registers, or possibly examining a translation lookaside buffer (TLB) entry for the address to determine if the address falls within a monitored range of addresses.
  • TLB translation lookaside buffer
  • the system performs the corresponding load operation and load marks the associated cache line (step 914). Otherwise, if the load instruction is an unmonitored load instruction, the system performs the load operation without load-marking the cache line (step 916). [0086] In a variation of this embodiment, the system does not allow an unmarked load operation from the current thread to cause other threads to fail transactional execution. This can be accomplished by propagating additional information during the coherency transactions associated with the load operation to ensure that the load operation does not cause another thread to fail.
  • FIG. 10A presents a flow chart illustrating how monitored and unmonitored store instructions are generated in accordance with an embodiment of the present invention. As was described above for load operations, this process can take place when a compiler or virtual machine automatically generates native code to support transactional execution, or when a programmer manually generates code to support transactional execution.
  • the system first determines whether a store operation within a block of instructions to be transactionally executed needs to be monitored (step 1002). This determination can be made in the based on the same factors as for load instructions. [0089] If the system determines that a store operation needs to be monitored, the system generates a "monitored store" instruction (step 1004). Otherwise, the system generates an "unmonitored store” instruction (step 1006). [0090] Note that monitored store instructions can be differentiated from unmonitored store instructions in the same way that monitored load instructions can be differentiated from unmonitored load instructions, for example the system can use different op codes or different address ranges.
  • FIG. 10B presents a flow chart illustrating how monitored and unmonitored store instructions are executed in accordance with an embodiment of the present invention.
  • the system first determines whether the store instruction is a monitored store instruction or an unmonitored store instruction (step 1010). This can be accomplished by looking at the op code for the store instruction, or alternatively, looking at the address for the store instruction. If the store instruction is a monitored store instruction, the system performs the corresponding store operation to a gated store buffer, or in another way so that it can be later undone, and store marks the associated cache line (step 1014). Otherwise, if the store instruction is an unmonitored store instruction, the system performs the store operation without store- marking the cache line (step 1016).
  • a store-marked cache line can indicate one or more of the following: (1) loads from other threads to the cache line should be monitored; (2) stores from other threads to the cache line should be monitored; or (3) stores to the cache line should be buffered until the transactional execution completes.
  • the system does not allow an unmarked store operation from the current thread cause another thread to fail transactional execution. This can be accomplished by propagating additional information during coherency transactions associated with the store operation to ensure that the store operation does not cause another thread to fail.
  • FIG. 11 presents a flow chart illustrating how a cache line is load- marked in accordance with an embodiment of the present invention.
  • This flow chart illustrates in more detail the load-marking operation performed in step 914 in FIG. 9 described above.
  • the system receives a special load instruction LOAD(dest,addr,A,B) (step 1102).
  • the special load specifies a destination register "dest” and a load address "addr". This load address can be used to identify a cache line that the load instruction is directed to.
  • the special load instruction includes two additional parameters "A" and "B.”
  • the parameter A specifies the minimum number of “commit-and-start-new-transaction operations” the corresponding cache line will remain marked for, while the parameter B specifies the minimum number of "release operations" that the load instruction will remain marked for.
  • a commit-and checkpoint operation commits the previous transactional execution operation and commences a new transactional execution operation in one atomic operation.
  • a release operation unmarks cache lines that have been specially load-marked during transactional execution. This enables load-marked cache lines to become unmarked during transactional execution.
  • a and B can be thought of as a generalization of the load-marking bit described above.
  • the system examines the current state "LLNE(X,Y)" of the cache line that the load operation is directed to (step 1104).
  • This current state includes values X and Y, which correspond to parameters A and B in the load instruction, respectively.
  • X indicates the number of "commit-and-start-new-transaction operations" the cache line will remain marked for, while Y specifies the number of
  • the system modifies the current state of the cache line, if necessary, to reflect the A and B parameters of the load instruction. If A > X, the system replaces X with A (step 1106), and if B > Y, the system replaces Y with B (step 1108). this way, the current state of the cache line is updated to reflect the maximum of A and X, and the maximum of B and Y. This means that a cache line will remain marked as long as any load instruction requires it to.
  • the system still supports an unchecked load instruction, which does not load-mark cache lines.
  • This unmarked load instruction can be thought of as LOAD(0,0).
  • the special load instruction only supports the parameter A, but not the parameter B.
  • the load instruction only supports the parameter B but not the parameter A. If the parameter A > 0, then the parameter B does not matter, because if the load can survive until the next checkpoint-and-commit instruction, the load has to survive any release instructions up till the next checkpoint-and-commit operation.
  • FIG. 12 presents a flow chart illustrating how a release instruction operates in accordance with an embodiment of the present invention.
  • the system receives a release instruction during transactional execution of a block of instructions within an application (step 1202).
  • the system examines the current state "LINE(X,Y)" of each cache line (step 1204). For each cache line, if Y > 0, the system decrements Y (step 1206). Furthermore, if Y becomes zero and X is also zero, the line becomes unmarked.
  • the present invention allows a programmer (or compiler/interpreter) to generate special load instructions and periodic release instructions, which release load-marked cache lines from monitoring during transactional execution.
  • Unmarking load-marked cache lines has a number of benefits. For example, cache lines that are unmarked do not have to remain locked in cache memory until the transaction completes (or is killed), and false failures are less likely to occur due to a large number of cache lines being marked. (Note that when a large number of cache lines are marked, false failures are likely to occur when accesses that appear to interfere with each other do not actually touch the same data items in a cache line.)
  • a commit-and-start-new-transaction instruction causes the current transactional execution to commit in the same way as if a normal commit instruction was encountered. All updates to register state and memory are performed. All store marks are cleared and some load marks are cleared as described.
  • the difference between a normal commit and a commit-and-start-new-transactions instruction is that a commit-and-start-new-transaction instruction causes a new transaction to be immediately started (like executing a STE) with the additional behavior that the new transaction starts with some lines already load marked. This allows a line to be monitored across consecutive transactions.
  • FIG. 13 presents a flow chart illustrating how a commit-and-start- new-transaction instruction operates in accordance with an embodiment of the present invention.
  • the system receives a commit-and-start-new-transaction instruction during transactional execution of a block of instructions within an application
  • step 1301 the system performs all relevant updates to the state register and to the memory (step 1302) and all associated store marks are cleared (step 1303).
  • updates to memory can involve committing stores from the store buffer to memory, or at least "ungating" them so that they subsequently drain to memory.
  • the present invention allows a programmer (or compiler/interpreter) to generate special load instructions and periodic commit-and- start-new-transaction instructions, which selectively release load-marked cache lines from monitoring during commit-and-start-new-transaction operations.
  • FIG. 14 presents a flow chart illustrating how a regular commit instruction (not a commit-and-start-new-transaction instruction) operates in accordance with an embodiment of the present invention.
  • the system receives a regular commit instruction during transactional execution of a block of instruction in an application (step 1402).
  • the system then clears the state variables X and Y in all cache lines.
  • a regular commit operation terminates transactional execution and unmarks all cache lines so that no cache lines continue to be monitored.
  • one embodiment of the present invention maintains a global counter that is incremented during each release operation.
  • the system marks cache lines by adding the value B to the global counter to produce a sum B' and then storing B' in the state variable Y if the state variable Y is greater than B'.
  • the cache lines remain "marked” until the global counter reaches or exceeds the value stored in the state variable Y. Note that if the state variable Y wraps around back to zero, it may cause a false failure during transactional execution. This can potentially degrade performance, however, the application will continue to operate correctly.
  • the system maintains a similar global counter that is incremented on every commit-and-start-new- transaction operation.
  • the system marks cache lines by adding the value A to the global counter to produce a sum A' and then storing A' in the state variable X if the state variable X is greater than A'.
  • the cache lines remain "marked” until the global counter reaches or exceeds the value stored in the state variable Y.

Abstract

One embodiment of the present invention provides a system that facilitates selectively unmarking load-marked cache lines during transactional program execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads. During operation, the system encounters a release instruction during transactional execution of a block of instructions. In response to the release instruction, the system modifies the state of cache lines, which are specially load-marked to indicate they can be released from monitoring, to account for the release instruction being encountered. In doing so, the system can potentially cause the specially load-marked cache lines to become unmarked. In a variation on this embodiment, upon encountering a commit-and­startnew-transaction instruction, the system modifies load-marked cache lines to account for the commit-and-start­new-transaction instruction being encountered. In doing so, the system causes normally load-marked cache lines to become unmarked, while other specially load-marked cache lines may remain load-marked past the commit-and­startnew-transaction instruction.

Description

SELECTIVELY UNMARKING LOAD-MARKED
CACHE LINES DURING TRANSACTIONAL
PROGRAM EXECUTION
Inventors: Marc Tremblay, Quinn A. Jacobson, Shailender Chaudhry, Mark S. Moir and Maurice P. Herlihy
BACKGROUND
Field of the Invention
[0001] The present invention relates to techniques for improving the performance of computer systems. More specifically, the present invention relates to a method and an apparatus for selectively unmarking load-marked cache lines during transactional program execution.
Related Art
[0002] Computer system designers are presently developing mechanisms to support multi-threading within the latest generation of Chip-Multiprocessors (CMPs) as well as more traditional Shared Memory Multiprocessors (SMPs). With proper hardware support, multi-threading can dramatically increase the performance of numerous applications. However, as microprocessor performance continues to increase, the time spent synchronizing between threads (processes) is becoming a large fraction of overall execution time, h fact, as multi-threaded applications begin to use even more threads, this synchronization overhead becomes the dominant factor in limiting application performance.
[0003] From a programmer's perspective, synchronization is generally accomplished through the use of locks. A lock is typically acquired before a thread enters a critical section of code, and is released after the thread exits the critical section. If another thread wants to enter a critical section protected by the same lock, it must acquire the same lock. If it is unable to acquire the lock, because a preceding thread has grabbed the lock, the thread must wait until the preceding thread releases the lock. (Note that a lock can be implemented in a number of ways, such as through atomic operations or semaphores.)
[0004] Unfortunately, the process of acquiring a lock and the process of releasing a lock are very time-consuming in modern microprocessors. They involve atomic operations, which typically flush the load buffer and store buffer, and can consequently require hundreds, if not thousands, of processor cycles to complete.
[0005] Moreover, as multi-threaded applications use more threads, more locks are required. For example, if multiple threads need to access a shared data structure, it is impractical for performance reasons to use a single lock for the entire data structure. Instead, it is preferable to use multiple fine-grained locks to lock small portions of the data structure. This allows multiple threads to operate on different portions of the data structure in parallel. However, it also requires a single thread to acquire and release multiple locks in order to access different portions of the data structure. It also introduces significant software engineering concerns, such as avoiding deadlock. [0006] In some cases, locks are used when they are not required. For example, many applications make use of "thread-safe" library routines that use locks to ensure that they are "thread-safe" for multi-threaded applications. Unfortunately, the overhead involved in acquiring and releasing these locks is still incurred, even when the thread-safe library routines are called by a single-threaded application. [0007] Applications typically use locks to ensure mutual exclusion within critical sections of code. However, in many cases threads will not interfere with each other, even if they are allowed to execute a critical section simultaneously. In these cases, mutual exclusion is used to prevent the unlikely case in which threads actually interfere with each other. Consequently, in these cases, the overhead involved in acquiring and releasing locks is largely wasted.
[0008] Hence, what is needed is a method and an apparatus that reduces the overhead involved in manipulating locks when accessing critical sections.
[0009] One technique to reduce the overhead involved in manipulating locks is to "transactionally" execute a critical section, wherein changes made during the transactional execution are not committed to the architectural state of the processor until the transactional execution completes without encountering an interfering data access from another thread. This technique is described in related U.S. Patent Application No. 10/637,168, entitled, "Selectively Monitoring Loads to Support
Transactional Program Execution," by inventors Marc Tremblay, Quinn A. Jacobson and Shailender Chaudhry, filed on 8 August 2003 (Attorney Docket No. SUN-P9327-
MEG). Note that committing changes can involve, for example, committing store buffer entries to the memory system by ungating the store buffer.
[0010] During transactional execution, load and store operations are modified so that they mark cache lines that are accessed during the transactional execution.
This allows the computer system to determine if an interfering data access occurs during the transactional execution. If so, the transactional execution fails, and results of the transactional execution are not committed to the architectural state of the processor. One the other hand, if the transactional execution is successful in executing a block of instructions, results of the transactional execution are atomically committed to the architectural state of the processor.
[0011] Unfortunately, existing designs for systems that support transactional execution require the hardware to maintain state information about every memory location accessed by the transaction until the transaction completes. Because the hardware resources needed to maintain such state are necessarily bounded, this renders such designs inapplicable to larger transactions that can potentially access a large number of memory locations. For example, a non-blocking implementation of a dynamically sized data structure (such as a linked list) can potentially need to access a large number memory locations during a single atomic transaction (for example, to scan down the linked list).
Hence, what is needed is a method and an apparatus that reduces the amount of state information that the system needs to keep track of during transactional program execution.
[0012] Unfortunately, problems can arise while marking cache lines. If a large number of lines are marked, false failures are likely to occur when accesses that appear to interfere with each other do not actually touch the same data items in a cache line. Furthermore, the marked cache lines cannot be easily moved out of cache until the transactional execution completes, which also causes performance problems. [0013] Also, since store operations need to be buffered during transactional execution, transactional execution will sometimes be limited by the number of available store buffers on the processor.
[0014] Hence, what is needed is a method and an apparatus that reduces the number of cache lines that need to be marked during transactional program execution.
SUMMARY
[0015] One embodiment of the present invention provides a system that facilitates selectively unmarking load-marked cache lines during transactional program execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads. During operation, the system encounters a release instruction during transactional execution of a block of instructions, wherein changes made during the transactional execution are not committed to the architectural state of the processor until the transactional execution completes without encountering an interfering data access from another thread. In response to the release instruction, the system modifies the state of cache lines, which are specially load-marked to indicate they can be released from monitoring, to account for the release instruction being encountered. In doing so, the system can potentially cause the specially load-marked cache lines to become unmarked. l
[0016] In a variation on this embodiment, a specially load-marked cache line contains a release value indicating how many release instructions need to be encountered before the cache line can become unmarked. In this embodiment, modifying the specially load-marked cache line involves decrementing the release value, wherein if the release value becomes zero, the cache line becomes unmarked. [0017] In a variation on this embodiment, when the system encounters a load instruction during the transactional execution, the system performs the corresponding load operation. If the load instruction is a monitored load instruction, the system also load-marks a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread. If the load instruction additionally specifies that the corresponding cache line can be released from monitoring during transactional execution, the system specially load-marks the cache line to indicate that the cache line can be released from monitoring after either an explicit or implicit number of release instructions have been encountered.
[0018] In a variation on this embodiment, if an interfering data access from another thread is encountered during transactional execution, the system discards changes made during the transactional execution, and attempts to re-execute the block of instructions.
[0019] In a variation on this embodiment, if transactional execution completes without encountering an interfering data access from another thread, the system commits changes made during the transactional execution to the architectural state of a processor, and resumes normal non-transactional execution of the program past the block of instructions.
[0020] In a variation on this embodiment, an interfering data access (which can potentially cause an eviction of a marked line from cache, and thus a failure of a transaction) can include a store by another thread to a cache line that has been load- marked by a thread, or a load or a store by another thread to a cache line that has been store-marked by the thread.
[0021] One embodiment of the present invention provides a system that selectively unmarks load-marked cache lines during transactional program execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads. During operation, the system encounters a commit-and-start-new-transaction instruction during transactional execution of a block of instructions within a program. In response to the commit-and- start-new-transaction instruction, the system modifies load-marked cache lines to account for the commit-and-start-new-transaction instruction being encountered. In doing so, the system causes normally load-marked cache lines to become unmarked, while other specially load-marked cache lines remain load-marked past the commit- and-start-new-transaction instruction.
[0022] In a variation on this embodiment, a specially load-marked cache line contains a checkpoint value indicating how many checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked. In this variation, modifying the specially load-marked cache line involves decrementing the checkpoint value, wherein if the checkpoint value becomes zero, the cache line becomes unmarked.
[0023] In a variation on this embodiment, when the system encounters a load instruction during the transactional execution, the system performs the corresponding load operation. If the load instruction is a monitored load instruction, the system also load-marks a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread. If the load instruction additionally specifies that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked, the system specially load- marks the cache line to indicate that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked.
BRIEF DESCRIPTION OF THE FIGURES
[0024] FIG. 1 illustrates a computer system in accordance with an embodiment of the present invention.
[0025] FIG. 2A illustrates how a critical section is executed in accordance with an embodiment of the present invention.
[0026] FIG. 2B illustrates another example of how a critical section is executed in accordance with an embodiment of the present invention. . [0027] FIG. 3 presents a flow chart illustrating the transactional execution process in accordance with an embodiment of the present invention.
[0028] FIG. 4 presents a flow chart illustrating a start transactional execution (STE) operation in accordance with an embodiment of the present invention.
[0029] FIG. 5 presents a flow chart illustrating how load-marking is performed during transactional execution in accordance with an embodiment of the present invention.
[0030] FIG. 6 presents a flow chart illustrating how store-marking is performed during transactional execution in accordance with an embodiment of the present invention. [0031] FIG. 7 presents a flow chart illustrating how a commit operation is performed in accordance with an embodiment of the present invention. [0032] FIG. 8 presents a flow chart illustrating how changes are discarded after transactional execution completes unsuccessfully in accordance with an embodiment of the present invention.
[0033] FIG. 9A presents a flow chart illustrating how monitored and unmonitored load instructions are generated in accordance with an embodiment of the present invention.
[0034] FIG. 9B presents a flow chart illustrating how monitored and unmonitored load instructions are executed in accordance with an embodiment of the present invention. [0035] FIG. 10A presents a flow chart illustrating how monitored and unmonitored store instructions are generated in accordance with an embodiment of the present invention.
[0036] FIG. 10B presents a flow chart illustrating how monitored and unmonitored store instructions are executed in accordance with an embodiment of the present invention.
[0037] FIG. 11 presents a flow chart illustrating how a cache line is load- marked in accordance with an embodiment of the present invention.
[0038] FIG. 12 presents a flow chart illustrating how a release instruction operates in accordance with an embodiment of the present invention. [0039] FIG. 13 presents a flow chart illustrating how a commit-and-start-new- transaction instruction operates in accordance with an embodiment of the present invention.
[0040] FIG. 14 presents a flow chart illustrating how a regular commit instruction operates in accordance with an embodiment of the present invention.
DETAILED DESCRD?TION [0041] 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.
[0042] 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.
Computer System
[0043] FIG. 1 illustrates a computer system 100 in accordance with an embodiment of the present invention. Computer system 100 can generally include any type of computer system, including, but not limited to, a computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a personal organizer, a device controller, and a computational engine within an appliance. As is illustrated in FIG. 1, computer system 100 includes processors 101 and level 2 (L2) cache 120, which is coupled to main memory (not shown). Processor 102 is similar in structure to processor 101, so only processor 101 is described below.
[0044] Processor 101 has two register files 103 and 104, one of which is an "active register file" and the other of which is a backup "shadow register file." In one embodiment of the present invention, processor 101 provides a flash copy operation that instantly copies all of the values from register file 103 into register file 104. This facilitates a rapid register checkpointing operation to support transactional execution.
[0045] Processor 101 also includes one or more functional units, such as adder 107 and multiplier 108. These functional units are used in performing computational operations involving operands retrieved from register files 103 or 104. As in a conventional processor, load and store operations pass through load buffer 111 and store buffer 112. [0046] Processor 101 additionally includes a level one (LI) data cache 115, which stores data items that are likely to be used by processor 101. Note that lines in
LI data cache 115 include load-marking bits 116, which indicate that a data value from the line has been loaded during transactional execution. These load-marking bits 116 are used to determine whether any interfering memory references take place during transactional execution as is described below with reference to FIGs. 3-8.
Processor 101 also includes an LI instruction cache (not shown).
[0047] Note that load-marking does not necessarily have to take place in LI data cache 115. In general load-marking can take place at any level cache, such as L2 cache 120, or even in an independent structure. However, for performance reasons, the load-marking will likely take place at the cache level that is as close to the processor as possible, which in this case is LI data cache 115. Otherwise, loads would have to go to L2 cache 120 even on an LI hit.
[0048] L2 cache 120 operates in concert with LI data cache 115 (and a corresponding LI instruction cache) in processor 101, and with LI data cache 117 (and a corresponding LI instruction cache) in processor 102. Note that L2 cache 120 is associated with a coherency mechanism 122, such as the reverse directory structure described in U.S. Patent Application No. 10/186,118, entitled, "Method and Apparatus for Facilitating Speculative Loads in a Multiprocessor System," filed on June 26, 2002, by inventors Shailender Chaudhry and Marc Tremblay (Publication No. US-2002-0199066-A1). This coherency mechanism 122 maintains "copyback information" 121 for each cache line. This copyback information 121 facilitates sending a cache line from L2 cache 120 to a requesting processor in cases where a cache line must be sent to another processor. [0049] Each line in L2 cache 120 includes a "store-marking bit," which indicates that a data value has been stored to the line during transactional execution. This store-marking bit is used to determine whether any interfering memory references take place during transactional execution as is described below with reference to FIGs. 3-8. Note that store-marking does not necessarily have to take place in L2 cache 120.
[0050] Ideally, the store-marking takes place in the cache level closest to the processor where cache lines are coherent. For write-through LI data caches, writes are automatically propagated to L2 cache 120. However, if an LI data cache is a write-back cache, we perform store-marking in the LI data cache. (Note that the cache coherence protocol ensures that any other processor that subsequently modifies the same cache line will retrieve the cache line from the LI cache, and will hence become aware of the store-mark.)
Executing a Critical Section
[0051] FIG. 2A illustrates how a critical section is executed in accordance with an embodiment of the present invention. As is illustrated in the left-hand side of FIG. 2A, a thread that executes a critical section typically acquires a lock associated with the critical section before entering the critical section. If the lock has been acquired by another thread, the thread may have to wait until the other thread releases the lock. Upon leaving the critical section, the thread releases the lock. (Note that the terms "thread" and "process" are used interchangeably throughout this specification.) [0052] A lock can be associated with a shared data structure. For example, before accessing a shared data structure, a thread can acquire a lock on the shared data structure. The thread can then execute a critical section of code that accesses the shared data structure. After the thread is finished accessing the shared data structure, the thread releases the lock. [0053] In contrast, in the present invention, the thread does not acquire a lock, but instead executes a start transactional execution (STE) instruction before entering the critical section. If the critical section is successfully completed without interference from other threads, the thread performs a commit operation, to commit changes made during transactional execution. This sequence of events is described in more detail below with reference to FIGs. 3-8.
[0054] Note that in one embodiment of the present invention a compiler replaces lock-acquiring instructions with STE instructions, and also replaces corresponding lock releasing instructions with commit instructions. Note that there may not be a one-to-one correspondence between replaced instructions. For example, a single lock acquisition operation comprised of multiple instructions may be replaced by a single STE instruction (see FIG. 2B). [0055] Note that in many cases we will want to maintain the ability to fall back on the lock in case we cannot make progress for some reason. Also, from a software engineering standpoint, it will often be desirable to transform the code only in common paths, and leave locking code intact in uncommon paths. To facilitate this, in transforming one critical section to execute transactionally, we can replace the lock-acquire with an STE instruction followed by code that reads the lock state transactionally and checks that the lock is not held.
[0056] The above discussion presumes that the processor's instruction set has been augmented to include an STE instruction and a commit instruction. These instructions are described in more detail below with reference to FIGs. 3-9.
Transactional Execution Process
[0057] FIG. 3 presents a flow chart illustrating how transactional execution takes place in accordance with an embodiment of the present invention. A thread first executes an STE instruction prior to entering of a critical section of code (step 302). Next, the system transactionally executes code within the critical section, without committing results of the transactional execution (step 304).
[0058] During this transactional execution, the system continually monitors data references made by other threads, and determines if an interfering data access (or other type of failure) takes place during transactional execution. If not, the system atomically commits all changes made during transactional execution (step 308) and then resumes normal non-transactional execution of the program past the critical section (step 310).
[0059] On the other hand, if an interfering data access is detected, the system discards changes made during the transactional execution (step 312), and attempts to re-execute the critical section (step 314).
[0060] In one embodiment of the present invention, the system attempts to transactionally re-execute the critical section zero, one, two or more times. If these attempts are not successful, the system executes an alternative block of code in normal execution mode. This alternative code may additionally attempt to perform the transaction and will likely have the ability to revert back to the conventional technique of acquiring a lock on the critical section before entering the critical section, and then releasing the lock after leaving the critical section.
[0061] Note that an interfering data access can include a store by another thread to a cache line that has been load-marked by the thread. It can also include a load or a store by another thread to a cache line that has been store-marked by the thread.
[0062] Also note that circuitry to detect interfering data accesses can be easily implemented by making minor modifications to conventional cache coherence circuitry. This conventional cache coherence circuitry presently generates signals indicating whether a given cache line has been accessed by another processor. Hence, these signals can be used to determine whether an interfering data access has taken place.
Starting Transactional Execution [0063] FIG.4 presents a flow chart illustrating a start transactional execution
(STE) operation in accordance with an embodiment of the present invention. This flow chart illustrates what takes place during step 302 of the flow chart in FIG. 3. The system starts by checkpointing the register file (step 402). This can involve performing a flash copy operation from register file 103 to register file 104 (see FIG. 1). In addition to checkpointing register values, this flash copy can also checkpoint various state registers associated with the currently executing thread. In general, the flash copy operation checkpoints enough state to be able to restart the corresponding thread.
[0064] At the same time the register file is checkpointed, the STE operation also causes store buffer 112 to become "gated" (step 404). This allows existing entries in store buffer to propagate to the memory sub-system (and to thereby become committed to the architectural state of the processor), but prevents new store buffer entries generated during transactional execution from doing so.
[0065] The system then starts transactional execution (step 406), which involves load-marking and store-marking cache lines, if necessary, as well as monitoring data references in order to detect interfering references. Load-Marking Process
[0066] FIG. 5 presents a flow chart illustrating how load-marking is performed during transactional execution in accordance with an embodiment of the present invention. During transactional execution of a critical section, the system performs a load operation. In performing this load operation if the load operation has been identified as a load operation that needs to be load-marked, the system first attempts to load a data item from LI data cache 115 (step 502). If the load causes a cache hit, the system "load-marks" the corresponding cache line in LI data cache 115 (step 506).
This involves setting the load-marking bit for the cache line. Otherwise, if the load causes a cache miss, the system retrieves the cache line from further levels of the memory hierarchy (step 508), and proceeds to step 506 to load-mark the cache line in
LI data cache 115.
Store-Marking Process [0067] FIG. 6 presents a flow chart illustrating how store-marking is performed during transactional execution in accordance with an embodiment of the present invention. During transactional execution of a critical section, the system performs a store operation. If this store operation has been identified as a store operation that needs to be store-marked, the system first prefetches a corresponding cache line for exclusive use (step 602). Note that this prefetch operation will do nothing if the line is already located in cache and is already in an exclusive use state. [0068] Since in this example LI data cache 115 is a write-through cache, the store operation propagates through LI data cache 115 to L2 cache 120. The system then attempts to lock the cache line corresponding to the store operation in L2 data cache 115 (step 604). If the corresponding line is in L2 cache 120 (cache hit), the system "store-marks" the corresponding cache line in L2 cache 120 (step 610). This involves setting the store-marking bit for the cache line. Otherwise, if the corresponding line is not in L2 cache 120 (cache miss), the system retrieves the cache line from further levels of the memory hierarchy (step 608) and then proceeds to step 610 to store-mark the cache line in L2 cache 120.
[0069] Next, after the cache line is store-marked in step 610, the system enters the store data into an entry of the store buffer 112 (step 612). Note that this store data will remain in store buffer 112 until a subsequent commit operation takes place, or until changes made during the transactional execution are discarded.
[0070] Note that a cache line that is store marked by a given thread can be read by other threads. Note that this may cause the given thread to fail while the other threads continue.
Commit Operation
[0071] FIG. 7 presents a flow chart illustrating how a commit operation is performed after transactional execution completes successfully in accordance with an embodiment of the present invention. This flow chart illustrates what takes place during step 308 of the flow chart in FIG. 3.
[0072] The system starts by treating store-marked cache lines as though they are locked (step 702). This means other threads that request a store-marked line must wait until the line is no longer locked before they can access the line. This is similar to how lines are locked in conventional caches.
[0073] Next, the system clears load-marks from LI data cache 115 (step 704).
[0074] The system then commits entries from store buffer 112 for stores that are identified as needing to be marked, which were generated during the transactional execution, into the memory hierarchy (step 706). As each entry is committed, a corresponding line in L2 cache 120 is unlocked.
[0075] The system also commits register file changes (step 708). For example, this can involve functionally performing a flash copy between register file 103 and register file 104 in the system illustrated in FIG. 1.
Discarding Changes
[0076] FIG. 8 presents a flow chart illustrating how changes are discarded after transactional execution completes unsuccessfully in accordance with an embodiment of the present invention. This flow chart illustrates what takes place during step 312 of the flow chart in FIG. 3. The system first discards register file changes made during the transactional execution (step 802). This can involve either clearing or simply ignoring register file changes made during transactional execution. This is easy to accomplish because the old register values were checkpointed prior to commencing transactional execution. The system also clears load-marks from cache lines in LI data cache 115 (step 804), and drains store buffer entries generated during transactional execution without committing them to the memory hierarchy (step 806). At the same time, the system unmarks corresponding L2 cache lines. Finally, in one embodiment of the present invention, the system branches to a target location specified by the STE instruction (step 808). The code at this target location optionally attempts to re-execute the critical section (as is described above with reference to step
314 of FIG. 1) or takes other action in response to the failure, for example backing off to reduce contention.
Monitored Load Instructions
[0077] FIG. 9A presents a flow chart illustrating how monitored and unmonitored load instructions are generated in accordance with an embodiment of the present invention. This process takes place when a program is being generated to support transactional execution. For example, in one embodiment of the present invention, a compiler or virtual machine automatically generates native code to support transactional execution. In another embodiment, a programmer manually generates code to support transactional execution. [0078] The system first determines whether a given load operation within a block of instructions to be transactionally executed needs to be monitored (step 902). In one embodiment of the present invention, the system determines whether a load operation needs to be monitored by determining whether the load operation is directed to a heap. Note that a heap contains data that can potentially be accessed by other threads. Hence, loads from the heap need to be monitored to detect interference. In contrast, loads from outside the heap, (for example, from the local stack) are not directed to data that is shared by other threads, and hence do not need to be monitored to detect interference.
[0079] One embodiment of the present invention determines whether a load operation needs to be monitored at the programming-language level, by examining a data structure associated with the load operation to determine whether the data structure is a "protected" data structure for which loads need to be monitored, or an
"unprotected" data structure for which loads do not need to be monitored.
[0080] In yet another embodiment, the system allows a programmer to determine whether a load operation needs to be monitored. [0081] If the system determines that a given load operation needs to be monitored, the system generates a "monitored load" instruction (step 904).
Otherwise, the system generates an "unmonitored load" instruction (step 906).
[0082] There are a number of different ways to differentiate a monitored load instruction from an unmonitored load instruction. (1) The system can use the op code to differentiate a monitored load instruction from an unmonitored load instruction. (2)
Alternatively, the system can use the address of the load instruction to differentiate between the two types of instructions. For example, loads directed to a certain range of addresses can be monitored load instructions, whereas loads directed to other address can be unmonitored load instructions. [0083] Also note that an unmonitored load instruction can either indicate that no other thread can possibly interfere with the load operation, or it can indicate that interference is possible, but it is not a reason to fail. (Note that in some situations, interfering accesses to shared data can be tolerated.)
[0084] FIG. 9B presents a flow chart illustrating how monitored and unmonitored load instructions are executed in accordance with an embodiment of the present invention. The system first determines whether the load instruction is a monitored load instruction or an unmonitored load instruction (step 910). This can be accomplished by looking at the op code of the load instruction, or alternatively, looking at the address for the load instruction. Note that the address can be examined by comparing the address against boundary registers, or possibly examining a translation lookaside buffer (TLB) entry for the address to determine if the address falls within a monitored range of addresses.
[0085] If the load instruction is a monitored load instruction, the system performs the corresponding load operation and load marks the associated cache line (step 914). Otherwise, if the load instruction is an unmonitored load instruction, the system performs the load operation without load-marking the cache line (step 916). [0086] In a variation of this embodiment, the system does not allow an unmarked load operation from the current thread to cause other threads to fail transactional execution. This can be accomplished by propagating additional information during the coherency transactions associated with the load operation to ensure that the load operation does not cause another thread to fail.
Monitored Store Instructions
[0087] FIG. 10A presents a flow chart illustrating how monitored and unmonitored store instructions are generated in accordance with an embodiment of the present invention. As was described above for load operations, this process can take place when a compiler or virtual machine automatically generates native code to support transactional execution, or when a programmer manually generates code to support transactional execution.
[0088] The system first determines whether a store operation within a block of instructions to be transactionally executed needs to be monitored (step 1002). This determination can be made in the based on the same factors as for load instructions. [0089] If the system determines that a store operation needs to be monitored, the system generates a "monitored store" instruction (step 1004). Otherwise, the system generates an "unmonitored store" instruction (step 1006). [0090] Note that monitored store instructions can be differentiated from unmonitored store instructions in the same way that monitored load instructions can be differentiated from unmonitored load instructions, for example the system can use different op codes or different address ranges.
[0091] FIG. 10B presents a flow chart illustrating how monitored and unmonitored store instructions are executed in accordance with an embodiment of the present invention. The system first determines whether the store instruction is a monitored store instruction or an unmonitored store instruction (step 1010). This can be accomplished by looking at the op code for the store instruction, or alternatively, looking at the address for the store instruction. If the store instruction is a monitored store instruction, the system performs the corresponding store operation to a gated store buffer, or in another way so that it can be later undone, and store marks the associated cache line (step 1014). Otherwise, if the store instruction is an unmonitored store instruction, the system performs the store operation without store- marking the cache line (step 1016).
[0092] Note that a store-marked cache line can indicate one or more of the following: (1) loads from other threads to the cache line should be monitored; (2) stores from other threads to the cache line should be monitored; or (3) stores to the cache line should be buffered until the transactional execution completes.
[0093] In a variation of this embodiment, the system does not allow an unmarked store operation from the current thread cause another thread to fail transactional execution. This can be accomplished by propagating additional information during coherency transactions associated with the store operation to ensure that the store operation does not cause another thread to fail.
Load-Marking Process
[0094] FIG. 11 presents a flow chart illustrating how a cache line is load- marked in accordance with an embodiment of the present invention. This flow chart illustrates in more detail the load-marking operation performed in step 914 in FIG. 9 described above. First, the system receives a special load instruction LOAD(dest,addr,A,B) (step 1102). Like a normal load instruction, the special load specifies a destination register "dest" and a load address "addr". This load address can be used to identify a cache line that the load instruction is directed to. The special load instruction includes two additional parameters "A" and "B." The parameter A specifies the minimum number of "commit-and-start-new-transaction operations" the corresponding cache line will remain marked for, while the parameter B specifies the minimum number of "release operations" that the load instruction will remain marked for.
[0095] Note that a commit-and checkpoint operation commits the previous transactional execution operation and commences a new transactional execution operation in one atomic operation. In contrast, a release operation unmarks cache lines that have been specially load-marked during transactional execution. This enables load-marked cache lines to become unmarked during transactional execution. Note that A and B can be thought of as a generalization of the load-marking bit described above. [0096] Next, the system examines the current state "LLNE(X,Y)" of the cache line that the load operation is directed to (step 1104). This current state includes values X and Y, which correspond to parameters A and B in the load instruction, respectively. Hence, X indicates the number of "commit-and-start-new-transaction operations" the cache line will remain marked for, while Y specifies the number of
"release operations" that the load instruction will remain marked for.
[0097] Next, the system modifies the current state of the cache line, if necessary, to reflect the A and B parameters of the load instruction. If A > X, the system replaces X with A (step 1106), and if B > Y, the system replaces Y with B (step 1108). this way, the current state of the cache line is updated to reflect the maximum of A and X, and the maximum of B and Y. This means that a cache line will remain marked as long as any load instruction requires it to.
[0098] Note that the system still supports an unchecked load instruction, which does not load-mark cache lines. (This unmarked load instruction can be thought of as LOAD(0,0).) Furthermore, other variations of the load instruction are possible. In one embodiment of the present invention, the special load instruction only supports the parameter A, but not the parameter B. In another embodiment, the load instruction only supports the parameter B but not the parameter A. If the parameter A > 0, then the parameter B does not matter, because if the load can survive until the next checkpoint-and-commit instruction, the load has to survive any release instructions up till the next checkpoint-and-commit operation.
[0099] Also note that it is possible for a cache line to be accessed multiple times within a transaction. For example, when we load a value that has already been stored to by this transaction, we need to get the value from the store buffer, not just do a regular load. Such loads do not cause a cache line that was store-marked to become load-marked. (Note that this problem does not arise if the store marks are in L2 and the load marks in LI). Release Instruction
[00100] FIG. 12 presents a flow chart illustrating how a release instruction operates in accordance with an embodiment of the present invention. First, the system receives a release instruction during transactional execution of a block of instructions within an application (step 1202). Next, the system examines the current state "LINE(X,Y)" of each cache line (step 1204). For each cache line, if Y > 0, the system decrements Y (step 1206). Furthermore, if Y becomes zero and X is also zero, the line becomes unmarked.
[00101] Hence, the present invention allows a programmer (or compiler/interpreter) to generate special load instructions and periodic release instructions, which release load-marked cache lines from monitoring during transactional execution.
[00102] Unmarking load-marked cache lines has a number of benefits. For example, cache lines that are unmarked do not have to remain locked in cache memory until the transaction completes (or is killed), and false failures are less likely to occur due to a large number of cache lines being marked. (Note that when a large number of cache lines are marked, false failures are likely to occur when accesses that appear to interfere with each other do not actually touch the same data items in a cache line.)
Commit-And-Start-New-Transaction Instruction
[00103] Note that a commit-and-start-new-transaction instruction causes the current transactional execution to commit in the same way as if a normal commit instruction was encountered. All updates to register state and memory are performed. All store marks are cleared and some load marks are cleared as described. The difference between a normal commit and a commit-and-start-new-transactions instruction is that a commit-and-start-new-transaction instruction causes a new transaction to be immediately started (like executing a STE) with the additional behavior that the new transaction starts with some lines already load marked. This allows a line to be monitored across consecutive transactions.
[00104] Also, unlike a normal transaction, a transaction initiated with a commit-and-start-new-transaction instruction cannot be retried if an interfering operation causes it to fail. Instead, execution proceeds to an appropriate alternative code sequence, in normal execution mode, to complete the work in an appropriate way.
[00105] FIG. 13 presents a flow chart illustrating how a commit-and-start- new-transaction instruction operates in accordance with an embodiment of the present invention. First, the system receives a commit-and-start-new-transaction instruction during transactional execution of a block of instructions within an application
(step 1301). Next, the system performs all relevant updates to the state register and to the memory (step 1302) and all associated store marks are cleared (step 1303). (Note that updates to memory can involve committing stores from the store buffer to memory, or at least "ungating" them so that they subsequently drain to memory.)
Next, for the load marks, the system examines the current state "LINE(X,Y)" of each cache line (step 1304). For each cache line, if X > 0, the system decrements X and sets Y = 0 (step 1306). Note that if X becomes zero, the line becomes unmarked. [00106] Hence, the present invention allows a programmer (or compiler/interpreter) to generate special load instructions and periodic commit-and- start-new-transaction instructions, which selectively release load-marked cache lines from monitoring during commit-and-start-new-transaction operations.
Regular Commit Instruction
[00107] FIG. 14 presents a flow chart illustrating how a regular commit instruction (not a commit-and-start-new-transaction instruction) operates in accordance with an embodiment of the present invention. First, the system receives a regular commit instruction during transactional execution of a block of instruction in an application (step 1402). The system then clears the state variables X and Y in all cache lines. Unlike a commit-and-start-new-transaction operation, a regular commit operation terminates transactional execution and unmarks all cache lines so that no cache lines continue to be monitored.
[00108] Note that it is hard to check the state information for all cache lines in parallel during release operations. To remedy this problem, one embodiment of the present invention maintains a global counter that is incremented during each release operation. In this embodiment, the system marks cache lines by adding the value B to the global counter to produce a sum B' and then storing B' in the state variable Y if the state variable Y is greater than B'. In this embodiment, the cache lines remain "marked" until the global counter reaches or exceeds the value stored in the state variable Y. Note that if the state variable Y wraps around back to zero, it may cause a false failure during transactional execution. This can potentially degrade performance, however, the application will continue to operate correctly.
[00109] In another embodiment of the present invention, the system maintains a similar global counter that is incremented on every commit-and-start-new- transaction operation. In this embodiment, the system marks cache lines by adding the value A to the global counter to produce a sum A' and then storing A' in the state variable X if the state variable X is greater than A'. In this embodiment, the cache lines remain "marked" until the global counter reaches or exceeds the value stored in the state variable Y. [00110] 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.

Claims

What Is Claimed Is:
1. A method for selectively unmarking load-marked cache lines during transactional execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads, the method comprising: encountering a release instruction during transactional execution of a block of instructions within a program, wherein changes made during the transactional execution are not committed to the architectural state of a processor until the transactional execution completes without encountering an interfering data access from another thread; and in response to the release instruction, modifying the state of cache lines, which are specially load-marked to indicate they can be released from monitoring, to account for the release instruction being encountered; wherein modifying the specially load-marked cache lines can cause the specially load-marked cache lines to become unmarked.
2. The method of claim 1, wherein a specially load-marked cache line contains a release value indicating how many release instructions need to be encountered before the cache line can become unmarked; wherein modifying the specially load-marked cache line involves decrementing the release value; and wherein if decrementing the release value causes the release value to become zero, the cache line becomes unmarked.
3. The method of claim 2, wherein decrementing release values for all specially load-marked cache lines involves incrementing a global counter, wherein release values are initialized with respect to the global counter.
4. The method of claim 1, wherein upon encountering a load instruction during the transactional execution, the method further comprises: performing the corresponding load operation; and if the load instruction is a monitored load instruction, load-marking a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread; wherein if the load instruction additionally specifies that the corresponding cache line can be released from monitoring during transactional execution, load- marking the cache line involves specially load-marking the cache line to indicate that the cache line can be released from monitoring after either an explicit or implicit number of release instructions have been encountered.
5. The method of claim 1, wherein if an interfering data access from another thread is encountered during transactional execution, the method further comprises: discarding changes made during the transactional execution; and attempting to re-execute the block of instructions.
6. The method of claim 1, wherein if transactional execution completes without encountering an interfering data access from another thread, the method further comprises: committing changes made during the transactional execution to the architectural state of a processor; and resuming normal non-transactional execution of the program past the block of instructions.
7. The method of claim 1, wherein an interfering data access can include: a store by another thread to a cache line that has been load-marked by a thread; and a load or a store by another thread to a cache line that has been store-marked by the thread.
8. An apparatus that selectively unmarks load-marked cache lines during transactional execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads, the apparatus comprising: an execution mechanism configured to execute a release instruction during transactional execution of a block of instructions within a program, wherein changes made during the transactional execution are not committed to the architectural state of a processor until the transactional execution completes without encountering an interfering data access from another thread; and an updating mechanism, wherein in response to the release instruction, the updating mechanism is configured to modify the state of cache lines, which are specially load-marked to indicate they can be released from monitoring, to account for the release instruction being encountered; wherein while modifying the specially load-marked cache lines, the updating mechanism can cause the specially load-marked cache lines to become unmarked.
9. The apparatus of claim 8, wherein a specially load-marked cache line contains a release value indicating how many release instructions need to be encountered before the cache line can become unmarked; wherein while modifying the specially load-marked cache line, the updating mechanism is configured to decrement the release value; and wherein if decrementing the release value causes the release value to become zero, the cache line becomes unmarked.
10. The apparatus of claim 9, wherein decrementing release values for all specially load-marked cache lines involves incrementing a global counter, wherein release values are initialized with respect to the global counter.
11. The apparatus of claim 8, further comprising a load-marking mechanism, wherein upon encountering a load instruction during the transactional execution, the load-marking mechanism is configured to: perform the corresponding load operation; and if the load instruction is a monitored load instruction, to load-mark a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread; wherein if the load instruction additionally specifies that the corresponding cache line can be released from monitoring during transactional execution, the load- marking mechanism is configured to specially load-mark the cache line to indicate that the cache line can be released from monitoring after either an explicit or implicit number of release instructions have been encountered.
12. The apparatus of claim 8, wherein if an interfering data access from another thread is encountered during transactional execution, the execution mechanism is configured to: discard changes made during the transactional execution; and to attempt to re-execute the block of instructions.
13. The apparatus of claim 8, wherein if transactional execution completes without encountering an interfering data access from another thread, the execution mechanism is configured to: commit changes made during the transactional execution to the architectural state of the processor; and to resume normal non-transactional execution of the program past the block of instructions.
14. The apparatus of claim 8, wherein an interfering data access can include: a store by another thread to a cache line that has been load-marked by a thread; and a load or a store by another thread to a cache line that has been store-marked by the thread.
15. A method for selectively unmarking load-marked cache lines during transactional execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads, the method comprising: encountering a commit-and-start-new-transaction instruction during transactional execution of a block of instructions within a program, wherein changes made during the transactional execution are not committed to the architectural state of a processor until the transactional execution completes without encountering an interfering data access from another thread; and in response to the commit-and-start-new-transaction instruction, modifying load-marked cache lines to account for the commit-and-start-new-transaction instruction being encountered; wherein modifying the load-marked cache lines causes normally load-marked cache lines to become unmarked, while other specially load-marked cache lines may remain load-marked past the commit-and-start-new-transaction instruction; whereby a new transaction can be immediately started with some cache lines already load-marked, thereby allowing a cache line to be monitored across consecutive transactions.
16. The method of claim 15, wherein a specially load-marked cache line contains a checkpoint value indicating how many checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked; wherein modifying the specially load-marked cache line involves decrementing the checkpoint value; and wherein if decrementing the checkpoint value causes the checkpoint value to become zero, the cache line becomes unmarked.
17. The method of claim 16, wherein decrementing release values for all specially load-marked cache lines involves incrementing a global counter, wherein release values are initialized with respect to the global counter.
18. The method of claim 15, wherein upon encountering a load instruction during the transactional execution, the method further comprises: performing the corresponding load operation; and if the load instruction is a monitored load instruction, load-marking a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread; wherein if the load instruction additionally specifies that multiple checkpoint- and-commit instructions need to be encountered before the cache line can become unmarked, and load-marking the cache line involves specially load-marking the cache line to indicate that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked.
19. The method of claim 15, wherein if an interfering data access from another thread is encountered during transactional execution, the method further comprises: determining if the transactional execution was initiated by a commit-and-start- new-transaction, and if so executing alternative code to complete the transactional execution in the presence of the interfering data access; and otherwise, discarding changes made during the transactional execution, and attempting to re-execute the block of instructions.
20. The method of claim 15, wherein if transactional execution completes without encountering an interfering data access from another thread, the method further comprises: committing changes made during the transactional execution to the architectural state of the processor; and resuming normal non-transactional execution of the program past the block of instructions.
21. The method of claim 15, wherein an interfering data access can include: a store by another thread to a cache line that has been load-marked by a thread; and a load or a store by another thread to a cache line that has been store-marked by the thread.
22. An apparatus that selectively unmarks load-marked cache lines during transactional execution, wherein load-marked cache lines are monitored during transactional execution to detect interfering accesses from other threads, the apparatus comprising: an execution mechanism configured to execute a commit-and-start-new- transaction instruction during transactional execution of a block of instructions within a program, wherein changes made during the transactional execution are not committed to the architectural state of a processor until the transactional execution completes without encountering an interfering data access from another thread; and an updating mechanism, wherein in response to the commit-and-start-new- transaction instruction, the updating mechanism is configured to modify load-marked cache lines to account for the commit-and-start-new-transaction instruction being encountered; wherein while modifying the load-marked cache lines, the updating mechanism can cause normally load-marked cache lines to become unmarked, while other specially load-marked cache lines may remain load-marked past the commit- and-start-new-transaction instruction; whereby a new transaction can be immediately started with some cache lines already load-marked, thereby allowing a cache line to be monitored across consecutive transactions.
23. The apparatus of claim 22, wherein a specially load-marked cache line contains a checkpoint value indicating how many checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked; wherein while modifying the specially load-marked cache line, the updating mechanism is configured to decrement the checkpoint value; and wherein if decrementing the checkpoint value causes the checkpoint value to become zero, the cache line becomes unmarked.
24. The apparatus of claim 23, wherein decrementing release values for all specially load-marked cache lines involves incrementing a global counter, wherein release values are initialized with respect to the global counter.
25. The apparatus of claim 22, further comprising a load-marking mechanism, wherein upon encountering a load instruction during the transactional execution, the load-marking mechanism is configured to: perform the corresponding load operation; and if the load instruction is a monitored load instruction, to load-mark a corresponding cache line to facilitate subsequent detection of an interfering data access to the cache line from another thread; wherein if the load instruction additionally specifies that multiple checkpoint- and-commit instructions need to be encountered before the cache line can become unmarked, the load-marking mechanism is configured to load-mark the cache line to indicate that multiple checkpoint-and-commit instructions need to be encountered before the cache line can become unmarked.
26. The apparatus of claim 22, wherein if an interfering data access from another thread is encountered during transactional execution, the execution mechanism is configured to: determine if the transactional execution was initiated by a commit-and-start- new-transaction, and if so to execute alternative code to complete the transactional execution in the presence of the interfering data access; and otherwise, to discard changes made during the transactional execution, and to attempt to re-execute the block of instructions .
27. The apparatus of claim 22, wherein if transactional execution completes without encountering an interfering data access from another thread, the execution mechanism is configured to: commit changes made during the transactional execution to the architectural state of the processor; and to resume normal non-transactional execution of the program past the block of instructions.
28. The apparatus of claim 22, wherein an interfering data access can include: a store by another thread to a cache line that has been load-marked by a thread; and a load or a store by another thread to a cache line that has been store-marked by the thread.
PCT/US2004/003668 2003-02-13 2004-02-06 Selectively unmarking of load-marked cache lines during t speculative thread execution WO2004075046A2 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
US44712803P 2003-02-13 2003-02-13
US60/447,128 2003-02-13
US10/764,412 2004-01-23
US10/764,412 US7089374B2 (en) 2003-02-13 2004-01-23 Selectively unmarking load-marked cache lines during transactional program execution

Publications (2)

Publication Number Publication Date
WO2004075046A2 true WO2004075046A2 (en) 2004-09-02
WO2004075046A3 WO2004075046A3 (en) 2006-11-02

Family

ID=32912254

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2004/003668 WO2004075046A2 (en) 2003-02-13 2004-02-06 Selectively unmarking of load-marked cache lines during t speculative thread execution

Country Status (2)

Country Link
US (2) US7089374B2 (en)
WO (1) WO2004075046A2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007138124A1 (en) * 2006-05-30 2007-12-06 Intel Corporation Method, apparatus and system applied in a cache memory coherence protocol
EP1958063A2 (en) * 2005-12-07 2008-08-20 Microsoft Corporation Optimization of software transactional memory operations
EP1973036A3 (en) * 2006-12-28 2009-11-04 Intel Corporation Efficient and consistent software transactional memory
US8099726B2 (en) 2005-12-07 2012-01-17 Microsoft Corporation Implementing strong atomicity in software transactional memory
WO2012067904A1 (en) * 2010-11-15 2012-05-24 Advanced Micro Devices, Inc. Preventing unintended loss of transactional data in hardware transactional memory systems
WO2015171498A1 (en) * 2014-05-05 2015-11-12 Google Inc. Thread waiting in a multithreaded processor architecture

Families Citing this family (107)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7269717B2 (en) * 2003-02-13 2007-09-11 Sun Microsystems, Inc. Method for reducing lock manipulation overhead during access to critical code sections
US20040163082A1 (en) * 2003-02-13 2004-08-19 Marc Tremblay Commit instruction to support transactional program execution
US7269694B2 (en) 2003-02-13 2007-09-11 Sun Microsystems, Inc. Selectively monitoring loads to support transactional program execution
US7269693B2 (en) * 2003-02-13 2007-09-11 Sun Microsystems, Inc. Selectively monitoring stores to support transactional program execution
US7418577B2 (en) * 2003-02-13 2008-08-26 Sun Microsystems, Inc. Fail instruction to support transactional program execution
US7216202B1 (en) 2003-02-25 2007-05-08 Sun Microsystems, Inc. Method and apparatus for supporting one or more servers on a single semiconductor chip
US7703098B1 (en) 2004-07-20 2010-04-20 Sun Microsystems, Inc. Technique to allow a first transaction to wait on condition that affects its working set
US8074030B1 (en) 2004-07-20 2011-12-06 Oracle America, Inc. Using transactional memory with early release to implement non-blocking dynamic-sized data structure
US7500056B2 (en) * 2004-07-21 2009-03-03 Hewlett-Packard Development Company, L.P. System and method to facilitate reset in a computer system
US7921407B2 (en) * 2004-08-10 2011-04-05 Oracle America, Inc. System and method for supporting multiple alternative methods for executing transactions
US7865701B1 (en) 2004-09-14 2011-01-04 Azul Systems, Inc. Concurrent atomic execution
US7376800B1 (en) 2004-09-14 2008-05-20 Azul Systems, Inc. Speculative multiaddress atomicity
EP1913473A1 (en) * 2005-08-01 2008-04-23 Sun Microsystems, Inc. Avoiding locks by transactionally executing critical sections
US7480771B2 (en) * 2005-08-17 2009-01-20 Sun Microsystems, Inc. Conditional synchronization mechanisms allowing multiple store operations to become visible while a flagged memory location is owned and remains unchanged
US8813052B2 (en) * 2005-12-07 2014-08-19 Microsoft Corporation Cache metadata for implementing bounded transactional memory
US8180971B2 (en) 2005-12-09 2012-05-15 University Of Rochester System and method for hardware acceleration of a software transactional memory
US20070136289A1 (en) * 2005-12-14 2007-06-14 Intel Corporation Lock elision with transactional memory
US20070143755A1 (en) * 2005-12-16 2007-06-21 Intel Corporation Speculative execution past a barrier
US7523266B2 (en) * 2006-02-06 2009-04-21 Sun Microsystems, Inc. Method and apparatus for enforcing memory reference ordering requirements at the L1 cache level
US20070186056A1 (en) * 2006-02-07 2007-08-09 Bratin Saha Hardware acceleration for a software transactional memory system
US8898652B2 (en) * 2006-03-23 2014-11-25 Microsoft Corporation Cache metadata for accelerating software transactional memory
EP2477109B1 (en) 2006-04-12 2016-07-13 Soft Machines, Inc. Apparatus and method for processing an instruction matrix specifying parallel and dependent operations
US7792805B2 (en) * 2006-05-30 2010-09-07 Oracle America, Inc. Fine-locked transactional memory
US20080005504A1 (en) * 2006-06-30 2008-01-03 Jesse Barnes Global overflow method for virtualized transactional memory
US9798590B2 (en) * 2006-09-07 2017-10-24 Intel Corporation Post-retire scheme for tracking tentative accesses during transactional execution
US7757044B2 (en) * 2006-10-31 2010-07-13 Oracle America, Inc. Facilitating store reordering through cacheline marking
US7797491B2 (en) * 2006-10-31 2010-09-14 Oracle America, Inc. Facilitating load reordering through cacheline marking
EP2527972A3 (en) 2006-11-14 2014-08-06 Soft Machines, Inc. Apparatus and method for processing complex instruction formats in a multi- threaded architecture supporting various context switch modes and virtualization schemes
US7549025B2 (en) * 2006-12-06 2009-06-16 Sun Microsystems, Inc. Efficient marking of shared cache lines
US9268710B1 (en) * 2007-01-18 2016-02-23 Oracle America, Inc. Facilitating efficient transactional memory and atomic operations via cache line marking
US7774552B1 (en) * 2007-01-30 2010-08-10 Oracle America, Inc. Preventing store starvation in a system that supports marked coherence
US8024521B2 (en) * 2007-03-13 2011-09-20 Sony Computer Entertainment Inc. Atomic operation on non-standard sized data using external cache
US8185698B2 (en) * 2007-04-09 2012-05-22 Bratin Saha Hardware acceleration of a write-buffering software transactional memory
US8688920B2 (en) 2007-05-14 2014-04-01 International Business Machines Corporation Computing system with guest code support of transactional memory
US9009452B2 (en) 2007-05-14 2015-04-14 International Business Machines Corporation Computing system with transactional memory using millicode assists
US8095750B2 (en) * 2007-05-14 2012-01-10 International Business Machines Corporation Transactional memory system with fast processing of common conflicts
US8095741B2 (en) * 2007-05-14 2012-01-10 International Business Machines Corporation Transactional memory computing system with support for chained transactions
US8321637B2 (en) * 2007-05-14 2012-11-27 International Business Machines Corporation Computing system with optimized support for transactional memory
US8117403B2 (en) * 2007-05-14 2012-02-14 International Business Machines Corporation Transactional memory system which employs thread assists using address history tables
EP2159702B1 (en) * 2007-06-20 2013-04-17 Fujitsu Limited Cache control device and control method
US9043553B2 (en) * 2007-06-27 2015-05-26 Microsoft Technology Licensing, Llc Leveraging transactional memory hardware to accelerate virtualization and emulation
US8266387B2 (en) * 2007-06-27 2012-09-11 Microsoft Corporation Leveraging transactional memory hardware to accelerate virtualization emulation
US8176253B2 (en) * 2007-06-27 2012-05-08 Microsoft Corporation Leveraging transactional memory hardware to accelerate virtualization and emulation
US7949831B2 (en) * 2007-11-02 2011-05-24 Oracle America, Inc. Maintaining cache coherence using load-mark metadata to deny invalidation of load-marked cache lines
US20090187906A1 (en) * 2008-01-23 2009-07-23 Sun Microsystems, Inc. Semi-ordered transactions
US8732438B2 (en) * 2008-04-16 2014-05-20 Oracle America, Inc. Anti-prefetch instruction
US9928072B1 (en) 2008-05-02 2018-03-27 Azul Systems, Inc. Detecting and recording atomic execution
CN101685408B (en) * 2008-09-24 2013-10-09 国际商业机器公司 Method and device for accessing shared data structure by multiple threads in parallel
US8806145B2 (en) * 2008-11-07 2014-08-12 Oracle America, Inc. Methods and apparatuses for improving speculation success in processors
US8898401B2 (en) * 2008-11-07 2014-11-25 Oracle America, Inc. Methods and apparatuses for improving speculation success in processors
US8566524B2 (en) 2009-08-31 2013-10-22 International Business Machines Corporation Transactional memory system with efficient cache support
US20110113409A1 (en) * 2009-11-10 2011-05-12 Rodrick Evans Symbol capabilities support within elf
US8782434B1 (en) 2010-07-15 2014-07-15 The Research Foundation For The State University Of New York System and method for validating program execution at run-time
EP2616928B1 (en) 2010-09-17 2016-11-02 Soft Machines, Inc. Single cycle multi-branch prediction including shadow cache for early far branch prediction
EP2689326B1 (en) 2011-03-25 2022-11-16 Intel Corporation Memory fragments for supporting code block execution by using virtual cores instantiated by partitionable engines
WO2012135041A2 (en) 2011-03-25 2012-10-04 Soft Machines, Inc. Register file segments for supporting code block execution by using virtual cores instantiated by partitionable engines
EP2689327B1 (en) 2011-03-25 2021-07-28 Intel Corporation Executing instruction sequence code blocks by using virtual cores instantiated by partitionable engines
WO2012162188A2 (en) 2011-05-20 2012-11-29 Soft Machines, Inc. Decentralized allocation of resources and interconnect structures to support the execution of instruction sequences by a plurality of engines
CN103649931B (en) 2011-05-20 2016-10-12 索夫特机械公司 For supporting to be performed the interconnection structure of job sequence by multiple engines
KR101703401B1 (en) 2011-11-22 2017-02-06 소프트 머신즈, 인크. An accelerated code optimizer for a multiengine microprocessor
KR101832679B1 (en) 2011-11-22 2018-02-26 소프트 머신즈, 인크. A microprocessor accelerated code optimizer
US9268596B2 (en) 2012-02-02 2016-02-23 Intel Corparation Instruction and logic to test transactional execution status
US9361115B2 (en) 2012-06-15 2016-06-07 International Business Machines Corporation Saving/restoring selected registers in transactional processing
US9436477B2 (en) 2012-06-15 2016-09-06 International Business Machines Corporation Transaction abort instruction
US20130339680A1 (en) 2012-06-15 2013-12-19 International Business Machines Corporation Nontransactional store instruction
US9448796B2 (en) 2012-06-15 2016-09-20 International Business Machines Corporation Restricted instructions in transactional execution
US9772854B2 (en) 2012-06-15 2017-09-26 International Business Machines Corporation Selectively controlling instruction execution in transactional processing
US9348642B2 (en) 2012-06-15 2016-05-24 International Business Machines Corporation Transaction begin/end instructions
US10437602B2 (en) 2012-06-15 2019-10-08 International Business Machines Corporation Program interruption filtering in transactional execution
US9740549B2 (en) 2012-06-15 2017-08-22 International Business Machines Corporation Facilitating transaction completion subsequent to repeated aborts of the transaction
US9384004B2 (en) 2012-06-15 2016-07-05 International Business Machines Corporation Randomized testing within transactional execution
US8688661B2 (en) 2012-06-15 2014-04-01 International Business Machines Corporation Transactional processing
CN104823168B (en) 2012-06-15 2018-11-09 英特尔公司 The method and system restored in prediction/mistake is omitted in predictive forwarding caused by for realizing from being resequenced by load store and optimizing
US8682877B2 (en) 2012-06-15 2014-03-25 International Business Machines Corporation Constrained transaction execution
US9122873B2 (en) 2012-09-14 2015-09-01 The Research Foundation For The State University Of New York Continuous run-time validation of program execution: a practical approach
US9069782B2 (en) 2012-10-01 2015-06-30 The Research Foundation For The State University Of New York System and method for security and privacy aware virtual machine checkpointing
US9977683B2 (en) * 2012-12-14 2018-05-22 Facebook, Inc. De-coupling user interface software object input from output
US9811342B2 (en) 2013-03-15 2017-11-07 Intel Corporation Method for performing dual dispatch of blocks and half blocks
US9886279B2 (en) 2013-03-15 2018-02-06 Intel Corporation Method for populating and instruction view data structure by using register template snapshots
KR20150130510A (en) * 2013-03-15 2015-11-23 소프트 머신즈, 인크. A method for emulating a guest centralized flag architecture by using a native distributed flag architecture
WO2014150991A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for implementing a reduced size register view data structure in a microprocessor
US10275255B2 (en) 2013-03-15 2019-04-30 Intel Corporation Method for dependency broadcasting through a source organized source view data structure
US9904625B2 (en) 2013-03-15 2018-02-27 Intel Corporation Methods, systems and apparatus for predicting the way of a set associative cache
US9891924B2 (en) 2013-03-15 2018-02-13 Intel Corporation Method for implementing a reduced size register view data structure in a microprocessor
US9569216B2 (en) 2013-03-15 2017-02-14 Soft Machines, Inc. Method for populating a source view data structure by using register template snapshots
WO2014150806A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for populating register view data structure by using register template snapshots
US10140138B2 (en) 2013-03-15 2018-11-27 Intel Corporation Methods, systems and apparatus for supporting wide and efficient front-end operation with guest-architecture emulation
KR102063656B1 (en) 2013-03-15 2020-01-09 소프트 머신즈, 인크. A method for executing multithreaded instructions grouped onto blocks
US9632825B2 (en) 2013-03-15 2017-04-25 Intel Corporation Method and apparatus for efficient scheduling for asymmetrical execution units
WO2014150971A1 (en) 2013-03-15 2014-09-25 Soft Machines, Inc. A method for dependency broadcasting through a block organized source view data structure
US9183043B2 (en) 2013-07-16 2015-11-10 Oracle International Corporation Systems and methods for adaptive integration of hardware and software lock elision techniques
US10169103B2 (en) * 2014-02-27 2019-01-01 International Business Machines Corporation Managing speculative memory access requests in the presence of transactional storage accesses
US9740614B2 (en) 2014-06-27 2017-08-22 International Business Machines Corporation Processor directly storing address range of co-processor memory accesses in a transactional memory where co-processor supplements functions of the processor
US10114752B2 (en) 2014-06-27 2018-10-30 International Business Machines Corporation Detecting cache conflicts by utilizing logical address comparisons in a transactional memory
US9772944B2 (en) 2014-06-27 2017-09-26 International Business Machines Corporation Transactional execution in a multi-processor environment that monitors memory conflicts in a shared cache
US9477481B2 (en) 2014-06-27 2016-10-25 International Business Machines Corporation Accurate tracking of transactional read and write sets with speculation
US9703718B2 (en) 2014-06-27 2017-07-11 International Business Machines Corporation Managing read tags in a transactional memory
US10025715B2 (en) 2014-06-27 2018-07-17 International Business Machines Corporation Conditional inclusion of data in a transactional memory read set
US10073784B2 (en) 2014-06-27 2018-09-11 International Business Machines Corporation Memory performance when speculation control is enabled, and instruction therefor
US9720837B2 (en) 2014-06-27 2017-08-01 International Business Machines Corporation Allowing non-cacheable loads within a transaction
US9658961B2 (en) 2014-06-27 2017-05-23 International Business Machines Corporation Speculation control for improving transaction success rate, and instruction therefor
US10013351B2 (en) 2014-06-27 2018-07-03 International Business Machines Corporation Transactional execution processor having a co-processor accelerator, both sharing a higher level cache
GB2529148B (en) 2014-08-04 2020-05-27 Advanced Risc Mach Ltd Write operations to non-volatile memory
US9858189B2 (en) * 2015-06-24 2018-01-02 International Business Machines Corporation Hybrid tracking of transaction read and write sets
US9760494B2 (en) 2015-06-24 2017-09-12 International Business Machines Corporation Hybrid tracking of transaction read and write sets
US10255071B2 (en) * 2015-10-14 2019-04-09 International Business Machines Corporation Method and apparatus for managing a speculative transaction in a processing unit
US10621103B2 (en) 2017-12-05 2020-04-14 Arm Limited Apparatus and method for handling write operations

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428761A (en) * 1992-03-12 1995-06-27 Digital Equipment Corporation System for achieving atomic non-sequential multi-word operations in shared memory

Family Cites Families (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2500101B2 (en) * 1992-12-18 1996-05-29 インターナショナル・ビジネス・マシーンズ・コーポレイション How to update the value of a shared variable
US5727203A (en) * 1995-03-31 1998-03-10 Sun Microsystems, Inc. Methods and apparatus for managing a database in a distributed object operating environment using persistent and transient cache
GB2302966A (en) * 1995-06-30 1997-02-05 Ibm Transaction processing with a reduced-kernel operating system
US5701432A (en) * 1995-10-13 1997-12-23 Sun Microsystems, Inc. Multi-threaded processing system having a cache that is commonly accessible to each thread
US6021480A (en) * 1996-06-05 2000-02-01 Compaq Computer Corporation Aligning a memory read request with a cache line boundary when the request is for data beginning at a location in the middle of the cache line
JP3488347B2 (en) * 1996-08-29 2004-01-19 株式会社日立製作所 Automatic address distribution system and address distribution server
US5974438A (en) * 1996-12-31 1999-10-26 Compaq Computer Corporation Scoreboard for cached multi-thread processes
US6148300A (en) 1998-06-19 2000-11-14 Sun Microsystems, Inc. Hybrid queue and backoff computer resource lock featuring different spin speeds corresponding to multiple-states
US6185577B1 (en) * 1998-06-23 2001-02-06 Oracle Corporation Method and apparatus for incremental undo
US6360220B1 (en) * 1998-08-04 2002-03-19 Microsoft Corporation Lock-free methods and systems for accessing and storing information in an indexed computer data structure having modifiable entries
US6460067B1 (en) * 1999-06-07 2002-10-01 Sun Microsystems, Inc. Using time stamps to improve efficiency in marking fields within objects
US6721944B2 (en) * 2000-05-31 2004-04-13 Sun Microsystems, Inc. Marking memory elements based upon usage of accessed information during speculative execution
US6460124B1 (en) * 2000-10-20 2002-10-01 Wisconsin Alumni Research Foundation Method of using delays to speed processing of inferred critical program portions
US6463511B2 (en) * 2000-12-29 2002-10-08 Intel Corporation System and method for high performance execution of locked memory instructions in a system with distributed memory and a restrictive memory model
JP3729087B2 (en) * 2001-05-23 2005-12-21 日本電気株式会社 Multiprocessor system, data-dependent speculative execution control device and method thereof
US6681311B2 (en) * 2001-07-18 2004-01-20 Ip-First, Llc Translation lookaside buffer that caches memory type information
US6918012B2 (en) * 2001-08-28 2005-07-12 Hewlett-Packard Development Company, L.P. Streamlined cache coherency protocol system and method for a multiple processor single chip device
US20030066056A1 (en) * 2001-09-28 2003-04-03 Petersen Paul M. Method and apparatus for accessing thread-privatized global storage objects
US7120762B2 (en) * 2001-10-19 2006-10-10 Wisconsin Alumni Research Foundation Concurrent execution of critical sections by eliding ownership of locks
AU2002217653A1 (en) 2001-12-12 2003-07-09 Telefonaktiebolaget Lm Ericsson (Publ) Collision handling apparatus and method
US6941449B2 (en) * 2002-03-04 2005-09-06 Hewlett-Packard Development Company, L.P. Method and apparatus for performing critical tasks using speculative operations
US6785789B1 (en) * 2002-05-10 2004-08-31 Veritas Operating Corporation Method and apparatus for creating a virtual data copy
US6862664B2 (en) * 2003-02-13 2005-03-01 Sun Microsystems, Inc. Method and apparatus for avoiding locks by speculatively executing critical sections

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5428761A (en) * 1992-03-12 1995-06-27 Digital Equipment Corporation System for achieving atomic non-sequential multi-word operations in shared memory

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RAJWAR R ET AL: "SPECULATIVE LOCK ELISION: ENABLING HIGH CONCURRENT MULTITHREADED EXECUTION" MICRO-34. PROCEEDINGS OF THE 34TH. ANNUAL ACM/IEEE INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE. AUSTIN, TX, DEC. 1 - 5, 2001, PROCEEDINGS OF THE ANNUAL ACM/IEEE INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE, LOS ALAMITOS, CA : IEEE COMP. SOC, US, 1 December 2001 (2001-12-01), pages 294-305, XP001075852 ISBN: 0-7695-1369-7 *
STEFFAN J G ET AL: "The potential for using thread-level data speculation to facilitate automatic parallelization" HIGH-PERFORMANCE COMPUTER ARCHITECTURE, 1998. PROCEEDINGS., 1998 FOURTH INTERNATIONAL SYMPOSIUM ON LAS VEGAS, NV, USA 1-4 FEB. 1998, LOS ALAMITOS, CA, USA,IEEE COMPUT. SOC, US, 1 February 1998 (1998-02-01), pages 2-13, XP010266833 ISBN: 0-8186-8323-6 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8799882B2 (en) 2005-12-07 2014-08-05 Microsoft Corporation Compiler support for optimizing decomposed software transactional memory operations
EP1958063A2 (en) * 2005-12-07 2008-08-20 Microsoft Corporation Optimization of software transactional memory operations
EP1958063A4 (en) * 2005-12-07 2011-04-13 Microsoft Corp Optimization of software transactional memory operations
US8099726B2 (en) 2005-12-07 2012-01-17 Microsoft Corporation Implementing strong atomicity in software transactional memory
US8266609B2 (en) 2005-12-07 2012-09-11 Microsoft Corporation Efficient placement of software transactional memory operations around procedure calls
US8185700B2 (en) 2006-05-30 2012-05-22 Intel Corporation Enabling speculative state information in a cache coherency protocol
WO2007138124A1 (en) * 2006-05-30 2007-12-06 Intel Corporation Method, apparatus and system applied in a cache memory coherence protocol
EP1973036A3 (en) * 2006-12-28 2009-11-04 Intel Corporation Efficient and consistent software transactional memory
EP2487589A1 (en) * 2006-12-28 2012-08-15 Intel Corporation (INTEL) Efficient and consistent software transactional memory
WO2012067904A1 (en) * 2010-11-15 2012-05-24 Advanced Micro Devices, Inc. Preventing unintended loss of transactional data in hardware transactional memory systems
US8543775B2 (en) 2010-11-15 2013-09-24 Advanced Micro Devices, Inc. Preventing unintended loss of transactional data in hardware transactional memory systems
KR101402299B1 (en) * 2010-11-15 2014-06-02 어드밴스드 마이크로 디바이시즈, 인코포레이티드 Preventing unintended loss of transactional data in hardware transactional memory systems
US8352688B2 (en) 2010-11-15 2013-01-08 Advanced Micro Devices, Inc. Preventing unintended loss of transactional data in hardware transactional memory systems
WO2015171498A1 (en) * 2014-05-05 2015-11-12 Google Inc. Thread waiting in a multithreaded processor architecture
US9778949B2 (en) 2014-05-05 2017-10-03 Google Inc. Thread waiting in a multithreaded processor architecture

Also Published As

Publication number Publication date
US7089374B2 (en) 2006-08-08
US20060200632A1 (en) 2006-09-07
US20040187123A1 (en) 2004-09-23
WO2004075046A3 (en) 2006-11-02
US7389383B2 (en) 2008-06-17

Similar Documents

Publication Publication Date Title
US7089374B2 (en) Selectively unmarking load-marked cache lines during transactional program execution
US6938130B2 (en) Method and apparatus for delaying interfering accesses from other threads during transactional program execution
US7818510B2 (en) Selectively monitoring stores to support transactional program execution
US7904664B2 (en) Selectively monitoring loads to support transactional program execution
US7206903B1 (en) Method and apparatus for releasing memory locations during transactional execution
US7398355B1 (en) Avoiding locks by transactionally executing critical sections
JP4558714B2 (en) Method and apparatus for avoiding locks by speculatively executing critical regions
US7930695B2 (en) Method and apparatus for synchronizing threads on a processor that supports transactional memory
US7500086B2 (en) Start transactional execution (STE) instruction to support transactional program execution
US7617421B2 (en) Method and apparatus for reporting failure conditions during transactional execution
EP1913473A1 (en) Avoiding locks by transactionally executing critical sections
US20040163082A1 (en) Commit instruction to support transactional program execution
US7418577B2 (en) Fail instruction to support transactional program execution
US8065670B2 (en) Method and apparatus for enabling optimistic program execution

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A2

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BW BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NA NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A2

Designated state(s): BW GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
122 Ep: pct application non-entry in european phase