JP4199746B2 - Computer system, exclusive control method, and program - Google Patents

Computer system, exclusive control method, and program Download PDF

Info

Publication number
JP4199746B2
JP4199746B2 JP2005089946A JP2005089946A JP4199746B2 JP 4199746 B2 JP4199746 B2 JP 4199746B2 JP 2005089946 A JP2005089946 A JP 2005089946A JP 2005089946 A JP2005089946 A JP 2005089946A JP 4199746 B2 JP4199746 B2 JP 4199746B2
Authority
JP
Japan
Prior art keywords
cache
exclusive control
lock
entry address
address
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.)
Expired - Fee Related
Application number
JP2005089946A
Other languages
Japanese (ja)
Other versions
JP2006268781A (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.)
NEC Computertechno Ltd
Original Assignee
NEC Computertechno Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Computertechno Ltd filed Critical NEC Computertechno Ltd
Priority to JP2005089946A priority Critical patent/JP4199746B2/en
Publication of JP2006268781A publication Critical patent/JP2006268781A/en
Application granted granted Critical
Publication of JP4199746B2 publication Critical patent/JP4199746B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Description

本発明は、排他制御を行う機能を備えた計算機システム、排他制御方法、およびプログラムに関する。   The present invention relates to a computer system having an exclusive control function, an exclusive control method, and a program.

従来より、計算機システムでは、複数のプロセッサ(計算手段)が同一データへアクセスするために生じるデータの矛盾を回避する方法として、排他制御が用いられている。   Conventionally, in a computer system, exclusive control is used as a method for avoiding data inconsistency caused by a plurality of processors (calculation means) accessing the same data.

こうした従来の排他制御におけるロック取得イメージを図8に示す。
この図8に示すように、一般的な排他制御では、ロックアドレス1とロックアドレス2といった複数のロックが同一キャッシュブロックへアクセスする。
FIG. 8 shows a lock acquisition image in such conventional exclusive control.
As shown in FIG. 8, in general exclusive control, a plurality of locks such as lock address 1 and lock address 2 access the same cache block.

また、従来の排他制御として、処理ユニットによりロック指示情報をキャッシュブロックに対応づけて登録し、他のプロセッサが同一データへアクセスした場合に登録済みのロック指示情報によりアクセスの可否を判定し制御するものがある(例えば、特許文献1参照)。
特開平6−175981号公報
Also, as conventional exclusive control, lock instruction information is registered in association with a cache block by a processing unit, and when other processors access the same data, access permission is determined and controlled based on the registered lock instruction information. There are some (see, for example, Patent Document 1).
JP-A-6-175981

しかしながら、図8により上述した従来の排他制御では、同一キャッシュブロックへのアクセスが競合した場合、排他制御構造体1と排他制御構造体2の各々のメモリストアにより異なる排他制御構造体でのメモリリード時のキャッシュミス要因となってしまう虞があった。このキャッシュミスは、メモリリード量に比例して増加する。   However, in the conventional exclusive control described above with reference to FIG. 8, when access to the same cache block competes, the memory read in the exclusive control structure differs depending on the memory stores of the exclusive control structure 1 and the exclusive control structure 2. There was a risk of becoming a cash miss factor at the time. This cache miss increases in proportion to the memory read amount.

また、このように同一キャッシュブロックへのアクセス競合による待ち合わせが発生してしまうと、マルチプロセッサとしての処理効率が低下してしまうという問題があった。   In addition, when waiting due to contention for access to the same cache block occurs in this way, there is a problem that the processing efficiency as a multiprocessor is lowered.

また、上述した特許文献1のものは、上述した同一キャッシュブロックへのアクセス競合によるキャッシュミスの防止についてまで考慮されたものではなかった。   In addition, the above-mentioned Patent Document 1 does not take into account the prevention of cache miss due to access competition to the same cache block.

本発明はこのような状況に鑑みてなされたものであり、同一キャッシュブロックへのアクセス競合によるキャッシュミスを防止することができると共に、アクセス競合による待ち時間を最小限にすることができる計算機システム、排他制御方法、およびプログラムを提供することをを目的とする。   The present invention has been made in view of such a situation, and a computer system capable of preventing a cache miss due to access conflict to the same cache block and minimizing waiting time due to access conflict, An object is to provide an exclusive control method and a program.

かかる目的を達成するために、本発明の第1の態様としての計算機システムは、複数の計算手段を備え、排他制御を行う機能を備えた計算機システムであって、キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出手段(例えば、図2のステップS2)と、キャッシュのエントリアドレスが存在しない場合に上記キャッシュエントリアドレス算出手段により算出されたエントリアドレスを用いてキャッシュブロック単位にロックアドレスを設定するロックアドレス設定手段と、1つの計算手段によりロックアドレスが取得されてロック取得状態となった後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段に優先順位のより高い処理を先に実行させる優先処理実行手段(例えば、図6のステップS14)とを備え、上記キャッシュエントリアドレス算出手段は、上記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて上記キャッシュのエントリアドレスを算出することを特徴とする。 To achieve this object, the computer system according to the first aspect of the present invention is a computer system having a plurality of calculation means and a function of performing exclusive control, and there is no cache entry address. Cache entry address calculating means (for example, step S2 in FIG. 2) for calculating the entry address of the cache, and if there is no cache entry address, the cache entry address is calculated using the entry address calculated by the cache entry address calculating means. Lock content setting means for setting a lock address in block units, and access conflict in which a lock acquisition request is issued from another calculation means to the lock address after the lock address is acquired by one calculation means and the lock acquisition state is obtained If this occurs, the other Priority processing execution means for executing a higher processing priority to calculating means earlier (e.g., step S14 in FIG. 6) and a, the cache entry address calculation means, the number of said plurality of calculation means and the cache structure The cache entry address is calculated according to the cache block capacity measured by the measurement program for investigating

