JP3996355B2 - Multiprocessor system - Google Patents
Multiprocessor system Download PDFInfo
- Publication number
- JP3996355B2 JP3996355B2 JP2001083506A JP2001083506A JP3996355B2 JP 3996355 B2 JP3996355 B2 JP 3996355B2 JP 2001083506 A JP2001083506 A JP 2001083506A JP 2001083506 A JP2001083506 A JP 2001083506A JP 3996355 B2 JP3996355 B2 JP 3996355B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- lock
- communication
- request
- processor
- 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
Links
Images
Landscapes
- Multi Processors (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、マルチプロセッサシステムにおける通信制御技術に関し、特にロック/アンロック処理を高速化する通信制御技術等に適用して有効な技術に関する。
【0002】
【従来の技術】
マルチプロセッサシステムにおいて効率よいマルチプロセス制御または並列プロセス制御を行うためには、プロセッサ間の高速な同期、排他、通信制御が必要である。そのために通信レジスタと呼ばれる主記憶より高速な共有のレジスタを使用する場合がある。
【0003】
特開2000−187652号公報においては、図7に示すマルチプロセッサシステムにおいて、図8の構成をとる通信レジスタを用いたプロセッサ間の高速な同期の例が開示されている。
【0004】
N個の通信レジスタモジュール400〜402はN個のプロセッサ10〜12と信号線L80〜L82を介して1対1に接続される。各プロセッサ10〜12は、信号線L80〜L82にロードストア要求および主記憶の実アドレスを出力する。通信レジスタモジュール400〜402は複数のレジスタから構成される通信レジスタ群500〜502を有し、通信レジスタモジュール間は通信モジュール間バス700で結合される。通信レジスタ群500〜502の各々内の相対応する番号のレジスタは通信レジスタモジュール間で同一の値を保持するよう制御されている(これを「通信レジスタがミラーリングされている」と呼ぶ)。信号線L80〜L82上のロードストア要求は、通信レジスタモジュール内のデコーダ430〜432でデコードされ、要求が主記憶30へのアクセス要求である場合は、相互結合網20を介して主記憶30をアクセスするよう制御され、要求が通信レジスタへのアクセス要求である場合は、通信モジュール間バス700を介して通信レジスタ群500〜502をアクセスするよう制御される。
【0005】
具体的には、プロセッサから書き込み要求が来た場合は、全通信レジスタモジュールに対して同一の値を書き込むよう相互結合網20、または通信モジュール間バス700が制御し、プロセッサ10〜12からの読み出し要求に対しては、各プロセッサ10〜12に対応する通信レジスタモジュール400〜402内のレジスタから値を読み出す。
【0006】
各通信レジスタはメモリマップドレジスタ方式(MMR方式)により、メモリアドレス空間上にマッピングされる。本従来例においては、ロック要求時、通信レジスタに非ロック状態を示す固定値が設定されていた場合、該通信レジスタには、ロック要求を発行したプロセッサのプロセッサ番号が設定され、リプライデータにも同じプロセッサ番号が返される。一方、通信レジスタに非ロック状態を示す固定値以外の値が設定されていたら、通信レジスタの内容(この場合はロックをかけている他のプロセッサ番号)をリプライデータとして返す。プロセッサはリプライデータの値が、自プロセッサ番号ならロック成功、他プロセッサ番号ならロック失敗を検知することができ、従来のプロセッサアーキテクチャを変えることなく、ロード/ストア要求によって、ロック/アンロック処理が可能になる。
【0007】
また、ロック値をプロセッサ番号ではなく、個々のプロセッサ内にて並行動作する複数のプロセスの各々を識別するためにユニークに付与されたプロセス番号とし、マルチプロセス時にプロセス単位でロック/アンロック処理を実現することも可能である。
【0008】
【発明が解決しようとする課題】
上述の特開2000−187652号公報に示されるマルチプロセッサシステムではプロセス番号をロック値として使用する場合、通信レジスタモジュール内の通信レジスタ本数を、ロック要求元であるプロセスの数に応じて増加させる必要がある。また、通信レジスタがミラーリングされているため、通信レジスタの増加がシステム全体の物量に与える影響も大きい。
【0009】
一方、ミラーリングせずに、通信レジスタが通信レジスタモジュール間で個別の内容を持つように制御する案も考えられる(これを「通信レジスタをフラットに置く」と呼ぶ)。こうすれば、物量の増大は抑えられるが、異なる通信レジスタモジュールに存在する通信レジスタへのアクセスやロック成功/失敗の報告信号が、通信モジュール間バスを中継しなければならず、アクセス速度が低下する。
【0010】
本発明の目的は、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、回路や論理物量等を増大させることなく、プロセッサ間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することが可能な技術を提供することにある。
【0011】
本発明の他の目的は、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、主記憶に対するアクセス速度を低下させることなく、プロセッサ間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することが可能な技術を提供することにある。
【0012】
本発明の他の目的は、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、回路や論理物量等の増大や主記憶に対するアクセス速度の低下を生じることなく、個々のプロセッサにて並行動作する複数のプロセス間での同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することが可能な技術を提供することにある。
【0013】
本発明の他の目的は、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、プロセッサアーキテクチャ等に変更を加えることなく、プロセッサ間あるいはプロセス間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することが可能な技術を提供することにある。
【0014】
【課題を解決するための手段】
本発明は、主記憶と、この主記憶を共有する複数のプロセッサの各々との間に、通信レジスタを介在させた構成のマルチプロセッサシステムにおいて、前記通信レジスタは、ロック/アンロック状態を保持する第1のレジスタとロック/アンロック情報を保持する第2のレジスタを持つ構成としたものである。また、ロック/アンロック状態を保持する第1のレジスタは、通信レジスタモジュール間でミラーリングされている。つまり、通信レジスタモジュール間で同一の値を保持するよう制御される。一方、ロック/アンロック情報を保持する第2のレジスタは、各通信レジスタモジュール間でフラットに置かれる。つまり、通信レジスタモジュール毎に個別の内容を保持する。
【0015】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照しながら詳細に説明する。
【0016】
図1は、本発明の一実施の形態であるマルチプロセッサシステムの全体構成の一例を示す概念図であり、図2、図3および図4は、その構成の一例をより詳細に例示した概念図である。
【0017】
本実施の形態のマルチプロセッサシステムは、複数のプロセッサ10(#1〜#NのN個)が、通信レジスタ40および相互結合網20を介して主記憶30を共有する構成となっている。通信レジスタ40は複数の通信レジスタモジュール400(#1〜#NのN個)を含んでいる。
【0018】
複数の通信レジスタモジュール400の各々は、複数のプロセッサ10の各々と信号線L80を介して1対1に接続される。各プロセッサ10は、信号線L80にロードストア要求および主記憶30の実アドレスを出力する。
【0019】
図2に例示されるように、個々の通信レジスタモジュール400は複数のレジスタから構成される通信レジスタ群500(#1〜#N)を有し、通信レジスタモジュール400の間は通信モジュール間バス700で結合される。信号線L80上のロードストア要求は、通信レジスタモジュール400内のデコーダ430でデコードされ、要求が主記憶30へのアクセス要求である場合は、信号線L80および相互結合網20を介して主記憶30をアクセスするよう制御され、要求が通信レジスタ40へのアクセス要求である場合は、通信モジュール間バス700を介して通信レジスタ群500をアクセスするよう制御される。
【0020】
なお、通信モジュール間バス700は、全通信レジスタモジュール400へのブロードキャスト書き込み要求が、同時に全通信レジスタモジュールに到達することが保証できれば、バスではなく結合網で構成してもよい。
【0021】
図3に、本実施の形態における通信レジスタ群500の構成の一例を示す。本実施の形態の場合、通信レジスタ群500には、ロック情報レジスタ510とロック状態レジスタ520の2種類の通信レジスタが存在する。
【0022】
ロック情報レジスタ510は、複数のビットから構成されるレジスタであり、通信レジスタ群500の全てにわたって合計N×M本存在する。各レジスタには固有の番号(1からN×Mまで)がレジスタ番号として割り当てられている。各レジスタの実体は、N個の通信レジスタモジュールそれぞれにM本ずつ分配されて存在する。具体的には、通信レジスタモジュール#1内にはレジスタ番号1からMまで、通信レジスタモジュール#2内にはレジスタ番号M+1から2Mまで、通信レジスタモジュール#N内にはレジスタ番号(N−1)M+1からN×Mまで、といった形でレジスタが各通信レジスタモジュールに割り振られる。
【0023】
ロック状態レジスタ520は、1ビットのフラグレジスタであり、各通信レジスタ群毎にN×M本ずつ存在する。レジスタ番号は各通信レジスタ群500毎に1からN×Mまで割り当てられる。異なる通信レジスタモジュール400間で対応するレジスタ番号をもつレジスタは同一の値を保持する(一つの通信レジスタモジュール400内でのロック状態レジスタ520の変更が、常に他の通信レジスタモジュール400内でのロック状態レジスタ520に反映される)ように制御される。
【0024】
つまり、ロック情報レジスタ510は各通信レジスタモジュール間でフラットに置かれ、ロック状態レジスタ520は各通信レジスタモジュール間でミラーリングされる。これらはいずれも実アドレスにマッピングされ、レジスタへのアクセスは、メモリアクセスを行うロード/ストア等の命令で行う。
【0025】
ロック状態レジスタ520のフラグがセットされている場合はその通信レジスタはロック状態にあることを示し、対応するレジスタ番号をもつロック情報レジスタ510には、ロック処理を要求したプロセスのプロセス番号が設定される。また、ロック状態レジスタ520のフラグがリセットされている場合はその通信レジスタはアンロック状態であることを示し、ロック情報レジスタ510の内容はDon’t careである。
【0026】
プロセス番号を設定するレジスタ(ロック情報レジスタ510)はフラットに存在し、通信レジスタ全体をミラーリングする場合に比べ物量の増大を抑えることができる。また、フラグレジスタ(ロック状態レジスタ520)のみミラーリングするため、ロック要求に対するロック成功/失敗の報告を通信モジュール間バス700を介さずにプロセッサ10に返すことが可能になる。
【0027】
ロック情報レジスタ510とロック状態レジスタ520へアクセスして、実際にロック/アンロック処理を行うには、従来アーキテクチャでロックフラグが主記憶30上にある場合のロック/アンロック処理時に使用する命令を使用する。本実施例では、一例として、PowerPCアーキテクチャにおけるロックフラグ操作用命令を用いる。
【0028】
なお、PowerPCアーキテクチャにおけるメモリ同期命令等については、たとえば、ソフトバンク株式会社1994年12月10日発行「Inside PowerPC」P181以降、等の文献に記載されている。
【0029】
PowerPCアーキテクチャにおいて、主記憶上にロックフラグが存在する場合のロック/アンロック処理は図5に示す命令列によって実現する。
【0030】
図5の各命令の意味を以下に示す。尚、r3はロックフラグの存在する主記憶上のアドレスが入っているレジスタ、r5は読み出したロックフラグ値を格納するレジスタ、r4は新たに設定するロック値が入っているレジスタである。
【0031】
lwarx r5,0,r3:ロックフラグの値を読み出し、レジスタr5に格納する。同時にリザベーション(後述)を確立する。
【0032】
cmp r5,0:r5の値をゼロと比較する。
【0033】
bc loop:r5の値がゼロでないならば、loopへ戻る。
【0034】
stwcx.r4,0,r3:リザベーションが残っていたらロックフラグにr4の値を書き込みに成功する。リザベーションが破棄されていたら、ロックフラグ書き込みに失敗する。
【0035】
bc loop:ロックフラグ書き込みが失敗していたらloopへ戻る。成功していたら、次行以降のクリティカル・リージョン内の命令列を実行する。
【0036】
sync:クリティカル・リージョン内の命令実行がすべて完了したことを保証する。
【0037】
stw 0,0(r3):ロックフラグにゼロを書き込む。
【0038】
前半5行に渡る命令列がロック処理、最後の1行がアンロック処理、それ以外はクリティカル・リージョンを示す。
【0039】
lwarx命令、stwcx.命令はそれぞれロード・アンド・リザーブ命令、ストア・コンディショナル命令と呼ばれ、PowerPCアーキテクチャにおけるアトミックな処理を実現する際に、常に対となって使用される命令である。
【0040】
ロード・アンド・リザーブ命令は、指定アドレスに対して、内容をリードする動作を行うとともに、リザベーションと呼ばれる保護領域を確立する。ストア・コンディショナル命令は、先行するロード・アンド・リザーブ命令によって確立されたリザベーションが破棄されていなかったら、指定アドレスへのライト動作を実行し、プロセッサにストア動作の「成功」を報告する。もし、リザベーションが存在する時に、他のプロセッサがストア命令を発行して、該アドレスの内容を更新すると、リザベーションは破棄される。この状態で、最初にロード・アンド・リザーブ命令を発行したプロセッサが、ストア・コンディショナル命令を発行すると、ストア動作は行われず、「失敗」したことを示すリプライをプロセッサに報告する。
【0041】
ロック処理を実現する場合、プロセッサはまず主記憶上のロックフラグに対してロード・アンド・リザーブ命令を発行する。読み出されたフラグ値がゼロでない場合は、他のプロセッサがロック中なので、自プロセッサはloopに戻り、フラグ値がゼロになるまで、ロード・アンド・リザーブ命令を繰り返す。フラグ値がゼロになったら、ストア・コンディショナル命令によって、ロックフラグを設定する。このとき、自プロセッサよりも他のプロセッサのロックフラグ設定が早いと、リザベーションが破棄されるので、フラグ値設定に失敗し、再びloopに戻ってロック値がゼロになるのを待つ。フラグ値設定に成功した場合、クリティカル・リージョンを実行する。クリティカル・リージョン実行後は、ロックフラグにゼロをストアしてアンロック処理を行う。
【0042】
図6に、本実施の形態におけるロック情報レジスタ510およびロック状態レジスタ520を使用してロック/アンロック処理を行う場合の命令列を例示する。
【0043】
図6の各命令の意味を以下に示す。尚、r3はロック情報レジスタR0のマッピングされている実アドレスが格納されているレジスタ、r4は新たに設定するロック値が入っているレジスタである。
【0044】
stwcx.r4,0,r3:ロック状態レジスタF0の値がゼロの場合、ロック状態レジスタF0を1にセットし、ロック情報レジスタR0にr4の値を書き込むことに成功する。ロック状態レジスタF0の値が1の場合、書き込み動作に失敗する。
【0045】
bc loop:フラグ書き込みが「失敗」ならばloopへ戻る。「成功」ならば、次行以降のクリティカル・リージョンに移る。
【0046】
sync:クリティカル・リージョン内の命令実行がすべて完了したことを保証する。
【0047】
stw 0,0(r3):ロック情報レジスタR0にゼロを書き込み、同時にロック状態レジスタF0にゼロをセットする。
【0048】
前半2行分の命令列がロック処理、最後の1行がアンロック処理、それ以外がクリティカル・リージョンである。
【0049】
ここでのストア・コンディショナル命令の動作は、図5の例の動作とは全く異なる。オペランドにはロック情報レジスタ510しか明示しないが、発行されると、対応するロック状態レジスタ520のフラグ値も参照・更新する。フラグ値がゼロならば、フラグをセットし、ロック情報レジスタ510にロック値を設定し、プロセッサに「成功」報告を行う。フラグ値が1ならば、フラグもロック値も設定せず、プロセッサに「失敗」報告を行う。
【0050】
ロック処理を実現する場合、まず、ロック情報レジスタ510に対してストア・コンディショナル命令を発行する。すると、対応するロック状態レジスタ520のフラグ値を参照し、フラグ値がゼロならば非ロック状態であるので、フラグをセットし、ロック情報レジスタ510にロック値を設定する。フラグ値が1ならば、他のプロセスによってロックされている状態なので、loopに戻り、再びストア・コンディショナル命令を繰り返す。ロック値設定に成功したら、クリティカル・リージョンを実行する。クリティカル・リージョン実行後は、ロック情報レジスタ510に対してストア命令を発行する。すると、対応するロック状態レジスタ520のフラグ値を無条件にゼロとし、ロック情報レジスタ510に値を書き込んで、アンロック処理を行う。
【0051】
このように、本実施の形態では、主記憶30をアクセスする場合と通信レジスタ40をアクセスする場合とで、既存のロックフラグを操作する命令の動作を切り替えている。切り替え制御を通信レジスタモジュール400内で行えば、従来のプロセッサアーキテクチャを変更することなく、通信レジスタ40を用いた高速ロック処理を実現することができる。また、その高速性は、図5と図6との命令列数の差に示されるように、ロック処理に要する命令数を削減して実行時間を短縮できることからも明白である。
【0052】
図4に本実施の形態のマルチプロセッサシステムにおける個々の通信レジスタモジュール400の構成の一例を示す。
【0053】
信号線L80から入力された要求はデコーダ430により解析され、ロード/ストア要求であった場合には、アクセスアドレスが通信レジスタ40にマッピングされた範囲外であれば、要求を信号線L80、相互結合網20を介して、主記憶30に送る。アクセスアドレスが通信レジスタ40にマッピングされた範囲内であれば、要求はリクエスト制御回路410に送られる。以下、要求ごとの動作を説明する。
【0054】
尚、本実施の形態の説明においては、要求を出したプロセッサ10と信号線L80を介して直接接続されている通信レジスタモジュール400を「マスタモジュール」、それ以外の通信レジスタモジュール400を「スレーブモジュール」とそれぞれ定義する。
【0055】
(a)ストア・コンディショナル要求(ロック要求)
ストア・コンディショナル要求が入力された場合、リクエスト制御回路410は、要求をセレクタ480に送り、それに基づきバス出力制御回路490は、通信モジュール間バス700に全通信レジスタモジュールにブロードキャスト出力するためのバス権を確保する。バス権確保が完了しブロードキャストが実行されると、自モジュールを含む全通信レジスタモジュール400のバス入力制御回路420に同時に要求が積まれる。
【0056】
バス入力制御回路420は要求を解析し、ロック情報レジスタ510が自モジュールにあるか調べる。そして、要求をレジスタ入力回路440に送る。それに基づき、書き込み対象のロック状態レジスタ520の内容が読み出されて、レジスタ出力回路450から出力される。その際、レジスタ入力回路440にはロック情報レジスタ510への書き込み値(この場合はロック要求元のプロセス番号値)とロック状態レジスタ520への書き込み値(この場合はロック成功時に書き込む値1)が、信号線L70からの指示信号を受け取るまで保持される。もし、書き込み対象となるロック情報レジスタ510が自モジュールに存在しない場合は、ロック状態レジスタ520への書き込み値のみが保持される。レジスタ出力回路450の出力は比較器460へ送られて、読み出された値がチェックされる。
【0057】
以降の動作は、自モジュールが、マスタモジュールかスレーブモジュールかによって、以下のように異なる。
【0058】
(a)−1:マスタモジュールの場合
読み出された値が1の場合は、他のプロセスによってロックされた状態であるのでロック失敗となり、リプライ制御回路470に、プロセッサへロックの「失敗」を示すリプライ報告を信号線L80を介して返すよう指示する。同時にレジスタ入力回路440に保持された書き込み値は破棄される。
【0059】
また、値がゼロの場合、非ロック状態なので、リプライ制御回路470に、プロセッサ10へロックの「成功」を示すリプライ報告を信号線L80を介して返すよう指示する。それと並行して、比較器460は信号線L70を通じてレジスタ入力回路440に、ロック情報レジスタ510への書き込み値とロック状態レジスタ520への書き込み値をレジスタに書き込むよう指示する。自モジュールに書き込み対象となるロック情報レジスタ510が存在しない場合は、ロック状態レジスタ520へのみ書き込みを行う。
【0060】
ロック状態レジスタ520はミラーリングされているため、プロセッサ10へのロック成功/失敗の報告は、通信モジュール間バス700を介さずに行うことができ、ロック処理の高速化が図れる。また、ロック情報レジスタ510はフラットに置かれるため、プロセス番号をロック値とする際に必要となる通信レジスタ数の増大によるシステムへの物量の影響を抑えることができる。
【0061】
(a)−2:スレーブモジュールの場合
読み出された値が1の場合は、他のプロセスによってロックされた状態であるのでロック失敗となり、レジスタ入力回路440内の値を破棄して処理を終わる。
【0062】
また、値がゼロの場合、非ロック状態なので、比較器460は信号線L70を通じてレジスタ入力回路440に、ロック情報レジスタ510への書き込み値とロック状態レジスタ520への書き込み値をレジスタに書き込むよう指示する。自モジュールに書き込み対象となるロック情報レジスタ510が存在しない場合は、ロック状態レジスタ520へのみ書き込みを行う。
【0063】
通信レジスタ40へのアクセス要求は、いったん通信モジュール間バス700経由でブロードキャストされ、バス入力制御回路420を介してからアクセスが行われる。そのため、複数のプロセスがほぼ同時に同じ通信レジスタ40に対してロック要求を発しても、要求は通信モジュール間バス700上でシリアライズされ、ロック要求のすり抜けは発生しない。
【0064】
(b)ストア要求(アンロック要求)
ストア要求が入力された場合、リクエスト制御回路410は、要求をセレクタ480に送り、それに基づきバス出力制御回路490は、通信モジュール間バス700にロック情報レジスタ510への書き込み値(この場合ストア命令で指定されたストアデータ)とロック状態レジスタ520への書き込み値(この場合フラグリセット値)を出力するためのバス権を確保する。バス権を確保し書き込み値をブロードキャストすると、自モジュールを含む全通信レジスタモジュールのバス入力制御回路420に同時に書き込み要求が積まれる。バス入力制御回路420は要求を解析し、自モジュールにロック情報レジスタ510があるか調べる。ある場合には、ロック情報レジスタ510とロック状態レジスタ520の両方への書き込み値をレジスタ入力回路440に送り、ない場合にはロック状態レジスタ520への書き込み値だけをレジスタ入力回路440に送る。それに基づき、通信レジスタ群500に書き込みが行われる。
【0065】
(c)ロード要求
ロード要求が入力された場合、リクエスト制御回路410は、要求をセレクタ480に送り、それに基づきバス出力制御回路490は、通信モジュール間バス700にロック情報レジスタ510またはロック状態レジスタ520への読み出し要求を出力するためのバス権を確保する。バス権を確保し要求をブロードキャストすると、自モジュールを含む全通信レジスタモジュール400のバス入力制御回路420に同時に読み出し要求が積まれる。
【0066】
バス入力制御回路420は要求を解析し、自モジュールにアクセス先のレジスタが存在する場合、要求をレジスタ入力回路440に送る。それに基づき、通信レジスタ群500内のレジスタの値が読み出され、レジスタ出力回路450から出力される。読み出された値はセレクタ480に送られ、バス出力制御回路490は、通信モジュール間バス700に読み出し値を出力するためにバス権を確保する。バス権を確保すると、値はバスを通じてロード要求元の通信レジスタモジュール400のバス入力制御回路420に送られる。
【0067】
ロード要求元の通信レジスタモジュール400のバス入力制御回路420は信号線L90を通じて、リプライ制御回路470に、値をロード要求発行元のプロセッサにリプライするよう指示し、リプライ値が信号線L80を通じてプロセッサ10に返される。
【0068】
以上説明したように、本実施の形態のマルチプロセッサシステムによれば、以下のことが可能となる。
【0069】
通信レジスタ40をロック情報レジスタ510とロック状態レジスタ520に分化し、通信レジスタモジュール400間でロック情報レジスタ510をフラットに持ち、ロック状態レジスタ520をミラーリングして持つことで、たとえば各プロセッサ10で稼働するプロセス単位でロック処理を行うマルチプロセッサシステムの物量増大を抑えることが可能になり、また、ロック処理時におけるプロセッサ10へのロック成功/失敗報告を通信モジュール間バス700を介さずにできるため、ロック処理の高速化が可能になる。
【0070】
通信レジスタ40へのアクセス要求は、通信モジュール間バス700経由でブロードキャストされ、シリアライズされるので、複数のプロセスがほぼ同時に同じ通信レジスタ40に対してロック要求を発しても、ロック要求のすり抜けを防ぐことができる。
【0071】
従来ロックフラグ操作命令を用い、ロックフラグが主記憶30に存在する場合と通信レジスタ40に存在する場合とで命令の動作を通信レジスタモジュール400内で切り替える制御を行うことにより、従来アーキテクチャのプロセッサ10を使用して高速なロック/アンロック処理を実現することができる。
【0072】
以上本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。
【0073】
たとえば、プロセッサとしては、PowerPCアーキテクチャに限らず、一般のプロセッサに広く適用することができる。
【0074】
【発明の効果】
本発明によれば、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、回路や論理物量等を増大させることなく、プロセッサ間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することができる、という効果が得られる。
【0075】
本発明によれば、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、主記憶に対するアクセス速度を低下させることなく、プロセッサ間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することができる、という効果が得られる。
【0076】
本発明によれば、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、回路や論理物量等の増大や主記憶に対するアクセス速度の低下を生じることなく、個々のプロセッサにて並行動作する複数のプロセス間での同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することができる、という効果が得られる。
【0077】
本発明によれば、複数のプロセッサにて主記憶を共有するマルチプロセッサシステムにおいて、プロセッサアーキテクチャ等に変更を加えることなく、プロセッサ間あるいはプロセス間の同期、排他、通信制御のための多数のロック/アンロック要求の処理を的確に実現することができる、という効果が得られる。
【図面の簡単な説明】
【図1】本発明の一実施の形態であるマルチプロセッサシステムの全体構成の一例を示す概念図である。
【図2】本発明の一実施の形態であるマルチプロセッサシステムの構成の一部をより詳細に例示した概念図である。
【図3】本発明の一実施の形態であるマルチプロセッサシステムの構成の一部をより詳細に例示した概念図である。
【図4】本発明の一実施の形態であるマルチプロセッサシステムの構成の一部をより詳細に例示した概念図である。
【図5】ロックフラグを主記憶上に置く場合の、プロセッサによるロック処理の命令列の一例を示す説明図である。
【図6】本発明の一実施の形態であるマルチプロセッサシステムにおけるプロセッサによるロック処理の命令列の一例を示す説明図である。
【図7】従来のマルチプロセッサシステムの構成を示す概念図である。
【図8】従来のマルチプロセッサシステムにおける構成の一部をより詳細に示す概念図である。
【符号の説明】
10…プロセッサ、20…相互結合網、30…主記憶、40…通信レジスタ、400…通信レジスタモジュール、410…リクエスト制御回路、420…バス入力制御回路、430…デコーダ、440…レジスタ入力回路、450…レジスタ出力回路、460…比較器、470…リプライ制御回路、480…セレクタ、490…バス出力制御回路、500…通信レジスタ群、510…ロック情報レジスタ(第2のレジスタ)、520…ロック状態レジスタ(第1のレジスタ)、700…通信モジュール間バス、L70…信号線、L80…信号線、L90…信号線。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a communication control technique in a multiprocessor system, and more particularly to a technique effective when applied to a communication control technique for speeding up lock / unlock processing.
[0002]
[Prior art]
In order to perform efficient multi-process control or parallel process control in a multi-processor system, high-speed synchronization, exclusion, and communication control between processors are necessary. Therefore, a shared register called a communication register that is faster than the main memory may be used.
[0003]
Japanese Patent Application Laid-Open No. 2000-187852 discloses an example of high-speed synchronization between processors using a communication register having the configuration shown in FIG. 8 in the multiprocessor system shown in FIG.
[0004]
The N
[0005]
Specifically, when a write request is received from the processor, the
[0006]
Each communication register is mapped on the memory address space by a memory mapped register method (MMR method). In this conventional example, when a lock request is made and a fixed value indicating an unlocked state is set in the communication register, the processor number of the processor that issued the lock request is set in the communication register, and the reply data is also set in the reply data. The same processor number is returned. On the other hand, if a value other than a fixed value indicating an unlocked state is set in the communication register, the contents of the communication register (in this case, the other processor number that is locked) are returned as reply data. If the value of the reply data is the own processor number, the processor can detect the lock success, and if the other processor number, the lock failure can be detected, and lock / unlock processing can be performed by load / store requests without changing the conventional processor architecture. become.
[0007]
Also, the lock value is not a processor number, but a process number uniquely assigned to identify each of a plurality of processes operating in parallel within each processor, and lock / unlock processing is performed in units of processes during multi-process. It can also be realized.
[0008]
[Problems to be solved by the invention]
When the process number is used as a lock value in the multiprocessor system disclosed in the above Japanese Patent Laid-Open No. 2000-187852, it is necessary to increase the number of communication registers in the communication register module in accordance with the number of processes that are lock request sources. There is. In addition, since the communication register is mirrored, the influence of the increase in the communication register on the physical quantity of the entire system is great.
[0009]
On the other hand, it is also conceivable to perform control so that the communication register has individual contents between the communication register modules without mirroring (this is referred to as “laying the communication register flat”). In this way, the increase in the amount can be suppressed, but the access signal to the communication register existing in the different communication register module and the report signal of the lock success / failure must be relayed through the communication module bus, and the access speed decreases. To do.
[0010]
An object of the present invention is to provide a large number of locks / unlocks for synchronization, exclusion, and communication control between processors in a multiprocessor system in which a main memory is shared by a plurality of processors without increasing a circuit or a logical amount. The object is to provide a technology capable of accurately realizing the processing of a request.
[0011]
Another object of the present invention is to provide a large number of locks for synchronization, exclusion, and communication control between processors without reducing the access speed to the main memory in a multiprocessor system in which a plurality of processors share the main memory. An object of the present invention is to provide a technique capable of accurately realizing processing of an unlock request.
[0012]
Another object of the present invention is a multiprocessor system in which a plurality of processors share a main memory, and the parallel operation of individual processors without causing an increase in circuit or logical quantity or a decrease in access speed to the main memory. It is an object of the present invention to provide a technique capable of accurately realizing processing of a large number of lock / unlock requests for synchronization, exclusion, and communication control among a plurality of processes.
[0013]
Another object of the present invention is that in a multiprocessor system in which a main memory is shared by a plurality of processors, a number of units for synchronization, exclusion, and communication control between processors or between processes without changing the processor architecture or the like. An object of the present invention is to provide a technique capable of accurately realizing processing of a lock / unlock request.
[0014]
[Means for Solving the Problems]
According to the present invention, in a multiprocessor system having a configuration in which a communication register is interposed between a main memory and each of a plurality of processors sharing the main memory, the communication register holds a locked / unlocked state. In this configuration, a first register and a second register for holding lock / unlock information are provided. The first register that holds the locked / unlocked state is mirrored between the communication register modules. That is, the communication register modules are controlled to hold the same value. On the other hand, the second register holding the lock / unlock information is placed flat between the communication register modules. That is, individual contents are held for each communication register module.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0016]
FIG. 1 is a conceptual diagram showing an example of the overall configuration of a multiprocessor system according to an embodiment of the present invention, and FIGS. 2, 3 and 4 are conceptual diagrams illustrating an example of the configuration in more detail. It is.
[0017]
The multiprocessor system according to the present embodiment is configured such that a plurality of processors 10 (N from # 1 to #N) share the
[0018]
Each of the plurality of
[0019]
As illustrated in FIG. 2, each
[0020]
Note that the
[0021]
FIG. 3 shows an example of the configuration of the
[0022]
The lock information register 510 is a register composed of a plurality of bits, and there are a total of N × M registers throughout the
[0023]
The
[0024]
That is, the lock information register 510 is placed flat between the communication register modules, and the
[0025]
When the flag of the
[0026]
A register for setting a process number (lock information register 510) exists in a flat manner, and an increase in the amount of material can be suppressed as compared with the case where the entire communication register is mirrored. In addition, since only the flag register (lock status register 520) is mirrored, it is possible to return a lock success / failure report for the lock request to the
[0027]
In order to access the lock information register 510 and the
[0028]
Note that the memory synchronization instruction and the like in the PowerPC architecture are described in documents such as “Inside PowerPC” P181 issued on and after December 10, 1994, SOFTBANK CORP.
[0029]
In the PowerPC architecture, the lock / unlock process when the lock flag exists in the main memory is realized by the instruction sequence shown in FIG.
[0030]
The meaning of each command in FIG. 5 is shown below. Note that r3 is a register that contains an address on the main memory where the lock flag exists, r5 is a register that stores the read lock flag value, and r4 is a register that contains a newly set lock value.
[0031]
lwarx r5, 0, r3: The value of the lock flag is read and stored in the register r5. At the same time, reservation (described later) is established.
[0032]
Compare the value of cmp r5,0: r5 with zero.
[0033]
bc loop: If the value of r5 is not zero, return to loop.
[0034]
stwcx. r4, 0, r3: If the reservation remains, the value r4 is successfully written to the lock flag. If the reservation has been discarded, writing the lock flag fails.
[0035]
bc loop: Return to loop if the lock flag writing has failed. If successful, execute the instruction sequence in the critical region after the next line.
[0036]
sync: guarantees that all instruction execution in the critical region is complete.
[0037]
[0038]
The instruction sequence over the first five lines indicates the lock process, the last line indicates the unlock process, and the rest indicates the critical region.
[0039]
lwarx instruction, stwcx. The instructions are referred to as a load and reserve instruction and a store conditional instruction, respectively, and are always used as a pair when realizing atomic processing in the PowerPC architecture.
[0040]
The load and reserve instruction performs an operation of reading the contents for a specified address and establishes a protection area called reservation. If the reservation established by the preceding load and reserve instruction has not been discarded, the store conditional instruction performs a write operation to the specified address, and reports the “success” of the store operation to the processor. If a reservation exists and another processor issues a store instruction to update the contents of the address, the reservation is discarded. In this state, when the processor that first issued the load and reserve instruction issues a store conditional instruction, the store operation is not performed, and a reply indicating “failure” is reported to the processor.
[0041]
When realizing the lock processing, the processor first issues a load and reserve instruction to the lock flag in the main memory. If the read flag value is not zero, the other processor is locked, so that the own processor returns to loop and repeats the load and reserve instruction until the flag value becomes zero. When the flag value becomes zero, the lock flag is set by a store conditional instruction. At this time, if the lock flag setting of the other processor is earlier than the own processor, the reservation is discarded. Therefore, the flag value setting fails, and it returns to loop again and waits for the lock value to become zero. If the flag value is set successfully, the critical region is executed. After executing the critical region, store zero in the lock flag and perform unlock processing.
[0042]
FIG. 6 shows an example of an instruction sequence when lock / unlock processing is performed using the lock information register 510 and the
[0043]
The meaning of each command in FIG. 6 is shown below. Note that r3 is a register storing a real address to which the lock information register R0 is mapped, and r4 is a register containing a lock value to be newly set.
[0044]
stwcx. r4, 0, r3: When the value of the lock state register F0 is zero, the lock state register F0 is set to 1, and the value of r4 is successfully written to the lock information register R0. When the value of the lock state register F0 is 1, the write operation fails.
[0045]
bc loop: If flag writing is “failure”, return to loop. If “success”, move to the critical region after the next line.
[0046]
sync: guarantees that all instruction execution in the critical region is complete.
[0047]
[0048]
The instruction sequence for the first two lines is the lock process, the last one is the unlock process, and the other is the critical region.
[0049]
The operation of the store conditional instruction here is completely different from the operation of the example of FIG. Only the lock information register 510 is explicitly shown in the operand, but when issued, the flag value of the corresponding
[0050]
When realizing the lock processing, first, a store conditional instruction is issued to the
[0051]
As described above, in the present embodiment, the operation of the instruction that operates the existing lock flag is switched between when the
[0052]
FIG. 4 shows an example of the configuration of each
[0053]
The request input from the signal line L80 is analyzed by the
[0054]
In the description of the present embodiment, the
[0055]
(A) Store conditional request (lock request)
When a store conditional request is input, the
[0056]
The bus
[0057]
Subsequent operations differ as follows depending on whether the own module is a master module or a slave module.
[0058]
(A) -1: Master module
When the read value is 1, it is locked by another process, so that the lock fails, and a reply report indicating “failure” of the lock is sent to the
[0059]
If the value is zero, the lock state is not locked, and the
[0060]
Since the
[0061]
(A) -2: Slave module
When the read value is 1, the lock is failed because it is locked by another process, the value in the
[0062]
Further, when the value is zero, since it is in the unlocked state, the
[0063]
An access request to the
[0064]
(B) Store request (unlock request)
When a store request is input, the
[0065]
(C) Load request
When a load request is input, the
[0066]
The bus
[0067]
The bus
[0068]
As described above, according to the multiprocessor system of the present embodiment, the following is possible.
[0069]
The
[0070]
Since an access request to the
[0071]
By using a conventional lock flag operation instruction and controlling the operation of the instruction in the
[0072]
Although the invention made by the present inventor has been specifically described based on the embodiments, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say.
[0073]
For example, the processor is not limited to the PowerPC architecture and can be widely applied to general processors.
[0074]
【The invention's effect】
According to the present invention, in a multiprocessor system in which a main memory is shared by a plurality of processors, a large number of locks / unlocks for synchronization, exclusion, and communication control between processors without increasing the circuit and the amount of logical objects. The effect that the processing of the request can be accurately realized is obtained.
[0075]
According to the present invention, in a multiprocessor system in which a main memory is shared by a plurality of processors, a large number of locks / unlocks for synchronization, exclusion, and communication control between processors without reducing the access speed to the main memory. The effect that the processing of the request can be accurately realized is obtained.
[0076]
According to the present invention, in a multiprocessor system in which a main memory is shared by a plurality of processors, a plurality of processors that operate in parallel in each processor without causing an increase in circuits, logical quantities, etc. or a decrease in access speed to the main memory. It is possible to accurately realize processing of a large number of lock / unlock requests for synchronization, exclusion, and communication control between the processes.
[0077]
According to the present invention, in a multiprocessor system in which a main memory is shared by a plurality of processors, a number of locks for synchronization, exclusion, and communication control between processors or between processes without changing the processor architecture or the like. There is an effect that the processing of the unlock request can be accurately realized.
[Brief description of the drawings]
FIG. 1 is a conceptual diagram showing an example of the overall configuration of a multiprocessor system according to an embodiment of the present invention.
FIG. 2 is a conceptual diagram illustrating a part of a configuration of a multiprocessor system according to an embodiment of the present invention in more detail.
FIG. 3 is a conceptual diagram illustrating a part of the configuration of a multiprocessor system according to an embodiment of the present invention in more detail.
FIG. 4 is a conceptual diagram illustrating a part of a configuration of a multiprocessor system according to an embodiment of the present invention in more detail.
FIG. 5 is an explanatory diagram showing an example of a command sequence for lock processing by a processor when a lock flag is placed on the main memory;
FIG. 6 is an explanatory diagram showing an example of an instruction sequence for lock processing by a processor in a multiprocessor system according to an embodiment of the present invention;
FIG. 7 is a conceptual diagram showing a configuration of a conventional multiprocessor system.
FIG. 8 is a conceptual diagram showing a part of a configuration in a conventional multiprocessor system in more detail.
[Explanation of symbols]
DESCRIPTION OF
Claims (3)
前記通信レジスタは、ロック/アンロック状態を保持する第1のレジスタとロック/アンロック情報を保持する第2のレジスタから構成され、
ロック/アンロック状態を保持する前記第1のレジスタは相異なる前記通信レジスタモジュール内の対応するレジスタと同一の内容を保持し、
ロック/アンロック情報を保持する前記第2のレジスタは個々の前記通信レジスタモジュール毎に個別の内容を保持し、
前記プロセッサからのロック処理要求に対しては、前記インターフェースを介して全ての前記通信レジスタモジュールに該要求をブロードキャストし、該プロセッサに対応する前記通信レジスタモジュール内の通信レジスタ内のロック/アンロック状態を保持する前記第1のレジスタの値を参照して、ロックの成功/失敗を該プロセッサに報告し、ロック可能時には全ての前記通信レジスタモジュール内のロック/アンロック状態を保持する前記第1のレジスタに同一のロックフラグを設定し、同時に対応するロック/アンロック情報を保持する前記第2のレジスタにロック処理要求を出した前記プロセッサ内のプロセス番号を設定することを特徴とするマルチプロセッサシステム。A plurality of processors, a main memory shared by the processors, an interconnection network for coupling the processors and the main memory, a plurality of communication register modules corresponding to each of the plurality of processors, and a plurality of the communications Each of the communication register modules is a multiprocessor system having a plurality of communication registers,
The communication register includes a first register that holds a lock / unlock state and a second register that holds lock / unlock information.
The first register holding the locked / unlocked state holds the same contents as the corresponding register in the different communication register module;
The second register holding lock / unlock information holds individual contents for each of the communication register modules,
In response to a lock processing request from the processor, the request is broadcast to all the communication register modules via the interface, and the lock / unlock state in the communication register in the communication register module corresponding to the processor is broadcast. The success / failure of the lock is reported to the processor with reference to the value of the first register that holds the first register, and the lock / unlock state in all the communication register modules is held when the lock is possible. A multiprocessor system in which the same lock flag is set in a register, and the process number in the processor that issued a lock processing request is set in the second register that simultaneously holds corresponding lock / unlock information .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001083506A JP3996355B2 (en) | 2001-03-22 | 2001-03-22 | Multiprocessor system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001083506A JP3996355B2 (en) | 2001-03-22 | 2001-03-22 | Multiprocessor system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2002278947A JP2002278947A (en) | 2002-09-27 |
| JP3996355B2 true JP3996355B2 (en) | 2007-10-24 |
Family
ID=18939310
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001083506A Expired - Fee Related JP3996355B2 (en) | 2001-03-22 | 2001-03-22 | Multiprocessor system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3996355B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7421529B2 (en) * | 2005-10-20 | 2008-09-02 | Qualcomm Incorporated | Method and apparatus to clear semaphore reservation for exclusive access to shared memory |
-
2001
- 2001-03-22 JP JP2001083506A patent/JP3996355B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2002278947A (en) | 2002-09-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR100249148B1 (en) | Data processing system and method | |
| US5721870A (en) | Lock control for a shared main storage data processing system | |
| US6662252B1 (en) | Group and virtual locking mechanism for inter processor synchronization | |
| US6138231A (en) | System and method for register renaming | |
| US5043873A (en) | Method of parallel processing for avoiding competition control problems and data up dating problems common in shared memory systems | |
| JPS60144855A (en) | Memory lock system | |
| TWI666551B (en) | Decentralized allocation of resources and interconnect structures to support the execution of instruction sequences by a plurality of engines | |
| JPS6069746A (en) | Control system of vector data processor | |
| JPH0225212B2 (en) | ||
| JPH05324572A (en) | Atomic-access-controlled register device | |
| JPH05508495A (en) | Global register for multiple processors | |
| JP2825906B2 (en) | Computer system | |
| JP3431941B2 (en) | Method and apparatus for determining instruction execution order in a data processing system | |
| JPH0155499B2 (en) | ||
| JP2003271574A (en) | Data communication method in shared memory multiprocessor system | |
| JP3996355B2 (en) | Multiprocessor system | |
| US20010021944A1 (en) | Distributed memory type parallel computer and write data transfer end confirming method thereof | |
| JP4051788B2 (en) | Multiprocessor system | |
| JP2602241B2 (en) | Parallel computer | |
| JPH06266620A (en) | Exclusive control system using cache memory | |
| JPH011049A (en) | parallel computer | |
| JP2731738B2 (en) | Multiprocessor system | |
| JP2742245B2 (en) | Parallel computer | |
| JPH02222047A (en) | Memory controller | |
| JP2024165938A (en) | Processor and information processing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050118 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070312 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070417 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070615 |
|
| 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: 20070710 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070802 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100810 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100810 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100810 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110810 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120810 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130810 Year of fee payment: 6 |
|
| LAPS | Cancellation because of no payment of annual fees |