JP6642806B2 - Adaptive process for data sharing using lock invalidation and lock selection - Google Patents

Adaptive process for data sharing using lock invalidation and lock selection Download PDF

Info

Publication number
JP6642806B2
JP6642806B2 JP2016521660A JP2016521660A JP6642806B2 JP 6642806 B2 JP6642806 B2 JP 6642806B2 JP 2016521660 A JP2016521660 A JP 2016521660A JP 2016521660 A JP2016521660 A JP 2016521660A JP 6642806 B2 JP6642806 B2 JP 6642806B2
Authority
JP
Japan
Prior art keywords
hle
transaction
lock
count
failed
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
JP2016521660A
Other languages
Japanese (ja)
Other versions
JP2016537709A (en
Inventor
ガシュウィンド、マイケル、ケイ
マイケル、マゲッド、エム
サラプラ、バレンティナ
シャム、チャーンラーン、ケイ
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
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
Priority claimed from US14/191,581 external-priority patent/US9524195B2/en
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Publication of JP2016537709A publication Critical patent/JP2016537709A/en
Application granted granted Critical
Publication of JP6642806B2 publication Critical patent/JP6642806B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

本開示は、一般に、トランザクション・メモリ・システムに関し、より詳細には、ロック無効化(lock elision)とロック(locking)の選択を用いたデータの適応共有のための方法、コンピュータ・プログラム、及びコンピュータ・システムに関する。   The present disclosure relates generally to transaction memory systems, and more particularly, to methods, computer programs, and computers for adaptive sharing of data using lock elision and locking selection. -Regarding the system.

増大するワークロード容量の需要をサポートするために、チップ上の中央処理ユニット(CPU)コアの数及び共有メモリに接続されたCPUコアの数は、著しく増大し続けている。協働して同じワークロードを処理するCPUの数の増大は、ソフトウェアの拡張性(scalability)への大きな負担となり、例えば、従来のセマフォにより保護される共有キュー又はデータ構造はホットスポットになり、ほぼ直線のnウェイ・スケーリング曲線(sub-linear n-way scaling curves)をもたらす。従来より、これは、ソフトウェアにおける細粒度ロック(finer-grained locking)の実装とハードウェアにおける低遅延/高帯域幅の相互接続とにより相殺される。ソフトウェアの拡張性を改善するために細粒度ロックを実装することは、非常に複雑でエラーが発生しやすい場合があり、今日のCPU周波数においては、ハードウェア相互接続の待ち時間は、チップ及びシステムの物理的寸法、並びに光の速度により制限される。   To support the increasing demand for workload capacity, the number of central processing unit (CPU) cores on a chip and the number of CPU cores connected to shared memory continue to increase significantly. The increase in the number of CPUs working together to handle the same workload places a significant burden on software scalability, for example, shared queues or data structures protected by traditional semaphores become hotspots, This results in substantially linear n-way scaling curves. Traditionally, this is offset by the implementation of fine-grained locking in software and low-latency / high-bandwidth interconnects in hardware. Implementing fine-grained locks to improve software scalability can be very complex and error-prone, and at today's CPU frequencies, the latency of hardware interconnects is limited by chip and system requirements. And the speed of light.

ハードウェア・トランザクション・メモリ(HTM、又は本考察では単にTM)の実装が導入され、ここで、トランザクションと呼ばれる命令のグループが、他の中央処理ユニット(CPU)及びI/Oサブシステムが見たときに、メモリ内のデータ構造上でアトミックな方法で動作する(他の文献では、アトミック操作は「ブロック・コンカレント(block concurrent)」又は「シリアル化される」としても知られる)。トランザクションは、ロックを取得することなく楽観的に(optimistically)実行されるが、メモリ位置上の実行中のトランザクションの動作が同じメモリ位置上の別の動作と競合する場合、トランザクション実行のアボート及び再試行を必要とすることがある。これまでに、ソフトウェア・トランザクション・メモリ(TM)をサポートするために、ソフトウェア・トランザクション・メモリの実装が提案されている。しかしながら、ハードウェアTMは、ソフトウェアTMに優る改善された性能的側面及び使いやすさを提供することができる。   An implementation of a hardware transaction memory (HTM, or simply TM in this discussion) was introduced, where a group of instructions called a transaction was seen by other central processing units (CPUs) and I / O subsystems. At times, it operates in an atomic manner on data structures in memory (in other literature, atomic operations are also known as "block concurrent" or "serialized"). A transaction is executed optimistically without acquiring a lock, but if the operation of a running transaction on a memory location conflicts with another on the same memory location, the transaction execution aborts and restarts. May require trial. So far, software transaction memory implementations have been proposed to support software transaction memory (TM). However, hardware TM can provide improved performance aspects and ease of use over software TM.

2002年8月28日に出願され、引用により本明細書に組み入れられる「Method and apparatus for the synchronization of distributed caches」という名称の特許文献1は、分散キャッシュの同期のための方法及び装置を教示する。より特定的には、本実施形態は、キャッシュ・メモリ・システムに関し、より具体的には、キャッシュ入力/出力(I/O)ハブ内での使用を含む、分散キャッシュと共に使用するのに適した階層キャッシュ・プロトコルに関する。   U.S. Pat. No. 6,083,838, filed Aug. 28, 2002 and incorporated herein by reference, teaches a method and apparatus for distributed cache synchronization, entitled "Method and Apparatus for the Synchronization of Distributed Caches." . More particularly, the present embodiments relate to cache memory systems and, more particularly, are suitable for use with distributed caches, including use within cache input / output (I / O) hubs. Related to the hierarchical cache protocol.

1994年3月24日に出願され、引用により本明細書に組み入れられる「Partial cache line write transactions in a computing system with a write back cache」という名称の特許文献2は、メモリ、入力/出力アダプタ及びプロセッサを含む、提示されたコンピューティング・システムを教示する。プロセッサは、ダーティ・データ(dirty data)を格納することができるライトバック・キャッシュを含む。入力/出力アダプタからメモリへの一貫性のある書き込みを行う際、データ・ブロックは、入力/出力アダプタからメモリ内のあるメモリ位置に書き込まれる。データ・ブロックは、ライトバック・キャッシュ内のフル・キャッシュラインよりも少ないデータを含む。ライトバック・キャッシュを検索して、ライトバック・キャッシュがそのメモリ位置についてのデータを含むかどうかがを判断する。検索により、ライトバック・キャッシュがそのメモリ位置についてのデータを含むと判断された場合、そのメモリ位置についてのデータを含むフル・キャッシュラインはパージされる。   Patent Document 2, entitled "Partial cache line write transactions in a computing system with a write back cache," filed March 24, 1994 and incorporated herein by reference, discloses a memory, processor, output / adapter. Teach the proposed computing system, including: The processor includes a write-back cache that can store dirty data. In performing a consistent write from an input / output adapter to memory, a block of data is written from the input / output adapter to a memory location in memory. A data block contains less data than a full cache line in the write-back cache. The write-back cache is searched to determine if the write-back cache contains data for that memory location. If the search determines that the write-back cache contains data for that memory location, the full cache line containing data for that memory location is purged.

米国特許出願公開第2004/0044850号明細書US Patent Application Publication No. 2004/0044850 米国特許第5,586,297号明細書U.S. Pat. No. 5,586,297 米国特許第6,349,361号明細書US Patent No. 6,349,361

「Intel Architecture Instruction Set Extensions Programming Reference」319433−012A、2012年2月"Intel Architecture Construction Set Extensions Programming Reference," 319433-012A, February 2012. Austen McDonald著、「ARCHITECTURES FOR TRANSACTIONAL MEMORY」、博士号の要件の部分的履行として、スタンフォード大学のComputer Science学部及び大学院の委員会に提出された論文、2009年6月Austen McDonald, "ARCHITECTURES FOR TRANSACTIONAL MEMORY", a dissertation submitted to the Committee of the Computer Science Faculty and Graduate School at Stanford University, June 2009, as a partial fulfillment of the PhD requirements. 「Transactional Memory Architecture and Implementation for IBM System z」、カナダ国ブリティッシュ・コロンビア州バンクーバーにおいて2012年12月1〜5日開催のMICRO−45予稿集、25〜36ページ、IEEE Computer Society Conference Publishing Services(CPS)より入手可能"Transactional Architecture Architecture and Implementation for IBM Systems z", MICRO-45 Proceedings, December 1-5, 2012, Vancouver, British Columbia, Canada, pages 25-36, IEEE Computer ScienceCopiers. More available 「z/Architecture,Principles of Operation」、第10版、IBM(登録商標)SA22−7832−09、2012年9月"Z / Architecture, Principles of Operation", 10th edition, IBM (registered trademark) SA22-7832-09, September 2012 P.Mark、C.Walters、及びG.Strait著、「IBM system z10 processor cache subsystem microarchitecture」、IBM Journal of Research and Development、Vol53:1、2009年P. Mark, C.I. Walters and G.W. Strait, "IBM system z10 processor cache subsystem microarchitecture", IBM Journal of Research and Development, Vol 53: 1, 2009.

ロック無効化とロックの選択を用いたデータの適応共有のための方法、コンピュータ・プログラム、及びコンピュータ・システムを提供する。   Methods, computer programs, and computer systems for adaptive sharing of data using lock invalidation and lock selection are provided.

Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクションに実行すべきかどうかを予測的に決定するための方法が提供される。本開示の1つの実施形態によれば、本方法は、HLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、ロックを無効化し、HLEトランザクションとして進行させるか、又はロックを取得して非トランザクションとして進行させるかを決定することと、HLE予測器が無効化を行うと予測することに基づき、ロックのアドレスをHLEトランザクションの読み取りセットとして設定し、lock−acquire命令によるロックへのあらゆる書き込みを抑止し、ロックを解放するxrelease命令に遭遇するまで又はHLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、HLE予測器が無効化を行わないと予測することに基づき、HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることとを含むことができる。   In a Hardware Lock Elimination (HLE) environment, a method is provided for an HLE transaction to actually acquire a lock and predictively determine whether to execute non-transactionally. According to one embodiment of the present disclosure, the method invalidates a lock and proceeds as an HLE transaction or acquires a lock based on an HLE predictor based on encountering an HLE lock-acquire instruction. And setting the address of the lock as a read set of the HLE transaction, based on the HLE predictor predicting that the invalidation will be performed, and setting the lock to the lock by the lock-acquire instruction. Preventing any writes and proceeding in HLE transaction execution mode until an xrelease instruction is encountered to release a lock or an HLE transaction encounters a transaction conflict, and the HLE predictor predicts that it will not invalidate Based on It may include a possible handling, By proceeding in a non-transactional mode HLE lock-The acquire instruction as a non HLE lock-The acquire instruction.

本開示の別の実施形態において、Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクションに実行すべきかどうかを予測的に決定するためのコンピュータ・プログラム製品を提供することができる。本コンピュータ・プログラム製品は、処理回路により読み出し可能であり、HLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、ロックを無効化し、HLEトランザクションとして進行させるか、又はロックを取得して非トランザクションとして進行させるかを決定することと、HLE予測器が無効化を行うと予測することに基づき、ロックのアドレスをHLEトランザクションの読み取りセットとして設定し、lock−acquire命令によるロックへのあらゆる書き込みを抑止し、ロックを解放するxrelease命令に遭遇するまで又はHLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、HLE予測器が無効化を行わないと予測することに基づき、HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることとを含む方法を実施するために、処理回路により実行される命令を格納するコンピュータ可読ストレージ媒体を含むことができる。   In another embodiment of the present disclosure, there is provided a computer program product for a hardware lock elimination (HLE) environment in which an HLE transaction actually acquires a lock and predictively determines whether to execute non-transactionally. be able to. The computer program product is readable by a processing circuit and, upon encountering an HLE lock-acquire instruction, invalidates the lock based on the HLE predictor and proceeds as an HLE transaction or acquires the lock. And setting the address of the lock as a read set of the HLE transaction, based on the HLE predictor predicting that the invalidation will be performed, and setting the lock to the lock by the lock-acquire instruction. Proceed in HLE transaction execution mode until the xrelease instruction that suppresses any writes and releases the lock or the HLE transaction encounters a transaction conflict, and the HLE predictor invalidates. Storing the instructions executed by the processing circuitry to implement a method that, based on the expectation, treats the HLE lock-acquire instruction as a non-HLE lock-acquire instruction and proceeds in a non-transactional mode. Computer-readable storage media.

本開示の別の実施形態において、Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクションに実行すべきかどうかを予測的に決定するためのコンピュータ・システムが提供される。本コンピュータ・システムは、メモリと、メモリと通信するプロセッサとを含むことができ、かつ、HLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、ロックを無効化し、HLEトランザクションとして進行させるか、又はロックを取得し、非トランザクションとして進行させるかを決定することと、HLE予測器が無効化を行うと予測することに基づき、ロックのアドレスをHLEトランザクションの読み取りセットとして設定し、lock−acquire命令によるロックへのあらゆる書き込みを抑止し、ロックを解放するxrelease命令に遭遇するまで又はHLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、HLE予測器が無効化を行わないと予測することに基づき、HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることとを含む方法を実施するように構成される。   In another embodiment of the present disclosure, a computer system is provided for determining in a Hardware Lock Elision (HLE) environment whether an HLE transaction actually acquires a lock and non-transactionally should execute. . The computer system may include a memory and a processor in communication with the memory, and based on encountering an HLE lock-acquire instruction, based on an HLE predictor, invalidates a lock and performs a HLE transaction. Setting the address of the lock as a read set of the HLE transaction based on deciding whether to proceed or acquire the lock and proceed as a non-transaction, and based on the prediction that the HLE predictor will invalidate inhibiting any write to the lock by the lock-acquire instruction and proceeding in HLE transaction execution mode until an xrelease instruction to release the lock or until the HLE transaction encounters a transaction conflict; Treating the HLE lock-acquire instruction as a non-HLE lock-acquire instruction and proceeding in a non-transaction mode based on the E-predictor predicting no invalidation. You.

開示される本実施形態の特徴及び利点は、添付図面と併せて読まれるべき、例示的な実施形態の以下の詳細な説明から明らかになるであろう。例証は、当業者が詳細な説明と併せて本開示を理解するのを容易にするときに明確にするためのものであるので、図面の種々の特徴は縮尺通りではない。   The features and advantages of the disclosed embodiments will become apparent from the following detailed description of exemplary embodiments, which should be read in conjunction with the accompanying drawings. The various features of the drawings are not to scale, as the illustrations are for the purpose of clarity when facilitating the understanding of the present disclosure in conjunction with the detailed description.

本開示の実施形態による例示的なマルチコア・トランザクション・メモリ環境を示す。1 illustrates an exemplary multi-core transaction memory environment according to embodiments of the present disclosure. 本開示の実施形態による例示的なマルチコア・トランザクション・メモリ環境を示す。1 illustrates an exemplary multi-core transaction memory environment according to embodiments of the present disclosure. 本開示の実施形態による例示的なCPUの例示的なコンポーネントを示す。4 illustrates exemplary components of an exemplary CPU according to embodiments of the present disclosure. 例示的なハードウェア又はソフトウェア実施形態による、ロック無効化とロックの間の選択を用いたデータの適応共有のための方法のフロー図を示す。FIG. 3 illustrates a flow diagram of a method for adaptive sharing of data with lock invalidation and selection between locks, according to an exemplary hardware or software embodiment. HLEサポートが存在する環境において、HLE予測器又はハードウェア・ロック・バーチャライザとも呼ばれる競合予測器が実装されるフロー図を示す。FIG. 4 illustrates a flow diagram in which a contention predictor, also called an HLE predictor or hardware locked virtualizer, is implemented in an environment where HLE support is present. 付加的なハードウェア能力が存在しない例示的な実施形態による、ロック無効化とロックの間の選択を用いたデータの適応共有のための方法のフロー図を示す。FIG. 7 illustrates a flow diagram of a method for adaptive sharing of data with lock invalidation and selection between locks, according to an exemplary embodiment in which no additional hardware capabilities are present. ハードウェア・ロック監視を有する例示的な実施形態による、ロック無効化とロックの間の選択を用いたデータの適応共有のための方法のフロー図を示す。FIG. 4 illustrates a flow diagram of a method for adaptive sharing of data with lock invalidation and selection between locks, according to an exemplary embodiment with hardware lock monitoring. データの適応共有を行う例示的なフローを示す。4 shows an exemplary flow for adaptively sharing data. データの適応共有を行う例示的なフローを示す。4 shows an exemplary flow for adaptively sharing data. 図4〜図7の方法の少なくとも1つの例示的な実施形態による、コンピュータ環境のハードウェア及びソフトウェアの概略的なブロック図である。FIG. 8 is a schematic block diagram of hardware and software of a computer environment in accordance with at least one example embodiment of the methods of FIGS.

従来、コンピュータ・システム又はプロセッサは、シングル・プロセッサ(別名、処理ユニット又は中央処理ユニット)しか有していなかった。プロセッサは、命令処理ユニット(IPU)、分岐ユニット、メモリ制御ユニット等を含んでいた。こうしたプロセッサは、一度に単一のプログラム・スレッドを実行することができた。一定の期間プロセッサ上で実行されるようにプログラムをディスパッチし、次に、別の期間プロセッサ上で実行されるように別のプログラムをディスパッチすることによって、プロセッサを時分割する(time-share)ことが可能なオペレーティング・システムが開発された。技術が発展すると、メモリ・サブシステム・キャッシュ、並びに変換ルックアサイド・バッファ(TLB)を含む複雑な動的アドレス変換が、プロセッサに付加されることが多くなった。IPU自体が、多くの場合、プロセッサと呼ばれた。技術が発展し続けると、プロセッサ全体を単一の半導体チップ又はダイとしてパッケージ化できるようになり、こうしたプロセッサは、マイクロプロセッサと呼ばれた。その後、複数のIPUを組み入れたプロセッサが開発され、こうしたプロセッサは、多くの場合、マルチプロセッサと呼ばれた。マルチプロセッサ・コンピュータ・システム(プロセッサ)のこうしたプロセッサの各々は、個々の又は共有のキャッシュ、メモリ・インターフェース、システム・バス、アドレス変換機構等を含むことができる。仮想マシン及び命令セット・アーキテクチャ(instruction set architecture、ISA)エミュレータは、ソフトウェアの層をプロセッサに付加し、シングル・ハードウェア・プロセッサ内にシングルIPUのタイムスライスを使用することにより、複数の「仮想プロセッサ」(別名、プロセッサ)を有する仮想マシンを提供した。技術がさらに発展すると、マルチスレッド・プロセッサが開発され、シングル・マルチスレッドIPUを有するシングル・ハードウェア・プロセッサが異なるプログラムのスレッドを同時に実行する能力を提供することを可能にし、従って、コンピュータ・システムには、マルチスレッド・プロセッサの各スレッドが1つのプロセッサとして見えるようになった。技術がさらに発展すると、単一の半導体チップ又はダイ上に複数のプロセッサ(各々がIPUを有する)をのせることが可能になった。これらのプロセッサは、プロセッサ・コア、又は単にコアと呼ばれた。従って、例えば、プロセッサ、中央処理ユニット、処理ユニット、マイクロプロセッサ、コア、プロセッサ・コア、プロセッサ・スレッド及びスレッドといった用語は、交換可能に使用されることが多い。本明細書における実施形態の態様は、本明細書での教示から逸脱することなく、上に示されるものを含むいずれかの又は全てのプロセッサによって実施することができる。「スレッド」又は「プロセッサ・スレッド」という用語が本明細書で用いられる場合、実施形態の特定の利点は、プロセッサ・スレッドの実装において有することができたと考えられる。   In the past, computer systems or processors only had a single processor (aka processing unit or central processing unit). The processor included an instruction processing unit (IPU), a branch unit, a memory control unit, and the like. These processors could execute a single program thread at a time. Time-share the processor by dispatching a program to run on the processor for a period of time and then dispatching another program to run on the processor for another period of time A capable operating system was developed. As technology has evolved, complex dynamic address translations, including memory subsystem caches as well as translation lookaside buffers (TLBs), have often been added to processors. The IPU itself was often called a processor. As technology continues to evolve, the entire processor can be packaged as a single semiconductor chip or die, and such processors have been termed microprocessors. Subsequently, processors incorporating multiple IPUs were developed, and such processors were often referred to as multiprocessors. Each such processor of a multiprocessor computer system (processor) may include individual or shared caches, memory interfaces, system buses, address translation mechanisms, and the like. The virtual machine and instruction set architecture (ISA) emulator adds multiple layers of software to the processor and uses a single IPU time slice within a single hardware processor to create multiple "virtual processor" (Aka processor). As the technology evolves further, multi-threaded processors have been developed that enable a single hardware processor with a single multi-threaded IPU to provide the ability to execute threads of different programs simultaneously, and thus, a computer system. Now allows each thread of a multi-threaded processor to appear as one processor. As technology evolved further, it became possible to mount multiple processors (each with an IPU) on a single semiconductor chip or die. These processors were called processor cores, or simply cores. Thus, for example, terms such as processor, central processing unit, processing unit, microprocessor, core, processor core, processor thread and thread are often used interchangeably. Aspects of the embodiments herein may be implemented by any or all processors, including those set forth above, without departing from the teachings herein. As the terms "thread" or "processor thread" are used herein, it is believed that certain advantages of the embodiments could have been provided in the implementation of the processor thread.

Intel(登録商標)ベースの実施形態におけるトランザクション実行
その全体を引用により本明細書に組み入れる、非特許文献1において、第8章は、部分的に、マルチスレッド・アプリケーションが、より高い性能を達成するためにCPUコアの数の増大を利用できることを教示する。しかしながら、マルチスレッド・アプリケーションの書き込みでは、プログラマーが、複数のスレッド間のデータ共有を理解し、考慮に入れる必要がある。共有データへのアクセスは、一般的に、同期機構を必要とする。これらの同期機構を用いて、多くの場合、ロックで保護されたクリティカル・セクション(critical section)を用いて、共有データに適用される動作をシリアル化することにより、複数のスレッドが共有データを更新することを保証する。シリアル化により、並行性(concurrency)が制限されるので、プログラマーは、同期に起因するオーバーヘッドを制限しようと試みる。
Transaction Execution in Intel (R) -Based Embodiments In Non-Patent Document 1, Chapter 8, Partially, Multi-Threaded Applications Achieve Higher Performance It teaches that the increase in the number of CPU cores can be used for this purpose. However, writing a multithreaded application requires the programmer to understand and take into account data sharing between multiple threads. Access to shared data generally requires a synchronization mechanism. Multiple threads update shared data using these synchronization mechanisms, often using lock-protected critical sections to serialize the operations applied to the shared data. I guarantee you. Since serialization limits concurrency, programmers attempt to limit the overhead due to synchronization.

intel(登録商標) Transactional Synchronization Extensions(Intel(登録商標)TSX)は、プロセッサが、ロックで保護されたクリティカル・セクションによりスレッドをシリアル化する必要があるかどうかを動的に判断し、必要な場合にのみこのシリアル化を行うことを可能にする。これにより、プロセッサは、動的な不要な同期のためにアプリケーション内に隠れている並行性を顕在化させ利用することができる。   Intel® Transactional Synchronization Extensions (Intel® TSX) dynamically determines whether a processor needs to serialize a thread with a lock-protected critical section and, if necessary, Only allows this serialization to be performed. This allows the processor to manifest and utilize the concurrency hidden in the application due to dynamic and unnecessary synchronization.

Intel(登録商標)TSXでは、プログラマーが指定したコード領域(「トランザクション領域」又は単に「トランザクション」とも呼ばれる)がトランザクション実行される。トランザクション実行が成功裏に完了すると、トランザクション領域内で実施された全てのメモリ操作は、他のプロセッサから見たときに瞬時に起こったように見える。プロセッサは、成功裏にコミットが行われる場合にのみ、即ち、トランザクションが成功裏に実行を完了した場合にのみ、他のプロセッサに見えるトランザクション領域内で実施される、実行されたトランザクションのメモリ操作を行う。このプロセスは、アトミック・コミットと呼ばれることが多い。   In Intel (registered trademark) TSX, a code area (also referred to as a “transaction area” or simply “transaction”) designated by a programmer executes a transaction. Upon successful completion of a transaction execution, all memory operations performed within the transaction area appear to have occurred instantly to other processors. A processor may execute a memory operation of an executed transaction that is performed in a transaction area visible to other processors only if the commit is successful, i.e., only if the transaction has successfully completed execution. Do. This process is often called an atomic commit.

Intel(登録商標)TSXは、トランザクション実行のためのコード領域を指定するための、2つのソフトウェア・インターフェースを提供する。Hardware Lock Elision(HLE)は、トランザクション領域を指定するための、従来の(legacy)互換命令セット拡張(compatible instruction setextension)(XACQUIRE及びXRELEASEプリフィックスを含む)である。Restricted Transactional Memory(Restricted Transactional Memory、RTM)は、新しい命令セット・インターフェース(XBEGIN、XEND、及びXABORT命令を含む)であり、プログラマーは、HLEで可能なよりも柔軟性の高い手法でトランザクション領域を定義できる。HLEは、従来の相互排他プログラミング・モデルの後方互換性(backward compatibility)を好み、従来のハードウェア上でHLE対応のソフトウェアを実行したいが、HLEサポートを有するハードウェア上で新しいロック無効化機能を利用したいと望むプログラマー向けのものである。RTMは、トランザクション実行ハードウェアよりも柔軟なインターフェースを好むプログラマー向けのものである。さらに、Intel(登録商標)TSXはまた、XTEST命令も提供する。この命令は、論理プロセッサが、HLE又はRTMのいずれかによって識別されたトランザクション領域においてトランザクション実行しているかどうかを、ソフトウェアが照会することを可能にする。   Intel (R) TSX provides two software interfaces for specifying code regions for transaction execution. Hardware Lock Elimination (HLE) is a legacy compatible instruction set extension (including the XACQUIRE and XRELEASE prefixes) for specifying the transaction area. Restricted Transactional Memory (Restricted Transactional Memory, RTM) is a new instruction set interface (including XBEGIN, XEND, and XABORT instructions) that allows programmers to define transaction areas in a more flexible way than is possible with HLE. it can. HLE prefers the backward compatibility of the traditional mutual exclusion programming model and wants to run HLE-enabled software on legacy hardware, but provides a new lock override function on hardware with HLE support. For programmers who want to use it. RTM is for programmers who prefer a more flexible interface than transaction execution hardware. In addition, Intel (R) TSX also provides an XTEST instruction. This instruction allows software to query whether the logical processor is executing a transaction in the transaction area identified by either HLE or RTM.

成功したトランザクション実行はアトミック・コミットを保証するので、プロセッサは、明示的な同期を行うことなく、コード領域を楽観的に実行する。特定の実行で同期が不要であった場合、いかなるクロススレッドのシリアル化も行うことなく、実行をコミットすることができる。プロセッサがアトミックにコミットできない場合、楽観的実行に失敗する。楽観的実行に失敗すると、プロセッサは実行をロールバックし、プロセスはトランザクション・アボートと呼ばれる。トランザクションがアボートすると、プロセッサは、トランザクションが使用するメモリ領域で実行された全ての更新を廃棄し、あたかも楽観的に実行が行われなかったように見えるようにアーキテクチャ上の状態を復元し、非トランザクションに実行を再開する。   Because a successful transaction execution guarantees an atomic commit, the processor optimistically executes the code area without explicit synchronization. If synchronization is not required for a particular run, the run can be committed without any cross-thread serialization. If the processor cannot commit atomically, optimistic execution will fail. If the optimistic execution fails, the processor rolls back execution and the process is called a transaction abort. When a transaction aborts, the processor discards any updates made in the memory area used by the transaction, restores the architectural state as if it had not been optimistically executed, Resume execution.

プロセッサは、多くの理由によりトランザクションをアボートすることがある。トランザクションをアボートする主たる理由は、トランザクションを実行している論理プロセッサと別の論理プロセッサとの間のメモリ・アクセスの競合によるものである。このようなメモリ・アクセス競合は、トランザクション実行の成功の妨げとなり得る。トランザクション領域内から読み取られたメモリ・アドレスによりトランザクション領域の読み取りセット(read set)が構成され、トランザクション領域内に書き込まれたアドレスによりトランザクション領域の書き込みセット(write set)が構成される。Intel(登録商標)TSXは、キャッシュラインの粒度で読み取りセットと書き込みセットを維持する。別の論理プロセッサがトランザクション領域の書き込みセットの一部の場所で読み取りを行うか又はトランザクション領域の読み取りセット若しくは書き込みセットの一部の場所で書き込みを行う場合、メモリ・アクセス競合が発生する。アクセス競合は、一般的には、そのコード領域に対してシリアル化が必要であることを意味する。Intel(登録商標)TSXは、キャッシュラインの粒度でデータ競合を検出するため、同じキャッシュラインに置かれた無関係なデータ位置は競合として検出され、その結果、トランザクション・アボートがもたらされる。トランザクション・アボートはまた、トランザクション・リソースの制限により発生することもある。例えば、領域内でアクセスされるデータの量が、実装固有の能力を超えた場合である。さらに、一部の命令とシステム・イベントがトランザクション・アボートを引き起こすこともある。頻繁なトランザクション・アボートは無駄なサイクル及び非効率性の増大をもたらす。   A processor may abort a transaction for a number of reasons. The main reason for aborting a transaction is due to contention for memory access between the logical processor executing the transaction and another logical processor. Such memory access contention may hinder successful transaction execution. The memory area read from the transaction area constitutes a read set of the transaction area, and the address written in the transaction area constitutes a write set of the transaction area. Intel (R) TSX maintains read and write sets at the granularity of cache lines. A memory access conflict occurs when another logical processor reads at some location in the transaction area write set or writes at some location in the transaction area read set or write set. Access contention generally means that the code area needs to be serialized. Since Intel (R) TSX detects data conflicts at the granularity of cache lines, extraneous data locations located on the same cache line are detected as conflicts, resulting in a transaction abort. Transaction aborts may also occur due to transaction resource limitations. For example, when the amount of data accessed in the area exceeds the capability inherent in the implementation. In addition, some instructions and system events may cause a transaction abort. Frequent transaction aborts result in wasted cycles and increased inefficiencies.

Hardware Lock Elision
Hardware Lock Elision(HLE)は、プログラマーがトランザクション実行を使用するための従来の互換命令セット・インターフェースである。HLEは、2つの新しい命令プリフィックス・ヒント、即ちXACQUIRE及びXRELEASEを提供する。
Hardware Lock Elion
Hardware Lock Elimination (HLE) is a conventional compatible instruction set interface for programmers to use transaction execution. HLE provides two new instruction prefix hints, XACQUIRE and XRELEASE.

HLEでは、プログラマーは、クリティカル・セクションを保護するロックの取得に使用する命令の前に、XACQUIREプリフィックスを付加する。プロセッサは、ロック取得操作と関連付けられている書き込みを無効化する(elide)ヒントとしてプリフィックスを扱う。ロック取得がロックと関連付けられている書き込み操作を有していても、プロセッサは、トランザクション領域の書き込みセットにロックのアドレスを追加せず、ロックに対するいかなる書き込み要求も発行しない。代わりに、ロックのアドレスが読み取りセットに追加される。論理プロセッサがトランザクション実行に入る。XACQUIREプリフィックス付加された命令の前にロックが利用可能であった場合、命令の後に他の全てのプロセッサはそのロックを利用可能なものとして見なし続ける。トランザクション実行する論理プロセッサは、書き込みセットにロックのアドレスを追加せず、外部に明確な書き込み操作を行わないため、他の論理プロセッサは、データ競合を引き起こすことなくロックを読み取ることができる。これにより、他の論理プロセッサがロックで保護されたクリティカル・セクションに入り、同時実行することが可能になる。プロセッサは、トランザクション実行中に引き起こされるあらゆるデータ競合を自動的に検出し、必要に応じてトランザクション・アボートを実行する。   In HLE, the programmer adds the XACQUIRE prefix before the instruction used to acquire the lock that protects the critical section. The processor treats the prefix as a hint to elide the write associated with the lock acquisition operation. Even though the lock acquisition has a write operation associated with the lock, the processor does not add the address of the lock to the write set of the transaction area and does not issue any write requests for the lock. Instead, the address of the lock is added to the read set. The logical processor enters transaction execution. If a lock was available before the XACQUIRE-prefixed instruction, all other processors continue to consider the lock available after the instruction. The logical processor performing the transaction does not add the address of the lock to the write set and does not perform explicit write operations externally, so that other logical processors can read the lock without causing data contention. This allows other logical processors to enter the lock-protected critical section and execute concurrently. The processor automatically detects any data races caused during the execution of the transaction and performs a transaction abort as needed.

無効化を行うプロセッサがロックに対するいかなる外部書き込み操作も行わないにもかかわらず、ハードウェアは、ロックに対する操作のプログラム順を保証する。無効化を行うプロセッサ自体がクリティカル・セクションにおいてロックの値を読み取ると、プロセッサがロックを取得したように見える、即ち、読み取りにより、非無効化(non-elide)値が戻される。この挙動は、HLE実行が、HLEプリフィックスなしの実行と機能的に等しくなることを可能にする。   The hardware guarantees the program order of operations on locks, even though the invalidating processor does not perform any external write operations on locks. When the invalidating processor itself reads the value of the lock in the critical section, it appears that the processor has acquired the lock, ie, the read returns a non-elide value. This behavior allows HLE execution to be functionally equivalent to execution without the HLE prefix.

XRELEASEプリフィックスは、クリティカル・セクションを保護するロックの解放(release)に使用される命令の前に追加することができる。ロックの解放には、ロックに対する書き込みが含まれる。この命令により、ロックの値が、同じロックのXACQUIREプリフィックスでロック取得操作の前にロックが有していた値に戻された場合、プロセッサは、ロックの解放に関連付けられている外部書き込み要求を無視し、書き込みセットにロックのアドレスを追加しない。次に、プロセッサは、トランザクション実行をコミットしようとする。   The XRELEASE prefix can be added before the instruction used to release the lock protecting the critical section. Releasing a lock includes writing to the lock. If this instruction returns the value of the lock to the value the lock had before the lock acquisition operation with the same lock's XACQUIRE prefix, the processor ignores any external write requests associated with releasing the lock. And does not add the address of the lock to the write set. Next, the processor attempts to commit the transaction execution.

HLEでは、複数のスレッドが同じのロックで保護されたクリティカル・セクションを実行する場合でも、互いのデータに対していかなる競合が発生する操作を行わないのであれば、スレッドをシリアル化することなく同時に実行することができる。ソフトウェアが共通のロックでロック取得操作を使用した場合でも、ハードウェアはこれを認識し、ロックを無効化し、ロックを通じていずれの通信も行うことなく、2つのスレッドでクリティカル・セクションを実行する(こうした通信が動的に不要だった場合)。   HLE allows multiple threads to execute critical sections protected by the same lock at the same time without serializing the threads, provided that they do not perform any conflicting operations on each other's data. Can be performed. If software uses a lock acquisition operation on a common lock, the hardware recognizes this, invalidates the lock, and executes the critical section in two threads without any communication through the lock (such as Communication was not needed dynamically).

プロセッサが領域をトランザクション実行できない場合、プロセッサは、その領域を、非トランザクションに且つ無効化を行わずに実行する。HLE対応のソフトウェアは、基礎をなす非HLEのロック・ベースの実行と同じように前方進行を保証する。HLE実行を成功させるためには、ロック及びクリティカル・セクションコードが特定のガイドラインに従わなければならない。これらのガイドラインは性能にのみ影響し、これらのガイドラインに従わなかった場合でも機能的不具合は生じない。HLEサポートを有していないハードウェアは、XACQUIRE及びXRELEASEプリフィックス・ヒントを無視するが、これらのプリフィックスはXACQUIRE及びXRELEASEが有効な場合に命令で無視されるREPNE/REPE IA−32プリフィックスに対応しているので、いかなる無効化も行わない。重要なことに、HLEは既存のロック・ベースのプログラミング・モデルと互換性がある。ヒントを不適切に使用しても機能的なバグは起こらないが。コードに既に含まれている潜在的なバグが暴露する可能性がある。   If the processor cannot transactionally execute the region, the processor executes the region non-transactionally and without invalidating. HLE-enabled software guarantees forward progress as well as the underlying non-HLE lock-based implementation. Lock and critical section code must follow certain guidelines for successful HLE execution. These guidelines only affect performance, and non-compliance with these guidelines does not result in functional failure. Hardware without HLE support ignores the XACQUIRE and XRELEASE prefix hints, but these prefixes correspond to the REPNE / REPE IA-32 prefixes that are ignored in the instruction when XACQUIRE and XRELEASE are enabled. Do not do any invalidation. Importantly, HLE is compatible with existing lock-based programming models. Although improper use of hints does not cause a functional bug. Potential bugs already in the code may be exposed.

Restricted Transactional Memory(RTM)は、トランザクション実行用の柔軟なソフトウェア・インターフェースを提供する。RTMは、プログラマーがトランザクション実行を開始、コミット、アボートする3つの新しい命令(XBEGIN、XEND、及びXABORT)を提供する。   Restricted Transactional Memory (RTM) provides a flexible software interface for executing transactions. RTM provides three new instructions (XBEGIN, XEND, and XABORT) that allow the programmer to start, commit, and abort transaction execution.

プログラマーは、XBEGIN命令を使用してトランザクション・コード領域の開始を指定し、XEND命令を使用してトランザクション・コード領域の終了を指定する。XBEGIN命令は、RTM領域がトランザクション実行に成功しなかった場合、相対的なオフセットをフォールバック命令アドレスに与えるオペランドを利用する。   The programmer specifies the start of the transaction code area using the XBEGIN instruction, and specifies the end of the transaction code area using the XEND instruction. The XBEGIN instruction utilizes an operand that provides a relative offset to the fallback instruction address if the RTM area did not successfully execute the transaction.

プロセッサは、多くの理由によりRTMトランザクション実行をアボートすることがある。ハードウェアは、トランザクション・アボート条件を自動的に検出して、XBEGIN命令の開始、及びアボート・ステータスを説明するために更新されたEAXレジスタに対応するアーキテクチャ状態で、フォールバック命令アドレスから実行を再開する。   A processor may abort RTM transaction execution for a number of reasons. The hardware automatically detects a transaction abort condition and resumes execution from the fallback instruction address with the start of the XBEGIN instruction and the architected state corresponding to the EAX register updated to account for abort status. I do.

XABORT命令は、プログラマーが、RTM領域の実行を明示的にアボートすることを可能にする。XABORT命令には、RTMアボートの後にソフトウェアで利用可能になる、EAXレジスタにロードされる8ビットの即時引数を利用する。RTM命令は、いずれのデータ・メモリ位置とも関連付けられない。ハードウェアは、RTM領域がこれまでトランザクション・コミットに成功したかどうかに関して保証しないが、推奨されるガイドラインに従う大部分のトランザクションは、トランザクション・コミットに成功すると予想される。しかしながら、プログラマーは、前方進行を保証するため、フォールバック経路に代替コード・シーケンスを常に提供しなければならない。これは、ロックを取得して指定されたコード領域を非トランザクションに実行するのと同じくらい簡単であり得る。さらに、所与の実装では常にアボートされるトランザクションが、将来の実装ではトランザクションに完了する可能性がある。従って、プログラマーは、トランザクション領域と代替コード・シーケンスのコード経路が機能的にテストされることを保証しなければならない。   The XABORT instruction allows the programmer to explicitly abort execution of the RTM region. The XABORT instruction utilizes an 8-bit immediate argument loaded into the EAX register that becomes available in software after an RTM abort. The RTM instruction is not associated with any data memory location. Although the hardware does not guarantee that the RTM region has ever successfully committed a transaction, most transactions that follow the recommended guidelines are expected to succeed. However, the programmer must always provide an alternative code sequence in the fallback path to guarantee forward progress. This can be as simple as acquiring a lock and executing the specified code region non-transactionally. Furthermore, a transaction that is always aborted in a given implementation may complete in a future implementation. Therefore, the programmer must ensure that the code areas of the transaction area and the alternative code sequence are functionally tested.

HLEサポートの検出
プロセッサは、CPUID.07H.EBX.HLE[bit4]=1の場合に、HLE実行をサポートする。しかしながら、アプリケーションは、プロセッサがHLEをサポートするかどうかをチェックすることなく、HLEプリフィックス(XACQUIRE及びXRELEASE)を使用することができる。HLEサポートを有していないプロセッサは、これらのプリフィックスを無視し、トランザクション実行に入ることなく、コードを実行する。
HLE support detection Processor is CPUID. 07H. EBX. When HLE [bit4] = 1, HLE execution is supported. However, applications can use HLE prefixes (XACQUIRE and XRELEASE) without checking whether the processor supports HLE. Processors without HLE support ignore these prefixes and execute code without entering transaction execution.

RTMサポートの検出
プロセッサは、CPUID.07H.EBX.RTM[bit11]=1の場合に、RTM実行をサポートする。アプリケーションは、RTM命令(XBEGIN、XEND、XABORT)を使用する前に、プロセッサがRTMをサポートしているかどうかをチェックする必要がある。これらの命令は、RTMをサポートしていないプロセッサで使用されると、#UD例外が発生する。
Detection of RTM support Processor is CPUID. 07H. EBX. When RTM [bit11] = 1, RTM execution is supported. Before using an RTM instruction (XBEGIN, XEND, XABORT), the application needs to check if the processor supports RTM. When these instructions are used in a processor that does not support RTM, a #UD exception occurs.

XTEST命令の検出
プロセッサが、HLE又はRTMのいずれかをサポートしている場合、XTEST命令をサポートする。アプリケーションは、XTEST命令を使用する前に、これらの特徴フラグのどちらかをチェックする必要がある。この命令は、HLE又はRTMのいずれもサポートしていないプロセッサで使用されると、#UD例外が発生する。
XTEST instruction detection If the processor supports either HLE or RTM, it will support the XTEST instruction. The application needs to check either of these feature flags before using the XTEST instruction. If this instruction is used in a processor that does not support either HLE or RTM, a #UD exception will occur.

トランザクション実行状態を照会する
XTEST命令は、HLE又はRTMによって指定されたトランザクション領域のトランザクション状態を判断するために使用することができる。HLEプリフィックスは、HLEをサポートしていないプロセッサ上で無視されるが、XTEST命令は、HLE又はRTMのいずれもサポートしていないプロセッサ上で使用されると、#UD例外が発生することに留意されたい。
Querying Transaction Execution Status The XTEST instruction can be used to determine the transaction status of a transaction area specified by HLE or RTM. Note that the HLE prefix is ignored on processors that do not support HLE, but the XTEST instruction raises a #UD exception when used on a processor that does not support either HLE or RTM. I want to.

HLEロックの要件
HLE実行がトランザクション・コミットに成功するために、ロックが特定の特性を満たし、ロックへのアクセスが次の特定のガイドラインに従っていなければならない。
HLE Lock Requirements For an HLE execution to succeed in a transaction commit, the lock must meet certain characteristics and access to the lock must follow the following specific guidelines:

XRELEASEプリフィックスの付いた(prefixed)命令は、無効化されたロックの値を、ロック取得の前に有していた値に復元する必要がある。これにより、ハードウェアは、書き込みセットに追加することなく、安全にロックを無効化することができる。ロック解放(XRELEASEプリフィックスが付加された)命令のデータ・サイズ及びデータ・アドレスは、ロック取得(XACQUIREプリフィックスの付いた)命令のものと一致していなければならず、ロックはキャッシュライン境界をまたぐことはできない。   The XRELEASE prefixed instruction needs to restore the value of the invalidated lock to the value it had before the lock was acquired. This allows the hardware to safely disable the lock without adding it to the write set. The data size and data address of the release lock (with the XRELEASE prefix) instruction must match that of the acquire lock (with the XACQUIRE prefix) instruction, and the lock must cross cache line boundaries. Can not.

ソフトウェアは、XRELEASEプリフィックス命令以外のいかなる命令によってもトランザクションHLE領域内の無効化されたロックに書き込みを行うべきではなく、さもなければ、こうした書き込みがトランザクション・アボートを引き起こすことがある。さらに、再帰ロック(recursive lock)(スレッドが、最初にロックを解放することなく、同じロックを複数回取得する場合)もトランザクション・アボートを引き起こすことがある。ソフトウェアは、クリティカル・セクション内で取得された無効化されたロックの結果を観察できることに留意されたい。こうした読み取り操作は、書き込みの値をロックに戻す。   Software should not write to an invalidated lock in the transaction HLE area with any instruction other than the XRELEASE prefix instruction, or such a write may cause a transaction abort. In addition, recursive locks (when a thread acquires the same lock multiple times without first releasing the lock) can also cause a transaction abort. Note that the software can observe the consequences of invalidated locks acquired in the critical section. Such a read operation returns the value of the write to the lock.

プロセッサは、これらのガイドラインの違反を自動的に検出し、無効化を行うことなく、安全に非トランザクション実行に遷移する。Intel(登録商標)TSXは、キャッシュラインの粒度で競合を検出するので、無効化されたロックと同じキャッシュライン上に配置されたデータへの書き込みは、同じロックを無効化を行う他の論理プロセッサによってデータ競合として検出される可能性がある。   The processor automatically detects violations of these guidelines and safely transitions to non-transactional execution without invalidation. Since Intel (registered trademark) TSX detects conflicts at the granularity of a cache line, writing to data placed on the same cache line as the invalidated lock requires another logical processor that invalidates the same lock. May be detected as a data race.

トランザクション・ネスト
HLE及びRTMの両方とも、ネスト化された(nested)トランザクション領域をサポートする。しかしながら、トランザクション・アボートは、状態を、トランザクション実行を開始した操作に、即ち、最外(outermost)XACQUIREプリフィックスの付いたHLE適格(HLE-eligible)命令、又は最外XBEGIN命令のいずれかに復元する。プロセッサは、全てのネスト化トランザクションを1つのトランザクションとして扱う。
Transaction Nest Both HLE and RTM support nested transaction regions. However, a transaction abort restores the state to the operation that initiated the transaction execution, ie, either an HLE-eligible instruction with an outermost XACQUIRE prefix or an outermost XBEGIN instruction. . The processor treats all nested transactions as one transaction.

HLEのネスト化及び無効化
プログラマーは、HLE領域を、MAX_HLE_NEST_COUNTの実装指定深さまでネスト化することができる。各論理プロセッサは、ネスト化カウントを内部で追跡するが、このカウントはソフトウェアに利用可能でない。XACQUIREプリフィックスの付いたHLE適格命令はネスト化カウントをインクリメントし、XRELEASEプリフィックスの付いたHLE適格命令はこれをデクリメントする。論理プロセッサは、ネスト化カウントがゼロから1になったとき、トランザクション実行に入る。論理プロセッサは、ネスト化カウントがゼロになったときにのみ、コミットしようと試みる。ネスト化カウントがMAX_HLE_NEST_COUNTを上回った場合には、トランザクション・アボートが発生することがある。
HLE Nesting and Invalidation The programmer can nest the HLE region to an implementation specified depth of MAX_HLE_NEST_COUNT. Each logical processor internally tracks a nested count, which is not available to software. HLE eligible instructions with the XACQUIRE prefix increment the nested count, and HLE eligible instructions with the XRELEASE prefix decrement it. The logical processor enters transaction execution when the nested count goes from zero to one. The logical processor attempts to commit only when the nested count reaches zero. If the nesting count exceeds MAX_HLE_NEST_COUNT, a transaction abort may occur.

ネスト化されたHLE領域をサポートすることに加えて、プロセッサはまた、複数のネスト化されたロックを無効化することもできる。プロセッサは、無効化に関してロックを追跡し、そのロックに対するXACQUIREプリフィックスの付いたHLE適格命令から開始し、その同じロックに対するXRELEASEプリフィックスの付いたHLE適格命令で終了する。プロセッサは、常に、ロックのMAX_HLE_ELIDED_LOCKS数まで追跡することができる。例えば、実装が2のMAX_HLE_ELIDED_LOCKS値をサポートし、プログラマーが3つのHLE識別クリティカル・セクションをネスト化する場合(ロックのどれに対しても介在するXRELEASEプリフィックスの付いたHLE適格命令を実行することなく、3つの個別ロックに対して介在するXACQUIREプリフィックスの付いたHLE適格命令を実行することによって)、最初の2つのロックは無効化されるが、第3のロックは無効化されない(しかし、トランザクションの書き込みセットに追加される)。しかしながら、実行は依然としてトランザクションに続行する。2つの無効化されたロックの1つに対してXRELEASEに遭遇すると、XACQUIREプリフィックスの付いたHLE適格命令を介して取得された後続のロックが無効化される。   In addition to supporting nested HLE regions, the processor can also invalidate multiple nested locks. The processor tracks the lock for invalidation and starts with an HLE eligible instruction with the XACQUIRE prefix for that lock and ends with an HLE eligible instruction with the XRELEASE prefix for the same lock. The processor can always keep track of up to MAX_HLE_ELIDED_LOCKS number of locks. For example, if the implementation supports a MAX_HLE_ELIDED_LOCKS value of 2 and the programmer nests 3 HLE identification critical sections (without executing HLE eligible instructions with an intervening XRELEASE prefix on any of the locks, By executing an HLE-eligible instruction with an intervening XACQUIRE prefix on three individual locks), the first two locks are invalidated, but the third lock is not invalidated (but the transaction write Added to the set). However, execution still continues with the transaction. When an XRELEASE is encountered for one of the two revoked locks, subsequent locks acquired via HLE eligible instructions with the XACQUIRE prefix are revoked.

プロセッサは、全ての無効化されたXACQUIRE及びXRELEASEのペアが一致し、ネスト化カウントがゼロになり、ロックが要件を満たした場合に、HLE実行をコミットしようと試みる。実行がアトミックにコミットできない場合、実行は、あたかも最初の命令がXACQUIREプリフィックスを有していなかったかのように、無効化を行わない非トランザクション実行に遷移する。   The processor attempts to commit the HLE execution if all invalidated XACQUIRE and XRELEASE pairs match, the nested count goes to zero, and the lock meets the requirements. If execution cannot be committed atomically, execution transitions to non-transactional execution with no invalidation as if the first instruction did not have the XACQUIRE prefix.

RTMのネスト化
プログラマーは、RTM領域を、実装指定のMAX_RTM_NEST_COUNTまでネスト化することができる。論理プロセッサは、ネスト化カウントを内部で追跡するが、このカウントはソフトウェアに利用可能でない。XBEGIN命令はネスト化カウントをインクリメントし、XEND命令はネスト化カウントをデクリメントする。論理プロセッサは、ネスト化カウントがゼロになった場合にのみ、コミットを試みる。ネスト化カウントがMAX_RTM_NEST_COUNTを上回った場合には、トランザクション・アボートが発生する。
Nesting of RTM The programmer can nest the RTM area up to the MAX_RTM_NEST_COUNT specified by the implementation. The logical processor keeps track of the nested count internally, but this count is not available to software. The XBEGIN instruction increments the nested count, and the XEND instruction decrements the nested count. The logical processor will only try to commit if the nested count goes to zero. If the nesting count exceeds MAX_RTM_NEST_COUNT, a transaction abort occurs.

HLE及びRTMのネスト化
HLE及びRTMは、2つの代替的なソフトウェア・インターフェースを一般的なトランザクション実行機能に提供する。トランザクション処理の挙動は、例えばHLEがRTMの内部にある又はRTMがHLEの内部にあるなど、HLE及びRTMが互いにネスト化された場合、実装固有のものである。しかしながら、全ての場合において、実装は、HLE及びRTMのセマンティクスを維持する。ある実装は、RTM領域内で使用されるとき、HLEヒントを無視するように選択することができ、RTM命令がHLE領域内で使用されるとき、トランザクション・アボートを発生させることがある。後者の場合、プロセッサは実際に無効化を行わずにHLE領域を再実行し、次にRTM命令を実行するので、トランザクション実行から非トランザクション実行への遷移はシームレスに行われる。
HLE and RTM Nesting HLE and RTM provide two alternative software interfaces for common transaction execution functions. The behavior of transaction processing is implementation specific if the HLE and RTM are nested within each other, for example, the HLE is inside the RTM or the RTM is inside the HLE. However, in all cases, the implementation maintains the HLE and RTM semantics. Certain implementations may choose to ignore HLE hints when used in the RTM domain, and may cause a transaction abort when the RTM instruction is used in the HLE domain. In the latter case, the processor re-executes the HLE area without actually invalidating, and then executes the RTM instruction, so that the transition from transaction execution to non-transaction execution occurs seamlessly.

アボート・ステータスの定義
RTMは、EAXレジスタを使用して、アボート・ステータスをソフトウェアに伝える。RTMアボートの後、EAXレジスタは、以下の定義を有する。

Figure 0006642806
Abort Status Definition The RTM uses the EAX register to communicate abort status to software. After an RTM abort, the EAX register has the following definition:
Figure 0006642806

RTMに関するEAXアボート・ステータスは、アボートの原因のみを提供する。これ自体が、RTM領域に関してアボートが発生したか又はコミットが発生したかをコード化するものではない。EAXの値は、RTMアボートの後に、0になることがある。例えば、RTM領域の内部でCPUID命令を使用すると、トランザクション・アボートを引き起こすが、EAXビットのいずれかを設定する要件を満たさない場合がある。これにより、EAXの値が0になる場合がある。   The EAX abort status for RTM provides only the cause of the abort. This by itself does not code whether an abort or a commit has occurred for the RTM area. The value of EAX may be 0 after an RTM abort. For example, using a CPUID instruction inside an RTM area may cause a transaction abort, but may not meet the requirement to set any of the EAX bits. As a result, the value of EAX may become zero.

RTMメモリの順序付け
RTMがコミットに成功すると、RTM領域内の全てのメモリ操作はアトミックに実行されるように見える。RTM領域内でメモリ操作が行われない場合でも、XBEGINの後にXENDが続き、コミットに成功したRTM領域は、LOCKプリフィックス命令と同じ順序付けセマンティクスを有する。
RTM Memory Ordering When the RTM successfully commits, all memory operations in the RTM region appear to be performed atomically. Even if no memory operations are performed in the RTM region, the XBEGIN is followed by the XEND, and a successfully committed RTM region has the same ordering semantics as the LOCK prefix instruction.

XBEGIN命令には、フェンス・セマンティクスがない。しかしながら、RTM実行がアボートした場合、RTM領域内部から全てのメモリ更新が廃棄され、あらゆる他の論理プロセッサから見えなくなる。   The XBEGIN instruction has no fence semantics. However, if the RTM execution aborts, all memory updates from within the RTM area are discarded and are invisible to any other logical processors.

RTM対応デバッガのサポート
デフォルトでは、RTM領域内部のあらゆるデバッグ例外がトランザクション・アボートを引き起こし、アーキテクチャ状態が復旧し、ビット4がEAX内に設定された状態で、制御フローをフォールバック命令アドレスにリダイレクトする。しかしながら、ソフトウェア・デバッガが、デバッグ例外時に実行をインターセプトするのを可能にするために、RTMアーキテクチャは付加的な機能を提供する。
RTM-enabled debugger support By default, any debug exception inside the RTM region will cause a transaction abort, restore architectural state, and redirect control flow to the fallback instruction address with bit 4 set in EAX. . However, the RTM architecture provides additional functionality to allow software debuggers to intercept execution on debug exceptions.

DR7のビット11及びIA32_DEBUGCTL_MSRのビット15が両方とも1である場合、デバッグ例外(#DB)又はブレークポイント例外(#BP)に起因するいずれかのRTMアボートにより、実行がロールバックし、フォールバック・アドレスの代わりにXBEGIN命令から再開する。このシナリオでは、EAXレジスタもまた、XBEGIN命令の時点に復元される。   If both bit 11 of DR7 and bit 15 of IA32_DEBUGCTL_MSR are 1, execution rolls back due to either RTM abort due to debug exception (#DB) or breakpoint exception (#BP), and fallback. Resume from XBEGIN instruction instead of address. In this scenario, the EAX register is also restored at the time of the XBEGIN instruction.

プログラミング上の考慮事項
一般的に、通常プログラマーが指定した領域は、トランザクション実行及びコミットに成功することが想定される。しかしながら、Intel(登録商標)TSXでは、そうした保証はない。トランザクション実行は、様々な理由によりアボートされることがある。トランザクション機能を最大限に利用するために、プログラマーは、特定のガイドラインに従い、トランザクション実行のコミットが成功する可能性を高める必要がある。
Programming Considerations In general, it is generally assumed that the area specified by the programmer will successfully execute and commit the transaction. However, there is no such guarantee in Intel (R) TSX. Transaction execution may be aborted for various reasons. To take full advantage of transactional features, programmers need to follow certain guidelines to increase the likelihood of a successful commit to executing a transaction.

このセクションでは、トランザクション・アボートを引き起こし得る様々なイベントについて論じる。アーキテクチャは、後で実行をアボートするトランザクション内で行われた更新は決して見えるようにならないことを保証する。コミットされたトランザクション実行のみが、アーキテクチャ状態の更新を開始する。トランザクション・アボートは、決して機能的不具合を引き起こすことはなく、性能にのみに影響を与える。   This section discusses various events that can cause a transaction abort. The architecture guarantees that updates made within a transaction that later aborts execution will never be visible. Only committed transaction executions initiate architectural state updates. A transaction abort never causes a functional failure and only affects performance.

命令ベースの考慮事項
プログラマーは、トランザクション(HLE又はRTM)の内部であらゆる命令を安全に使用することができ、あらゆる特権レベルでトランザクションを使用することができる。しかしながら、一部の命令は常にトランザクション実行をアボートさせ、実行は非トランザクション経路にシームレスかつ安全に遷移される。
Instruction Based Considerations The programmer can safely use any instruction inside a transaction (HLE or RTM) and use the transaction at any privilege level. However, some instructions always abort transaction execution, and execution is seamlessly and safely transitioned to a non-transactional path.

Intel(登録商標)TSXでは、殆どの一般的な命令を、アボートを引き起こさずに、トランザクション内部で使用することができる。通常、以下の操作により、トランザクションでアボートが引き起こされることはない。
・命令ポインタ・レジスタ、汎用レジスタ(GPR)及びステータス・ラグ(CF、OF、SF、PF、AF、及びZF)に対する操作、及び、
・XMMレジスタ及びYMMレジスタ、並びにMXCSRレジスタに対する操作。
In Intel® TSX, most common instructions can be used inside a transaction without causing an abort. Generally, the following operations do not cause an abort in a transaction:
Operations on instruction pointer registers, general purpose registers (GPR) and status lags (CF, OF, SF, PF, AF, and ZF); and
-Operations on the XMM, YMM, and MXCSR registers.

しかしながら、プログラマーは、トランザクション領域内でSSE操作及びAVX操作を混在させる際に注意深くなければならない。XMMレジスタにアクセスするSSE命令と、YMMレジスタにアクセスするAVX命令との混在により、トランザクションがアボートする可能性がある。プログラマーは、トランザクション内でREP/REPNEプリフィックスの付いた文字列操作を使用することができる。しかしながら、長い文字列はアボートを引き起こすことがある。さらに、CLD及びSTD命令の使用は、これらがDFフラグの値を変えた場合に、アボートを引き起こすことがある。しかしながら、DFが1である場合、STD命令はアボートを引き起こさない。同様に、DFが0である場合、CLD命令はアボートを引き起こさない。   However, the programmer must be careful when mixing SSE and AVX operations within a transaction area. The transaction may abort due to the mixture of the SSE instruction accessing the XMM register and the AVX instruction accessing the YMM register. Programmers can use string operations with the REP / REPNE prefix in transactions. However, long strings can cause aborts. Further, the use of CLD and STD instructions may cause an abort if they change the value of the DF flag. However, if DF is 1, the STD instruction will not cause an abort. Similarly, if DF is 0, the CLD instruction will not cause an abort.

トランザクション内部で使用されたときにアボートを引き起こすものとしてここで列挙されていない命令によりトランザクションがアボートされることは通常ない(例として、これらに限定されるものではないが、MFENCE、LFENCE、SFENCE、RDTSC、RDTSCP等が挙げられる)。   Instructions not listed here as causing an abort when used inside a transaction will usually not abort the transaction (for example, but not limited to, MFENCE, LFENCE, SFENCE, RDTSC, RDTSCP, etc.).

以下の命令は、あらゆる実装でトランザクション実行をアボートする。
・XABORT
・CPUID
・PAUSE
The following instruction aborts transaction execution in any implementation.
・ XABORT
・ CPUID
・ PAUSE

さらに、一部の実装では、以下の命令は常にトランザクション・アボートを引き起こし得る。これらの命令は通常、トランザクション領域の内部で使用されることは想定されていない。しかしながら、これらの命令がトランザクション・アボートを引き起こすかどうかは実装に依存するため、プログラマーは、これらの命令に依存してトランザクション・アボートを強制すべきではない。
・X87及びMMX(商標)のアーキテクチャ状態に対する操作。これには、FXRSTOR及びFXSAVE命令を含む、全てのMMX及びX87命令が含まれる。
・EFLAGの非ステータス部分の更新:CLI、STI、POPFD、POPFQ、CLTS。
・セグメント・レジスタ、デバッグ・レジスタ、及び/又は制御レジスタを更新する命令:DS/ES/FS/GS/SSに対するMOV、POP DS/ES/FS/GS/SS、LDS、LES、LFS、LGS、LSS、SWAPGS、WRFSBASE、WRGSBASE、LGDT、SGDT、LIDT、SIDT、LLDT、SLDT、LTR、STR、Far CALL、Far JMP、Far RET、IRET、DRxに対するMOV、CR0/CR2/CR3/CR4/CR8に対するMOV、及びLMSW。
・リング遷移:SYSENTER、SYSCALL、SYSEXIT、及びSYSRET。
・TLB及びキャッシュ可能な制御:CLFLUSH、INVD、WBINVD、INVLPG、INVPCID、及び非一時的ヒントを有するメモリ命令(MOVNTDQA、MOVNTDQ、MOVNTI、MOVNTPD、MOVNTPS、及びMOVNTQ)。
・プロセッサ状態の保存:XSAVE、XSAVEOPT、及びXRSTOR。
・割り込み:INTn、INTO。
・IO:IN、INS、REP INS、OUT、OUTS、REP OUTS、及びその変形。
・VMX:VMPTRLD、VMPTRST、VMCLEAR、VMREAD、VMWRITE、VMCALL、VMLAUNCH、VMRESUME、VMXOFF、VMXON、INVEPT、及びINVVPID。
・SMX:GETSEC。
・UD2、RSM、RDMSR、WRMSR、HLT、MONITOR、MWAIT、XSETBV、VZEROUPPER、MASKMOVQ、及びV/MASKMOVDQU。
Further, in some implementations, the following instructions may always cause a transaction abort. These instructions are not normally expected to be used inside a transaction area. However, programmers should not rely on these instructions to force a transaction abort, because whether these instructions cause a transaction abort is implementation dependent.
Operations on X87 and MMX architectural states. This includes all MMX and X87 instructions, including the FXRSTOR and FXSAVE instructions.
Update of non-status part of EFLAG: CLI, STI, POPFD, POPQQ, CLTS.
Instructions for updating segment registers, debug registers, and / or control registers: MOV for DS / ES / FS / GS / SS, POP DS / ES / FS / GS / SS, LDS, LES, LFS, LGS, MOV for LSS, SWAPGS, WRFSBASE, WRGSBASE, LGDT, SGDT, LIDT, SIDT, LLDT, SLDT, LTR, STR, Far CALL, Far JMP, Far RET, IRET, DRx, MOV for CR0 / CR2 / CR3 / CR4 / CR8. , And LMSW.
-Ring transitions: SYSENTER, SYSCALL, SYSEXIT, and SYSRET.
TLB and cacheable controls: CLFLUSH, INVD, WBINVD, INVLPG, INVPCID, and memory instructions with non-temporary hints (MOVNTDQA, MOVNTDQ, MOVNTI, MOVNTPD, MOVNTPS, and MOVNTQ).
Save processor state: XSAVE, XSAVEOPT, and XRSTOR.
・ Interrupts: INTn, INTO.
IO: IN, INS, REP INS, OUT, OUTS, REP OUTS, and variants.
VMX: VMPTRLD, VMPTRST, VMCLEAR, VMREAD, VMWRITE, VMCALL, VMLAUNCH, VMRESUME, VMXOFF, VMXON, INVEPT, and INVVPID.
SMX: GETSEC.
-UD2, RSM, RDMSR, WRMSR, HLT, MONITOR, MWAIT, XSETBV, VZEROUPPER, MASKMOVQ, and V / MASKMOVDQU.

ランタイムの考慮事項
命令ベースの考慮事項に加えて、ランタイム・イベントによりトランザクション実行がアボートされる場合がある。これは、データ・アクセス・パターン又はマイクロ・アーキテクチャの実装機能に起因し得る。以下のリストは、全てのアボートの原因を包括的に説明したものではない。
Runtime Considerations In addition to instruction-based considerations, runtime events may abort transaction execution. This may be due to data access patterns or the implementation capabilities of the micro-architecture. The following list is not a comprehensive description of the causes of all aborts.

ソフトウェアに対して暴露しなければならないトランザクションのフォルト又はトラップは抑止される。トランザクション実行がアボートすると、フォルト又はトラップが発生しなかったように、実行は非トランザクション実行に遷移する。例外がマスクされない場合、そのマスクされない例外はトランザクション・アボートを引き起こし、状態は、例外が発生しなかったように見える。   Transaction faults or traps that must be exposed to software are suppressed. When transaction execution aborts, execution transitions to non-transactional execution as if no fault or trap had occurred. If the exception is not masked, the unmasked exception causes a transaction abort and the state appears as if the exception had not occurred.

トランザクション実行中に同期例外イベント(#DE、#OF、#NP、#SS、#GP、#BR、#UD、#AC、#XF、#PF、#NM、#TS、#MF、#DB、#BP/INT3)が発生すると、トランザクション実行はコミットされず、非トランザクション実行が必要となる場合がある。これらのイベントは、発生しなかったかのように抑止される。HLEでは、非トランザクション・コード経路はトランザクション・コード経路と同一であるため、例外を引き起こした命令が非トランザクションに再実行されると、これらのイベントは再度現れ、非トランザクション実行で関連する同期イベントが適切に配信される。トランザクション実行中に非同期イベント(NMI、SMI、INTR、IPI、PMI等)が発生すると、トランザクション実行はアボートされ、非トランザクション実行に遷移し得る。非同期イベントは保留され、トランザクション・アボートが処理された後に処理される。   Synchronous exception events (#DE, #OF, #NP, #SS, #GP, #BR, #UD, #AC, #XF, #PF, #NM, #TS, #MF, #DB, When # BP / INT3) occurs, transaction execution is not committed, and non-transaction execution may be required. These events are suppressed as if they had not occurred. In the HLE, the non-transactional code path is identical to the transactional code path, so that when the instruction that caused the exception is re-executed to the non-transaction, these events reappear and the associated synchronization event in non-transactional execution Delivered properly. If an asynchronous event (NMI, SMI, INTR, IPI, PMI, etc.) occurs during transaction execution, transaction execution may be aborted and transition to non-transactional execution. Asynchronous events are suspended and processed after the transaction abort has been processed.

トランザクションは、ライトバック・キャッシュが可能なメモリ・タイプの操作のみをサポートする。トランザクションがいずれかの他のメモリ・タイプの操作を含む場合、トランザクションは常にアボートし得る。これには、UCメモリ・タイプにフェッチする命令が含まれる。   Transactions only support write-back cacheable memory-type operations. If a transaction involves operations of any other memory type, the transaction can always abort. This includes instructions fetching into the UC memory type.

トランザクション領域内のメモリ・アクセスには、プロセッサが参照するページ・テーブル・エントリのアクセス(Accessed)フラグ及びダーティ(Dirty)フラグを設定しなければならないことがある。プロセッサがこの制御をどのように行うかの挙動は、実装固有である。一部の実装では、トランザクション領域が続いてアボートされた場合でも、これらのフラグに対する更新を外部から見えるようにすることが可能である。一部のIntel(登録商標)TSXの実装では、これらのフラグを更新する必要がある場合、トランザクション実行のアボートを選択することがある。さらに、プロセッサのページ・テーブル・ウォークが、それ自体に書き込まれるが、コミットされていない状態へのアクセスをもたらす場合がある。一部のIntel(登録商標)TSXの実装では、このような状況でトランザクション領域の実行のアボートを選択することがある。それにも関わらず、アーキテクチャは、トランザクション領域がアボートした場合、トランザクションに書き込まれた状態が、アーキテクチャ上、TLBのような構造の挙動により目に入らないようにすることを保証する。   For the memory access in the transaction area, the access (Accessed) flag and the dirty (Dirty) flag of the page table entry referred to by the processor may need to be set. The behavior of how the processor performs this control is implementation specific. In some implementations, updates to these flags can be made visible externally, even if the transaction area is subsequently aborted. Some Intel (R) TSX implementations may choose to abort the transaction execution if these flags need to be updated. Further, the processor's page table walk may be written to itself, but result in access to an uncommitted state. Some Intel (R) TSX implementations may choose to abort execution of the transaction area in such situations. Nevertheless, the architecture ensures that if the transaction area aborts, the state written to the transaction is architecturally invisible to the behavior of a TLB-like structure.

自己修正(self-modifying)コードのトランザクション実行がトランザクション・アボートを引き起こすこともある。プログラマーは、HLE及びRTMを使用する場合でも、自己修正コード及びクロス修正コードの記述に際してIntel(登録商標)が推奨するガイドラインに引き続き従う必要がある。RTM及びHLEの実装では通常、共通のトランザクション領域を実行するための十分なリソースが提供されるが、トランザクション領域の実装を制約したり、サイズを必要以上に大きくすると、トランザクション実行がアボートされ、非トランザクション実行に遷移することがある。アーキテクチャは、トランザクション実行で利用可能なリソース量を保証せず、また、トランザクション実行が常に成功することを保証しない。   Transaction execution of self-modifying code may cause a transaction abort. Even when using the HLE and RTM, the programmer must continue to follow the guidelines recommended by Intel® when writing self-correcting code and cross-correcting code. RTM and HLE implementations typically provide sufficient resources to execute a common transaction area, but constraining the transaction area implementation or making the size unnecessarily large aborts transaction execution, and It may transition to transaction execution. The architecture does not guarantee the amount of resources available for transaction execution, and does not guarantee that transaction execution will always succeed.

トランザクション領域内にアクセスするキャッシュラインに対して競合する要求を行うと、トランザクション実行の成功の妨げとなることがある。例えば、論理プロセッサP0がトランザクション領域内のラインAを読み取り、別の論理プロセッサP1がラインA(トランザクション領域の内部又は外部のいずれか)に書き込み、論理プロセッサP1の書き込みがプロセッサP0のトランザクション実行能力を妨げる場合には、論理プロセッサP0はアボートし得る。   If a conflicting request is made to a cache line accessed in the transaction area, the transaction execution may be prevented from succeeding. For example, the logical processor P0 reads the line A in the transaction area, another logical processor P1 writes the line A (either inside or outside the transaction area), and the writing of the logical processor P1 increases the transaction execution capability of the processor P0. If so, logical processor P0 may abort.

同様に、P0がトランザクション領域内のラインAに書き込み、P1がラインA(トランザクション領域の内部又は外部のいずれか)を読み取る又は書き込む場合にも、P1のラインAへのアクセスがP0のトランザクション実行能力を妨げる場合には、P0はアボートし得る。さらに、他のコヒーレンス・トラフィックが競合する要求として見え、アボートを引き起こすことがある。これら偽の競合(false conflict)が発生することはあるが、一般的ではないと考えられる。上記のシナリオにおいて、P0がアボートするか又はP1がアボートするかを決定するための競合解消ポリシーは、実装固有である。   Similarly, when P0 writes to line A in the transaction area and P1 reads or writes to line A (either inside or outside the transaction area), the access to line A of P1 is the transaction execution capability of P0. Can prevent P0 from aborting. In addition, other coherence traffic may appear as competing requests and cause aborts. These false conflicts may occur, but are considered uncommon. In the above scenario, the conflict resolution policy for determining whether P0 aborts or P1 aborts is implementation specific.

一般的なトランザクション実行の実施形態:
その全体を引用によりここに組み入れる非特許文献2によれば、基本的に、アトミックな及び分離された(isolated)トランザクション領域を実装するのに必要な3つの機構:即ち、バージョニング(versioning)、競合検出、及びコンテンション管理(contentionmanagement)が存在する。
General Transaction Execution Embodiment:
According to [2], which is hereby incorporated by reference in its entirety, there are basically three mechanisms required to implement atomic and isolated transaction areas: versioning, contention. There is detection and contention management.

トランザクション・コード領域がアトミックに見えるようにするために、そのトランザクション・コード領域により行われた全ての修正を、コミット時まで格納し、他のトランザクションから分離する必要がある。本システムは、バージョニング・ポリシーの実装によってこれを行う。2つのバージョニング・パラダイム:即ち、eager及びlazyが存在する。eagerバージョニング・システムは、新しく生成されたトランザクション値をイン・プレースに(in place)格納し、以前のメモリ値は、undo(取り消し)ログと呼ばれるものの中に別に格納する。lazyバージョニング・システムは、新しい値を、書き込みバッファと呼ばれるものの中に一時的に格納し、コミット時にのみこれらをメモリにコピーする。どちらのシステムにおいても、新しいバージョンの格納の最適化のために、キャッシュが使用される。   In order for a transaction code region to look atomic, all modifications made by that transaction code region must be stored until commit and isolated from other transactions. The system does this by implementing a versioning policy. There are two versioning paradigms: eager and lazy. The eager versioning system stores the newly generated transaction values in place and the previous memory values separately in what is called an undo (undo) log. Lazy versioning systems temporarily store new values in what is called a write buffer and copy them to memory only on commit. In both systems, a cache is used to optimize the storage of new versions.

トランザクションがアトミックに実行されるように見えることを保証するために、競合を検出し、解決する必要がある。2つのシステム、即ちeager及びlazyバージョニング・システムは、楽観的(optimistic)又は悲観的(pessimistic)のいずれかの競合検出ポリシーを実装することにより、競合を検出する。楽観的システムは、トランザクションを並行して実行し、トランザクションのコミット時にのみ競合をチェックする。悲観的システムは、ロード及びストアごとに競合をチェックする。バージョニングと同様に、競合検出もまたキャッシュを使用し、各ラインを読み取りセットの一部、書き込みセットの一部、又はその両方としてマーク付けする。2つのシステムは、コンテンション管理ポリシーを実装することにより、競合を解決する。多数のコンテンション管理ポリシーが存在し、一部は楽観的競合検出により適し、一部は悲観的競合検出により適している。幾つかの例示的なポリシーを以下に説明する。   Conflicts need to be detected and resolved to ensure that the transaction appears to execute atomically. Two systems, the eager and lazy versioning systems, detect conflicts by implementing either optimistic or pessimistic conflict detection policies. An optimistic system executes transactions in parallel and checks for conflicts only when the transaction commits. The pessimistic system checks for conflicts for each load and store. Like versioning, conflict detection also uses a cache and marks each line as part of a read set, part of a write set, or both. The two systems resolve the conflict by implementing a contention management policy. There are numerous contention management policies, some better suited for optimistic conflict detection and some better suited for pessimistic conflict detection. Some exemplary policies are described below.

各トランザクション・メモリ(TM)システムは、バージョニング検出と競合検出の両方を必要とするので、これらの選択肢は4つの個別のTM設計:Eager−悲観的(Pessimistic)(EP)、Eager−楽観的(Optimistic)(EO)、Lazy−悲観的(LP)、及びLazy−楽観的(LO)を生み出す。表2は、4つの個別のTM設計の全てを簡単に説明する。   Since each Transaction Memory (TM) system requires both versioning and contention detection, these options are available in four separate TM designs: Eager-Pessimistic (EP), Eager-Optimistic ( Optimistic (EO), Lazy-pessimistic (LP), and Lazy-optimistic (LO). Table 2 briefly describes all four individual TM designs.

図1及び図2は、マルチコアTM環境の一例を示す。図1は、相互接続制御120a、120bの管理下で、相互接続122と接続された、1つのダイ100上の多数のTM対応CPU(CPU1 114a、CPU2 114b等)を示す。各々のCPU114a、114b(プロセッサとしても知られる)は、実行されるメモリからの命令をキャッシュするための命令キャッシュ116a、116bと、CPU114a、114bによって動作されるメモリ位置のデータ(オペランド)をキャッシュするためのTMをサポートするデータ・キャッシュ118a、118bとから成る分割キャッシュ(split cache)を有することができる。1つの実装において、複数のダイ100のキャッシュが相互接続され、複数のダイ100のキャッシュ間のキャッシュ・コヒーレンシをサポートする。1つの実装においては、分割キャッシュではなく単一のキャッシュが使用され、命令及びデータの両方を保持する。1つの実装においては、CPUキャッシュは、階層キャッシュ構造におけるキャッシュ・レベル1である。例えば、各ダイ100は、共有キャッシュ124を、ダイ100上の全てのCPU114a、114bの間で共有されるように使用することができる。別の実装においては、各ダイ100は、全てのダイ100の全てのプロセッサの間で共有される共有キャッシュ124へのアクセスを有することができる。   1 and 2 show an example of a multi-core TM environment. FIG. 1 shows a number of TM-compatible CPUs (CPU1 114a, CPU2 114b, etc.) on one die 100 connected to an interconnect 122 under the control of the interconnect controls 120a, 120b. Each CPU 114a, 114b (also known as a processor) caches instruction caches 116a, 116b for caching instructions from memory to be executed and data (operands) at memory locations operated by CPUs 114a, 114b. And a split cache consisting of a data cache 118a, 118b that supports TM for storage. In one implementation, the caches of the dies 100 are interconnected to support cache coherency between the caches of the dies 100. In one implementation, a single cache, rather than a split cache, is used to hold both instructions and data. In one implementation, the CPU cache is at cache level 1 in a hierarchical cache structure. For example, each die 100 can use the shared cache 124 to be shared among all CPUs 114a, 114b on die 100. In another implementation, each die 100 may have access to a shared cache 124 that is shared among all processors on all dies 100.

図2は、TMをサポートするための追加物を含む、例示的なトランザクションCPU114の詳細を示す。トランザクションCPU114(プロセッサ)は、レジスタ・チェックポイント126及び特殊TMレジスタ128をサポートするためのハードウェアを含むことができる。トランザクションCPUキャッシュは、従来のキャッシュのMESIビット130、タグ140及びデータ142を含むことができるが、同様に、例えば、トランザクション実行中にCPU114によりラインが読み取られたことを示すRビット132と、トランザクション実行中にCPU114によりラインに書き込まれたことを示すWビット138とを含むことができる。   FIG. 2 shows details of an exemplary transaction CPU 114, including additionals to support TM. The transaction CPU 114 (processor) may include hardware to support register checkpoints 126 and special TM registers 128. The transaction CPU cache may include the MESI bit 130, tag 140, and data 142 of a conventional cache, as well as, for example, an R bit 132 indicating that a line was read by the CPU 114 during execution of the transaction, A W bit 138 indicating that the line was written by the CPU 114 during execution.

いずれのTMシステムにおいても、プログラマーにとって重要な詳細は、非トランザクション・アクセスがどのようにトランザクションと対話するかである。意図的に、トランザクション・アクセスは、上記の機構を用いて互いから遮蔽される。しかしながら、通常の非トランザクション・ロードと、そのアドレスについての新しい値を含むトランザクションとの間の対話を依然として考慮する必要がある。さらに、非トランザクション・ストアとそのアドレスを読み取ったトランザクションとの間の対話も検討する必要がある。これらは、データベースの概念分離の問題である。   An important detail for any programmer in any TM system is how non-transactional access interacts with the transaction. By design, transaction access is shielded from each other using the mechanism described above. However, the interaction between the normal non-transactional load and the transaction containing the new value for that address still needs to be considered. In addition, the interaction between the non-transactional store and the transaction that read its address must be considered. These are issues of database concept separation.

あらゆる非トランザクション・ロード及びストアがアトミック・トランザクションのように動作する場合、TMシステムは、強い分離性(strong isolation)(強いアトミック性(strong atomicity)と呼ばれることもある)を実装すると言われる。従って、非トランザクション・ロードは、コミットされないデータを見ることができず、非トランザクション・ストアは、そのアドレスを読み取ったいずれのトランザクションにおいても、アトミック性違反を引き起こす。これが当てはまらないシステムは、弱いアトミック性(weak atomicity)と呼ばれることもある、弱い分離性(weakisolation)を実装すると言われる。   If every non-transactional load and store behaves like an atomic transaction, the TM system is said to implement strong isolation (sometimes called strong atomicity). Thus, non-transactional loads cannot see uncommitted data, and non-transactional stores cause an atomicity violation in any transaction that has read its address. Systems for which this is not the case are said to implement weak isolation, sometimes called weak atomicity.

強い分離性の概念化及び実装が相対的に容易であるため、強い分離性は、弱い分離性よりも望ましいことが多い。さらに、プログラマーが何らかの共有メモリ参照をトランザクションで囲うことを忘れた場合、バグが生じ、強い分離性では、プログラマーはアトミック性違反を引き起こす非トランザクション領域を見るので、プログラマーは、単一のデバッグ・インターフェースを用いて見落としを検出することが多い。また、1つのモデルにおいて書かれたプログラムは、別のモデル上では異なるように動作する場合がある。   Strong separability is often more desirable than weak separability because strong separability is relatively easy to conceptualize and implement. In addition, if the programmer forgets to enclose some shared memory reference in a transaction, a bug arises, and with strong isolation, the programmer sees a non-transactional region that causes an atomicity violation, so the programmer needs a single debug interface. Is often used to detect oversight. A program written in one model may operate differently on another model.

さらに、強い分離性は、弱い分離性よりもハードウェアTMにおいてサポートが容易であることが多い。強い分離性では、コヒーレンス・プロトコルが既にプロセッサ間のロード及びストア通信を管理しているので、トランザクションは、非トランザクション・ロード及びストアを検出し、適切に動作することができる。ソフトウェア・トランザクション・メモリ(TM)において強い分離性を実装するためには、非トランザクション・コードを、読み取りバリア(read barrier)及び書き込みバリア(write barrier)を含むように修正する必要があり、性能を損なう可能性がある。多くの不要なバリアを取り除くために多大な努力が費やされてきたが、こうした技術は複雑であることが多く、性能は、通常、HTMのものに比べてはるかに低い。

Figure 0006642806
Further, strong separability is often easier to support in hardware TM than weak separability. With strong isolation, transactions can detect non-transactional loads and stores and operate properly because the coherence protocol already manages load and store communications between processors. In order to implement strong isolation in software transaction memory (TM), non-transactional code must be modified to include read and write barriers, thus increasing performance. May be impaired. Although much effort has been expended to remove many unwanted barriers, such techniques are often complex and performance is typically much lower than that of HTMs.
Figure 0006642806

表2は、トランザクション・メモリの基本的な設計空間を示す(バーショニング及び競合検出)。   Table 2 shows the basic design space of the transaction memory (versioning and conflict detection).

Eager−悲観的(EP)
後述するこの最初のTM設計は、Eager−悲観的として知られる。EPシステムは、その書き込みセットを「イン・プレースに」格納し(従って、「eager」の名がある)、かつ、ロールバックをサポートするために、上書きされたラインの古い値を「undoログ」に格納する。プロセッサは、Wキャッシュ・ビット138及びRキャッシュ・ビット132を用いて、読み取り及び書き込みセットを追跡し、スヌープした(snooped)ロード要求を受信したときに競合を検出する。恐らく、既知の文献におけるEPシステムの最も顕著な例は、LogTM及びUTMである。
Eager-pessimistic (EP)
This first TM design described below is known as Eager-pessimistic. The EP system stores the write set "in place" (hence the name "eager") and, to support rollback, stores the old value of the overwritten line in an "undo log". To be stored. The processor uses the WCache bit 138 and the RCache bit 132 to keep track of the read and write sets and detect contention when receiving a snooped load request. Perhaps the most prominent examples of EP systems in the known literature are LogTM and UTM.

EPシステムにおけるトランザクションの開始は、他のシステムにおけるトランザクションの開始とよく似ている:tm_begin()がレジスタ・チェックポイントを取り、あらゆるステータス・レジスタを初期化する。EPシステムはまたundoログの初期化も必要とし、この詳細はログ・フォーマットに依存するが、多くの場合、予め割り当てられたスレッド・プライベート・メモリの領域へのログ・ベース・ポインタを初期化すること、及びログ境界レジスタをクリアすることを含む。   Starting a transaction in an EP system is very similar to starting a transaction in other systems: tm_begin () takes a register checkpoint and initializes any status registers. EP systems also require undo log initialization, the details of which depend on the log format, but often initialize a log base pointer to a pre-allocated area of thread private memory. And clearing the log boundary register.

バージョニング:EPにおいては、eagerバージョニングが機能するように設計される方法に起因して、MESI 130の状態遷移(Modified(修正)、Exclusive(排他)、Shared(共有)、及びInvalid(無効)のコード状態に対応するキャッシュライン・インジケータ)は、殆ど変更されないままである。トランザクションの外部では、MESI 130の状態遷移は、全く変更されないままである。トランザクション内部のラインを読み取るとき、標準的コヒーレンス遷移が適用され(S(Shared)→S、I(Invalid)→S、又はI→E(Exclusive))、必要に応じてロード・ミスを発行するが、Rビット132も設定される。同様に、ラインの書き込みに、標準的遷移が適用され(S→M、E→I、I→M)、必要に応じてミスを発行するが、加えてW(Write、書き込み)ビット138も設定する。現トランザクションがアボートした場合には、ラインが初めて書き込まれる際、ライン全体の古いバージョンをロードし、次に、undoログに書き込んで保存する。次に、新しく書き込まれたデータが、古いデータの上に「イン・プレースに」格納される。   Versioning: In EP, due to the way that eager versioning is designed to work, the state transition (Modified, Exclusive, Shared, and Invalid) codes for MESI 130. The cache line indicator corresponding to the state) remains almost unchanged. Outside the transaction, the state transitions of MESI 130 remain unchanged at all. When reading a line inside a transaction, a standard coherence transition is applied (S (Shared) → S, I (Invalid) → S, or I → E (Exclusive)), and issues a load miss if necessary. , R bit 132 is also set. Similarly, standard transitions are applied to line writes (S → M, E → I, I → M), issuing misses as needed, but also setting the W (Write, Write) bit 138 I do. If the current transaction aborts, the first time a line is written, it loads the old version of the entire line and then writes and saves it to the undo log. The newly written data is then stored "in place" over the old data.

競合検出:悲観的競合検出は、ミス、又はアップグレード時に交換されるコヒーレンス・メッセージを用いて、トランザクション間の競合を探す。トランザクション内で読み取りミスが発生すると、他のプロセッサはロード要求を受信するが、それらが必要とされるラインを有していない場合には、この要求を無視する。他のプロセッサが、必要とされるラインを非投機的に有する又はラインR132(Read、読み取り)を有する場合、このラインをSにダウングレードし、ある場合には、それらがMESIのM又はE状態でラインを有する場合、キャッシュ間転送(cash-to-cash transfer)を発行する。しかしながら、キャッシュがラインW138を有する場合には、2つのトランザクション間に競合が検出され、追加のアクションを取らなければならない。   Conflict Detection: Pessimistic conflict detection looks for conflicts between transactions using misses or coherence messages exchanged during upgrades. If a read miss occurs in the transaction, other processors will receive the load request, but will ignore this request if they do not have the required line. If other processors have the required line non-speculatively or have line R132 (Read, Read), downgrade this line to S, and in some cases, if they have MESI M or E state. If the line has a line, a cache-to-cash transfer is issued. However, if the cache has line W138, a conflict between the two transactions is detected and additional action must be taken.

同様に、(最初の書き込み時に)トランザクションがラインをsharedからmodifiedにアップグレードしようとした際、トランザクションは、競合の検出にも使用される排他的ロード要求を発行する。受信しているキャッシュがラインを非投機的に有する場合、次に、そのラインは無効にされ、特定の場合には、キャッシュ間転送(M又はE状態)が発行される。しかしながら、このラインがR132又はW138である場合には、競合が検出される。   Similarly, when a transaction attempts to upgrade a line from shared to modified (during the first write), the transaction issues an exclusive load request that is also used to detect conflicts. If the receiving cache has the line non-speculatively, then the line is invalidated and, in certain cases, an inter-cache transfer (M or E state) is issued. However, if this line is R132 or W138, a conflict is detected.

妥当性検査:競合検出はあらゆるロードで実施されるので、トランザクションは常に、それぞれの書き込みセットに対する排他的アクセスを有する。従って、妥当性検査は、いずれの付加的な作業も必要としない。   Validation: Transactions always have exclusive access to each write set since conflict detection is performed on every load. Therefore, validation does not require any additional work.

コミット:eagerバージョニングはデータ項目の新たなバージョンをイン・プレースに格納するので、コミット・プロセスは、単にWビット138及びRビット132をクリアし、undoログを廃棄する。   Commit: Since eager versioning stores the new version of the data item in place, the commit process simply clears the W bit 138 and the R bit 132 and discards the undo log.

アボート:トランザクションがロールバックすると、undoログ内の各キャッシュラインのオリジナルのバージョンを復元しなければならず、プロセスは、ログの「アンロール(unrolling)」又は「適用」と呼ばれる。これは、tm_discard()の間に行われ、他のトランザクションに関してアトミックでなければならない。具体的には、競合を検出するために、書き込みセットを依然として使用しなければならない:このトランザクションは、そのundoログ内にラインの正しいバージョンのみを有し、要求中のトランザクションは、そのログから正しいバージョンを復元するのを待たなくてはならない。こうしたログは、ハードウェア状態マシン又はソフトウェア・アボート・ハンドラを用いて適用することができる。   Abort: When a transaction rolls back, the original version of each cache line in the undo log must be restored, and the process is called "unrolling" or "applying" the log. This is done during tm_discard () and must be atomic with respect to other transactions. Specifically, the write set must still be used to detect conflicts: this transaction has only the correct version of the line in its undo log, and the requesting transaction has the correct You have to wait for the version to be restored. These logs can be applied using a hardware state machine or a software abort handler.

Eager−悲観的は、以下の特徴を有する:コミットは単純であり、イン・プレースにあるため非常に高速である。同様に、妥当性検査はノー・オペレーション(no−op)である。悲観的競合検出は、競合を早期に検出し、それにより、「失敗させられた(doomed)」トランザクションの数が減少する。例えば、2つのトランザクションが、Write−After−Read依存関係に関与する場合、その依存関係は、悲観的競合検出において瞬時に検出される。しかしながら、楽観的競合検出においては、ライタ(writer)がコミットするまで、そうした競合は検出されない。   Eager-Pessimistic has the following characteristics: Commit is simple and very fast because it is in place. Similarly, validation is a no-op. Pessimistic conflict detection detects conflicts early, thereby reducing the number of "doomed" transactions. For example, if two transactions participate in a Write-After-Read dependency, that dependency is detected instantaneously in pessimistic conflict detection. However, optimistic conflict detection does not detect such conflicts until the writer commits.

Eager−悲観的はまた、以下の特徴も有する:上述したように、初めてキャッシュラインに書き込まれる際、古い値をログに書き込む必要があり、余分なキャッシュ・アクセスを招く。アボートはログの取り消し(undo)を必要とするため、費用がかかる。ロードは、ログ内のキャッシュラインごとに発行しなければならず、恐らく、次のラインに進む前にメインメモリまで前進する。悲観的競合検出はまた、特定のシリアル化可能なスケジュールの存在を防止する。   Eager-Pessimistic also has the following characteristics: As mentioned above, when first written to a cache line, the old values need to be written to the log, resulting in extra cache accesses. Aborts are expensive because they require undoing the log. The load must be issued for each cache line in the log, and will probably advance to main memory before proceeding to the next line. Pessimistic conflict detection also prevents the presence of certain serializable schedules.

さらに、競合は、それらが発生した時に処理されるので、ライブロック(livelock)の可能性があり、前方進行を保証するために、慎重なコンテンション管理機構を利用しなければならない。   In addition, conflicts are handled when they occur, so there is the potential for livelocks and careful contention management mechanisms must be used to ensure forward progress.

Lazy−楽観的(LO)
別の一般的なTM設計は、Lazy−楽観的(LO)であり、これは、その書き込みセットを「書き込みバッファ」又は「redoログ」に格納し、コミット時に競合を検出する(依然として、R及びWビットを使用する)。
Lazy-Optimistic (LO)
Another common TM design is Lazy-optimistic (LO), which stores its write set in a "write buffer" or "redo log" and detects conflicts at commit (still R and Use W bit).

バージョニング:EPシステムと同様に、LO設計のMESIプロトコルが、トランザクションの外側で実施される。トランザクションの内部に入ると、ラインの読み取りは標準的MESI遷移を招くが、同様にRビット132も設定する。同様に、ラインの書き込みは、ラインのWビット138を設定するが、LO設計のMESI遷移の処理は、EP設計のものとは異なる。第1に、lazyバージョニングにおいては、書き込まれたデータの新しいバージョンは、コミットまでキャッシュ階層に格納されるが、他のトランザクションは、メモリ又は他のキャッシュにおいて利用可能な古いバージョンにアクセスすることができる。古いバージョンを利用可能にするために、トランザクションによる最初の書き込み時に、ダーティ・ライン(Mライン)を無効化しなければならない。第2に、楽観的競合検出の特徴のため、アップグレード・ミスは必要とされない:競合検出はコミット時に行われるので、トランザクションがS状態のラインを有する場合、トランザクションは単にラインに書き込み、変更を他のトランザクションと通信することなく、そのラインをM状態にアップグレードするだけでよい。   Versioning: Similar to the EP system, the LO design MESI protocol is implemented outside the transaction. Once inside the transaction, reading the line will cause a standard MESI transition, but will also set the R bit 132. Similarly, writing a line sets the W bit 138 of the line, but the processing of the MESI transition in the LO design is different from that in the EP design. First, in lazy versioning, new versions of the written data are stored in the cache hierarchy until commit, while other transactions can access older versions available in memory or other caches. . To make the old version available, the dirty line (M line) must be invalidated on the first write by the transaction. Second, due to the optimistic conflict detection feature, no upgrade misses are required: since conflict detection is performed at commit, if the transaction has a line in S state, the transaction simply writes to the line and changes the other. It is only necessary to upgrade that line to the M state without communicating with this transaction.

競合検出及び妥当性検査:トランザクションを検証し、競合を検出するために、LOは、コミットの準備をしているときのみ、投機的に修正されたラインのアドレスを他のトランザクションに通信する。妥当性検査において、プロセッサは、書き込みセット内の全てのアドレスを含む、1つの、恐らくは大容量の、ネットワーク・パケットを送信する。データは送信されないが、コミッタ(committer)のキャッシュ内に残され、ダーティ(M)とマーク付けされる。Wとマーク付けされたラインを求めてキャッシュを検索することなくこのパケットを構築するために、これらの投機的に修正されたラインを追跡するために、キャッシュラインごとに1ビットを有する、「ストア・バッファ」と呼ばれる簡潔ビットベクトル(simple bit vector)を使用する。他のトランザクションは、このアドレス・パケットを使用して競合を検出する:アドレスがキャッシュ内に見つかり、Rビット132及び/又はWビット138が設定された場合、競合が開始される。ラインは見つかったが、R132もW138も設定されない場合には、ラインは単に無効にされ、これは排他的ロードの処理に類似している。   Conflict Detection and Validation: To verify transactions and detect conflicts, the LO communicates the address of the speculatively modified line to other transactions only when preparing for a commit. In validation, the processor sends a single, possibly large, network packet containing all addresses in the write set. No data is transmitted, but is left in the committer's cache and marked as dirty (M). To keep track of these speculatively modified lines, in order to build this packet without searching the cache for lines marked W, one bit per cache line, the "Store Use a simple bit vector called a "buffer". Other transactions use this address packet to detect conflicts: if the address is found in the cache and R bit 132 and / or W bit 138 are set, a conflict is initiated. If the line is found but neither R132 nor W138 is set, the line is simply invalidated, which is similar to processing an exclusive load.

トランザクションのアトミック性をサポートするために、これらのアドレス・パケットをアトミックに処理しなければならない、即ち、同じアドレスに対して2つのアドレス・パケットが同時に存在することはできない。LOシステムにおいては、これは、アドレス・パケットを送信する前に、単にグローバル・コミット・トークンを獲得することにより達成することができる。しかしながら、最初にアドレス・パケットを送信し、応答を収集し、順序付けプロトコルを実施し(恐らく最も古いトランザクションを先頭に)、そして、全ての応答が満たされた場合にコミットすることによって、2段階コミット・スキームを用いることもできる。   In order to support the atomicity of the transaction, these address packets must be processed atomically, ie no two address packets can exist for the same address at the same time. In a LO system, this can be achieved by simply obtaining a global commit token before sending the address packet. However, a two-phase commit by first sending the address packet, collecting the responses, implementing the ordering protocol (perhaps the oldest transaction first), and committing if all responses are satisfied -A scheme can also be used.

コミット:ひとたび妥当性検査が行われると、コミットは、いかなる特別な処理も必要とせず、単にWビット138及びRビット132、並びにストア・バッファをクリアするだけである。トランザクションの書き込みは既にキャッシュ内でダーティとしてマーク付けされており、これらのラインの他のキャッシュのコピーは、アドレス・パケットにより無効にされる。次に、他のプロセッサは、通常のコヒーレンス・プロトコルを通じてコミットされたデータにアクセスすることができる。   Commit: Once validated, commit does not require any special processing, it simply clears the W bit 138 and R bit 132, and the store buffer. The transaction write has already been marked dirty in the cache, and other cache copies of these lines are invalidated by the address packet. The other processors can then access the committed data through the normal coherence protocol.

アボート:ロールバックは等しく容易である:書き込みセットがローカル・キャッシュ内に含まれているので、これらのラインを無効にすることができ、次に、Wビット138及びRビット132、並びにストア・バッファをクリアする。ストア・バッファは、キャッシュを検索する必要なしに、Wラインを見つけて無効にすることを可能にする。   Abort: Rollback is equally easy: these lines can be invalidated because the write set is contained in the local cache, then the W bit 138 and R bit 132, and the store buffer Clear The store buffer allows the W line to be found and invalidated without having to search the cache.

Lazy−楽観的は、以下の特徴を有する:即ち、アボートは非常に高速であり、付加的なロード又はストアを必要とせず、ローカル変更のみを行う。EPにおいて見出されるよりも多くのシリアル化可能なスケジュールが存在することができ、これにより、トランザクションが独立であることを、LOシステムがより積極的に推測することが可能になり、そのことはより高い性能をもたらし得る。最終的に、競合検出が遅いと前方進行の可能性が高くなり得る。   Lazy-optimistic has the following characteristics: aborts are very fast, do not require additional loads or stores, and only make local changes. There can be more serializable schedules than found in the EP, which allows the LO system to more aggressively infer that transactions are independent, which Can result in high performance. Finally, slower competition detection may increase the likelihood of forward progress.

Lazy−楽観的はまた、以下の特徴を有する:即ち、妥当性検査では、書き込みセットのサイズに比例してグローバル通信時間を要する。コミット時にしか競合が検出されないので、失敗させられたトランザクションは無駄な作業になり得る。   Lazy-optimistic also has the following characteristics: Validation takes global communication time in proportion to the size of the write set. A failed transaction can be a waste of work, as conflicts are only detected at commit time.

Lazy−悲観的(LP)
Lazy−悲観的(LP)は、EPとLOとの間のどこかに位置する第3のTM設計選択肢を表し:新しく書き込まれたラインを書き込みバッファに格納するが、アクセスごとに競合を検出する。
Lazy-pessimistic (LP)
Lazy-pessimistic (LP) represents a third TM design option located somewhere between EP and LO: store newly written lines in write buffer, but detect conflicts on every access .

バージョニング:バージョニングはLOのものと類似しているが、同一ではない:ラインの読み取りによりRビット132が設定され、ラインの書き込みによりWビット138が設定され、ストア・バッファは、キャッシュ内のWラインを追跡するために使用される。また、LOと同様に、トランザクションによる最初の書き込み時に、ダーティ(M)ラインを無効化しなければならない。しかしながら、競合検出は悲観的であるので、トランザクション・ラインをI,S→Mにアップグレードするときに、load exclusiveを実行しなければならず、これはLOとは異なる。   Versioning: Versioning is similar to, but not identical to, that of LO: reading a line sets the R bit 132, writing a line sets the W bit 138, and the store buffer stores the W line in the cache. Used to track. Also, like the LO, the dirty (M) line must be invalidated during the first write by the transaction. However, because conflict detection is pessimistic, a load exclusive must be performed when upgrading a transaction line from I, S to M, which is different from LO.

競合検出:LPの競合検出は、EPのものと同様に動作する:コヒーレンス・メッセージを用いて、トランザクション間の競合を探す。   Conflict Detection: LP conflict detection operates in the same way as EP: it looks for conflicts between transactions using coherence messages.

妥当性検査:EPにおけるように、悲観的競合検出は、どの時点でも、実行中のトランザクションがいずれの他の実行中のトランザクションとも競合しないことを保証し、従って、妥当性検査はノー・オペレーションである。   Validation: As in the EP, pessimistic conflict detection ensures that, at any point in time, a running transaction does not conflict with any other running transactions, so the validation is a no-operation is there.

コミット:LOにおけるように、コミットは、特別な処理を必要としない:単にWビット138及びRビット132、並びにストア・バッファをクリアするだけである。   Commit: As in LO, commit requires no special processing: it simply clears the W bit 138 and R bit 132, and the store buffer.

アボート:ロールバックもまた、LOのものに類似している:単にストア・バッファを用いて書き込みセットを無効にし、Wビット138及びRビット132、並びにストア・バッファをクリアするだけである。   Abort: Rollback is also similar to that of LO: simply invalidate the write set using the store buffer, clear the W bit 138 and R bit 132, and the store buffer.

LPは、以下の特徴を有する:LOと同様に、アボートは非常に高速である。EPと同様に、悲観的競合検出の使用により、「失敗させられた」トランザクションの数が低減する。EPと同様に、一部のシリアル化可能なスケジュールは許容されず、キャッシュ・ミスごとに競合検出を実施しなければならない。   LP has the following characteristics: Like LO, abort is very fast. As with EP, the use of pessimistic conflict detection reduces the number of "failed" transactions. As with the EP, some serializable schedules are not allowed and contention detection must be performed on every cache miss.

Eager−楽観的(EO)
バージョニングと競合検出の最終的な組み合わせは、Eager−楽観的(EO)である。EOは、HTMシステムにとって最適とはいえない選択肢であり得る:新しいトランザクション・バージョンはイン・プレースに書き込まれるので、競合の発生時に(即ち、キャッシュ・ミスの発生時に)競合に気付かざるを得ない。しかしながら、EOはコミット時まで競合の検出を待つので、これらのトランザクションは「ゾンビー(zombie)」になり、実行を続行し、リソースを浪費し、しかもアボートする「運命にある」。
Eager-Optimistic (EO)
The final combination of versioning and conflict detection is Eager-optimistic (EO). EO may be a sub-optimal option for HTM systems: new transaction versions are written in-place, so you must be aware of conflicts when conflicts occur (i.e., when a cache miss occurs). . However, as the EO waits for conflict detection until commit time, these transactions become "zombie", continue execution, waste resources, and abort.

EOは、STMにおいて有用であることが分かっており、Bartok−STM及びMcRTにより実装される。lazyバージョニングSTMは、読み取りごとに書き込みバッファをチェックし、最新の値を読み取っていることを保証する必要がある。書き込みバッファはハードウェア構造ではないので、高価であり、従って、write−in−placeを好む。付加的に、競合のチェックもまた、STMにおいて高価であるので、楽観的競合検出は、この操作をまとめて実行する利点をもたらす。   EO has been found useful in STM and is implemented by Bartok-STM and McRT. The lazy versioning STM needs to check the write buffer on each read to ensure that the latest value is being read. Write buffers are expensive because they are not hardware structures, and therefore prefer write-in-place. Additionally, optimistic conflict detection offers the advantage of performing this operation collectively, as conflict checking is also expensive in STM.

コンテンション管理
ひとたびシステムがそのトランザクションのアボートを決定すると、トランザクションがどのようにロールバックするかについて上述したが、競合には2つのトランザクションが関与するので、どのトランザクションをアボートすべきか、そのアボートをどのように開始すべきか、及びアボートされたトランザクションをいつ再試行すべきかのトピックを検討する必要がある。これらは、トランザクション・メモリの重要なコンポーネントである、コンテンション管理(CM)により対処されるトピックである。システムがどのようにアボートを開始するか、及び、競合においてどのトランザクションをアボートすべきかを管理する種々の確立された方法が後述される。
Contention Management Once the system decides to abort the transaction, we have discussed how a transaction rolls back, but since the conflict involves two transactions, it decides which transaction should be aborted, and which You need to consider topics such as how to start and when to retry an aborted transaction. These are topics addressed by contention management (CM), a key component of transaction memory. Various established methods of how the system initiates an abort and which transactions to abort in a conflict are described below.

コンテンション管理ポリシー
コンテンション管理(CM)ポリシーは、競合に関与するどのトランザクションをアボートすべきか、及び、アボートされたトランザクションをいつ再試行すべきかを決定する機構である。例えば、アボートされたトランザクションを瞬時に再試行することが最良の性能につながらない場合が多い。逆に、アボートされたトランザクションの再試行を遅延させるバックオフ機構を用いるが、より良い性能をもたらすことがある。STMは最初に最良のコンテンション管理ポリシーを見出すことに取り組んでおり、以下に概説したポリシーの多くは、もともとSTM向けに開発されたものである。
Contention Management Policy The contention management (CM) policy is a mechanism that determines which transactions involved in a conflict should be aborted and when to retry the aborted transaction. For example, retrying an aborted transaction instantaneously often does not lead to best performance. Conversely, using a back-off mechanism to delay the retry of an aborted transaction, but may result in better performance. The STM is initially working on finding the best contention management policy, and many of the policies outlined below were originally developed for the STM.

CMポリシーは、トランザクションのエイジ(age)、読み取りセット及び書き込みセットのサイズ、以前のアボート数などを含む、判断を行うための多数の尺度を利用する。こうした判断を行うための尺度の組み合わせは無限にあるが、特定の組み合わせを、複雑性が高い順に大まかに後述する。   CM policies make use of a number of measures to make decisions, including the age of the transaction, the size of the read and write sets, the number of previous aborts, and the like. Although there are an infinite number of combinations of measures for making such a determination, specific combinations will be roughly described in descending order of complexity.

幾つかの専門語を確立するために、最初に、競合においては、アタッカ(attacker)及びデフェンダ(defender)の両者が存在することに留意されたい。アタッカは、共有メモリ位置へのアクセスを要求しているトランザクションである。悲観的競合検出においては、アタッカは、load又はload exclusiveを発行するトランザクションである。楽観的競合検出においては、アタッカは、検証を行おうとするトランザクションである。デフェンダは、どちらの場合も、アタッカの要求を受け取るトランザクションである。   To establish some terminology, it should first be noted that in the competition, there are both attackers and defenders. An attacker is a transaction requesting access to a shared memory location. In pessimistic conflict detection, an attacker is a transaction that issues a load or a load exclusive. In optimistic conflict detection, an attacker is a transaction that is to be verified. A defender is a transaction that receives an attacker request in both cases.

積極的な(Aggressive)CMポリシーは、瞬時にかつ常にアタッカ又はデフェンダのいずれかを再試行する。LOにおいては、積極的とは、アタッカが常に勝つことを意味し、従って、積極的は、コミッタの勝利と呼ばれることもある。こうしたポリシーは、最も初期のLOシステムに使用された。EPの場合には、積極的は、デフェンダの勝利、又はアタッカの勝利のいずれかとすることができる。   Aggressive CM policies retry either the attacker or the defender instantly and always. In the LO, aggressive means that the attacker always wins, and thus aggressive is sometimes referred to as committer victory. These policies were used for the earliest LO systems. In the case of an EP, the aggressiveness can be either a defender win or an attacker win.

直ちに別の競合に直面する競合するトランザクションの再開は、必ず作業の無駄を引き起こす、即ち、相互接続される帯域幅がキャッシュ・ミスを再充填する。丁寧な(Polite)CMポリシーは、競合を再開する前に、指数関数的バックオフ(exponentialbackoff)を使用する(しかし、線形を用いることもできる)。スターベーション(starvation)、即ち、プロセスがスケジューラにより割り当てられたリソースを有していない状況を防止するために、指数関数的バックオフは、およそn回の再試行後、トランザクションの成功の勝算を大幅に高める。   Resuming a competing transaction immediately in the face of another conflict always causes a waste of work, i.e., the interconnected bandwidth refills cache misses. Polite CM policies use exponential backoff before resuming contention (but can also use linear). To prevent starvation, a situation in which a process does not have the resources allocated by the scheduler, exponential backoff significantly increases the chance of success of the transaction after approximately n retries. Enhance.

競合解決の別の手法は、アタッカ又はデフェンダをランダムにアボートすることである(ランダム化(Randomized)と呼ばれるポリシー)。こうしたポリシーは、不必要なコンテンションを回避するためのランダム化バックオフ・スキームと組み合わせることができる。   Another approach to conflict resolution is to randomly abort the attacker or defender (a policy called Randomized). These policies can be combined with a randomized backoff scheme to avoid unnecessary contention.

しかしながら、アボートするトランザクションを選択する際、ランダムな選択を行うことは、「多くの作業」を完了したトランザクションのアボートをもたらすことがあり、これによりリソースが無駄になり得る。こうした無駄を回避するために、どのトランザクションをアボートするかを決定するときに、トランザクションにおける完了した作業の量を考慮に入れることができる。作業の1つの尺度は、トランザクションのエイジとすることができる。他の方法として、Oldest、Bulk TM、Size Matters、Karma、及びPolkaが挙げられる。Oldestは、競合における若い方のトランザクションをアボートする単純なタイムスタンプである。Bulk TMはこのスキームを使用する。Size Mattersは、Oldestに類似しているが、トランザクションのエイジの代わりに、読み取り/書き込みワードの数が優先順位として用いられ、一定数のアボートの後、Oldestに戻る。Karmaは類似しており、書き込みセットのサイズを優先順位として用いる。次に、一定の時間バックオフした後、ロールバックが進行する。アボートされたトランザクションは、アボートされた後もその優先順位を保持する(従って、Karmaの名が付いている)。Polkaは、Karmaと同様であるが、所定の時間バックオフする代わりに、毎回指数関数的により多くバックオフする。   However, when selecting a transaction to abort, making a random selection may result in aborting a transaction that has completed "many work", which can waste resources. To avoid such waste, the amount of completed work in a transaction can be taken into account when deciding which transaction to abort. One measure of work may be the age of the transaction. Other methods include Oldest, Bulk ™, Size Matters, Karma, and Polka. Oldest is a simple timestamp that aborts the younger transaction in the conflict. Bulk TM uses this scheme. Size Matters is similar to Oldest, but instead of the age of the transaction, the number of read / write words is used as priority, and after a certain number of aborts, it returns to Oldest. Karma is similar and uses the size of the write set as the priority. Next, after backing off for a certain period of time, rollback proceeds. The aborted transaction retains its priority after being aborted (hence the name Karma). Polka is similar to Karma, but instead of backing off for a predetermined amount of time, it backs off more exponentially each time.

アボートは作業を無駄にするので、デフェンダがそのトランザクションを終了するまでアタッカをストールすることがより良い性能をもたらすという議論は理にかなっている。残念なことに、こうした単純なスキームは、容易にデッドロックをもたらす。   Since aborts waste work, it makes sense to stall the attacker until the defender finishes its transaction for better performance. Unfortunately, these simple schemes easily lead to deadlocks.

この問題を解決するために、デッドロック回避技術を用いることができる。Greedyは、デッドロックを回避するために2つの規則を用いる。第1の規則は、第1のトランザクションT1が第2のトランザクションT0よりも低い優先順位を有する場合、又は、T1が別のトランザクションを待っている場合、T1は、T0との競合時にアボートするというものである。第2の規則は、T1がT0よりも高い優先順位を有し、待機していない場合、T0は、T1のコミットまで待つか、アボートするか、又は待機を開始する(この場合、第1の規則が適用される)というものである。Greedyは、トランザクションのセットを実行するための期限についての何らかの保証を提供する。1つのEP設計(LogTM)は、Greedyに類似したCMポリシーを用いて、保守的なデッドロック回避によるストールを達成する。   To solve this problem, a deadlock avoidance technique can be used. Greedy uses two rules to avoid deadlocks. The first rule states that if the first transaction T1 has a lower priority than the second transaction T0, or if T1 is waiting for another transaction, T1 will abort on contention with T0. Things. The second rule is that if T1 has a higher priority than T0 and is not waiting, T0 will wait, abort, or start waiting until T1 commits (in this case, the first) Rules apply). Greedy provides some assurance about the deadline for executing a set of transactions. One EP design (LogTM) uses a CM policy similar to Greedy to achieve conservative deadlock avoidance stall.

例示的なMESIコヒーレンシ規則は、マルチプロセッサ・キャッシュ・システムのキャッシュラインが存在し得る4つの可能な状態、即ち、次のように定義される4つの可能な状態M、E、S、Iを提供する。:
Modified(M):キャッシュラインは現キャッシュ内にのみ存在し、ダーティである。即ち、キャッシュラインは、メインメモリ内の値から修正されている。キャッシュは、(もはや有効ではない)メインメモリ状態のいずれかの他の読み取りを可能にする前に、将来のいずれかの時点で、データをメインメモリにライトバックしなければならない。ライトバックによりラインはExclusive状態に変化する。
Exclusive(E):キャッシュラインは現キャッシュ内にのみ存在するが、クリーンである。即ち、キャッシュラインはメインメモリと一致する。キャッシュラインは、読み取り要求に応答して、いつでもShared状態に変わることが可能である。代替的に、キャッシュラインは、書き込みがなされると、Modified状態に変わることが可能である。
Shared(S):このキャッシュラインは、マシンの他のキャッシュ内に格納することができ、「クリーン」であることを示す。即ち、このキャッシュラインはメインメモリと一致する。ラインは、いつでも廃棄する(Invalid状態に変更する)ことができる。
Invalid(I):このキャッシュラインが、無効である(未使用である)ことを示す。
The exemplary MESI coherency rules provide four possible states in which a cache line of a multiprocessor cache system can exist, ie, four possible states M, E, S, I defined as follows: I do. :
Modified (M): The cache line exists only in the current cache and is dirty. That is, the cache line has been modified from the value in the main memory. At some point in the future, the cache must write data back to main memory before allowing any other reading of the main memory state (no longer valid). The line changes to the Exclusive state due to the write-back.
Exclusive (E): The cache line exists only in the current cache, but is clean. That is, the cache line matches the main memory. A cache line can change to the Shared state at any time in response to a read request. Alternatively, the cache line can change to the modified state when a write is made.
Shared (S): This cache line can be stored in other caches of the machine and indicates "clean". That is, this cache line matches the main memory. The line can be discarded (changed to Invalid state) at any time.
Invalid (I): Indicates that this cache line is invalid (unused).

MESIコヒーレンシ・ビットに加えて又はそこに符号化された、各キャッシュラインに対して、TMコヒーレンシ状態インジケータ(R132、W138)を設けることができる。R132インジケータは、現トランザクションがキャッシュラインのデータから読み取りを行ったことを示し、W138インジケータは、現トランザクションがキャッシュラインのデータに書き込みを行ったことを示す。   For each cache line encoded in addition to or in addition to the MESI coherency bits, a TM coherency status indicator (R132, W138) may be provided. The R132 indicator indicates that the current transaction has read from cache line data, and the W138 indicator indicates that the current transaction has written to cache line data.

TM設計の別の態様において、システムは、トランザクション・ストア・バッファを用いて設計される。2000年3月31日に出願され、その全体が引用により本明細書に組み入れられる、「Methods and Apparatus for Reordering and Renaming Memory References in a Multiprocessor Computer System」という名称の特許文献3は、少なくとも第1及び第2のプロセッサを有するマルチプロセッサ・コンピュータ・システムにおいて、メモリ参照を再順序付けし、再命名するための方法を教示する。第1のプロセッサは、第1のプライベート・キャッシュ及び第1のバッファを有し、第2のプロセッサは、第2のプライベート・キャッシュ及び第2のバッファを有する。この方法は、第1のプロセッサが受信した、データを格納する複数のゲート付きストア要求(gated store request)の各々について、第1のプライベート・キャッシュによって、データを含むキャッシュラインを排他的に取得するステップと、データを第1のバッファに格納するステップとを含む。第1のバッファが、第1のプロセッサから、特定のデータをロードするロード要求を受信すると、ロード及びストア操作のイン・オーダー・シーケンスに基づいて、特定のデータが、第1のバッファに格納されたデータの中から第1のプロセッサに提供される。第1のキャッシュが所定データのロード要求を第2のキャッシュから受信すると、エラー条件が示され、所定データのロード要求が第1のバッファに格納されたデータに対応する場合、プロセッサの少なくとも1つの現在の状態が以前の状態にリセットされる。   In another aspect of the TM design, the system is designed with a transaction store buffer. "Methods and Apparatus for Reordering and Renaming Memory References in a Multiprocessor Computer System, at least with the name of at least three patents, filed on March 31, 2000, which is incorporated herein by reference in its entirety. A method is taught for reordering and renaming memory references in a multiprocessor computer system having a second processor. The first processor has a first private cache and a first buffer, and the second processor has a second private cache and a second buffer. The method includes, for each of a plurality of gated store requests storing data, received by the first processor, exclusively obtaining a cache line containing the data by the first private cache. And storing the data in the first buffer. When the first buffer receives a load request from the first processor to load the particular data, the particular data is stored in the first buffer based on an in-order sequence of load and store operations. The data is provided to the first processor. When the first cache receives a request to load the predetermined data from the second cache, an error condition is indicated, and if the request to load the predetermined data corresponds to the data stored in the first buffer, at least one of the processors The current state is reset to the previous state.

1つのこうしたトランザクション・メモリ機能の主要実装コンポーネントは、トランザクション前の(pre-transaction)GR(汎用レジスタ)のコンテンツを保持するためのトランザクション・バックアップ・レジスタ・ファイル、トランザクション中にアクセスされたキャッシュラインを追跡するためのキャッシュ・ディレクトリ、トランザクションが終了するまでストアをバッファするためのストア・キャッシュ、及び種々の複雑な機能を実施するためのファームウェア・ルーチンである。本セクションでは、詳細な実装を説明する。   One major implementation component of such a transaction memory function is a transaction backup register file to hold the contents of a pre-transaction GR (General Purpose Register), a cache line accessed during the transaction. A cache directory for tracking, a store cache for buffering the store until the end of the transaction, and a firmware routine for performing various complex functions. This section describes the detailed implementation.

IBM zEnterprise EC12エンタープライズ・サーバの実施形態
IBM zEnterprise EC12エンタープライズ・サーバは、トランザクション・メモリにトランザクション実行(TX)を導入し、その全体が引用によりここに組み入れられる非特許文献3に部分的に説明される。
IBM zEnterprise EC12 Enterprise Server Embodiment The IBM zEnterprise EC12 Enterprise Server introduces transaction execution (TX) in transaction memory, partially described in Non-Patent Document 3, incorporated herein by reference in its entirety. .

表3は、例示的なトランザクションを示す。例えば他のCPUとの競合の繰り返しが原因で、あらゆる実行の試行においてアボート条件に遭遇し得るので、TBEGINで開始されたトランザクションが、TENDで常に成功裏に完了することは保証されない。このことは、プログラムが、例えば従来のロック・スキームを用いることにより、同じ操作を非トランザクション的に実行するためにフォールバック経路をサポートすることを必要とする。このことは、特にフォールバック経路が信頼できるコンパイラによって自動的に生成されない場合、プログラミング及びソフトウェア検証チームに著しい負担をかける。

Figure 0006642806
Table 3 shows an exemplary transaction. An abort condition can be encountered in every execution attempt, for example, due to repeated contention with other CPUs, so that a transaction started with TBEGIN is not guaranteed to always complete successfully in TEND. This requires that the program support a fallback path to perform the same operation non-transactionally, for example, by using a conventional locking scheme. This places a significant burden on the programming and software verification team, especially if the fallback path is not automatically generated by a trusted compiler.
Figure 0006642806

アボートされたトランザクション実行(TX)のトランザクションに対してフォールバック経路を提供する要件は、負担になり得る。共有データ構造で動作する多くのトランザクションは短いものであり、ぼんの数個の個別メモリ位置にタッチし、単純な命令しか使用しないと考えられる。これらのトランザクションに対して、IBM zEnterprise EC12は、制約付き(constrained)トランザクションの概念を導入する。通常の条件下で、CPU114は、制約付きトランザクションが、たとえ必要な再試行の数に厳密な制限を与えなくても最終的に成功裏に終了することを保証する。制約付きトランザクションは、TBEGINC命令で開始し、通常のTENDで終了する。制約付きトランザクション又は制約なしトランザクションとしてのタスクの実装は、一般的に、極めて匹敵する機能をもたらすが、制約付きトランザクションは、フォールバック経路に対する必要性を取り除くことにより、ソフトウェア開発を簡単化する。IBMのトランザクション実行アーキテクチャは、その全体が引用により本明細書に組み入れられる非特許文献4にさらに説明される。   The requirement to provide a fallback path for aborted transaction execution (TX) transactions can be burdensome. Many transactions that operate on shared data structures are short, touching only a few discrete memory locations and using only simple instructions. For these transactions, IBM zEnterprise EC12 introduces the concept of constrained transactions. Under normal conditions, the CPU 114 guarantees that the constrained transaction will eventually complete successfully, even without imposing a hard limit on the number of retries required. A constrained transaction starts with a TBEGINC instruction and ends with a normal TEND. While the implementation of tasks as constrained or unconstrained transactions generally provides very comparable functionality, constrained transactions simplify software development by eliminating the need for a fallback path. IBM's transaction execution architecture is further described in Non-Patent Document 4, which is incorporated herein by reference in its entirety.

制約付きトランザクションは、TBEGINC命令で開始する。TBEGINCで開始されたトランザクションは、プログラミング上の制約のリストに従わなければならない。そうでない場合には、プログラムはフィルタリング可能でない制約違反割り込み(non-filterable constraint-violation interruption)を利用する。例示的な制約として、これらに限定されるものではないが、トランザクションは最大32個の命令を実行することができる、全ての命令テキストはメモリの連続した256バイトの範囲内になければならない、トランザクションは前方を指示する相対分岐のみを含む(即ち、ループ又はサブルーチン呼び出しはない)、トランザクションはメモリの最大4つの位置合わせされたオクトワード(オクトワードは32バイトである)にアクセスすることができる、及び10進演算又は浮動小数点数演算のような複雑な命令を除外するための命令セットの制限を挙げることができる。最大4つの位置合わせされたオクトワードをターゲットにするアトミックcompare−and−swapの非常に強力な概念を含む、二重連結リスト(doubly linked list)−挿入/削除演算のような多くの一般的な演算を実行できるように、制約が選択される。同時に、制約は、将来のCPU実装が、制約の調整を必要とせずにトランザクションの成功を保証できるように保守的に選択されるが、それは、そうでない場合にソフトウェアの非互換性を招くためである。   A restricted transaction starts with a TBEGINC instruction. Transactions started with TBEGINC must follow a list of programming constraints. Otherwise, the program uses a non-filterable constraint-violation interruption. As an exemplary constraint, but not limited to, a transaction can execute up to 32 instructions, all instruction text must be within contiguous 256 bytes of memory, the transaction Contains only relative branches pointing forward (i.e., there are no loops or subroutine calls), and a transaction can access up to four aligned octowords in memory (the octoword is 32 bytes). And restrictions on the instruction set to exclude complex instructions such as decimal or floating point arithmetic. Doubly linked list-including many very powerful concepts of atomic compare-and-swap targeting up to four aligned octowords-many common operations such as insert / delete operations The constraints are selected so that the operation can be performed. At the same time, the constraints are conservatively chosen so that future CPU implementations can guarantee the success of the transaction without the need to adjust the constraints, otherwise this would lead to software incompatibilities. is there.

TBEGINCは、浮動小数点数レジスタ(FPR)制御及びプログラム割り込みフィルタリング・フィールドが存在せず、制御はゼロであると見なされる点を除いて、大部分は、Intel(登録商標)TSXにおけるXBEGIN又はIBM(登録商標)のzEC12サーバ上のXBEGINのように挙動する。トランザクションがアボートすると、命令アドレスは、制約付きトランザクションについての即時再試行及びアボート経路の不存在を反映して、命令の後ではなく、直接TBEGINCに戻される。   TBEGINC is mostly based on XBEGIN or IBM (in IBM® TSX) except that there is no floating point register (FPR) control and program interrupt filtering fields and control is considered to be zero. It behaves like XBEGIN on the zEC12 server. When a transaction aborts, the instruction address is returned directly to TBEGINC instead of after the instruction, reflecting immediate retries for the constrained transaction and the absence of the abort path.

ネスト化されたトランザクションは、制約付きトランザクション内で許容されないが、TBEGINCが非制約付きトランザクション内で行われた場合には、TBEGINと同様に新しい非制約付きネスト・レベルを開くものとして扱われる。このことは、例えば、非制約付きトランザクションが制約付きトランザクションを内部で使用するサブルーチンを呼び出した場合などに起こり得る。   Nested transactions are not allowed in constrained transactions, but if TBEGINC is performed in an unconstrained transaction, it is treated as opening a new unconstrained nesting level, similar to TBEGIN. This can occur, for example, when an unconstrained transaction calls a subroutine that uses a constrained transaction internally.

割り込みフィルタリングは暗黙的にオフにされるので、制約付きトランザクション中の全ての例外は、オペレーティング・システム(OS)への割り込みをもたらす。最終的なトランザクションの終了の成功は、いずれかの制約付きトランザクションによりタッチされたせいぜい4ページをページインするOSの能力に依存する。OSはまた、トランザクションが完了するのを可能にするのに十分に長いタイムスライスも保証しなければならない。

Figure 0006642806
Since interrupt filtering is implicitly turned off, every exception during a constrained transaction results in an interrupt to the operating system (OS). The successful completion of the final transaction depends on the OS's ability to page in at most four pages touched by any constrained transaction. The OS must also guarantee a time slice long enough to allow the transaction to complete.
Figure 0006642806

表4は、制約付きトランザクションが他のロック・ベースのコードと対話しないと仮定する、表3のコードの制約付きトランザクション実装を示す。従って、ロック・テストは示されないが、制約付きトランザクションとロック・ベースのコードが混合された場合には、これを付加することができる。   Table 4 shows a constrained transaction implementation of the code in Table 3, assuming that the constrained transaction does not interact with other lock-based code. Thus, a lock test is not shown, but can be added if constrained transactions and lock-based code are mixed.

繰り返し障害が発生した場合、ソフトウェア・エミュレーションが、システム・ファームウェアの一部としてミリコードを用いて実施される。有利なことに、プログラマーから負担が取り除かれるので、制約付きトランザクションは所望の特性を有する。   In the event of repeated failures, software emulation is implemented using millicode as part of the system firmware. Advantageously, the constrained transaction has the desired properties, since the burden is removed from the programmer.

IBM zEnterprise EC12プロセッサは、トランザクション実行ファシリティを導入した。このプロセッサは、クロックサイクルごとに3つの命令をデコードすることができる。即ち、単純な命令は、単一のmicro−op(マイクロ・オペレーション)としてディスパッチされ、より複雑な命令は、複数のmicro−op232bに分割される。micro−op(図3に示されるUops232b)が、統合された発行キュー216に書き込まれ、そこから、それらをアウト・オブ・オーダー式に発行することができる。サイクルごとに、最大2つの固定小数点数命令、1つの浮動小数点数命令、2つのロード/ストア命令、及び2つの分岐命令を実行することができる。グローバル完了テーブル(GCT)232は、あらゆるmicro−op及びトランザクション・ネスト化深さ(transaction nesting depth、TND)232aを保持する。GCT232は、デコード時にイン・オーダー式に書き込まれ、各micro−opの実行ステータスを追跡し、最も古い命令グループの全てのmicro−op232bが成功裏に実行されると、命令を完了する。   The IBM zEnterprise EC12 processor introduced a transaction execution facility. The processor can decode three instructions every clock cycle. That is, a simple instruction is dispatched as a single micro-op (micro operation), and a more complicated instruction is divided into a plurality of micro-ops 232b. The micro-ops (Uops 232b shown in FIG. 3) are written to the integrated publish queue 216, from which they can be published out-of-order. Up to two fixed-point instructions, one floating-point instruction, two load / store instructions, and two branch instructions can be executed per cycle. Global Completion Table (GCT) 232 holds any micro-ops and transaction nesting depths (TND) 232a. The GCT 232 is written in-order at decode time to track the execution status of each micro-op, and completes the instruction when all micro-ops 232b of the oldest instruction group have been successfully executed.

レベル1(L1)データ・キャッシュ240(図3)は、256バイトのキャッシュライン及び4サイクルの使用待ち時間を有する96KB(キロバイト)の6ウェイ・アソシアティブ・キャッシュ(6-way associative cache)であり、L1ミスに対して7サイクルの使用待ち時間ペナルティを有して、プライベート1MB(メガバイト)の8ウェイ・アソシアティブ第2レベル(L2)データ・キャッシュ268(図3)に結合される。L1キャッシュ240(図3)は、プロセッサに最も近いキャッシュであり、Lnキャッシュは、第n番目のキャッシュ・レベルのキャッシュである。L1キャッシュ240(図3)及びL2キャッシュ268(図3)の両方とも、ストアスルー(store through)方式である。各々の中央処理装置(CP)チップ上の6つのコアは、48MBの第3レベル・ストアイン(store-in)方式キャッシュを共有し、6つのCPチップは、ガラス・セラミック・マルチチップ・モジュール(MCM)上に一緒にパッケージ化されたオフ・チップの384MBの第4レベル・キャッシュに接続される。最大4つのマルチチップ・モジュール(MCM)を、最大144個のコアを有するコヒーレントな対称マルチプロセッサ(SMP)システムに接続することができる(顧客のワークロードを実行するのに全てのコアが利用可能とは限らない)。   Level 1 (L1) data cache 240 (FIG. 3) is a 96 KB (kilobyte) 6-way associative cache with a cache line of 256 bytes and a latency of 4 cycles, It is coupled to a private 1MB (megabyte) 8-way associative second level (L2) data cache 268 (FIG. 3) with a 7 cycle use latency penalty for L1 misses. L1 cache 240 (FIG. 3) is the cache closest to the processor, and Ln cache is the cache at the nth cache level. Both the L1 cache 240 (FIG. 3) and the L2 cache 268 (FIG. 3) are of the store through type. The six cores on each central processing unit (CP) chip share a 48 MB third-level store-in cache, and the six CP chips are glass-ceramic multi-chip modules ( Connected to an off-chip 384 MB fourth level cache packaged together on the MCM). Up to four multi-chip modules (MCMs) can be connected to a coherent symmetric multi-processor (SMP) system with up to 144 cores (all cores available to run customer workloads) Not necessarily).

コヒーレンシは、MESIプロトコルの変形により管理される。キャッシュラインは、読み取り専用(shared)又はexclusiveで所有することができ、L1 240(図3)及びL2 268(図3)はストアスルー方式であり、従って、ダーティラインを含まない。L3及びL4のキャッシュはストアイン方式であり、ダーティ状態を追跡する。各キャッシュは接続された全ての下位レベルのキャッシュを含む。   Coherency is managed by a variant of the MESI protocol. Cache lines can be owned as read-only or exclusive, and L1 240 (FIG. 3) and L2 268 (FIG. 3) are store-through and therefore do not include dirty lines. The L3 and L4 caches are store-in and track the dirty state. Each cache includes all connected lower-level caches.

コヒーレンシ要求は「相互問い合わせ」(cross interrogate、XI)と呼ばれ、上位レベルのキャッシュから下位レベルのキャッシュにかつL4間で階層的に送信される。1つのコアがL1 240(図3)及びL2 268(図3)をミスし、ローカルL3からキャッシュラインを要求すると、L3は、L3がこのラインを所有するかどうかをチェックし、必要に応じて、コヒーレンシを保証するために、そのL3下で現在所有しているL2 268(図3)/L1 240(図3)にXIを送信してから、キャッシュラインを要求側に戻す。要求がL3もミスした場合、L3は要求をL4に送信し、L4は、XIをそのL4下の全ての必要なL3及び近隣のL4に送信することによって、コヒーレンシを実施する。次に、L4は要求中のL3に応答し、L3は応答をL2 268(図3)/L1 240(図3)に転送する。   The coherency request is called a "cross interrogate" (XI) and is sent hierarchically from a higher level cache to a lower level cache and between L4s. If one core misses L1 240 (FIG. 3) and L2 268 (FIG. 3) and requests a cache line from the local L3, L3 checks whether L3 owns this line and, if necessary, , Send XI to the currently owned L2 268 (FIG. 3) / L1 240 (FIG. 3) under its L3 to guarantee coherency, and then return the cache line to the requestor. If the request also misses L3, L3 sends the request to L4, which enforces coherency by sending XI to all required L3s under that L4 and neighboring L4s. Next, L4 responds to the requesting L3, which forwards the response to L2 268 (FIG. 3) / L1 240 (FIG. 3).

キャッシュ階層の包含の規則のために、要求から他のキャッシュラインへのアソシアティビティ・オーバーフローにより引き起こされた上位レベルのキャッシュに対するエビクション(eviction)が原因で、キャッシュラインが下位レベルのキャッシュから相互問い合わせされる(XI)ことに留意されたい。これらのXIは「LRU XI」と呼ぶことができ、ここでLRUは、最長時間未使用(least recently used)を意味する。   Due to the rules of inclusion of the cache hierarchy, cache lines are cross-interrogated from lower level caches due to eviction on higher level caches caused by associative overflow from requests to other cache lines. (XI). These XIs may be referred to as “LRU XI”, where LRU means least recently used.

さらに別のタイプのXI要求を参照すると、Demote−XIは、キャッシュ・オーナーシップを、exclusiveからread−only(読み取り専用)状態に遷移させ、Exclusive−XIは、キャッシュ・オーナーシップをexclusiveからinvalid状態に遷移させる。Demote−XI及びExclusive−XIは、元のXI送信者への応答を必要とする。ターゲット・キャッシュは、XIを「受け入れる」ことができ、又は、XIを受け入れる前に最初にダーティ・データをエビクトする必要がある場合には、「拒否」応答を送信することができる。L1キャッシュ240(図3)/L2キャッシュ268(図3)はストアスルー方式であるが、ストア・キュー内に、排他的状態をダウングレードする前にL3に送信する必要があるストアを有する場合には、demote−XI及びexclusive−XIを拒否することができる。拒否されたXIは、送信者により繰り返される。Read−only−XIは、ラインを読み取り専用で所有するキャッシュに送信され、こうしたXIを拒否することができないので、こうしたXIに対して応答は必要ない。SMPプロトコルの詳細は、その全体が引用により本明細書に組み入れられる非特許文献5により、IBM z10に関して説明されるものと類似している。   Referring to yet another type of XI request, Demote-XI transitions cache ownership from exclusive to read-only state, and Exclusive-XI transitions cache ownership from exclusive to invalid state. Transition to. Demote-XI and Exclusive-XI require a response to the original XI sender. The target cache can either "accept" the XI or send a "reject" response if it needs to first evict dirty data before accepting the XI. The L1 cache 240 (FIG. 3) / L2 cache 268 (FIG. 3) is a store-through scheme, but has a store in the store queue that needs to be sent to L3 before downgrading an exclusive state. Can reject demote-XI and exclusive-XI. The rejected XI is repeated by the sender. The Read-only-XI is sent to the cache that owns the line read-only and cannot respond to such XI, so no response is required for such XI. The details of the SMP protocol are similar to those described for IBM z10 by Non-Patent Document 5, which is incorporated herein by reference in its entirety.

トランザクション命令の実行
図3は、例示的なCPUの例示的なコンポーネントを示す。命令デコード・ユニット(IDU)208は、現トランザクション・ネスト化深さ(TND)212を常時監視している。IDU208がTBEGIN命令を受信すると、ネスト化深さがインクリメントされ、逆に、TEND命令時にはデクリメントされる。あらゆるディスパッチされた命令について、ネスト化深さがGCT232に書き込まれる。TBEGIN又はTENDが、後でフラッシュされる投機的経路上でデコードされると、IDU208のネスト化深さは、フラッシュされない最も若いGCT232エントリからリフレッシュされる。実行ユニットによる、大部分はロード/ストア・ユニット(LSU)280による消費のために、トランザクション状態も発行キュー216内に書き込まれる。TBEGIN命令は、TEND命令に到達する前にトランザクションがアボートした場合に状態情報を記録するためのトランザクション診断ブロック(TDB)を指定することができる。
Executing Transaction Instructions FIG. 3 illustrates exemplary components of an exemplary CPU. An instruction decode unit (IDU) 208 keeps track of the current transaction nesting depth (TND) 212. When IDU 208 receives a TBEGIN instruction, the nesting depth is incremented, and conversely, it is decremented upon a TEND instruction. The nesting depth is written to GCT 232 for every dispatched instruction. When TBEGIN or TEND is decoded on a speculative path that is later flushed, the nesting depth of IDU 208 is refreshed from the youngest GCT232 entry that is not flushed. The transaction state is also written into the issue queue 216, for consumption by the execution unit, mostly by the load / store unit (LSU) 280. The TBEGIN instruction may specify a transaction diagnostic block (TDB) for recording state information if the transaction aborts before reaching the TEND instruction.

ネスト化深さと同様に、IDU208/GCU232は、トランザクション・ネストを通じて、アクセス・レジスタ/浮動小数点数レジスタ(AR/FPR)修正マスクを協調的に追跡する。即ち、AR/FPR修正命令がデコードされ、修正マスクがそれをブロックすると、IDU208は、アボート要求をGCT232内に配置することができる。命令がnext−to−completeになると、完了がブロックされ、トランザクションがアボートする。制約付きトランザクション内にある間にデコードされた場合又は最大ネスト化深さを上回る場合、TBEGINも含む他の制限付き命令が同様に処理される。   Similar to nesting depth, IDU 208 / GCU 232 cooperatively tracks access register / floating point register (AR / FPR) modification masks through transaction nesting. That is, once the AR / FPR modification instruction is decoded and the modification mask blocks it, IDU 208 can place an abort request in GCT 232. When the instruction is next-to-complete, completion is blocked and the transaction aborts. If decoded while in a constrained transaction or exceeds the maximum nesting depth, other restricted instructions, including TBEGIN, are processed similarly.

最外TBEGINは、GR−Save−Maskに応じて、複数のmicro−opに分割され、各micro−op232bは、2つの固定小数点数ユニット(FXU)220の一方によって実行され、トランザクション・アボートに場合、1対のGR228を、GR228のコンテンツを後で復元するために用いられる特殊トランザクション・バックアップ・レジスタ・ファイル224内に保存する。TBEGINはまた、1が指定されている場合、TDBのアクセシビリティ・テストを実施するためのmicro−op232bも生成し、このアドレスは、アボートの場合に後で使用するために、専用レジスタ内に保存される。最外TBEGINのデコードにおいて、潜在的な後のアボート処理のために、TBEGINの命令アドレス及び命令テキストもまた、専用レジスタ内に保存される。   The outermost TBEGIN is divided into a plurality of micro-ops according to the GR-Save-Mask, and each micro-op 232b is executed by one of the two fixed-point number units (FXU) 220, and a transaction abort is performed. Save the pair of GRs 228 in a special transaction backup register file 224 that is used to later restore the contents of GR 228. TBEGIN also generates a micro-op 232b to perform an accessibility test of the TDB if 1 is specified, and this address is stored in a dedicated register for later use in the case of an abort. You. In decoding the outermost TBEGIN, the TBEGIN instruction address and instruction text are also stored in dedicated registers for potential subsequent abort processing.

TEND及びNTSTGは、単純なmicro−op232b命令である。NTSTG(非トランザクション・ストア(non-transactional store))は、発行キューにおいて非トランザクションとしてマーク付けされ、LSU280がそれを適切に処理できるようにする点を除いて、通常のストアのように処理される。TENDは、実行時にノー・オペレーションであり、TENDが完了したときに、トランザクションの終了が行われる。   TEND and NTSTG are simple micro-op 232b instructions. NTSTG (non-transactional store) is marked as non-transactional in the publishing queue and is treated like a normal store except that LSU 280 can process it properly. . TEND is a no-operation at run time, and the transaction ends when TEND completes.

上述のように、トランザクション内にある命令は、発行キュー216においてそのようにマーク付けされるが、他の点ではほぼ変更されずに実行され、LSU280は、次のセクションで説明されるように、分離追跡(isolation track)を行う。   As described above, the instructions within the transaction are marked as such in the issue queue 216, but otherwise executed with little change, and the LSU 280, as described in the next section, Perform an isolation track.

デコードはイン・オーダー式であり、かつ、IDU208は現在のトランザクション状態を常時監視し、これをトランザクションからの全ての命令と併せて発行キュー216内に書き込むことから、TBEGIN、TEND、並びにトランザクションの前、内部及び後の命令の実行は、アウト・オブ・オーダー式に実行することができる。実効アドレス計算器236が、LSU280内に含められる。TENDを最初に、トランザクション全体を次に実行し、最後にTBEGINを実行することさえ可能である(可能性は低いが)。プログラム順は、完了時にGCT232により復元される。汎用レジスタ(GR)228は、バックアップ・レジスタ・ファイル224から復元することができるので、トランザクションの長さは、GCT232のサイズによって制限されない。   The decoding is in-order and the IDU 208 constantly monitors the current transaction state and writes it in the issue queue 216 along with all instructions from the transaction, so TBEGIN, TEND, and , Internal and subsequent instruction execution can be performed out-of-order. An effective address calculator 236 is included in LSU 280. It is even possible (though unlikely) to perform TEND first, the entire transaction second, and finally TBEGIN. The program order is restored by the GCT 232 upon completion. Since the general purpose register (GR) 228 can be restored from the backup register file 224, the length of the transaction is not limited by the size of the GCT 232.

実行中、プログラム・イベント記録(PER)イベントが、イベント抑止制御に基づいてフィルタリングされ、PER TENDイベントは、イネーブルにされた場合に検出される。同様に、トランザクション・モードにある間、トランザクション診断制御によりイネーブルにされたときに、擬似乱数生成器がランダム・アボートを引き起こしていることがある。   During execution, program event recording (PER) events are filtered based on event suppression controls, and PER TEND events are detected when enabled. Similarly, while in transaction mode, the pseudo-random number generator may have caused a random abort when enabled by the transaction diagnostic control.

トランザクション分離の追跡
ロード/ストア・ユニットは、トランザクション実行中にアクセスされたキャッシュラインを追跡し、別のCPUからのXI(又はLRU−XI)がフットプリントと競合する場合にアボートをトリガする。競合するXIがexclusive又はdemote XIである場合、L3がXIを繰り返す前にトランザクションが終了することを期待して、LSUはXIを拒否してL3に戻す。この「押しのけ(stiff-arming)」は、高競合状態のトランザクションにおいて非常に有効である。2つのCPUが互いに押しのけ合う際のハングアップを防止するために、XI拒否カウンタが実装され、該XI拒否カウンタは、閾値が満たされると、トランザクション・アボートをトリガする。
Transaction Isolation Tracking The load / store unit keeps track of cache lines accessed during transaction execution and triggers an abort if XI (or LRU-XI) from another CPU conflicts with the footprint. If the competing XI is exclusive or demote XI, the LSU rejects the XI and returns to L3, expecting the transaction to end before L3 repeats the XI. This "stiff-arming" is very useful in high contention transactions. To prevent hang-up when the two CPUs push each other, an XI reject counter is implemented, which triggers a transaction abort when a threshold is met.

L1キャッシュ・ディレクトリ240は、従来より、スタティック・ランダム・アクセス・メモリ(SRAM)で実装される。トランザクション・メモリの実装では、ディレクトリの有効ビット244(64行×6ウェイ)は通常の論理ラッチに移動され、キャッシュラインごとにさらに2つのビット、即ちTX−読み取りビット248及びTX−ダーティビット252が補充される。   The L1 cache directory 240 is conventionally implemented with a static random access memory (SRAM). In a transaction memory implementation, the valid bits 244 of the directory (64 rows x 6 ways) are moved to a normal logical latch, and two more bits per cache line, a TX-read bit 248 and a TX-dirty bit 252, Be replenished.

新しい最外TBEGIN(先のまだ保留中のトランザクションに対してインターロックされる)がデコードされると、TX−読み取り248ビットがリセットされる。TX−読み取り248ビットは、発行キュー内で「トランザクショナル(transactional)」としてマーク付けされた全てのロード命令によって実行時に設定される。これは、投機的ロードが、例えば誤って予測された分岐経路上で実行される場合に、過剰なマーク付けをもたらし得ることに留意されたい。ロード完了時にTX−読み取りビットを設定する代替案は、複数のロードが同時に完了することがあり、ロード・キュー上に多数の読み取りポートを必要とすることから、シリコン面積に対して高価すぎるものであった。   When the new outermost TBEGIN (interlocked to the previous still pending transaction) is decoded, the TX-Read 248 bit is reset. TX-read 248 bits are set at run time by all load instructions marked as "transactional" in the issue queue. Note that this may result in over-marking if the speculative load is performed, for example, on a mispredicted branch path. An alternative to setting the TX-read bit at load completion is too expensive for silicon area because multiple loads can be completed simultaneously and require a large number of read ports on the load queue. there were.

ストアは、非トランザクション・モードと同じ方法で実行されるが、トランザクション・マークが、ストア命令のストア・キュー(STQ)260エントリ内に置かれる。ライトバック時に、STQ260からのデータがL1 240内に書き込まれるとき、書き込まれたキャッシュラインに関して、L1ディレクトリ256内のTX−ダーティ252ビットが設定される。L1 240へのストア・ライトバックは、ストア命令が完了した後にのみ行われ、サイクルごとにせいぜい1つのストアがライトバックされる。完了及びライトバックの前に、ロードは、ストア転送により、STQ260からのデータにアクセスすることができ、ライトバック後は、CPU114(図2)は、L1 240内の投機的に更新されたデータにアクセスすることができる。トランザクションが成功裏に終了した場合、全てのキャッシュラインのTX−ダーティビット252はクリアされ、STQ260において、まだ書き込まれていないストアのTX−マークもクリアされ、有効に保留中のストアを通常のストアに変える。   Stores are performed in the same manner as in non-transactional mode, except that a transaction mark is placed in the store queue (STQ) 260 entry of the store instruction. When data from STQ 260 is written into L1 240 during write back, the TX-Dirty 252 bit in L1 directory 256 is set for the written cache line. Store write-back to L1 240 occurs only after the store instruction has completed, and at most one store is written back per cycle. Before completion and write-back, the load can access the data from STQ 260 by store transfer, and after write-back, CPU 114 (FIG. 2) uses the speculatively updated data in L1 240 Can be accessed. If the transaction is successfully completed, the TX-Dirty bit 252 of all cache lines is cleared, and in STQ 260, the TX-mark of the store that has not been written is also cleared, and the store that is effectively pending is replaced with the normal store. Change to

トランザクションがアボートすると、全ての保留中のトランザクション・ストアは、既に完了したものでさえ、STQ260から無効にされる。L1 240内のトランザクションにより修正された、つまり、TX−ダーティビット252がオンにされ、その有効ビットがオフにされた、全てのキャッシュラインが、有効に、これらをL1 240キャッシュから瞬時に取り除く。   When the transaction aborts, all pending transaction stores, even those that have already completed, are invalidated from STQ 260. All cache lines modified by a transaction in L1 240, that is, the TX-Dirty bit 252 turned on and its valid bit turned off, will effectively remove them from the L1 240 cache instantly.

アーキテクチャは、新しい命令を完了する前に、トランザクションの読み取りセット及び書き込みセットの分離が保持されることを必要とする。この分離は、XIが保留中の適切な時点で命令の完了をストールすることにより確実にされる。投機的なアウト・オブ・オーダー式実行が許容され、保留中のXIが異なるアドレスに対するものであり且つ実際にトランザクション競合を引き起こさないと楽観的に仮定する。この設計は、アーキテクチャが必要とする強力なメモリ順序付けを保証するために従来のシステム上に実装されるXI対完了(XI-vs-completion)インターロックに非常に自然に適合する。   The architecture requires that the read set and write set separation of a transaction be maintained before completing a new instruction. This separation is ensured by the XI stalling the completion of the instruction at the appropriate time pending. Speculative out-of-order execution is allowed, optimistically assuming that the pending XI is to a different address and does not actually cause a transaction conflict. This design fits very naturally with XI-vs-completion interlocks implemented on conventional systems to ensure the strong memory ordering required by the architecture.

L1 240がXIを受信すると、L1 240はディレクトリにアクセスして、相互問い合わせ(XI)されたL1 240内のアドレスの有効性をチェックし、相互問い合わせ(XI)されたライン上でTX−読み取りビット248がアクティブであり、かつ、XIが拒否されない場合、LSU280がアボートをトリガする。アクティブなTX−読み取りビット248を有するキャッシュラインがL1 240から最長時間未使用(LRU)にされると、特別なLRU拡張ベクトルは、L1 240の64行の各々について、その行上にTX−読み取りラインが存在したことを思い出す。LRU拡張に対して正確なアドレス追跡は存在しないので、あらゆる拒否されないXIが有効な拡張行にヒットし、LSU280がアボートをトリガする。正確でないLRU拡張追跡に対する他のCPU114(図2)との競合がアボートを引き起こさなければ、LRU拡張の提供は、L1サイズからL2サイズまでの読み取りフットプリント能力及びアソシアティビティを有効に向上させる。   When L1 240 receives the XI, L1 240 accesses the directory, checks the validity of the address in the interrogated (XI) L1 240, and reads the TX-read bit on the interrogated (XI) line. If 248 is active and XI is not rejected, LSU 280 will trigger an abort. When a cache line with an active TX-read bit 248 is taken from L1 240 to Least Recently Used (LRU), a special LRU extension vector is created for each of the 64 rows of L1 240 with a TX-read on that row. Remember that the line existed. Since there is no exact address tracking for the LRU extension, any non-rejected XI will hit a valid extension row and the LSU 280 will trigger an abort. Provided that contention with other CPUs 114 (FIG. 2) for inaccurate LRU extension tracking does not cause an abort, providing LRU extensions effectively improves read footprint capability and associativity from L1 size to L2 size.

ストア・フットプリントは、ストア・キャッシュ・サイズ(ストア・キャッシュは、以下により詳細に説明される)によって、従って、L2サイズ及びアソシアティビティによって暗黙的に、制限される。TX−ダーティ・キャッシュラインがL1からLRU処理された場合、LRU拡張アクションを実施する必要はない。   The store footprint is limited by the store cache size (store cache is described in more detail below), and thus implicitly by L2 size and associativity. If a TX-dirty cache line is LRU processed from L1, there is no need to perform an LRU extension action.

ストア・キャッシュ
従来のシステムにおいて、L1 240及びL2 268はストアスルー・キャッシュであるので、全てのストア命令は、L3ストア・アクセスを引き起こし、今やL3ごとに6つのコアがあり、各コアの性能がさらに改善され、L3に関する(及びより少ない程度ではあるがL2に関する)ストア速度が、特定のワークロードに関して問題になる。ストア・キューイングの遅延を避けるために、ストアをL3に送信する前にストアを近隣のアドレスと組み合わせる、収集ストア・キャッシュを付加する必要がある。
Store Cache In conventional systems, since L1 240 and L2 268 are store-through caches, all store instructions cause an L3 store access, and now there are six cores per L3, and the performance of each core is Further improved, the store speed for L3 (and to a lesser extent L2) becomes a problem for certain workloads. To avoid store queuing delays, it is necessary to add a collection store cache that combines the store with a neighboring address before sending the store to L3.

トランザクション・メモリ性能については、L2キャッシュ268は、もう少しでクリーン・ラインを戻すので(7サイクルL1ミス・ペナルティ)、トランザクション・アボート時に、L1 240からのあらゆるTX−ダーティ・キャッシュラインを無効にすることが許容可能である。しかしながら、性能(及び追跡のためのシリコン領域)に関して、トランザクションが終了する前にトランザクション・ストアにL2 268を書き込ませ、次に、アボート時に(又はさらに悪いことには共有L3で)全てのダーティL2キャッシュラインを無効にすることは、許容可能でない。   For transaction memory performance, invalidate any TX-Dirty cache line from L1 240 upon transaction abort, as L2 cache 268 will return a clean line sooner (7 cycle L1 miss penalty). Is acceptable. However, in terms of performance (and silicon area for tracking), the transaction store is forced to write L2 268 before the transaction is completed, and then all dirty L2s at abort (or worse, with shared L3) Invalidating cache lines is not acceptable.

ストア帯域幅及びトランザクション・メモリ・ストア処理の2つの問題はどちらも、収集ストア・キャッシュ264で対処することができる。キャッシュ264は、64エントリの循環キューであり、各エントリは、バイト精度(byte-precise)の有効ビットを有する128バイトのデータを保持する。非トランザクション操作において、LSU280からストアを受信すると、ストア・キャッシュ264は、同じアドレスのエントリが存在するかどうかをチェックし、存在する場合には、新しいストアを既存のエントリに収集する。エントリが存在しない場合には、新しいエントリがキューに書き込まれ、空きエントリの数が閾値より下になる場合、最も古いエントリがL2キャッシュ268及びL3キャッシュにライトバックされる。   Both issues of store bandwidth and transactional memory store processing can be addressed with the collection store cache 264. The cache 264 is a 64-entry circular queue, with each entry holding 128 bytes of data with byte-precise valid bits. In a non-transactional operation, upon receiving a store from LSU 280, store cache 264 checks if an entry with the same address exists, and if so, gathers the new store into the existing entry. If no entry exists, a new entry is written to the queue, and if the number of free entries falls below the threshold, the oldest entry is written back to the L2 cache 268 and L3 cache.

新しい最外トランザクションが開始すると、ストア・キャッシュ264内の全ての既存のエントリは、新しいストアをそこに収集できないように、closedとしてマーク付けされ、L2 268及びL3に対するこれらのエントリのエビクションが開始される。その時点から、LSU280 STQ260から得られるトランザクション・ストアは、新しいエントリを割り当てる、又は既存のトランザクション・エントリに集まる。L2 268及びL3へのこれらのストアのライトバックは、トランザクションが成功裏に終了するまでブロックされ、その時点で、後の(トランザクション後の)ストアは、次のトランザクションがそれらのエントリを再び閉じるまで、引き続き既存のエントリ内に集めることができる。   When the new outermost transaction begins, all existing entries in the store cache 264 are marked as closed so that the new store cannot be collected there, and eviction of these entries to L2 268 and L3 begins. Is done. From that point on, the transaction store from LSU 280 STQ 260 allocates new entries or aggregates with existing transaction entries. Write-back of these stores to L2 268 and L3 will be blocked until the transaction is successfully completed, at which point the later (post-transaction) store will wait until the next transaction closes their entries again. , Can continue to be collected in existing entries.

ストア・キャッシュ264は、あらゆるexclusive XI又はdemote XIのたびに照会され、XIがいずれかのアクティブ・エントリと比較された場合、XIの拒否を引き起こす。継続的にXIを拒否する間、コアがさらなる命令を完了しない場合、トランザクションは、ハングアップを回避するために特定の閾値でアボートされる。   The store cache 264 is queried on every exclusive XI or demote XI, causing a rejection of the XI if the XI is compared to any active entry. If the core does not complete further instructions while continuously rejecting XI, the transaction is aborted at a certain threshold to avoid hang-up.

ストア・キャッシュがオーバーフローすると、LSU280は、トランザクション・アボートを要求する。LSU280は、既存のエントリにマージする(merge)ことができない新しいストアを送信しようと試みたときに、この条件を検出し、ストア・キャッシュ264全体が現トランザクションからのストアで満たされる。ストア・キャッシュ264は、L2 268のサブセットとして管理され、ダーティラインをL1 240からトランザクション的にエビクトすることができるが、これらは、トランザクション全体を通じてL2 268内に常駐しなければならない。従って、最大ストア・フットプリントは、64×128バイトのストア・キャッシュ・サイズに制限され、L2 268のアソシアティビティによっても制限される。L2 268は、8ウェイ・アソシアティブであり、512行を有するので、一般的には、十分に大きく、トランザクション・アボートを引き起こさない。   When the store cache overflows, LSU 280 requests a transaction abort. LSU 280 detects this condition when attempting to send a new store that cannot be merged with an existing entry, and the entire store cache 264 is filled with stores from the current transaction. Store cache 264 is managed as a subset of L2 268, and dirty lines can be transactionally evicted from L1 240, but they must reside in L2 268 throughout the transaction. Thus, the maximum store footprint is limited to a store cache size of 64 × 128 bytes, and is also limited by L2 268 associativity. L2 268 is 8-way associative and has 512 rows, so it is generally large enough to not cause a transaction abort.

トランザクションがアボートした場合、ストア・キャッシュに通知され、トランザクション・データを保持する全てのエントリが無効にされる。ストア・キャッシュはまた、1ダブルワード(8バイト)ごとに、エントリがNTSTG命令により書き込まれたかどうかのマークを有し−これらのダブルワードは、トランザクション・アボートにわたって有効なままである。   If the transaction aborts, the store cache is notified and all entries holding transaction data are invalidated. The store cache also has a mark every 1 doubleword (8 bytes) whether the entry was written by the NTSTG instruction-these doublewords remain valid over the transaction abort.

ミリコード実装の機能
従来より、IBMメインフレーム・サーバ・プロセッサは、特定のCISC命令実行、割り込み処理、システム同期、及びRASのような複雑な機能を実施する、ミリコードと呼ばれるファームウェアの層を含む。ミリコードは、マシン依存命令、並びに、アプリケーション・プログラム及びオペレーティング・システム(OS)の命令と同様にメモリからフェッチされ、実行される命令セット・アーキテクチャ(ISA)の命令を含む。ファームウェアは、顧客プログラムがアクセスできないメインメモリの制限区域内に常駐する。ハードウェアが、ミリコードを呼び出す必要がある状況を検出すると、命令フェッチ・ユニット204が「ミリコード・モード」に切り替わり、ミリコード・メモリ領域内の適切な位置でフェッチを開始する。ミリコードは、命令セット・アーキテクチャ(ISA)の命令と同じ手法でフェッチ及び実行することができ、ISA命令を含むことができる。
Features of Millicode Implementation Traditionally, IBM mainframe server processors include a layer of firmware called millicode that performs complex functions such as specific CISC instruction execution, interrupt handling, system synchronization, and RAS. . Millicode includes machine dependent instructions and instruction set architecture (ISA) instructions fetched and executed from memory as well as application program and operating system (OS) instructions. Firmware resides in a restricted area of main memory that is not accessible to customer programs. When the hardware detects a situation in which millicode needs to be called, the instruction fetch unit 204 switches to "millicode mode" and starts fetching at the appropriate location in the millicode memory area. Millicode can be fetched and executed in the same manner as Instruction Set Architecture (ISA) instructions, and can include ISA instructions.

トランザクション・メモリに関して、ミリコードは、種々の複雑な状況に関与する。あらゆるトランザクション・アボートは、必要なアボート操作を行うために、専用ミリコード・サブルーチンを呼び出す。トランザクション・アボート・ミリコードは、ハードウェア内部のアボート原因、潜在的な例外原因、及びアボートされた命令アドレスを保持する特殊用途レジスタ(SPR)を読み取ることで開始し、次に、ミリコードを用いて、1が指定されている場合には、TDBを格納する。ミリコードがどのGR228を復元するかを知るのに必要とされるGR保存マスクを取得するために、TBEGIN命令テキストがSPRからロードされる。   With respect to transaction memory, millicode is involved in a variety of complex situations. Every transaction abort calls a dedicated millicode subroutine to perform the required abort operation. The transaction abort millicode begins by reading a special purpose register (SPR) that holds the abort cause, potential exception cause, and the aborted instruction address inside the hardware, and then uses the millicode. If 1 is specified, the TDB is stored. The TBEGIN instruction text is loaded from the SPR to get the GR preservation mask needed to know which GR 228 the millicode restores.

CPU114(図2)は、バックアップGRを読み出し、それらをメインGRにコピーするための、特殊ミリコード専用命令をサポートする。TBEGIN命令アドレスもSPRからロードされ、ひとたびミリコード・アボート・サブルーチンが終了すると、TBEGIN後の実行を続行するための新しい命令アドレスをPSW内に設定する。このPSWは、アボートがフィルタリングされていないプログラム割り込みにより引き起こされた場合に、プログラム−旧PSWとして後に保存することができる。   The CPU 114 (FIG. 2) supports special millicode-specific instructions for reading backup GRs and copying them to the main GR. The TBEGIN instruction address is also loaded from the SPR, and once the Millicode Abort subroutine is completed, a new instruction address is set in the PSW to continue execution after TBEGIN. This PSW can later be saved as a program-old PSW if the abort was caused by an unfiltered program interrupt.

TABORT命令は、ミリコード実装することができる、即ち、IDU208がTABORTをデコードすると、TABORT命令は、TABORTのミリコードに分岐するように命令フェッチ・ユニットに指示し、そこからミリコードが共通のアボート・サブルーチンに分岐する。   The TABORT instruction may be implemented in millicode, i.e., when the IDU 208 decodes the TABORT, the TABORT instruction instructs the instruction fetch unit to branch to the TABORT millicode, from which the millicode is sent to the common abort.・ Branch to subroutine.

Extract Transactional Nesting Depth(トランザクション・ネスト化深さ抽出)(ETND)命令も、パフォーマンス・クリティカル(performance critical)ではないので、ミリコード化することができる。即ち、ミリコードは、特殊ハードウェア・レジスタから現在のネスト化深さをロードし、それをGR228に入れる。PPA命令はミリコード化することができる。PPA命令は、PPAへのオペランドとしてソフトウェアにより提供される現在のアボート・カウントと、同じく他のハードウェア内部状態とに基づいて、最適な遅延を実施する。   The Extract Transactional Nesting Depth (ETND) instruction is also not performance critical and can therefore be millicoded. That is, the millicode loads the current nesting depth from a special hardware register and places it into GR228. PPA instructions can be millicoded. The PPA instruction implements an optimal delay based on the current abort count provided by software as an operand to the PPA, as well as other hardware internal states.

制約付きトランザクションに関して、ミリコードは、アボートの数を常時監視することができる。TENDが成功裏に完了したとき、又は、OSへの割り込みが生じた場合、カウンタは0にリセットされる(OSがプログラムに戻るかどうか、又はOSがいつプログラムに戻るかは知られていない)。現在のアボート・カウントに依存して、ミリコードは、特定の機構を呼び出して、後のトランザクションの再試行が成功する可能性を高めることができる。この機構は、例えば、再試行の間のランダムな遅延を連続的に増大させることと、投機的実行の量を低減させて、トランザクションが実際には使用していないデータへの投機的アクセスにより引き起こされるアボートに遭遇するのを回避することとを含む。最後の手段として、他のCPUを解放して通常の処理を続行する前に、ミリコードを他のCPUにブロードキャストして、全ての競合する作業を停止させ、ローカル・トランザクションを再試行することができる。デッドロックを引き起こさないように、複数のCPUを連携させる必要があるので、異なるCPU上のミリコード・インスタンス間の何らかのシリアル化が必要とされる。   For constrained transactions, the millicode can constantly monitor the number of aborts. The counter is reset to 0 when TEND completes successfully or when an interrupt to the OS occurs (it is not known whether the OS returns to the program or when the OS returns to the program). . Depending on the current abort count, the millicode can call a specific mechanism to increase the likelihood of a successful retry of a later transaction. This mechanism can be caused, for example, by continuously increasing the random delay between retries and by reducing the amount of speculative execution, caused by speculative access to data that the transaction is not actually using. Avoiding encountering an abort. As a last resort, before releasing the other CPU and continuing with normal processing, broadcast the millicode to the other CPU to stop all conflicting work and retry the local transaction. it can. Some serialization between millicode instances on different CPUs is required because multiple CPUs need to be coordinated to avoid deadlocks.

ここで図4を参照すると、参照符号400は、一般に、データの適応共有のための方法をハードウェア又はソフトウェアで実装することができる、例示的な実施形態を示す。   Referring now to FIG. 4, reference numeral 400 generally indicates an exemplary embodiment in which a method for adaptive sharing of data may be implemented in hardware or software.

現在の実装においては、ロックに基づいてデータ・アクセスを同期するための2つの手法を従来通りに実施することができる。ロック(locking)又は真のロック(true locking)とも呼ばれるデータ構造のロックにおいて、プログラムは、コードのクリティカル・セクションの間、共有データとも呼ばれるメモリ領域への排他的アクセスが保証されることを望む場合がある。この場合、プログラムは、この時点で共有データが利用可能でない競合するプログラムへのフラグのように働くロックによって、共有データを保護することができる。しかしながら、ロック機構は、共有データへのアクセスを厳格に制御することができる。低競合状態のメモリ領域では、競合するプログラムが不必要に待機することがあり、性能に悪影響を与える。例えば、以下のコード・サンプルにおいて、2つのスレッドは構造の異なる部分を更新しており、並列に実行するとしても、スレッド1が構造hash_tbl上にロックを保持する間、スレッド2は実行を待つ。

Figure 0006642806

HLEは、前述のように、従来のロック・コードを使用するように書かれたプログラムが、トランザクション実行を実装するハードウェアを利用する機会を可能にする。しかしながら、高競合状態のメモリ領域においては、競合が発生した場合、プロセッサは、トランザクションをアボートし、悲観的ロック挙動を用いてクリティカル・セクションを再び実行することができる。一実施形態においては、キャッシュラインをまたぐいずれのロックも無効化することができず、HLEなしに再実行を自動的にトリガする。従って、クリティカル・セクションが常にトランザクションとして失敗することが分かっている場合、トランザクション実行にデフォルト設定し、その後、ロックを用いて成功裏に再開させることは、性能を低下させることがある。 In current implementations, two approaches to synchronizing data access based on locks can be implemented conventionally. In locking data structures, also called locking or true locking, when a program wants to guarantee exclusive access to a memory area, also called shared data, during a critical section of code. There is. In this case, the program can protect the shared data with a lock that acts like a flag to competing programs for which no shared data is available at this time. However, the locking mechanism can strictly control access to shared data. In a memory area in a low contention state, a competing program may wait unnecessarily, adversely affecting performance. For example, in the following code sample, two threads are updating different parts of the structure, and even if they execute in parallel, thread 2 waits for execution while thread 1 holds a lock on the structure hash_tbl.
Figure 0006642806

HLE, as described above, allows programs written to use conventional locking code to take advantage of hardware that implements transaction execution. However, in memory areas with high contention, if a contention occurs, the processor can abort the transaction and re-execute the critical section using pessimistic locking behavior. In one embodiment, any locks across cache lines cannot be invalidated and automatically trigger a re-run without HLE. Thus, if a critical section is known to always fail as a transaction, defaulting to transaction execution and then successfully restarting with locks can degrade performance.

410において、プロセッサ、即ちCPU114(図2)が、メモリ領域にアクセスするためにコード・シーケンスを開始すると、CPU114(図2)は、ハードウェア又はソフトウェアのいずれかで実装され得る競合予測器(即ち、HLE予測器又はハードウェア・ロック・バーチャライザ)を呼び出して、ロック無効化が成功する可能性があるかどうか、又は代わりにロックを使用すべきかどうかを予測しようと試みる。後述のように、動作において、競合予測器は、種々のハードウェア及びソフトウェア環境で動作することができる。しかしながら、競合予測器がHLE環境内の競合予測の実施形態を指す場合には、競合予測器はHLE予測器と呼ぶこともできる。一実施形態において、成功したトランザクション実行の単純なカウントは、例えば、スレッドごとにハードウェア・レジスタ又はメモリ位置内に保持することができる、又は全てのスレッドについて共有することができる。成功したトランザクション実行のカウントを表す閾値を超えると、410において、干渉の可能性が低いため、競合予測器は、トランザクション実行経路、即ちロック無効化が、455における非トランザクション実行経路、即ちロックよりも有効であり得ると予測することができる。少なくとも1つの実施形態において、カウンタは、最初により有効な実行経路を好むように初期化され、少なくとも1つの実施形態においては、好ましくは、ロック無効化に基づくトランザクション実行に対応する。別の実施形態においては、ハードウェアで又はプログラム・ストリームに挿入された命令により、ロックの取得及び実行に対する、トランザクション実行の推定される相対コストを計算することができる。計算された相対コストに基づき、競合予測器は、例えば予測される経路は実行するコストが低いこと又は干渉に遭遇する可能性が低いことから、トランザクション経路又は非トランザクション経路がより有効であると予測することができる。別の実施形態においては、コンパイラが挙動ヒントを競合予測器に暗黙的に挿入し、410において、420におけるトランザクション実行経路、又は455におけるロック経路のいずれかを選択することができる。CPU114(図2)は、420においてトランザクションとしてクリティカル・セクションの実行を開始し、425においてデータを必要に応じて更新することができる。430におけるトランザクションの終了時に、しかし結果をコミットする前に、CPU114(図2)は、435において、トランザクションのアボートをもたらす干渉(即ち、2つ又はそれ以上のコード・シーケンスが同じデータ上で並列に動作すること)が検出されるかどうかを判断することができる。干渉が検出されない場合、440において、トランザクションは成功裏に結果をコミットすることができ、その後にそれを他のトランザクションにより使用することができる。しかしながら、435においてCPU114(図2)が干渉を検出した場合は、455において、実行はロックを用いて再開される。460において、クリティカル・セクションは、アクセスされるメモリ領域を保護するロックを明示的に取得しなければならない。しかしながら、ロック・リクエスタは、スピン(spinning)と呼ばれるアクションにおいて、ロックが競合プロセスにより解放されるまで、待機させられる場合がある。最終的に460においてロックを取得すると、クリティカル・セクションは処理を続行することができる。470において、ロックにより保護されるデータが更新されると、クリティカル・セクションは完了し、475においてロックを解放することができる。   At 410, when the processor or CPU 114 (FIG. 2) initiates a code sequence to access a memory area, the CPU 114 (FIG. 2) causes the contention predictor (ie, CPU) to be implemented in either hardware or software. , HLE Predictor or Hardware Lock Virtualizer) to attempt to predict if lock invalidation could succeed or if locks should be used instead. In operation, as described below, the contention predictor can operate in various hardware and software environments. However, where a conflict predictor refers to an embodiment of a conflict prediction in an HLE environment, the conflict predictor may also be referred to as an HLE predictor. In one embodiment, a simple count of successful transaction executions can be kept, for example, in hardware registers or memory locations for each thread, or can be shared for all threads. Beyond the threshold representing the count of successful transaction executions, at 410, due to the low likelihood of interference, the contention predictor indicates that the transaction execution path, i. It can be expected that it can be effective. In at least one embodiment, the counter is initially initialized to favor the more effective execution path, and in at least one embodiment, preferably corresponds to transaction execution based on lock invalidation. In another embodiment, the estimated relative cost of executing a transaction for acquiring and executing a lock can be calculated in hardware or with instructions inserted into the program stream. Based on the calculated relative costs, the conflict predictor predicts that the transactional or non-transactional path is more effective, for example, because the predicted path is less expensive to execute or less likely to encounter interference. can do. In another embodiment, the compiler may implicitly insert a behavior hint into the contention predictor and select either the transaction execution path at 420 or the lock path at 455 at 410. CPU 114 (FIG. 2) may begin executing the critical section as a transaction at 420 and may update data at 425 as needed. At the end of the transaction at 430, but before committing the result, the CPU 114 (FIG. 2) determines at 435 the interference that caused the transaction to abort (ie, two or more code sequences were executed in parallel on the same data). Operating) is detected. If no interference is detected, at 440, the transaction can successfully commit the result, which can then be used by other transactions. However, if CPU 114 (FIG. 2) detects the interference at 435, execution resumes at 455 using the lock. At 460, the critical section must explicitly acquire a lock that protects the memory area being accessed. However, a lock requester may be made to wait until a lock is released by a competing process in an action called spinning. Finally, when the lock is obtained at 460, the critical section can continue processing. At 470, once the data protected by the lock has been updated, the critical section is complete and the lock can be released at 475.