障害の発生が通知されると、該障害の発生した計算手段について上記ロックアドレス設定手段により設定されたロックアドレスにおけるロックを解放する診断装置を備えることが好ましい。When the occurrence of a failure is notified, it is preferable to provide a diagnostic device that releases the lock at the lock address set by the lock address setting unit for the calculation unit in which the failure has occurred.

記憶手段における排他制御に用いられる排他制御領域を備え、上記した排他制御領域は、上記した複数の計算手段の数を最大エントリ数とすることが好ましい。   An exclusive control area used for exclusive control in the storage means is provided, and the exclusive control area described above preferably uses the number of the plurality of calculating means as the maximum number of entries.

また、本発明の第2の態様としての排他制御方法は、複数の計算手段を備え、排他制御を行う機能を備えたシステムにおける排他制御方法であって、キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出工程(例えば、図2のステップS2)と、キャッシュのエントリアドレスが存在しない場合に上記キャッシュエントリアドレス算出工程で算出されたエントリアドレスを用いて1つの計算手段によりキャッシュブロック単位のロックアドレスが取得されてロック取得状態となる排他制御工程と、排他制御工程の後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段が優先順位のより高い処理を先に実行する優先処理実行工程(例えば、図6のステップS14)とを備え、上記キャッシュエントリアドレス算出工程では、上記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて上記キャッシュのエントリアドレスを算出することを特徴とする。 The exclusive control method according to the second aspect of the present invention is an exclusive control method in a system having a plurality of calculation means and a function of performing exclusive control, and when the cache entry address does not exist A cache entry address calculation step (for example, step S2 in FIG. 2) for calculating the cache entry address and one calculation using the entry address calculated in the cache entry address calculation step when there is no cache entry address An exclusive control process that obtains a lock address in cache block units by the means and enters the lock acquisition state, and an access conflict occurs after the exclusive control process that causes a lock acquisition request from another calculation means to the lock address , The other calculation means perform the higher priority processing Cache priority processing execution step of executing (e.g., step S14 in FIG. 6) and provided with, in the cache entry address calculating step, the number of said plurality of calculation means and, measured by the measurement program to investigate the cache structure The cache entry address is calculated according to the block capacity .

障害の発生が通知されると、該障害の発生した計算手段について上記排他制御工程で取得されたロックアドレスにおけるロックを解放する診断工程を備えることが好ましい。It is preferable to provide a diagnosis step of releasing the lock at the lock address acquired in the exclusive control step for the calculation means in which the failure has been notified when the occurrence of the failure is notified.

上記した優先処理実行工程では、排他制御に用いられる排他制御領域に対して、上記した複数の計算手段の数を最大エントリ数とすることが好ましい。   In the above priority processing execution step, it is preferable that the number of the plurality of calculation means described above is set to the maximum number of entries for the exclusive control area used for exclusive control.

また、本発明の第3の態様としての排他制御プログラムは、複数の計算手段を備え、排他制御を行う機能を備えたシステムにおける排他制御プログラムであって、コンピュータに、キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出処理(例えば、図2のステップS2)と、キャッシュのエントリアドレスが存在しない場合に上記キャッシュエントリアドレス算出処理で算出されたエントリアドレスを用いて1つの計算手段によりキャッシュブロック単位のロックアドレスが取得されてロック取得状態となる排他制御処理と、排他制御処理の後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段が優先順位のより高い処理を先に実行する優先処理実行処理(例えば、図6のステップS14)とを実行させ、上記キャッシュエントリアドレス算出処理では、上記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて上記キャッシュのエントリアドレスを算出することを特徴とする。 The exclusive control program according to the third aspect of the present invention is an exclusive control program in a system having a plurality of calculation means and a function of performing exclusive control, and there is no cache entry address in the computer. In this case, the cache entry address calculation process (for example, step S2 in FIG. 2) for calculating the entry address of the cache and the entry address calculated by the cache entry address calculation process when the cache entry address does not exist are used. An exclusive control process in which a lock address for each cache block is acquired by one calculation means and the lock acquisition state is entered, and an access conflict occurs after the exclusive control process in which a lock acquisition request is issued from another calculation means to the lock address The other calculator There priority processing execution process for executing a higher processing priority to previously (e.g., step S14 in FIG. 6) and allowed to run, with the cache entry address calculation process, the number of said plurality of calculation means and the cache structure The cache entry address is calculated according to the cache block capacity measured by the measurement program for investigating .

障害の発生が通知されると、該障害の発生した計算手段について上記排他制御処理で取得されたロックアドレスにおけるロックを解放する診断処理を上記コンピュータに実行させることが好ましい。When the occurrence of a failure is notified, it is preferable to cause the computer to execute a diagnostic process for releasing the lock at the lock address acquired by the exclusive control process for the calculation means in which the failure has occurred.

上記した優先処理実行処理では、排他制御に用いられる排他制御領域に対して、上記した複数の計算手段の数を最大エントリ数とすることが好ましい。   In the above priority processing execution processing, it is preferable that the number of the plurality of calculation means described above is set to the maximum number of entries for the exclusive control region used for exclusive control.

以上のように、本発明によれば、同一キャッシュブロックへのアクセス競合によるキャッシュミスを防止することができると共に、アクセス競合による待ち時間を最小限にすることができる。   As described above, according to the present invention, it is possible to prevent a cache miss due to access contention to the same cache block and to minimize waiting time due to access contention.

次に、本発明に係る計算機システム、排他制御方法、およびプログラムを適用した一実施形態について、図面を用いて詳細に説明する。
本実施形態の計算機システムは、排他制御動作における同一キャッシュブロックへのアクセス競合を削減しキャッシュ常駐率を高めることで、マルチプロセッサの処理効率を向上させる好適なものを例示している。
Next, an embodiment to which a computer system, an exclusive control method, and a program according to the present invention are applied will be described in detail with reference to the drawings.
The computer system of the present embodiment exemplifies a suitable system that improves the processing efficiency of the multiprocessor by reducing the access competition to the same cache block in the exclusive control operation and increasing the cache residence rate.