図5を参照すると、参照符号500は、一般に、HLEサポートが存在する環境において競合予測器(即ち、ハードウェア・ロック・バーチャライザ)が実装されている、例示的な実施形態を示す。上述したように、HLEは、XACQUIRE及びXRELEASEを含む、Intel(登録商標)の従来の互換命令セット拡張であり、これは従来のロック・コードを使用するように書かれたプログラムが、コードを実質的に修正する必要なしにトランザクション実行を実装するハードウェアを利用する機会を可能にする。この実施形態においては、HLE予測器は、Intel(登録商標)HLEの特定の例である。   Referring to FIG. 5, reference numeral 500 generally illustrates an exemplary embodiment in which a contention predictor (ie, a hardware lock virtualizer) is implemented in an environment where HLE support is present. As described above, HLE is a legacy compatible instruction set extension of Intel, including XACQUIRE and XRELEASE, which allows programs written to use traditional locking code to execute the code substantially. Enables the opportunity to utilize hardware that implements transaction execution without the need for local modifications. In this embodiment, the HLE predictor is a specific example of Intel® HLE.

505において、CPU114(図2)は、Intel(登録商標)XACQUIREプリフィックス命令を実行して、関連したロック取得トランザクションでHLEシーケンスを開始する。一実施形態において、シーケンスは、XACQUIREの後にロック取得トランザクションが続くように表すことができる。幾つかの実装では、XACQUIREプリフィックスを無視することができる。他の実装では、XACQUIREシーケンスを選択的に実施することができる。HLE開始シーケンスの開始に続き、510において、競合予測器、即ちHLE予測器が呼び出される。予測に基づき、ロック無効化を行うことができる、又はロックを取得することができる。ロック無効化とロック取得との間の予測を行うと、処理は、図4の420〜475に説明されたものと実質的に同様に続行することができる。   At 505, the CPU 114 (FIG. 2) executes the Intel® XACQUIRE prefix instruction to start the HLE sequence with the associated lock acquisition transaction. In one embodiment, the sequence may be represented as XACQUIRE followed by a lock acquisition transaction. In some implementations, the XACQUIRE prefix can be ignored. In other implementations, the XACQUIRE sequence can be selectively implemented. Following the start of the HLE start sequence, at 510, the conflict predictor, the HLE predictor, is called. Based on the prediction, lock invalidation can be performed or a lock can be obtained. Having made the prediction between lock invalidation and lock acquisition, processing can proceed substantially similar to that described at 420-475 in FIG.