まず、図1を参照して、本実施形態におけるキャッシュエントリアドレスを利用した排他制御方法の概要について説明する。
キャッシュエントリアドレスの生成手段11は、プロセッサ1のキャッシュ10の構成情報が存在するか調査し、キャッシュ10のキャッシュエントリアドレスが存在する場合その情報をキャッシュ情報記憶部21へ格納する。キャッシュ10の構成情報が存在しない場合は、キャッシュ構造を調査するための測定プログラムを起動しキャッシュ10のキャッシュエントリアドレスを算出してキャッシュ情報記憶部21へ格納する。
First, an overview of an exclusive control method using a cache entry address in the present embodiment will be described with reference to FIG.
The cache entry address generation unit 11 checks whether the configuration information of the cache 10 of the processor 1 exists, and stores the information in the cache information storage unit 21 when the cache entry address of the cache 10 exists. If the configuration information of the cache 10 does not exist, a measurement program for investigating the cache structure is activated to calculate the cache entry address of the cache 10 and store it in the cache information storage unit 21.

また、本実施形態では、複数プロセッサでアクセスするデータ領域の排他制御時に、上記したキャッシュ10の構成情報が存在しない場合であっても、キャッシュエントリアドレスの生成手段11により算出されたキャッシュエントリアドレスに対応する排他制御領域のアドレスビットを利用してキャッシュブロック単位に排他制御を行い、同一キャッシュブロックへのアクセス競合を完全に排除しマルチプロセッサ性能を向上させる。また、排他制御領域のアクセス競合時には、他の優先度の高い割り込み処理等を優先して処理することによりマルチプロセッサの処理効率を向上させる。   In the present embodiment, the cache entry address calculated by the cache entry address generation unit 11 is used even when the configuration information of the cache 10 does not exist at the time of exclusive control of a data area accessed by a plurality of processors. The exclusive control is performed in units of cache blocks by using the address bits of the corresponding exclusive control area, and the access conflict to the same cache block is completely eliminated to improve the multiprocessor performance. Further, when there is an access conflict in the exclusive control area, the processing efficiency of the multiprocessor is improved by giving priority to other high priority interrupt processing.

次に、本実施形態の構成について、図面を参照して詳細に説明する。
図1を参照すると、本実施形態としての計算機システムは、プログラムを実行するプロセッサ1と、プログラムやデータを記憶する記憶装置2と、診断装置3と、キャッシュエントリアドレスの生成手段11と、排他制御の実行手段12とを備えて構成されている。
Next, the configuration of the present embodiment will be described in detail with reference to the drawings.
Referring to FIG. 1, a computer system according to this embodiment includes a processor 1 that executes a program, a storage device 2 that stores programs and data, a diagnostic device 3, a cache entry address generation unit 11, and exclusive control. The execution means 12 is comprised.

プロセッサ1は、キャッシュエントリアドレスの生成手段11と、排他制御の実行手段12とを含む。
記憶装置2は、プログラム記憶部20と、キャッシュエントリアドレスの生成手段11で生成したキャッシュエントリアドレスを格納するキャッシュ情報記憶部21と、排他制御領域22と、排他制御が必要なデータアクセス領域23とを含む。プログラム記憶部20は、キャッシュエントリアドレス生成手段11と排他制御の実行手段12とのプログラムを格納する。
診断装置3は、プロセッサの障害発生時に障害処理を行う。
The processor 1 includes a cache entry address generation unit 11 and an exclusive control execution unit 12.
The storage device 2 includes a program storage unit 20, a cache information storage unit 21 that stores the cache entry address generated by the cache entry address generation unit 11, an exclusive control area 22, and a data access area 23 that requires exclusive control. including. The program storage unit 20 stores programs of the cache entry address generation unit 11 and the exclusive control execution unit 12.
The diagnostic device 3 performs failure processing when a processor failure occurs.

上述した各部分は、それぞれ概略、次のように動作する。
キャッシュエントリアドレスの生成手段11は、図2に示すように、プロセッサ1のキャッシュ10の構成情報が存在するか調査し(ステップS1)、キャッシュ10のキャッシュエントリアドレスが存在する場合(ステップS1;Yes)、その情報をキャッシュ情報記憶部21へ格納する(ステップS3)。
Each of the above-described parts generally operates as follows.
As shown in FIG. 2, the cache entry address generation means 11 checks whether the configuration information of the cache 10 of the processor 1 exists (step S1). If the cache entry address of the cache 10 exists (step S1; Yes) The information is stored in the cache information storage unit 21 (step S3).

キャッシュ10の構成情報が存在しない場合(ステップS1;No)、キャッシュ構造を調査するための測定プログラムを起動し、キャッシュ10のキャッシュエントリアドレスを算出して(ステップS2)、キャッシュ情報記憶部21へ格納する(ステップS3)。   When the configuration information of the cache 10 does not exist (step S1; No), a measurement program for investigating the cache structure is started, the cache entry address of the cache 10 is calculated (step S2), and the cache information storage unit 21 is entered. Store (step S3).

また、キャッシュエントリアドレスの生成手段11は、システムの立ち上げ時等に一度だけ動作し、キャッシュ10のキャッシュエントリアドレスとシステムに接続されるプロセッサ台数から排他制御に必要なロックエントリアドレスをキャッシュ情報記憶部21へ格納する。
排他制御の実行時には、キャッシュ情報記憶部21へ格納したロックエントリ有効情報を排他制御情報として使用する(ステップS4)。
The cache entry address generation means 11 operates only once when the system is started up, and stores the cache entry address of the cache 10 and the lock entry address necessary for exclusive control from the number of processors connected to the system. Store in the unit 21.
When executing exclusive control, the lock entry valid information stored in the cache information storage unit 21 is used as exclusive control information (step S4).

本実施形態における排他制御では、図3に示すように、キャッシュブロック単位にロックアドレスを取得する(排他制御としてのロックを行う)。すなわち、本発明の実施形態では、図8により上述した従来の排他制御におけるロックアドレス2,4を使用せず、キャッシュブロックに対応するロックアドレスを生成するようにしている。
なお、図3に示す例では、ブロック容量32byte、最大プロセッサ数4台の場合を例として示している。
In the exclusive control in the present embodiment, as shown in FIG. 3, a lock address is acquired for each cache block (locking as exclusive control is performed). That is, in the embodiment of the present invention, the lock addresses corresponding to the cache block are generated without using the lock addresses 2 and 4 in the conventional exclusive control described above with reference to FIG.
In the example illustrated in FIG. 3, a block capacity of 32 bytes and a maximum number of processors of 4 are illustrated as an example.

また、本実施形態では、ロックエントリアドレスとして、キャッシュブロックに対応したロックアドレスをロックエントリアドレスとして使用している。
この本実施形態によるロックエントリアドレスの取得例を図4に示す。
In this embodiment, the lock address corresponding to the cache block is used as the lock entry address as the lock entry address.
An example of acquiring the lock entry address according to this embodiment is shown in FIG.

また、排他制御の実行手段12は、排他制御が必要なデータアクセス領域23へアクセスする場合に、キャッシュ情報記憶部21へ格納されているロックエントリ有効情報に該当するアドレスビットに対応するアドレスを抽出し排他制御領域22のキャッシュブロックに対応するエントリを算出する。また、この排他制御領域22のエントリ数は、全てのキャッシュブロック分を確保する必要はないため、同時にメモリアクセスを行うシステムのプロセッサ台数と同数のエントリを最大エントリ数として確保するだけで良い。排他制御を取得する場合には、排他制御領域22の該当するエントリを読み出しロック取得状態“FF以外”であれば、データアクセス領域へのアクセスを中止し保留されている処理や優先度の高いプロセスを起動する。ロック未取得状態“FF”であれば、排他制御領域の該当するエントリがロック取得状態であることを示す“プロセッサ番号”を格納する。   The exclusive control executing means 12 extracts an address corresponding to the address bit corresponding to the lock entry valid information stored in the cache information storage unit 21 when accessing the data access area 23 that needs exclusive control. Then, an entry corresponding to the cache block in the exclusive control area 22 is calculated. Further, since the number of entries in the exclusive control area 22 does not need to be secured for all cache blocks, it is only necessary to secure the same number of entries as the number of processors of the system that simultaneously accesses the memory as the maximum number of entries. When acquiring exclusive control, if the corresponding entry in the exclusive control area 22 is read and the lock acquisition state is “other than FF”, access to the data access area is suspended and a process or a process with high priority is suspended. Start up. If the lock is not acquired “FF”, “processor number” indicating that the corresponding entry in the exclusive control area is in the lock acquisition state is stored.

次に、本実施形態による動作について、図面を参照して詳細に説明する。
図5は、本発明による排他制御領域のレイアウト例を示す図である。
Next, the operation according to the present embodiment will be described in detail with reference to the drawings.
FIG. 5 is a diagram showing a layout example of the exclusive control area according to the present invention.

以下の動作説明では、キャッシュブロックは32byteであることと仮定する。また、アドレスのビット幅は32bit、有効なプロセッサの台数は4台とし、プロセッサの番号は、00〜03として説明する。   In the following description of the operation, it is assumed that the cache block is 32 bytes. In the following description, the address bit width is 32 bits, the number of valid processors is four, and the processor numbers are 00 to 03.

システムの立ち上げ時に、プログラム記憶部20からキャッシュエントリアドレスの生成手段11が起動されると、キャッシュブロックの調査が行われる。キャッシュエントリアドレスの生成手段11は、キャッシュ10のキャッシュブロックが32byteであると判断すると、図4の〈例1〉に示すように、メモリへアクセスするアドレスビットのキャッシュブロック単位のアドレスの下位bitから有効なプロセッサの台数に対応する25〜26bitの2bit(プロセッサの台数が2の階乗でなければ、2の階乗に切り上げる)をロックエントリアドレスの有効ビットのマスク情報をロックエントリ情報としてキャッシュ情報記憶部21へ格納する。
また、排他制御領域22に、排他制御に必要なエントリをキャッシュブロック単位に有効なプロセッサ台数分確保する。このとき、ロック取得状態は未取得状態“FF”に初期化しておく。
When the cache entry address generation unit 11 is activated from the program storage unit 20 at the time of starting the system, the cache block is examined. When the cache entry address generation means 11 determines that the cache block of the cache 10 is 32 bytes, as shown in <Example 1> of FIG. 4, from the lower bits of the address of the cache block unit of the address bits for accessing the memory Cache information with the mask information of the effective bit of the lock entry address as 2 bits of 25 to 26 bits corresponding to the number of valid processors (if the number of processors is not the second factor, round up to the second factor) Store in the storage unit 21.
In the exclusive control area 22, entries necessary for exclusive control are secured for the number of valid processors in units of cache blocks. At this time, the lock acquisition state is initialized to the non-acquisition state “FF”.