図6を参照すると、参照符号600は、一般に、付加的なハードウェア・ファシリティが存在しない例示的な実施形態による、ロック無効化とロックとの間の選択を用いたデータの適応共有のための方法のフロー図を示す。この例示的な実施形態においては、例えば、オペレーティング・システムを通じて又はハードウェアにより、アプリケーション・プログラムのコード・ストリーム内に、競合予測器へのヒントを提供することができる。例えば、一実施形態において、プログラマーが1つ又は複数の命令を明示的に挿入してもよく、又は、コンパイラが挙動のヒントを競合予測器に暗黙的に挿入してもよい。競合予測器は、例えば1秒といったある期間にわたって、成功した予測及び成功しなかった予測、即ち予測ミスの両方の数を追跡するために履歴ベクトル又はカウントを保持することができる。次に、610において、競合予測器は、予測ミスのカウントを、時間窓中の失敗の閾値数と比較することができる。予測ミスが時間窓の間の失敗の閾値数を上回ると、競合予測器は、時間窓の残りについて、ロックを用いた実行、即ち非トランザクション・モードにデフォルト設定することができる。時間窓の間、メモリ領域は、例えば複数のトランザクションが競合するデータを同時に更新する際、ワークロード特性に起因して高競合状態になることがある。デフォルトとしてロックを一時的に選択することにより、競合予測器は、失敗したトランザクションを再開しなければならない可能性を回避し、トランザクション・アボートを回避することによりスループットを改善することができる。しかしながら、ひとたび時間窓が期間満了すると、メモリ領域のコンテンションは緩和している可能性があり、競合予測器は、トランザクション実行を再び試みることができる。1つの実施形態において、競合予測器はソフトウェアで実装され、ロックの無効化を実施するか又はロックを実施するかの決定は、ソフトウェア実装のアルゴリズムが、ロック無効化を実装する第1バージョンのコード、又は、ロック取得を実装する第2バージョンのコードに制御を渡すことによって行われる。他の実施形態においては、決定610は、干渉の履歴に基づき、ソフトウェアによる特定のエントリの更新の指示に応答して、更新トランザクションのターゲットであるフィールドに関連した予測される干渉又は不干渉を反映して、代替的なテストを用いて実装される。   Referring to FIG. 6, reference numeral 600 generally designates for adaptive sharing of data with a selection between lock invalidation and lock according to an exemplary embodiment in which there is no additional hardware facility. FIG. 2 shows a flow diagram of the method. In this exemplary embodiment, hints to the contention predictor may be provided, for example, through the operating system or by hardware, in the code stream of the application program. For example, in one embodiment, a programmer may explicitly insert one or more instructions, or a compiler may implicitly insert behavior hints into a conflict predictor. The contention predictor may maintain a history vector or count to track the number of both successful and unsuccessful predictions, i.e., misprediction, over a period of time, e.g., one second. Next, at 610, the contention predictor can compare the misprediction count to a threshold number of failures during the time window. If the misprediction exceeds the threshold number of failures during the time window, the contention predictor can default to performing with locks, ie, non-transactional mode, for the remainder of the time window. During the time window, the memory area may be in a high contention state due to workload characteristics, for example, when multiple transactions update competing data simultaneously. By temporarily choosing a lock as the default, the contention predictor can avoid the possibility of having to restart a failed transaction and improve throughput by avoiding a transaction abort. However, once the time window has expired, the contention of the memory region may have relaxed and the contention predictor may attempt to execute the transaction again. In one embodiment, the contention predictor is implemented in software, and the decision whether to perform lock invalidation or lock enforcement is made by a software-implemented algorithm that uses a first version of code that implements lock invalidation. Or by passing control to a second version of the code that implements lock acquisition. In other embodiments, the decision 610 is based on the history of interference and reflects expected interference or non-interference associated with a field that is the target of the update transaction in response to an instruction to update a particular entry by software. And implemented using alternative tests.