次に、本実施形態による排他制御の動作について、図6のフローチャートを参照して説明する。
まず、プロセッサ“00”にてデータアクセス領域にアクセスするアドレス(ビット25〜26=“00”)への排他制御が実行されると、排他制御の実行手段12にてキャッシュ情報記憶部21からロックエントリ情報(図4〈例2〉参照)を取り出し、ロックエントリアドレスを生成する(ステップS11)。
該当するエントリ00の排他制御領域22がロック未取得状態“FF”の時にロック取得状態“00”とする。この時、有効なプロセッサの台数が4台であるため、ロックエントリは、最大4エントリ確保されている。このときロックエントリアドレスは0と仮定し、図5で示すロックエントリ00以外の領域は、ロック取得状態と仮定する。
Next, the exclusive control operation according to the present embodiment will be described with reference to the flowchart of FIG.
First, when exclusive control to an address (bits 25 to 26 = “00”) for accessing the data access area is executed by the processor “00”, the exclusive information is locked from the cache information storage unit 21 by the exclusive control execution means 12. The entry information (see <Example 2> in FIG. 4) is taken out and a lock entry address is generated (step S11).
When the exclusive control area 22 of the corresponding entry 00 is in the lock non-acquisition state “FF”, the lock acquisition state “00” is set. At this time, since the number of valid processors is four, a maximum of four lock entries are secured. At this time, the lock entry address is assumed to be 0, and the area other than the lock entry 00 shown in FIG. 5 is assumed to be in the lock acquisition state.

この状態でプロセッサ“01”により、プロセッサ“00”と同一アドレスの排他制御が行われると、まず排他制御領域22の該当するエントリ00を読み出す(ステップS12)。このとき、エントリ00は、すでにロックされた「ロック取得状態」であるため(ステップS13;Yes)、ロックの取得を中止し、他の割り込み処理など、より優先順位の高いプロセスの実行を行う(ステップS14)。   In this state, when the exclusive control of the same address as the processor “00” is performed by the processor “01”, the corresponding entry 00 in the exclusive control area 22 is first read (step S12). At this time, since the entry 00 is already locked (“lock acquisition state”) (step S13; Yes), the acquisition of the lock is stopped, and a process with higher priority, such as other interrupt processing, is executed ( Step S14).

こうした割り込み処理など、実行要求がなされている排他制御よりも優先順位の高い処理の実行が完了すると(ステップS15;Yes)、再び上述したステップS12の処理から繰り返し、エントリ00が「ロック取得状態」でなくなっていれば、上述したステップS11と同様に、排他制御の実行手段12がキャッシュ情報記憶部21からロックエントリ情報を取り出し、プロセッサ“01”についてロックエントリアドレスを生成し、キャッシュ情報記憶部21に格納する。   When the execution of a process having a higher priority than the exclusive control for which an execution request has been made, such as the interrupt process, is completed (step S15; Yes), the process from step S12 described above is repeated again, and entry 00 becomes “lock acquisition state”. If not, as in step S11 described above, the exclusive control execution means 12 extracts the lock entry information from the cache information storage unit 21, generates a lock entry address for the processor "01", and generates the cache information storage unit 21. To store.

ここで仮に、プロセッサ“00”によりエントリ00が「ロック取得状態」となっている状態で、プロセッサ“01”がロックエントリアドレス(“01”)に対応するアドレスへの排他制御を実行すると、ロック未取得状態であるため、ロック取得が可能となる。   If the processor “01” executes exclusive control to the address corresponding to the lock entry address (“01”) in a state where the entry “00” is in the “lock acquisition state” by the processor “00”, the lock is performed. Since it is in an unacquired state, lock acquisition is possible.

次に、1台のプロセッサで障害が発生した時の動作について、図7のフローチャートを参照して説明する。この説明では、プロセッサ“00”で障害が発生したと仮定する。   Next, the operation when a failure occurs in one processor will be described with reference to the flowchart of FIG. In this description, it is assumed that a failure has occurred in the processor “00”.

プロセッサ“00”の障害が診断装置3に通知されると、排他制御領域22の4つのロックエントリを検索する(ステップS21)。ロックエントリ00には障害が発生したプロセッサの番号が格納されているため、診断装置3はそのプロセッサ番号のロックエントリ情報におけるロックを解放する(ステップS22)。   When the failure of the processor “00” is notified to the diagnosis device 3, four lock entries in the exclusive control area 22 are searched (step S21). Since the number of the processor in which the failure has occurred is stored in the lock entry 00, the diagnostic device 3 releases the lock in the lock entry information of the processor number (step S22).

このようにして、キャッシュブロックの登録アドレス単位に排他制御を行うことにより、排他制御が必要なデータアクセス領域23へのアクセスを完全に抑止しキャッシュ常駐率を高めると共に、排他制御時のアクセス競合を最小化することによりマルチプロセッサの処理効率を向上させることができる。また、排他制御の高速化のために必要な専用の処理ユニットを有することなくSW(ソフトウェア)のバイナリコードを維持しつつプロセッサのキャッシュ構造に応じた最適な排他制御を行うことも可能となる。   In this way, by performing exclusive control for each registered address of the cache block, access to the data access area 23 that requires exclusive control is completely suppressed, the cache residence rate is increased, and access conflict during exclusive control is prevented. By minimizing, the processing efficiency of the multiprocessor can be improved. It is also possible to perform optimum exclusive control according to the cache structure of the processor while maintaining the SW (software) binary code without having a dedicated processing unit necessary for speeding up the exclusive control.

以上のように、上述した本発明の実施形態によれば、以下の効果を得ることができる。
第1の効果は、排他制御を行うためのアクセス競合による待ちあわせ時間を最小限に出来ることである。
その理由は、キャッシュブロックの登録アドレス単位に排他制御を行うためである。
As described above, according to the embodiment of the present invention described above, the following effects can be obtained.
The first effect is that the waiting time due to access contention for performing exclusive control can be minimized.
This is because exclusive control is performed in units of cache block registration addresses.