655において、クリティカル・セクションは、アクセスされるメモリ領域を保護するロックを明示的に取得しなければならない。しかしながら、ロック・リクエスタは、スピンと呼ばれるアクションにおいて、競合するプロセスによりロックが解放されるまで、待機せざるを得ないことがある。660において最終的にロックを取得すると、クリティカル・セクションは処理を続行することができる。670においてロックにより保護されるデータが更新されると、675においてクリティカル・セクションが完了し、ロックを解放することができる。680において、CPU114(図2)は、時間窓の期間満了をチェックすることができる。時間窓が期間満了していない場合、次に680において、処理は終了する。しかしながら、時間窓が期間満了している場合、次に685において、失敗したトランザクション実行及び成功したトランザクション実行のカウントをリセットし、時間窓を有効にリセットし、競合予測器の再訓練を開始することができる。   At 655, the critical section must explicitly acquire a lock that protects the memory area being accessed. However, a lock requester may have to wait until a lock is released by a competing process in an action called spin. Upon finally acquiring the lock at 660, the critical section can continue processing. Once the data protected by the lock is updated at 670, the critical section is completed at 675 and the lock can be released. At 680, CPU 114 (FIG. 2) can check for expiration of the time window. If the time window has not expired, then, at 680, the process ends. However, if the time window has expired, then at 685, reset the count of failed and successful transaction executions, effectively reset the time window, and begin retraining the contention predictor. Can be.

予測ミスが、時間窓中の失敗の閾値数を上回らない場合、610において、競合予測器は、ロック無効化、即ち、HLEトランザクション、又は、ロック取得ではなくロック・ワードの明示的な読み取りと併せてロック無効化を実装するトランザクションを選択することができる。HLEトランザクションとして(又は、読み取りセット内のロック・ワードを含むトランザクションを実行することによりロック無効化を行うソフトウェア・トランザクションと併せてロック無効化を実装するトランザクションとして)実行することが選択されると、615において、CPU114(図2)は、成功したトランザクション実行のカウントをインクリメントすることができる。620におけるHLEトランザクションは、625において必要に応じてデータを更新することができる。630におけるトランザクションの終了後、しかし635において結果をコミットする前に、CPU114(図2)は、トランザクションのアボートをもたらす干渉(即ち、2つ又はそれ以上のコード・シーケンスが同じデータ上で並列に動作すること)が検出されるかどうかを判断することができる。干渉が検出されない場合、640において、HLEトランザクション(又はロック無効化を実装する他のトランザクション)は成功裏に結果をコミットすることができ、その後にそれを他のプロセスにより使用することができる。しかしながら、635においてCPU114(図2)が干渉を検出した場合、失敗したトランザクションは予測ミスとしてカウントされ、これを用いて競合予測器を訓練し、競合予測器の将来の予測をより正確にすることができるため、650において、失敗したトランザクション実行のカウントがインクリメントされる。655及び660において、CPU114(図2)はここで、メモリ領域に対するロックを取得し、クリティカル・セクションを非トランザクション的に、即ち、ロックを用いて再開しようと試みることができる。670において、ロックにより保護されるデータが最終的に更新されると、クリティカル・セクションの処理は完了し、675において、ロックを解放することができる。680において、CPU114(図2)は、時間窓の期間満了をチェックすることができる。時間窓が期間満了していない場合、次に680において処理は終了する。しかしながら、時間窓が期間満了している場合、次に685において、失敗したトランザクション実行及び成功したトランザクション実行のカウントをリセットすることができ、競合予測器の再訓練を有効に開始する。   If the misprediction does not exceed the threshold number of failures during the time window, then at 610, the contention predictor combines the lock with an HLE transaction or with an explicit read of the lock word rather than a lock acquisition. Transaction to implement lock invalidation. When selected to execute as an HLE transaction (or as a transaction that implements lock invalidation in conjunction with a software transaction that performs lock invalidation by executing a transaction that includes the lock word in the read set), At 615, CPU 114 (FIG. 2) can increment the count of successful transaction executions. The HLE transaction at 620 can update the data at 625 as needed. After the end of the transaction at 630, but before committing the result at 635, the CPU 114 (FIG. 2) may execute the abort of the transaction (ie, two or more code sequences operate in parallel on the same data). Is detected). If no interference is detected, at 640, the HLE transaction (or other transaction that implements lock invalidation) can successfully commit the result, which can then be used by other processes. However, if the CPU 114 (FIG. 2) detects the interference at 635, the failed transaction is counted as a misprediction, and this is used to train the conflict predictor to make the conflict predictor's future prediction more accurate. At 650, the count of failed transaction executions is incremented. At 655 and 660, CPU 114 (FIG. 2) can now acquire a lock on the memory area and attempt to resume the critical section non-transactedly, ie, with the lock. Once the data protected by the lock is finally updated at 670, processing of the critical section is complete and the lock can be released at 675. At 680, CPU 114 (FIG. 2) can check for expiration of the time window. If the time window has not expired, then the process ends at 680. However, if the time window has expired, then the failed transaction execution and successful transaction execution counts can be reset at 685, effectively retraining the contention predictor.