第2の効果は、排他制御するためにキャッシュメモリ内などに専用の処理ユニットを設ける必要がないことである。
その理由は、プログラムとして排他制御手段の実現が可能なためである。このため、排他制御を行うためのハードウェアリソースの不要な増加を抑えることができる。
The second effect is that it is not necessary to provide a dedicated processing unit in the cache memory or the like for exclusive control.
This is because the exclusive control means can be realized as a program. For this reason, an unnecessary increase in hardware resources for performing exclusive control can be suppressed.

第3の効果は、キャッシュ構造に応じて排他制御で使用するキャッシュブロックを容易に変更でき、キャッシュ構造の変化に柔軟に対応できることである。
その理由は、算出したキャッシュ情報により排他制御しているためである。
このように、キャッシュの構造に合わせてロック指示情報をキャッシュメモリ内の処理ユニットへ登録しないため、キャッシュ容量やエントリの変更が生じた場合であっても、ハードウェアリソースの変更を生じさせないようにすることができる。
A third effect is that the cache block used in the exclusive control can be easily changed according to the cache structure, and can flexibly cope with the change in the cache structure.
This is because exclusive control is performed based on the calculated cache information.
In this way, lock instruction information is not registered in the processing unit in the cache memory in accordance with the cache structure, so that even if the cache capacity or entry changes, the hardware resource does not change. can do.

第4の効果は、SWの実行ファイル(バイナリコード)を変更せずにプロセッサのキャッシュ構造に適した排他制御が可能なことである。
その理由は、プロセッサのキャッシュ情報を事前に調査し排他制御情報として利用しているためである。
The fourth effect is that exclusive control suitable for the cache structure of the processor is possible without changing the SW execution file (binary code).
This is because the cache information of the processor is examined in advance and used as exclusive control information.

第5の効果は、排他制御で使用するキャッシュブロック数を最小化できることである。
その理由は、プロセッサ台数に応じて排他制御に必要なキャッシュブロックの使用量を算出しているためである。
A fifth effect is that the number of cache blocks used in exclusive control can be minimized.
This is because the usage amount of the cache block necessary for exclusive control is calculated according to the number of processors.

このように、本発明の実施形態によれば、排他制御によるアクセス競合が生じた場合、割り込みや他の処理を優先して処理するため、アクセス競合による待ち時間を最小限にすることができる。   As described above, according to the embodiment of the present invention, when an access conflict due to exclusive control occurs, an interrupt or other processing is preferentially processed, so that a waiting time due to access conflict can be minimized.

また、図3により上述したようにキャッシュブロック単位にロックアドレスを取得するようにしているため、同一キャッシュブロックへのアクセス競合によるキャッシュミスを確実に防止することができる。   Also, as described above with reference to FIG. 3, since the lock address is acquired in units of cache blocks, it is possible to reliably prevent cache misses due to access competition to the same cache block.

また、発明の他の実施形態として、上述した実施形態のロックエントリアドレスビットの空きビットをロック種別表示として利用することにより、複数のロック制御も実現することが可能となる。   As another embodiment of the invention, a plurality of lock controls can be realized by using the empty bits of the lock entry address bits of the above-described embodiment as a lock type display.

以上のように、本発明の実施形態は、マルチプロセッサシステムの処理効率を向上するといった用途に適用できる。また、プログラムのバイナリコードを変更することなくプロセッサに適した排他制御を実現する機能といった用途にも適用可能である。   As described above, the embodiments of the present invention can be applied to uses such as improving the processing efficiency of a multiprocessor system. Further, the present invention can also be applied to uses such as a function for realizing exclusive control suitable for a processor without changing the binary code of the program.

なお、上述した各実施形態は本発明の好適な実施形態であり、本発明はこれに限定されることなく、本発明の技術的思想に基づいて種々変形して実施することが可能である。
例えば、上述した実施形態では、プロセッサ(計算手段)を“00”〜“03”の4台備えることとして説明したが、複数のプロセッサを備えていればこの数に限定されず、いくつであってもよい。
Each of the above-described embodiments is a preferred embodiment of the present invention, and the present invention is not limited to this, and various modifications can be made based on the technical idea of the present invention.
For example, in the above-described embodiment, it has been described that four processors (calculation means) “00” to “03” are provided. However, the number of processors is not limited to this number as long as a plurality of processors are provided. Also good.

また、上述した各実施形態では、プログラムは、プログラム記憶部20に格納されることとして説明したが、コンピュータが読み取り可能な記録媒体であればこのものに限定されず、例えば、フロッピー(登録商標)ディスク,ハードディスク,光ディスク,光磁気ディスク,CD−ROM,CD−R,磁気テープ,不揮発性のメモリカード,EEPROM等に格納されてもよい。
すなわち、本発明の各実施形態による上述した各機能が、上述した記録媒体から供給されるプログラムによって、各種計算機システムのCPUなどが処理を行うことにより実現されてもよい。
そして、その場合、上述した記録媒体により、あるいはネットワークを介して外部の記録媒体から、プログラムを含む情報群を出力装置に供給される場合でも本発明は適用されるものである。
すなわち、記録媒体から読み出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードを記憶した記録媒体および該記録媒体から読み出された信号は本発明を構成することになる。
In each of the above-described embodiments, the program has been described as being stored in the program storage unit 20, but the present invention is not limited to this as long as it is a computer-readable recording medium. For example, a floppy (registered trademark) It may be stored in a disk, hard disk, optical disk, magneto-optical disk, CD-ROM, CD-R, magnetic tape, nonvolatile memory card, EEPROM, or the like.
That is, each function described above according to each embodiment of the present invention may be realized by a CPU or the like of various computer systems performing a process by a program supplied from the above-described recording medium.
In this case, the present invention is applied even when an information group including a program is supplied to the output device from the recording medium described above or from an external recording medium via a network.
That is, the program code itself read from the recording medium realizes the novel function of the present invention, and the recording medium storing the program code and the signal read from the recording medium constitute the present invention. It will be.