ここで図7を参照すると、参照符号700は、一般に、データの適応共有のための方法が、ロックが実施されたときにハードウェア内に監視ファシリティを含むことができる、例示的な実施形態のフロー図を示す。図7において、HLEトランザクションの処理、即ち710乃至750は、図6の実施形態がHLEを処理する方法、即ち610乃至650と実質的に類似している。しかしながら、図7は、クリティカル・セクションが非トランザクション的に実行される経路について、ハードウェア・ロック監視ファシリティを導入する。この実施形態においては、ハードウェア・ロック監視ファシリティは、クリティカル・セクションが、ロックされたメモリ領域内での実行を可能にする間、クリティカル・セクションが実際にHLEトランザクションとして実行されたかのように結果を予測することによって、予測ミスを最小にしようと試みる。760及び765において成功裏にロックを取得すると、770において、ハードウェア・ロック監視ファシリティは、ロックの状態の監視を開始することができる。775において、クリティカル・セクションは、ロックされたメモリ領域内のデータを更新し、780において、ロックを解放することにより実行を終了する。しかしながら、実行中、785においてハードウェア・ロック監視ファシリティが、別のプロセスがロック・フラグのステータスをチェックし、次いでこのクリティカル・セクションが非トランザクション的ではなくトランザクションとして実行されていたことを検出した場合、他のプロセスにより試行されたアクセスは、干渉及びトランザクションの失敗をもたらした。一実施形態においては、ロックのみが監視される。別の実施形態においては、ロックされた領域の一部として更新されたデータが監視される。結果として、790において、ハードウェア・ロック監視ファシリティは、失敗したトランザクション実行のカウントをインクリメントすることができる。   Referring now to FIG. 7, reference numeral 700 generally designates an exemplary embodiment in which a method for adaptive sharing of data may include a monitoring facility in hardware when a lock is enforced. FIG. In FIG. 7, the processing of the HLE transaction, 710-750, is substantially similar to the way the embodiment of FIG. 6 processes the HLE, 610-650. However, FIG. 7 introduces a hardware lock monitoring facility for paths where critical sections are executed non-transactionally. In this embodiment, the hardware lock monitoring facility returns the result as if the critical section was actually executed as an HLE transaction while the critical section allowed execution in the locked memory area. Attempts to minimize misprediction by making predictions. Upon successfully acquiring the lock at 760 and 765, at 770, the hardware lock monitoring facility may begin monitoring the status of the lock. At 775, the critical section updates the data in the locked memory area, and at 780, terminates execution by releasing the lock. However, during execution, if the hardware lock monitoring facility at 785 detects that another process has checked the status of the lock flag, and then detected that this critical section was executing as a transaction rather than non-transactional Access attempted by other processes has resulted in interference and transaction failure. In one embodiment, only locks are monitored. In another embodiment, updated data is monitored as part of the locked area. As a result, at 790, the hardware lock monitoring facility can increment the count of failed transaction executions.

別の実施形態において、ハードウェア・ロック監視ファシリティは、ロックされたメモリ領域内の全てのデータ・アクセスの試行を監視することができる。別のプロセスがこの領域内のデータにアクセスしようと試みた場合、次に790において、ハードウェア・ロック監視ファシリティは、これを干渉及び潜在的なトランザクション失敗としてカウントすることができる。従って、競合予測器は、トランザクション実行又は非トランザクション実行のどちらが成功する可能性が高いかについて、より正確に予測するよう学習することができる。   In another embodiment, the hardware lock monitoring facility may monitor all data access attempts within the locked memory area. If another process attempts to access data in this area, then, at 790, the hardware lock monitoring facility may count this as interference and potential transaction failure. Thus, the contention predictor can learn to more accurately predict whether transactional execution or non-transactional execution is more likely to succeed.

別の実施形態において、750において、トランザクション実行失敗のカウントがインクリメントされると、再開(restart)フラグを設定することができる。次に755において、成功したトランザクション実行のカウントがインクリメントされたとき、再開フラグをリセットすることができる。再開フラグは、失敗したトランザクション実行のカウントが2回、即ち、750におけるHLEトランザクションのような失敗時に1回、及び755におけるロックを用いた再開時に1回、インクリメントされることを防止することにより、予測精度を改善することができる。   In another embodiment, at 750, a restart flag may be set when the transaction execution failure count is incremented. Next, at 755, the restart flag may be reset when the count of successful transaction executions has been incremented. The resume flag prevents the count of failed transaction executions from being incremented twice: once upon failure, such as an HLE transaction at 750, and once upon resumption with a lock at 755. The prediction accuracy can be improved.

ここで図8を参照すると、1つの実施形態において、Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクション的に実行すべきかどうかを予測的に決定すること810は、HLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、ロックを無効化し、HLEトランザクションとして進行させるか、又はロックを取得して非トランザクションとして進行させるかを決定すること820と、HLE予測器が無効化を行うと予測することに基づき、ロックのアドレスを、HLEトランザクションの読み取りセットとして設定し、lock−acquire命令によるロックへのあらゆる書き込みを抑止し、ロックを解放するxrelease命令に遭遇するまで、又はHLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させること830と、HLE予測器が無効化を行わないと予測することに基づき、HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させること840と、を含む。   Referring now to FIG. 8, in one embodiment, in a Hardware Lock Elimination (HLE) environment, predicting 810 whether the HLE transaction actually acquires the lock and should execute non-transactionally. , Based on encountering the HLE lock-acquire instruction, determining whether to invalidate the lock and proceed as an HLE transaction or acquire the lock and proceed as a non-transaction based on the HLE predictor 820; , Set the address of the lock as a read set for the HLE transaction, inhibit any write to the lock by lock-acquire instructions, and release the lock based on the prediction that the HLE predictor will invalidate. The HLE lock-acquire instruction is based on 830 proceeding in HLE transaction execution mode until a H.lease instruction is encountered or an HLE transaction encounters a transaction conflict and the HLE predictor predicts that no invalidation will be performed. 840 as a non-HLE lock-acquire instruction and proceed in non-transactional mode 840.

ここで図9を参照すると、1つの実施形態において、HLE予測器を更新することは、HLEの予測の成功に基づく910。ロック・アドレスを有するHLEトランザクションに初めて遭遇したことに基づき、ロック・アドレスと関連付けられた成功したHLEトランザクション実行のカウントはゼロに初期化され、ロック・アドレスを有するいずれかの後のHLEトランザクションを完了することに基づき、HLE予測器において、HLEトランザクションのロック・アドレスと関連した失敗したHLEトランザクション実行のカウントをインクリメントし、ここで、高いカウントはアボートの可能性が高いことを示す920。非トランザクション・モードにおいて、別のプロセスによるロックへのアクセスの試行を監視し、他のプロセスによるアクセスの試行が検出された際、失敗したHLEトランザクションのカウントをインクリメントする950。時間窓内の成功したHLEトランザクション実行のカウント及び失敗したHLEトランザクション実行のカウントを追跡し、失敗したHLEトランザクション実行のカウントが失敗の閾値数を上回ることに基づき、時間窓の残りについて非トランザクション・モードにデフォルト設定する970。時間窓の期間満了に基づき、成功したHLEトランザクション実行のカウント及び失敗したHLEトランザクション実行のカウントは、ゼロにリセットされる960。   Referring now to FIG. 9, in one embodiment, updating the HLE predictor is based on a successful prediction of the HLE 910. Based on the first encounter of an HLE transaction with a lock address, the count of successful HLE transaction executions associated with the lock address is initialized to zero, completing any subsequent HLE transactions with the lock address. Based on this, the HLE predictor increments the count of failed HLE transaction executions associated with the lock address of the HLE transaction, where a high count indicates a high likelihood of abort 920. In non-transactional mode, monitor attempts to access the lock by another process and increment 950 the count of failed HLE transactions when an attempt by another process is detected. Tracking the count of successful HLE transaction executions and the count of failed HLE transaction executions within the time window, and based on the count of failed HLE transaction executions exceeding a failure threshold number, the non-transactional mode for the remainder of the time window 970 to default. Based on the expiration of the time window, the count of successful HLE transaction executions and the count of failed HLE transaction executions are reset 960 to zero.

ここで図10を参照すると、コンピューティング・デバイス1000は、内部コンポーネント800及び外部コンポーネント900のそれぞれのセットを含むことができる。内部コンポーネント800のセットの各々は、1つ又は複数のバス826上の1つ又は複数のプロセッサ820、1つ又は複数のコンピュータ可読RAM822、及び1つ又は複数のコンピュータ可読ROM;1つ又は複数のオペレーティング・システム828;図5〜図7の方法を実行する1つ又は複数のソフトウェア・アプリケーション;及び1つ又は複数のコンピュータ可読有形ストレージ・デバイス830を含む。1つ又は複数のオペレーティング・システムは、それぞれのRAM822(一般的には、キャッシュ・メモリを含む)の1つ又は複数を介して、それぞれのプロセッサ820の1つ又は複数による実行のために、それぞれのコンピュータ可読有形ストレージ・デバイス830の1つ又は複数に格納される。図10に示される実施形態において、コンピュータ可読有形ストレージ・デバイス830の各々は、内蔵ハード・ドライブの磁気ディスク・ストレージ・デバイスである。代替的に、コンピュータ可読有形ストレージ・デバイス830の各々は、ROM824、EPROM、フラッシュ・メモリなどの半導体ストレージ・デバイス、又はコンピュータ・プログラム及びデジタル情報を格納することができるいずれかの他のコンピュータ可読有形ストレージ・デバイスである。   Referring now to FIG. 10, a computing device 1000 can include a respective set of internal components 800 and external components 900. Each of the set of internal components 800 includes one or more processors 820 on one or more buses 826, one or more computer readable RAMs 822, and one or more computer readable ROMs; Operating system 828; one or more software applications that perform the methods of FIGS. 5-7; and one or more computer-readable tangible storage devices 830. The one or more operating systems are each configured for execution by one or more of respective processors 820 via one or more of respective RAMs 822 (generally including cache memory). Stored on one or more of the computer-readable tangible storage devices 830. In the embodiment shown in FIG. 10, each of the computer-readable tangible storage devices 830 is an internal hard drive magnetic disk storage device. Alternatively, each of the computer readable tangible storage devices 830 may be a semiconductor storage device such as a ROM 824, an EPROM, a flash memory, or any other computer readable tangible storage capable of storing computer programs and digital information. It is a storage device.

内部コンポーネント800の各セットはまた、シン・プロビジョニング・ストレージ・デバイス、CD−ROM、DVD、SSD、メモリ・スティック、磁気テープ、磁気ディスク、光ディスク、又は半導体ストレージ・デバイスといった、1つ又は複数のコンピュータ可読有形ストレージ・デバイス936との間で読み書きを行うためのR/Wドライブ又はインターフェース832も含む。R/Wドライブ又はインターフェース832は、コンピューティング・デバイス1000のコンポーネントとの通信を容易にするために、デバイス・ドライバ840ファームウェア、ソフトウェア、又はマイクロコードを有形ストレージ・デバイス936にロードするために使用することができる。   Each set of internal components 800 may also include one or more computers, such as thin-provisioned storage devices, CD-ROMs, DVDs, SSDs, memory sticks, magnetic tapes, magnetic disks, optical disks, or semiconductor storage devices. Also includes an R / W drive or interface 832 for reading from and writing to the readable tangible storage device 936. R / W drive or interface 832 is used to load device driver 840 firmware, software, or microcode into tangible storage device 936 to facilitate communication with components of computing device 1000. be able to.

内部コンポーネント800の各セットはまた、TCP/IPアダプタ・カード、無線WI−FIインターフェース・カード、又は3G若しくは4G無線インターフェース・カード、又は他の有線若しくは無線通信リンクといったネットワーク・アダプタ(又はスイッチ・ポート・カード)又はインターフェース836も含む。コンピューティング・デバイス1000と関連付けられたオペレーティング・システム828は、ネットワーク(例えば、インターネット、ローカル・エリア・ネットワーク、又は広域ネットワーク)及びそれぞれのネットワーク・アダプタ又はインターフェース836を介して、外部コンピュータ(例えば、サーバ)からコンピューティング・デバイス1000にダウンロードすることができる。ネットワーク・アダプタ(又はスイッチ・ポート・アダプタ)又はインターフェース836から、コンピューティング・デバイス1000と関連付けられたオペレーティング・システム828が、それぞれのハード・ドライブ830及びネットワーク・アダプタ836内にロードされる。ネットワークは、銅線、光ファイバ、無線伝送、ルータ、ファイアウォール、スイッチ、ゲートウェイ・コンピュータ、及び/又はエッジ・サーバを含むことができる。   Each set of internal components 800 also includes a network adapter (or switch port) such as a TCP / IP adapter card, a wireless WI-FI interface card, or a 3G or 4G wireless interface card, or other wired or wireless communication link. Card) or interface 836. An operating system 828 associated with the computing device 1000 is connected to an external computer (eg, a server) via a network (eg, the Internet, a local area network, or a wide area network) and respective network adapters or interfaces 836. ) Can be downloaded to the computing device 1000. From a network adapter (or switch port adapter) or interface 836, an operating system 828 associated with the computing device 1000 is loaded into the respective hard drive 830 and network adapter 836. A network may include copper wires, fiber optics, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers.

外部コンポーネント900のセットの各々は、コンピュータ・ディスプレイ・モニタ920、キーボード930、及びコンピュータ・マウス934を含むことができる。外部コンポーネント900はまた、タッチスクリーン、仮想キーボード、タッチパッド、ポインティング・デバイス、及び他のヒューマン・インターフェース・デバイスを含むこともできる。内部コンポーネント800のセットの各々はまた、コンピュータ・ディスプレイ・モニタ920、キーボード930、及びコンピュータ・マウス934にインターフェース接続するためのデバイス・ドライバ840を含むこともできる。デバイス・ドライバ840、R/Wドライブ又はインターフェース832、及びネットワーク・アダプタ又はインターフェース836は、ハードウェア及びソフトウェア(ストレージ・デバイス830及び/又はROM824内に格納される)を含む。   Each set of external components 900 may include a computer display monitor 920, a keyboard 930, and a computer mouse 934. External components 900 may also include a touch screen, virtual keyboard, touch pad, pointing device, and other human interface devices. Each set of internal components 800 may also include a device driver 840 for interfacing to a computer display monitor 920, a keyboard 930, and a computer mouse 934. Device driver 840, R / W drive or interface 832, and network adapter or interface 836 include hardware and software (stored in storage device 830 and / or ROM 824).

本開示の種々の実施形態は、システム・バスを通じてメモリ要素に直接又は間接的に結合された少なくとも1つのプロセッサを含むプログラム・コードを格納及び/又は実行するのに適したデータ処理システム内で実装することができる。メモリ要素は、例えば、プログラム・コードの実際の実行中に用いられるローカル・メモリ、大容量記憶装置、及び実行中に大容量記憶装置からコードを取り出さなければならない回数を減らすために少なくとも一部のプログラム・コードを一時的に格納するキャッシュ。メモリを含む。   Various embodiments of the present disclosure are implemented in a data processing system suitable for storing and / or executing program code that includes at least one processor coupled directly or indirectly to a memory element through a system bus. can do. The memory elements may include, for example, local memory used during the actual execution of the program code, mass storage, and at least some of the code to reduce the number of times code must be retrieved from the mass storage during execution. A cache that temporarily stores program code. Including memory.

入力/出力又はI/Oデバイス(これらに限定されるものではないが、キーボード、ディスプレイ、ポインティング・デバイス、DASD、テープ、CD、DVD、サムドライブ及び他のメモリ媒体等を含む)を、直接又は介在するI/Oコントローラを通じてシステムに結合することができる。ネットワーク・アダプタをシステムに結合して、データ処理システムが、介在する私的又は公衆ネットワークを通じて他のデータ処理システム又は遠隔プリンタ又はストレージ・デバイスに結合されるようになるのを可能にもできる。モデム、ケーブル・モデム及びイーサネットは、利用可能なタイプのネットワーク・アダプタのほんのわずかにすぎない。   Input / output or I / O devices (including but not limited to keyboards, displays, pointing devices, DASDs, tapes, CDs, DVDs, thumb drives and other memory media, etc.) directly or It can be coupled to the system through an intervening I / O controller. A network adapter may be coupled to the system to allow the data processing system to become coupled to another data processing system or a remote printer or storage device through an intervening private or public network. Modems, cable modems and Ethernets are just a few of the available types of network adapters.

本発明は、システム、方法、及び/又はコンピュータ・プログラム製品とすることができる。コンピュータ・プログラム製品は、プロセッサに本発明の態様を実施させるためのコンピュータ可読プログラム命令をそこに有するコンピュータ可読ストレージ媒体(単数又は複数)を含むことができる。   The invention can be a system, method, and / or computer program product. The computer program product may include computer readable storage medium (s) having computer readable program instructions thereon for causing a processor to implement aspects of the invention.

コンピュータ可読ストレージ媒体は、命令実行デバイスにより使用される命令を保持し、格納することができる有形デバイスとすることができる。コンピュータ可読ストレージ媒体は、例えば、これらに限定されるものではないが、電子記憶装置、磁気記憶装置、光記憶装置、電磁気記憶装置、半導体記憶装置、又は上記のいずれかの適切な組み合わせとすることができる。コンピュータ可読ストレージ媒体のより具体的な例の非網羅的なリストとして、以下のもの:即ち、ポータブル・コンピュータ・ディスケット、ハード・ディスク、ランダム・アクセス・メモリ(RAM)、読み出し専用メモリ(ROM)、消去可能なプログラム可能読み出し専用メモリ(EPROM又はフラッシュ・メモリ)、スタティック・ランダム・アクセス・メモリ(SRAM)、ポータブル、コンパクト・ディスク読み出し専用メモリ(CD−ROM)、デジタル多用途ディスク(DVD)、メモリ・スティック、フロッピー・ディスク、パンチカード若しくはそこに命令が記録された溝内の隆起構造などの機械的符号化デバイス、及び上記のいずれかの適切な組み合わせが挙げられる。本明細書で使用される場合、コンピュータ可読ストレージ媒体は、電波又は他の自由に伝搬する電磁波、導波路若しくは他の伝送媒体を通じて伝搬する電磁波(例えば、光ファイバ・ケーブルを通る光パルス)、又は配線を通じて伝送される電気信号のような、一時的信号それ自体として解釈されるべきではない。   The computer-readable storage medium may be a tangible device capable of holding and storing instructions used by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. Can be. A non-exhaustive list of more specific examples of computer readable storage media includes: portable computer diskette, hard disk, random access memory (RAM), read only memory (ROM), Erasable programmable read only memory (EPROM or flash memory), static random access memory (SRAM), portable, compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory -Mechanical encoding devices, such as sticks, floppy disks, punch cards or raised structures in grooves with instructions recorded thereon, and suitable combinations of any of the above. As used herein, a computer-readable storage medium is a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, an optical pulse through a fiber optic cable), or It should not be interpreted as a transient signal itself, such as an electrical signal transmitted over wiring.

本明細書で説明されるコンピュータ可読プログラム命令は、コンピュータ可読ストレージ媒体からそれぞれのコンピュータピューティング/処理デバイスに、又は、例えばインターネット、ローカル・エリア・ネットワーク、広域ネットワーク、及び/又は無線ネットワークなどのネットワークを介して外部コンピュータ若しくは外部ストレージ・デバイスにダウンロードすることができる。ネットワークは、銅製伝送ケーブル、光伝送ケーブル、無線伝送、ルータ、ファイアウォール、スイッチ、ゲートウェイ・コンピュータ、及び/又はエッジ・サーバを含むことができる。各コンピューティング/処理デバイス内のネットワーク・アダプタ・カード又はネットワーク・インターフェースは、ネットワークからコンピュータ可読プログラム命令を受け取り、それぞれのコンピューティング/処理デバイス内のコンピュータ可読ストレージ媒体内に格納するためにコンピュータ可読プログラム命令を転送する。   The computer readable program instructions described herein may be transmitted from a computer readable storage medium to a respective computer computing / processing device or to a network such as, for example, the Internet, a local area network, a wide area network, and / or a wireless network. Via an external computer or an external storage device. The network may include copper transmission cables, optical transmission cables, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and stores the computer readable program instructions in a computer readable storage medium in the respective computing / processing device. Transfer instructions.

本発明の動作を実行するためのコンピュータ可読プログラム命令は、アセンブラ命令、命令セット・アーキテクチャ(ISA)命令、マシン命令、マシン依存命令、ミリコード、ファームウェア命令、状態設定データ、又はJava、Smalltalk、C++等などのオブジェクト指向型プログラミング言語、及び、「C」プログラミング言語、若しくは同様のプログラミング言語のような従来の手続き型プログラミング言語を含む1つ又は複数のプログラミング言語のいずれかの組み合わせで書かれたソース・コード若しくはオブジェクト・コードのいずれかとすることができる。コンピュータ可読プログラム命令は、完全にユーザのコンピュータ上で実行される場合もあり、スタンドアロンのソフトウェア・パッケージとして、一部がユーザのコンピュータ上で実行される場合もあり、一部がユーザのコンピュータ上で実行され、一部が遠隔コンピュータ上で実行される場合もあり、又は完全に遠隔コンピュータ若しくはサーバ上で実行される場合もある。最後のシナリオにおいては、遠隔コンピュータは、ローカル・エリア・ネットワーク(LAN)若しくは広域ネットワーク(WAN)を含むいずれかのタイプのネットワークを通じてユーザのコンピュータに接続される場合もあり、又は外部コンピュータへの接続がなされる場合もある(例えば、インターネット・サービス・プロバイダを用いたインターネットを通じて)。幾つかの実施形態において、例えば、プログラム可能論理回路、フィールド・プログラマブル・ゲート・アレイ(FPGA)、又はプログラム可能論理アレイ(PLA)を含む電子回路は、本発明の態様を実施するために、コンピュータ可読プログラム命令の状態情報を用いて電子回路を個人化することにより、コンピュータ可読プログラム命令を実行することができる。   The computer readable program instructions for performing the operations of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, millicode, firmware instructions, state setting data, or Java, Smalltalk, C ++. And source written in any combination of one or more programming languages, including an object-oriented programming language such as, and a conventional procedural programming language such as the "C" programming language, or a similar programming language. -Can be either code or object code. The computer readable program instructions may execute entirely on the user's computer, or may run partially on the user's computer and partially run on the user's computer as a standalone software package. It may be executed and partly executed on a remote computer, or completely executed on a remote computer or server. In the last scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or wide area network (WAN), or a connection to an external computer (Eg, through the Internet using an Internet service provider). In some embodiments, for example, an electronic circuit including a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may be a computer to implement aspects of the present invention. By personalizing the electronic circuit with the status information of the readable program instructions, the computer readable program instructions can be executed.

本発明の態様は、本発明の実施形態による方法、装置(システム)及びコンピュータ・プログラム製品のフローチャート図及び/又はブロック図を参照して、本明細書で説明される。フローチャート図及び/又はブロック図の各ブロック、並びにフローチャート図及び/又はブロック図内のブロックの組み合わせは、コンピュータ可読プログラム命令によって実装できることが理解されるであろう。   Aspects of the invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.