この本発明に係るプログラムによれば、当該プログラムによって制御されるコンピュータに、上述した本発明に係る各実施形態としての計算機システムにおける各機能を実現させることができる。   According to the program according to the present invention, each function in the computer system as each embodiment according to the present invention described above can be realized by a computer controlled by the program.

本発明の実施形態としての計算機システムの構成例を示す図である。It is a figure which shows the structural example of the computer system as embodiment of this invention. 本実施形態でのキャッシュへのアクセス動作を示すフローチャートである。It is a flowchart which shows the access operation to the cache in this embodiment. 本実施形態による排他制御でのロック取得イメージを示す図である。It is a figure which shows the lock acquisition image in the exclusive control by this embodiment. 本実施形態でのロックエントリアドレスの例を示す図である。It is a figure which shows the example of the lock entry address in this embodiment. 本実施形態による排他制御領域のレイアウト例を示す図である。It is a figure which shows the example of a layout of the exclusive control area | region by this embodiment. 本実施形態による排他制御動作を示すフローチャートである。It is a flowchart which shows the exclusive control operation | movement by this embodiment. 本実施形態による障害発生時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of the failure generation by this embodiment. 従来の排他制御でのロック取得イメージを示す図である。It is a figure which shows the lock acquisition image in the conventional exclusive control.

符号の説明Explanation of symbols

1 プロセッサ
10 キャッシュ
11 キャッシュエントリアドレスの生成手段
12 排他制御の実行手段
2 記憶装置
20 プログラム記憶部
21 キャッシュ情報記憶部
22 排他制御領域
23 データアクセス領域
3 診断装置
DESCRIPTION OF SYMBOLS 1 Processor 10 Cache 11 Cache entry address generation means 12 Exclusive control execution means 2 Storage device 20 Program storage portion 21 Cache information storage portion 22 Exclusive control area 23 Data access area 3 Diagnostic device

Claims (9)

複数の計算手段を備え、排他制御を行う機能を備えた計算機システムであって、
キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出手段と、
キャッシュのエントリアドレスが存在しない場合に前記キャッシュエントリアドレス算出手段により算出されたエントリアドレスを用いてキャッシュブロック単位にロックアドレスを設定するロックアドレス設定手段と、
1つの計算手段によりロックアドレスが取得されてロック取得状態となった後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段に優先順位のより高い処理を先に実行させる優先処理実行手段とを備え
前記キャッシュエントリアドレス算出手段は、前記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて前記キャッシュのエントリアドレスを算出することを特徴とする計算機システム。
A computer system having a plurality of calculation means and a function of performing exclusive control,
A cache entry address calculating means for calculating an entry address of the cache when there is no cache entry address;
Lock address setting means for setting a lock address for each cache block using the entry address calculated by the cache entry address calculation means when there is no cache entry address ;
When an access conflict occurs in which a lock acquisition request is made from another calculation means after the lock address is acquired by one calculation means and the lock acquisition state is set, the priority is given to the other calculation means. Priority processing execution means for executing the higher processing first ,
The cache entry address calculation means calculates the cache entry address according to the number of the plurality of calculation means and the cache block capacity measured by a measurement program for investigating the cache structure. .
障害の発生が通知されると、該障害の発生した計算手段について前記ロックアドレス設定手段により設定されたロックアドレスにおけるロックを解放する診断装置を備えたことを特徴とする請求項1記載の計算機システム。  2. The computer system according to claim 1, further comprising: a diagnostic device that releases a lock at a lock address set by the lock address setting unit when the occurrence of a failure is notified of the calculation unit in which the failure has occurred. . 記憶手段における排他制御に用いられる排他制御領域を備え、
前記排他制御領域は、前記複数の計算手段の数を最大エントリ数とすることを特徴とする請求項1または2記載の計算機システム。
Provided with an exclusive control area used for exclusive control in the storage means,
3. The computer system according to claim 1, wherein the exclusive control area sets the number of the plurality of calculation means as a maximum number of entries.
複数の計算手段を備え、排他制御を行う機能を備えたシステムにおける排他制御方法であって、
キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出工程と、
キャッシュのエントリアドレスが存在しない場合に前記キャッシュエントリアドレス算出工程で算出されたエントリアドレスを用いて1つの計算手段によりキャッシュブロック単位のロックアドレスが取得されてロック取得状態となる排他制御工程と、
前記排他制御工程の後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段が優先順位のより高い処理を先に実行する優先処理実行工程とを備え
前記キャッシュエントリアドレス算出工程では、前記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて前記キャッシュのエントリアドレスを算出することを特徴とする排他制御方法。
An exclusive control method in a system having a plurality of calculation means and a function of performing exclusive control,
A cache entry address calculating step for calculating an entry address of the cache when the entry address of the cache does not exist;
An exclusive control step in which a lock address in units of cache blocks is acquired by one calculation means using the entry address calculated in the cache entry address calculation step when there is no cache entry address, and a lock acquisition state is obtained;
Priority processing execution in which, when an access conflict occurs in which the lock acquisition request is made from the other calculation means at the lock address after the exclusive control step, the other calculation means executes the higher priority processing first. A process ,
In the cache entry address calculating step, the cache entry address is calculated according to the number of the plurality of calculation means and the cache block capacity measured by a measurement program for investigating the cache structure. Method.
障害の発生が通知されると、該障害の発生した計算手段について前記排他制御工程で取得されたロックアドレスにおけるロックを解放する診断工程を備えたことを特徴とする請求項4記載の排他制御方法。  5. The exclusive control method according to claim 4, further comprising a diagnostic step of releasing a lock at the lock address acquired in the exclusive control step for the calculation means in which the failure has been notified when the occurrence of the failure is notified. . 前記優先処理実行工程では、排他制御に用いられる排他制御領域に対して、前記複数の計算手段の数を最大エントリ数とすることを特徴とする請求項4または5記載の排他制御方法。   6. The exclusive control method according to claim 4, wherein, in the priority processing execution step, the number of the plurality of calculation units is set to the maximum number of entries for an exclusive control region used for exclusive control. 複数の計算手段を備え、排他制御を行う機能を備えたシステムにおける排他制御プログラムであって、
コンピュータに、
キャッシュのエントリアドレスが存在しない場合に当該キャッシュのエントリアドレスを算出するキャッシュエントリアドレス算出処理と、
キャッシュのエントリアドレスが存在しない場合に前記キャッシュエントリアドレス算出処理で算出されたエントリアドレスを用いて1つの計算手段によりキャッシュブロック単位のロックアドレスが取得されてロック取得状態となる排他制御処理と、
前記排他制御処理の後で当該ロックアドレスに他の計算手段からロック取得要求が行われるアクセス競合が発生した場合に、当該他の計算手段が優先順位のより高い処理を先に実行する優先処理実行処理とを実行させ
前記キャッシュエントリアドレス算出処理では、前記複数の計算手段の数および、キャッシュ構造を調査するための測定プログラムにより測定したキャッシュブロック容量に応じて前記キャッシュのエントリアドレスを算出することを特徴とする排他制御プログラム。
An exclusive control program in a system having a plurality of calculation means and a function of performing exclusive control,
On the computer,
A cache entry address calculation process for calculating an entry address of the cache when there is no cache entry address;
An exclusive control process in which a lock address for each cache block is acquired by one calculation means using the entry address calculated in the cache entry address calculation process when a cache entry address does not exist, and a lock acquisition state is obtained;
Execution of priority processing in which, when an access conflict occurs in which the lock acquisition request is made from the other calculation means at the lock address after the exclusive control process, the other calculation means executes the higher priority processing first. to execute the processing,
In the cache entry address calculation process, the cache entry address is calculated according to the number of the plurality of calculation means and the cache block capacity measured by a measurement program for investigating the cache structure. program.
障害の発生が通知されると、該障害の発生した計算手段について前記排他制御処理で取得されたロックアドレスにおけるロックを解放する診断処理を前記コンピュータに実行させることを特徴とする請求項7記載の排他制御プログラム。8. The computer according to claim 7, wherein when the occurrence of a failure is notified, the computer is caused to execute a diagnosis process for releasing the lock at the lock address acquired by the exclusive control process for the calculation means in which the failure has occurred. Exclusive control program. 前記優先処理実行処理では、排他制御に用いられる排他制御領域に対して、前記複数の計算手段の数を最大エントリ数とすることを特徴とする請求項7または8記載の排他制御プログラム。   9. The exclusive control program according to claim 7, wherein, in the priority process execution process, the number of the plurality of calculation units is set to the maximum number of entries for an exclusive control area used for exclusive control.
JP2005089946A 2005-03-25 2005-03-25 Computer system, exclusive control method, and program Expired - Fee Related JP4199746B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005089946A JP4199746B2 (en) 2005-03-25 2005-03-25 Computer system, exclusive control method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005089946A JP4199746B2 (en) 2005-03-25 2005-03-25 Computer system, exclusive control method, and program