これらのコンピュータ可読プログラム命令を、汎用コンピュータ、専用コンピュータ、又は他のプログラム可能データ処理装置のプロセッサに与えてマシンを製造し、それにより、コンピュータ又は他のプログラム可能データ処理装置のプロセッサによって実行される命令が、フローチャート及び/又はブロック図の1つ又は複数のブロックにおいて指定された機能/動作を実装するための手段を作り出すようにすることができる。これらのコンピュータ可読プログラム命令を、コンピュータ、プログラム可能データ処理装置、及び/又は他のデバイスを特定の方式で機能させるように指示することができるコンピュータ可読媒体内に格納し、それにより、内部に命令が格納されたコンピュータ可読ストレージ媒体が、フローチャート及び/又はブロック図の1つ又は複数のブロックにおいて指定された機能/動作を実装する命令を含む製品を製造するようにすることもできる。   These computer readable program instructions are provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing device to produce a machine, and thereby are executed by the processor of a computer or other programmable data processing device. The instructions may create a means for implementing the specified function / operation in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions are stored in a computer readable medium capable of directing a computer, programmable data processor, and / or other device to function in a particular manner, whereby the instructions are stored internally. The computer-readable storage medium on which is stored manufactures products that include instructions that implement the specified functions / acts in one or more blocks of the flowcharts and / or block diagrams.

コンピュータ・プログラム命令を、コンピュータ、他のプログラム可能データ処理装置、又は他のデバイス上にロードして、一連の動作ステップをコンピュータ、他のプログラム可能データ処理装置、又は他のデバイス上で行わせてコンピュータ実施のプロセスを生成し、それにより、コンピュータ又は他のプログラム可能装置、又は他のデバイス上で実行される命令が、フローチャート及び/又はブロック図の1つ又は複数のブロックにおいて指定された機能/動作を実行するためのプロセスを提供するようにもできる。   Loading computer program instructions onto a computer, other programmable data processing device, or other device to cause a series of operating steps to be performed on the computer, other programmable data processing device, or other device; Generates a computer-implemented process whereby instructions executed on a computer or other programmable device or other device cause instructions / functions specified in one or more blocks of flowcharts and / or block diagrams to occur. It can also provide a process for performing the action.

図面内のフローチャート及びブロック図は、本発明の種々の実施形態によるシステム、方法及びコンピュータ・プログラム製品の可能な実装のアーキテクチャ、機能及び動作を示す。この点に関して、フローチャート又はブロック図内の各ブロックは、指定された論理機能を実装するための1つ又は複数の実行可能命令を含むモジュール、セグメント、又は命令の部分を表すことができる。幾つかの代替的な実装において、ブロック内に記載された機能は、図面内に記載された順序とは異なる順序で行われ得ることもある。例えば、連続して示された2つのブロックが、関与する機能に応じて、実際には、実質的に同時に実行されることもあり、又は、ときにはブロックが逆順に実行されることもある。また、ブロック図及び/又はフローチャート図の各ブロック、並びにブロック図及び/又はフローチャート図内のブロックの組み合わせは、指定された機能又は動作を行う専用ハードウェア・ベースのシステムによって、又は専用ハードウェアとコンピュータ命令との組み合わせによって実装できることにも留意されたい。   The flowcharts and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions that includes one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially simultaneously, or sometimes the blocks may be executed in the reverse order, depending on the function involved. Also, each block in the block diagrams and / or flowchart diagrams, and combinations of blocks in the block diagrams and / or flowchart diagrams, may be performed by dedicated hardware-based systems that perform designated functions or operations, or Note also that it can be implemented in combination with computer instructions.

好ましい実施形態が本明細書に詳細に示され、説明されたが、当業者には、本開示の趣旨から逸脱することなく、種々の修正、付加、置換等を行うことができることが明らかであり、従って、これらは以下の特許請求の範囲内に定められるような本開示の趣旨の範囲内にあると考えられる。   While preferred embodiments have been shown and described in detail herein, it will be apparent to those skilled in the art that various modifications, additions, substitutions, and the like can be made without departing from the spirit of the disclosure. Accordingly, they are considered to be within the spirit of the present disclosure as defined in the following claims.

100:ダイ
114a、114b:CPU
116a、116b:命令キャッシュ
118a、118b:データ・キャッシュ
120a、120b:相互接続制御
122:相互接続
124:共有キャッシュ
126:レジスタ・チェックポイント
128:特殊TMレジスタ
130:MESIビット
132:Rビット
138:Wビット
140:タグ
142:データ
204:命令フェッチ・ユニット
208:命令デコード・ユニット(IDU)
212:トランザクション・ネスト化深さ(TND)
216:発行キュー
220:固定小数点数ユニット(FXU)
224:バックアップ・レジスタ・ファイル
228:汎用レジスタ(GR)
232:グローバル完了テーブル(GCT)
232a:トランザクション・ネスト化深さ(TND)
232b:micro−op(Uop)
236:アドレス計算器
240:L1データ・キャッシュ
244:有効ビット
248:TX−読み取りビット
252:TX−ダーティビット
256:L1ディレクトリ
260:ストア・キュー(STQ)
264:収集ストア・キャッシュ
268:L2データ・キャッシュ
280:ロード/ストア・ユニット(LSU)
800:内部コンポーネント
820:プロセッサ
822:コンピュータ可読RAM
824:コンピュータ可読ROM
826:バス
828:オペレーティング・システム
830、936:コンピュータ可読有形ストレージ・デバイス
832:R/Wドライブ又はインターフェース
836:ネットワーク・アダプタ又はインターフェース
840:デバイス・ドライバ
900:外部コンポーネント
920:コンピュータ・ディスプレイ・モニタ
930:キーボード
934:コンピュータ・マウス
1000:コンピューティング・デバイス
100: die 114a, 114b: CPU
116a, 116b: instruction caches 118a, 118b: data caches 120a, 120b: interconnection control 122: interconnection 124: shared cache 126: register checkpoint 128: special TM register 130: MESI bit 132: R bit 138: W Bit 140: Tag 142: Data 204: Instruction fetch unit 208: Instruction decode unit (IDU)
212: Transaction nesting depth (TND)
216: Issue queue 220: Fixed point number unit (FXU)
224: Backup register file 228: General-purpose register (GR)
232: Global Completion Table (GCT)
232a: Transaction nesting depth (TND)
232b: micro-op (Uop)
236: address calculator 240: L1 data cache 244: valid bit 248: TX-read bit 252: TX-dirty bit 256: L1 directory 260: store queue (STQ)
264: Collection store cache 268: L2 data cache 280: Load / store unit (LSU)
800: Internal component 820: Processor 822: Computer readable RAM
824: Computer readable ROM
826: Bus 828: Operating system 830, 936: Computer readable tangible storage device 832: R / W drive or interface 836: Network adapter or interface 840: Device driver 900: External component 920: Computer display monitor 930 : Keyboard 934: computer mouse 1000: computing device

Claims (20)

Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクション的に実行すべきかどうかを予測的に判断するための方法であって、
HLEトランザクション実行のためのHLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、前記ロックを無効化し、HLEトランザクションとして進行させるか、又は前記ロックを取得して非トランザクションとして進行させるかを決定することと、
HLE予測器が無効化を行うと予測することに基づき、前記ロックのアドレスを前記HLEトランザクションの読み取りセットとして設定し、前記lock−acquire命令による前記ロックへのあらゆる書き込みを抑止し、前記ロックを解放するxrelease命令に遭遇するまで又は前記HLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、
HLE予測器が無効化を行わないと予測することに基づき、前記HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることと、
を含み、前記HLE予測器は、前記ロックに関する以前の前記無効化を行わないとした予測の成否を考慮して、前記無効化を行うか前記無効化を行わないかの予測を行う、方法。
In a Hardware Lock Elimination (HLE) environment, a method for an HLE transaction to actually acquire a lock and predictively determine whether to execute non-transactionally,
Based on encountering an HLE lock-acquire instruction to execute an HLE transaction, invalidate the lock and proceed as an HLE transaction or acquire the lock and proceed as a non-transaction based on an HLE predictor. To determine
Based on the prediction that the HLE predictor will perform the invalidation, set the address of the lock as a read set of the HLE transaction, inhibit any write to the lock by the lock-acquire instruction, and release the lock. Proceeding in an HLE transaction execution mode until an xrelease instruction is encountered or the HLE transaction encounters a transaction conflict;
Treating the HLE lock-acquire instruction as a non-HLE lock-acquire instruction based on predicting that the HLE predictor will not perform the invalidation and proceeding in a non-transactional mode;
Only containing the HLE predictor takes into account the success of the prediction was not performed prior the revocation relating to the lock, to predict whether not to perform the said disabling or performing invalidation method .
前記HLEトランザクションの予測の成功に基づき、前記HLE予測器を更新することであって、前記HLE予測器は、HLEトランザクションがアボートする可能性が高いかどうかを予測する、更新することをさらに含む、請求項1に記載の方法。   Updating the HLE predictor based on a successful prediction of the HLE transaction, the HLE predictor further comprising: predicting and updating whether the HLE transaction is likely to abort; The method of claim 1. 前記ロックのアドレスを有するHLEトランザクションに初めて遭遇することに基づき、前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行のカウントをゼロに初期化することと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションをアボートすることに基づき、前記HLE予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることであって、失敗したHLEトランザクション実行のカウントが高いことはアボートの可能性が高いことを示す、前記インクリメントすることと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションを完了することに基づき、前記HLE予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行の前記カウントをインクリメントすることと、
をさらに含み、前記無効化を行うか前記無効化を行わないかの予測は、前記成功したHLEトランザクション実行のカウントおよび前記失敗したHLEトランザクション実行のカウントを考慮して行われる、請求項1又は2に記載の方法。
Initializing a count of successful HLE transaction executions associated with the address of the lock to zero based on the first encounter of an HLE transaction with the address of the lock;
Incrementing a count of failed HLE transaction executions associated with the address of the lock of the HLE transaction in the HLE predictor based on aborting any subsequent HLE transaction having the address of the lock. Increasing the count of failed HLE transaction executions indicates a high probability of an abort, said incrementing;
Incrementing the count of successful HLE transaction executions associated with the address of the lock of the HLE transaction in the HLE predictor based on completing any subsequent HLE transaction having the address of the lock;
Further seen including, wherein whether to disable or not to perform invalidation prediction, the are successful HLE considering the count of the count and the failed HLE transaction execution of transaction execution performed, according to claim 1 or 3. The method according to 2.
別のプロセスによる前記ロックへのアクセスの試行を非トランザクション・モードで監視することと、
前記別のプロセスによる前記アクセスの試行を検出したとき、前記失敗したHLEトランザクション実行の前記カウントをインクリメントすることと、
をさらに含む、請求項3に記載の方法。
Monitoring non-transactional mode for attempts to access the lock by another process;
Incrementing the count of the failed HLE transaction executions upon detecting the access attempt by the another process;
4. The method of claim 3, further comprising:
時間窓内の前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントを追跡することと、
前記失敗したHLEトランザクション実行のカウントを、前記時間窓の間の失敗の閾値数と比較することと、
前記失敗したHLEトランザクション実行のカウントが前記失敗の閾値数を上回ることに基づき、前記時間窓の残りについて非トランザクション・モードにデフォルト設定することと、
をさらに含む、請求項3又は4に記載の方法。
Tracking the count of the successful HLE transaction executions and the count of the failed HLE transaction executions within a time window;
Comparing the count of failed HLE transaction executions to a threshold number of failures during the time window;
Defaulting to a non-transactional mode for the remainder of the time window based on the count of failed HLE transaction executions exceeding the failed threshold number;
The method according to claim 3, further comprising:
前記時間窓の期間満了に基づき、前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントをゼロにリセットすることをさらに含む、請求項5に記載の方法。   The method of claim 5, further comprising resetting the count of successful HLE transaction executions and the count of failed HLE transaction executions to zero based on expiration of the time window. Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクション的に実行すべきかどうかを予測的に決定するためのコンピュータ・プログラムであって、前記コンピュータ・プログラムは、コンピュータに、
HLEトランザクション実行のためのHLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、前記ロックを無効化し、HLEトランザクションとして進行させるか、又は前記ロックを取得して非トランザクションとして進行させるかを決定することと、
HLE予測器が無効化を行うと予測することに基づき、前記ロックのアドレスを前記HLEトランザクションの読み取りセットとして設定し、前記lock−acquire命令による前記ロックへのあらゆる書き込みを抑止し、前記ロックを解放するxrelease命令に遭遇するまで又は前記HLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、
HLE予測器が無効化を行わないと予測することに基づき、前記HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることと、
を実行させるためのものであり、前記HLE予測器は、前記ロックに関する以前の前記無効化を行わないとした予測の成否を考慮して、前記無効化を行うか前記無効化を行わないかの予測を行う、コンピュータ・プログラム。
In a hardware lock elimination (HLE) environment, a computer program for an HLE transaction to actually acquire a lock and predictively determine whether to execute non-transactionally, said computer program comprising: ,
Based on encountering an HLE lock-acquire instruction to execute an HLE transaction, invalidate the lock and proceed as an HLE transaction or acquire the lock and proceed as a non-transaction based on an HLE predictor. To determine
Based on the prediction that the HLE predictor will perform the invalidation, set the address of the lock as a read set of the HLE transaction, inhibit any write to the lock by the lock-acquire instruction, and release the lock. Proceeding in an HLE transaction execution mode until an xrelease instruction is encountered or the HLE transaction encounters a transaction conflict;
Treating the HLE lock-acquire instruction as a non-HLE lock-acquire instruction based on predicting that the HLE predictor will not perform the invalidation and proceeding in a non-transactional mode;
The HLE predictor determines whether to perform the invalidation or the invalidation in consideration of the success or failure of the prediction that the previous invalidation for the lock was not performed. A computer program that makes predictions .
前記HLEトランザクションの予測の成功に基づき、前記HLE予測器を更新することであって、前記HLE予測器は、HLEトランザクションがアボートする可能性が高いかどうかを予測する、更新することをさらに実行させるための、請求項7に記載のコンピュータ・プログラム。   Updating the HLE predictor based on a successful prediction of the HLE transaction, wherein the HLE predictor further performs predicting and updating whether the HLE transaction is likely to abort. A computer program according to claim 7, for executing the program. 別のプロセスによる前記ロックへのアクセスの試行を非トランザクション・モードで監視することと、
前記別のプロセスによる前記アクセスの試行を検出したとき、前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることと、
をさらに実行させるための、請求項7又は8に記載のコンピュータ・プログラム。
Monitoring non-transactional mode for attempts to access the lock by another process;
Incrementing a count of failed HLE transaction executions associated with the address of the lock upon detecting the access attempt by the another process;
The computer program according to claim 7, further causing the computer program to execute.
別のプロセスによる、前記ロックにより保護されるメモリ領域へのアクセスの試行を非トランザクション・モードで監視することと、
前記別のプロセスによる前記アクセスの試行を検出したとき、前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることと、
をさらに実行させるための、請求項7ないし9のいずれかに記載のコンピュータ・プログラム。
Monitoring, in non-transactional mode, attempts by another process to access the memory area protected by the lock;
Incrementing a count of failed HLE transaction executions associated with the address of the lock upon detecting the access attempt by the another process;
The computer program according to any one of claims 7 to 9, further causing the computer program to execute.
前記ロックのアドレスを有するHLEトランザクションに初めて遭遇することに基づき、前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行のカウントをゼロに初期化することと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションをアボートすることに基づき、前記予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることであって、失敗したHLEトランザクション実行のカウントが高いことはアボートの可能性が高いことを示す、前記インクリメントすることと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションを完了することに基づき、前記HLE予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行の前記カウントをインクリメントすることと、
をさらに実行させるためのものであり、前記無効化を行うか前記無効化を行わないかの予測は、前記成功したHLEトランザクション実行のカウントおよび前記失敗したHLEトランザクション実行のカウントを考慮して行われる、請求項7ないし10のいずれかに記載のコンピュータ・プログラム。
Initializing a count of successful HLE transaction executions associated with the address of the lock to zero based on the first encounter of an HLE transaction with the address of the lock;
Incrementing a count of failed HLE transaction executions associated with the lock address of the HLE transaction in the predictor based on aborting any subsequent HLE transaction having the address of the lock, A high count of failed HLE transaction executions indicating a high probability of an abort, said incrementing;
Incrementing the count of successful HLE transaction executions associated with the address of the lock of the HLE transaction in the HLE predictor based on completing any subsequent HLE transaction having the address of the lock;
The prediction of whether to perform the invalidation or not to perform the invalidation is performed in consideration of the count of the successful HLE transaction execution and the count of the failed HLE transaction execution. computer program according to any one of claims 7 to 10.
時間窓内の前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントを追跡することと、
前記失敗したHLEトランザクション実行のカウントを、前記時間窓の間の失敗の閾値数と比較することと、
前記失敗したHLEトランザクション実行のカウントが前記失敗の閾値数を上回ることに基づき、前記時間窓の残りについて非トランザクション・モードにデフォルト設定することと、
をさらに実行させるための、請求項11に記載のコンピュータ・プログラム。
Tracking the count of the successful HLE transaction executions and the count of the failed HLE transaction executions within a time window;
Comparing the count of failed HLE transaction executions to a threshold number of failures during the time window;
Defaulting to a non-transactional mode for the remainder of the time window based on the count of failed HLE transaction executions exceeding the failed threshold number;
12. The computer program according to claim 11, further causing the computer program to execute.
前記時間窓の期間満了に基づき、前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントをゼロにリセットすることをさらに実行させるための、請求項12に記載のコンピュータ・プログラム。   13. The computer program of claim 12, further comprising resetting the count of successful HLE transaction executions and the count of failed HLE transaction executions to zero based on expiration of the time window. Hardware Lock Elision(HLE)環境において、HLEトランザクションが実際にロックを取得し、非トランザクション的に実行すべきかどうかを予測的に決定するためのコンピュータ・システムであって、前記コンピュータ・システムは、
メモリと、
前記メモリと通信するプロセッサと、を含み、かつ、
HLEトランザクション実行のためのHLE lock−acquire命令に遭遇することに基づき、HLE予測器に基づいて、前記ロックを無効化し、HLEトランザクションとして進行させるか、又は前記ロックを取得して非トランザクションとして進行させるかを決定することと、
HLE予測器が無効化を行うと予測することに基づき、前記ロックのアドレスを前記HLEトランザクションの読み取りセットとして設定し、前記lock−acquire命令による前記ロックへのあらゆる書き込みを抑止し、前記ロックを解放するxrelease命令に遭遇するまで又は前記HLEトランザクションがトランザクション競合に遭遇するまで、HLEトランザクション実行モードで進行させることと、
HLE予測器が無効化を行わないと予測することに基づき、前記HLE lock−acquire命令を非HLE lock−acquire命令として扱い、非トランザクション・モードで進行させることと、
を含む方法を実施するように構成され、前記HLE予測器は、前記ロックに関する以前の前記無効化を行わないとした予測の成否を考慮して、前記無効化を行うか前記無効化を行わないかの予測を行う、コンピュータ・システム。
In a Hardware Lock Elimination (HLE) environment, a computer system for an HLE transaction to actually acquire a lock and predictively determine whether to execute non-transactionally, said computer system comprising:
Memory and
A processor in communication with the memory; and
Based on encountering an HLE lock-acquire instruction to execute an HLE transaction, invalidate the lock and proceed as an HLE transaction or acquire the lock and proceed as a non-transaction based on an HLE predictor. To determine
Based on the prediction that the HLE predictor will perform the invalidation, set the address of the lock as a read set of the HLE transaction, inhibit any write to the lock by the lock-acquire instruction, and release the lock. Proceeding in an HLE transaction execution mode until an xrelease instruction is encountered or the HLE transaction encounters a transaction conflict;
Treating the HLE lock-acquire instruction as a non-HLE lock-acquire instruction based on predicting that the HLE predictor will not perform the invalidation and proceeding in a non-transaction mode;
Wherein the HLE estimator performs the invalidation or does not perform the invalidation in consideration of the success or failure of the prediction that the previous invalidation was not performed on the lock. A computer system that makes predictions .
前記コンピュータ・システムが実施する前記方法は、
前記HLEトランザクションの予測の成功に基づき、前記HLE予測器を更新することであって、前記HLE予測器は、HLEトランザクションがアボートする可能性が高いかどうかを予測する、更新することをさらに含む、請求項14に記載のコンピュータ・システム。
The method performed by the computer system comprises:
Updating the HLE predictor based on a successful prediction of the HLE transaction, the HLE predictor further comprising: predicting and updating whether the HLE transaction is likely to abort; The computer system according to claim 14.
前記コンピュータ・システムが実施する前記方法は、
別のプロセスによる前記ロックへのアクセスの試行を非トランザクション・モードで監視することと、
前記別のプロセスによる前記アクセスの試行を検出したとき、前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることと、
をさらに含む、請求項14又は15に記載のコンピュータ・システム。
The method performed by the computer system comprises:
Monitoring non-transactional mode for attempts to access the lock by another process;
Incrementing a count of failed HLE transaction executions associated with the address of the lock upon detecting the access attempt by the another process;
The computer system according to claim 14, further comprising:
前記コンピュータ・システムが実施する前記方法は、
別のプロセスによる、前記ロックにより保護されるメモリ領域へのアクセスの試行を非トランザクション・モードで監視することと、
前記別のプロセスによる前記アクセスの試行を検出したとき、前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることと、
をさらに含む、請求項14ないし16のいずれかに記載のコンピュータ・システム。
The method performed by the computer system comprises:
Monitoring, in non-transactional mode, attempts by another process to access the memory area protected by the lock;
Incrementing a count of failed HLE transaction executions associated with the address of the lock upon detecting the access attempt by the another process;
17. The computer system according to any one of claims 14 to 16, further comprising:
前記コンピュータ・システムが実施する前記方法は、
前記ロックのアドレスを有するHLEトランザクションに初めて遭遇することに基づき、前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行のカウントをゼロに初期化することと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションをアボートすることに基づき、前記予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた失敗したHLEトランザクション実行のカウントをインクリメントすることであって、失敗したHLEトランザクション実行のカウントが高いことはアボートの可能性が高いことを示す、前記インクリメントすることと、
前記ロックのアドレスを有するあらゆる後のHLEトランザクションを完了することに基づき、前記HLE予測器内の前記HLEトランザクションの前記ロックのアドレスと関連付けられた成功したHLEトランザクション実行の前記カウントをインクリメントすることと、
をさらに含み、前記無効化を行うか前記無効化を行わないかの予測は、前記成功したHLEトランザクション実行のカウントおよび前記失敗したHLEトランザクション実行のカウントを考慮して行われる、請求項14ないし17のいずれかに記載のコンピュータ・システム。
The method performed by the computer system comprises:
Initializing a count of successful HLE transaction executions associated with the address of the lock to zero based on the first encounter of an HLE transaction with the address of the lock;
Incrementing a count of failed HLE transaction executions associated with the lock address of the HLE transaction in the predictor based on aborting any subsequent HLE transaction having the address of the lock, A high count of failed HLE transaction executions indicating a high probability of an abort, said incrementing;
Incrementing the count of successful HLE transaction executions associated with the address of the lock of the HLE transaction in the HLE predictor based on completing any subsequent HLE transaction having the address of the lock;
18. The prediction of whether to perform the invalidation or not to perform the invalidation is performed in consideration of the count of the successful HLE transaction executions and the count of the failed HLE transaction executions. A computer system according to any one of the preceding claims.
前記コンピュータ・システムが実施する前記方法は、
時間窓内の前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントを追跡することと、
前記失敗したHLEトランザクション実行のカウントを、前記時間窓の間の失敗の閾値数と比較することと、
前記失敗したHLEトランザクション実行のカウントが前記失敗の閾値数を上回ることに基づき、前記時間窓の残りについて非トランザクション・モードにデフォルト設定することと、
をさらに含む、請求項18に記載のコンピュータ・システム。
The method performed by the computer system comprises:
Tracking the count of the successful HLE transaction executions and the count of the failed HLE transaction executions within a time window;
Comparing the count of failed HLE transaction executions to a threshold number of failures during the time window;
Defaulting to a non-transactional mode for the remainder of the time window based on the count of failed HLE transaction executions exceeding the failed threshold number;
19. The computer system of claim 18, further comprising:
前記コンピュータ・システムが実施する前記方法は、
前記時間窓の期間満了に基づき、前記成功したHLEトランザクション実行のカウント及び前記失敗したHLEトランザクション実行のカウントをゼロにリセットすることをさらに含む、請求項19に記載のコンピュータ・システム。
The method performed by the computer system comprises:
20. The computer system of claim 19, further comprising resetting the count of successful HLE transaction executions and the count of failed HLE transaction executions to zero based on expiration of the time window.
JP2016521660A 2013-10-14 2014-09-28 Adaptive process for data sharing using lock invalidation and lock selection Active JP6642806B2 (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
US201314052960A 2013-10-14 2013-10-14
US14/052,960 2013-10-14
US14/191,581 US9524195B2 (en) 2014-02-27 2014-02-27 Adaptive process for data sharing with selection of lock elision and locking
US14/191,581 2014-02-27
PCT/CN2014/087692 WO2015055083A1 (en) 2013-10-14 2014-09-28 Adaptive process for data sharing with selection of lock elision and locking

Publications (2)

Publication Number Publication Date
JP2016537709A JP2016537709A (en) 2016-12-01
JP6642806B2 true JP6642806B2 (en) 2020-02-12

Family

ID=52827651

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016521660A Active JP6642806B2 (en) 2013-10-14 2014-09-28 Adaptive process for data sharing using lock invalidation and lock selection

Country Status (3)

Country Link
JP (1) JP6642806B2 (en)
CN (1) CN105683906B (en)
WO (1) WO2015055083A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6468053B2 (en) * 2015-04-28 2019-02-13 富士通株式会社 Information processing apparatus, parallel processing program, and shared memory access method
JP6895719B2 (en) * 2016-06-24 2021-06-30 日立Astemo株式会社 Vehicle control device
US11868818B2 (en) * 2016-09-22 2024-01-09 Advanced Micro Devices, Inc. Lock address contention predictor
JP6943030B2 (en) 2017-06-16 2021-09-29 富士通株式会社 Information processing equipment, information processing methods and programs
EP3462308B1 (en) 2017-09-29 2022-03-02 ARM Limited Transaction nesting depth testing instruction
JP6839126B2 (en) * 2018-04-12 2021-03-03 日本電信電話株式会社 Control processing device, control processing method and control processing program
US10860388B1 (en) * 2019-07-09 2020-12-08 Micron Technology, Inc. Lock management for memory subsystems
CN113646763B (en) * 2019-08-15 2024-02-02 奇安信安全技术(珠海)有限公司 shellcode detection method and device
CN112905365B (en) * 2019-10-30 2024-02-13 支付宝(杭州)信息技术有限公司 Data processing method, device, equipment and medium
CN112199391B (en) * 2020-09-30 2024-02-23 深圳前海微众银行股份有限公司 Data locking detection method, equipment and computer readable storage medium
CN114791899A (en) * 2021-01-25 2022-07-26 华为技术有限公司 Database management method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529914B2 (en) * 2004-06-30 2009-05-05 Intel Corporation Method and apparatus for speculative execution of uncontended lock instructions
US8190859B2 (en) * 2006-11-13 2012-05-29 Intel Corporation Critical section detection and prediction mechanism for hardware lock elision
US8627030B2 (en) * 2007-11-07 2014-01-07 Intel Corporation Late lock acquire mechanism for hardware lock elision (HLE)
US8914620B2 (en) * 2008-12-29 2014-12-16 Oracle America, Inc. Method and system for reducing abort rates in speculative lock elision using contention management mechanisms
US8244988B2 (en) * 2009-04-30 2012-08-14 International Business Machines Corporation Predictive ownership control of shared memory computing system data
US8418156B2 (en) * 2009-12-16 2013-04-09 Intel Corporation Two-stage commit (TSC) region for dynamic binary optimization in X86
US20130159653A1 (en) * 2011-12-20 2013-06-20 Martin T. Pohlack Predictive Lock Elision

Also Published As

Publication number Publication date
JP2016537709A (en) 2016-12-01
WO2015055083A1 (en) 2015-04-23
CN105683906B (en) 2018-11-23
CN105683906A (en) 2016-06-15

Similar Documents

Publication Publication Date Title
US10585697B2 (en) Dynamic prediction of hardware transaction resource requirements
US9971628B2 (en) Salvaging hardware transactions
JP6490092B2 (en) Enhanced coherence protocol to indicate transaction status
JP6642806B2 (en) Adaptive process for data sharing using lock invalidation and lock selection
US9524196B2 (en) Adaptive process for data sharing with selection of lock elision and locking
US9753764B2 (en) Alerting hardware transactions that are about to run out of space
US9952943B2 (en) Salvaging hardware transactions
US9852014B2 (en) Deferral instruction for managing transactional aborts in transactional memory computing environments
US9495108B2 (en) Transactional memory operations with write-only atomicity
US11243770B2 (en) Latent modification instruction for substituting functionality of instructions during transactional execution
US10152418B2 (en) Speculation control for improving transaction success rate, and instruction therefor
US9262343B2 (en) Transactional processing based upon run-time conditions
US20150242216A1 (en) Committing hardware transactions that are about to run out of resource
JP6734760B2 (en) Prefetch insensitive transaction memory
US20150278120A1 (en) Transactional processing based upon run-time storage values
US20150378908A1 (en) Allocating read blocks to a thread in a transaction using user specified logical addresses

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160513

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170714

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180904

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181203

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20190528

RD12 Notification of acceptance of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7432

Effective date: 20190605

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20190606

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190910

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20190917

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20191126

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20191126

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191217

R150 Certificate of patent or registration of utility model

Ref document number: 6642806

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150