Publications (2)

Publication Number Publication Date
JP2006268781A JP2006268781A (en) 2006-10-05
JP4199746B2 true JP4199746B2 (en) 2008-12-17

Family

ID=37204627

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005089946A Expired - Fee Related JP4199746B2 (en) 2005-03-25 2005-03-25 Computer system, exclusive control method, and program

Country Status (1)

Country Link
JP (1) JP4199746B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4767361B2 (en) * 2008-03-31 2011-09-07 パナソニック株式会社 Cache memory device, cache memory system, processor system

Also Published As

Publication number Publication date
JP2006268781A (en) 2006-10-05

Similar Documents

Publication Publication Date Title
US9513959B2 (en) Contention management for a hardware transactional memory
EP2972885B1 (en) Memory object reference count management with improved scalability
KR101470713B1 (en) Mechanisms to accelerate transactions using buffered stores
US7890725B2 (en) Bufferless transactional memory with runahead execution
US20150154045A1 (en) Contention management for a hardware transactional memory
JP5137971B2 (en) Method and system for achieving both locking fairness and locking performance with spin lock
JP6333848B2 (en) System and method for implementing a statistical counter with scalable competitive adaptability
JP4764360B2 (en) Techniques for using memory attributes
JP5270268B2 (en) Computer system for allowing exclusive access to shared data, method and computer-readable recording medium
JP2008501199A (en) Thread synchronization based on lock sizing method and lock sizing device in managed runtime environment
KR101970390B1 (en) Lock elision with binary translation based processors
US20090177847A1 (en) System and method for handling overflow in hardware transactional memory with locks
US20090183159A1 (en) Managing concurrent transactions using bloom filters
JP2011529603A (en) Advanced synchronization mechanism that can be virtualized
JP6341931B2 (en) System and method for implementing a shared probabilistic counter that stores update probability values
US11594252B2 (en) Reader bias based locking technique enabling high read concurrency for read-mostly workloads
JP6310943B2 (en) System and method for implementing a NUMA aware statistics counter
US20100205609A1 (en) Using time stamps to facilitate load reordering
Negi et al. π-TM: Pessimistic invalidation for scalable lazy hardware transactional memory
JP5435741B2 (en) Using mold-fixability to facilitate conflict management
JP4199746B2 (en) Computer system, exclusive control method, and program
US20130103930A1 (en) Data processing device and method, and processor unit of same
JP6222100B2 (en) Data storage device, data storage method and program
WO1993003436A1 (en) Method and apparatus for reducing lock period of shared buffer
JP4755232B2 (en) compiler

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071106

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071228

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: 20080924

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081003

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111010

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4199746

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121010

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131010

Year of fee payment: 5

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees