JP4484436B2 - Information storage control method to storage device - Google Patents

Information storage control method to storage device Download PDF

Info

Publication number
JP4484436B2
JP4484436B2 JP2003043097A JP2003043097A JP4484436B2 JP 4484436 B2 JP4484436 B2 JP 4484436B2 JP 2003043097 A JP2003043097 A JP 2003043097A JP 2003043097 A JP2003043097 A JP 2003043097A JP 4484436 B2 JP4484436 B2 JP 4484436B2
Authority
JP
Japan
Prior art keywords
area
information
region
semaphore variable
stored
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
JP2003043097A
Other languages
Japanese (ja)
Other versions
JP2004252755A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003043097A priority Critical patent/JP4484436B2/en
Publication of JP2004252755A publication Critical patent/JP2004252755A/en
Application granted granted Critical
Publication of JP4484436B2 publication Critical patent/JP4484436B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、キューに蓄積された処理要求を実行する際の制御方法およびプログラム、またこれらを利用したシステムに関する。
【0002】
【従来の技術】
処理要求を含む処理要求情報を発行する発行側装置とその処理要求情報を受信し、処理要求を実行し、実行結果を発行側装置に送信する受信側装置とのインタフェースとして、2種類のキューが使用されることがある。一方のキューには、処理要求情報が待ち行列として蓄積され、キューの先頭の処理要求から順に受信側装置により実行される。
【0003】
他方のキューには、処理要求が完了したことを示す情報(処理完了情報)が待ち行列として蓄積され、キューの先頭の処理完了情報から順に発行側装置により回収され、処理完了時のステータス確認等が行われる。例えば、コンピュータと周辺機器を接続するための次世代の入出力(I/O)技術として提案されるインフィニバンド(Infiniband)(非特許文献1参照)やVIA(Virtual Interface Architecture)(非特許文献2参照)などのアーキテクチャにおいて、前述した2種類のキューを用いた処理要求の実行が行われる。
【0004】
【非特許文献1】
Infiniband(SM) Trade Association、"Infiniband(TM) Architecture Specification Volume 1 Release 1.1"、P.80、3.2.1節Queuing、[online]、Final, November 6,2002、[平成15年1月21日検索]、インターネット<http://www.infinibandta.org/specs/>
【0005】
【非特許文献2】
Compaq Computer Corp., Intel Corporation, Microsoft Corporation、"Virtual Interface Architecture Specification"、P.11、2.1.節 VI Architecture Components、[online]、Draft Revision 1.0, December 4, 1997、[平成15年1月21日検索]、インターネット<ftp://download.intel.com/design/servers/vi/san_10.pdf>
【0006】
【発明が解決しようとする課題】
しかしながら、前述した2種類のキューをインタフェースとして処理要求を実行する場合、各キューへ処理要求情報あるいは処理完了情報を蓄積する際に、そのキューに蓄積された処理要求情報あるいは処理完了情報の蓄積状況が判断されないことが多い。そのため、各キューの蓄積可能データ数を超えてしまい、キューが溢れる(オーバフローする)場合があった。
【0007】
キューがオーバフローすると、処理要求の実行が停止し、前述の発行側装置あるいは受信側装置に復旧処理という新たな処理をさせることになり、装置全体としての性能低下が避けられず問題である。当然のことながら、復旧処理をさせるには、ソフトウエアまたはハードウエアによる実装を必要とする。また、蓄積可能データ数を大きくするために、より大きな蓄積領域を確保して各キューのサイズを大きくすることも可能だが、むやみに大きく取られたキューは通常時その一部しか使用されず無駄が発生していた。
【0008】
そこで、本発明は、以上に述べた課題に鑑み、2種類のキューをインタフェースとして介在させキューに蓄積された処理要求を実行する場合に各キューを溢れさせないための情報蓄積制御方法を提供することを目的とする。また、両者を組み合わせて使用することにより、両キューを共に溢れさせないことも可能である。またハードウエアは実装コストの低減と高性能を実現するために実装を単純化する必要があり、そのためソフトウエアによる実装で実現できることが望ましい。
【0009】
【課題を解決するための手段】
上記課題を解決するため、処理要求情報が蓄積される第一の領域を設定する工程と、処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定する工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定し、正の値であれば、前記第一の領域に前記処理要求情報を追加し、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として更新する工程と、前記要求された処理が完了した場合、該処理要求を特定する情報と前記処理完了情報を対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記処理完了情報を1つ削除する工程を有することを特徴とする情報蓄積制御方法を提供する。
【0010】
この場合において、前記第二の領域に蓄積可能な情報数の最大数を前記第一の領域に蓄積可能な情報数の最大数以上に設定することも可能である。また、前記第一の領域、前記第二の領域に共にセマフォ変数を設定することも可能である。
【0011】
また、上記課題は、処理要求情報が蓄積される複数の第一の領域を設定する工程と、処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、前記複数の第一の領域にそれぞれ対応するセマフォ変数の初期値を前記複数の第一の領域にそれぞれ蓄積可能な情報数の最大数として設定する工程と、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定し、正の値であれば、前記選択された第一の領域に処理要求情報を追加し、前記選択された第一の領域と前記処理要求を特定する情報を対応付けて対応表に蓄積し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として更新する工程と、前記処理要求が完了した場合、該処理要求を特定する情報を前記処理完了情報と対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、前記対応表を参照して該特定された処理要求が蓄積された前記第一の領域を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として更新し、前記読み出された処理完了情報を削除する工程を有することを特徴とする情報蓄積制御方法を提供することにより解決される。
【0012】
この場合において、前記第二の領域に蓄積可能な情報数の最大数を各第一の領域に蓄積可能な情報数の最大数の総和以上に設定することも可能である。さらに、複数の第一の領域のそれぞれと前記第二の領域にそれぞれセマフォ変数を設定することも可能である。
【0013】
また、上記課題は、処理要求情報が蓄積される第一の領域と、処理要求の完了を示す情報である処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域と、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御する制御部とを有する装置において実行されるプログラムであって、前記制御部に、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定させる工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定させ、正の値であれば、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記第一の領域へ前記処理要求情報を追加させる工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定させ、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記処理完了情報を1つ削除させる工程を実行させるためのプログラムを提供することにより解決される。
【0014】
また、上記課題は、処理要求情報が蓄積される第一の領域と、処理要求の完了を示す情報である処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求を実行する制御部を有する第一の装置と、前記第一の装置に接続され、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求情報を前記第一の装置へ送信する制御部を有する第二の装置とを備え、前記第二の装置における制御部は、予め前記第一の領域に対するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定し、特定のタイミングで前記第一の領域に対応するセマフォ変数から1を減算した値が正の値か判定し、正の値であれば、前記第一の領域に対応するセマフォ変数から1を減算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第一の装置に新たな処理要求情報を送信し、前記第一の装置における制御部は、前記新たな処理要求情報を受信して前記第一の領域に追加し、特定のタイミングで前記第一の領域に蓄積された処理要求を実行し、該処理要求に対応する処理完了情報を作成して前記第二の装置に領域に蓄積し、前記第二の装置における制御部は、特定のタイミングで前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第二の領域に蓄積された前記処理完了情報を1つ削除することを特徴とするシステムを提供することにより解決される。
【0015】
【発明の実施の形態】
以下、本発明の実施形態について図面に従って説明する。しかしながら、本発明の技術的範囲はかかる実施形態に限定されるものではなく、特許請求の範囲に記載された発明とその均等物に及ぶものである。
【0016】
図1は、本発明の第一の実施形態に用いる情報処理装置の構成例を示す図である。本発明の適用はインフィニバンドに限定されるものではないが、本発明の実施形態においてはメモリに格納されたOSの指令を実行するCPUが処理要求の発行側装置として処理要求を含むデータ(ワークリクエスト)を送信し、同一筐体内のインフィニバンド用ホストチャネルアダプタが受信側装置としてワークリクエストを受信する場合に、本発明が適用される様子を説明する。
【0017】
メモリ5には、コンピュータを動作させるための基本ソフトウエアであるオペレーティングシステム(OS、Operating System)や、OS上で動作するアプリケーションプログラムが蓄積される。CPU2は、OSやアプリケーションプログラムからの処理要求に基づき、システムバス3を介して、メモリ5や各種周辺機器(図示されないハードディスクや、SCSIやファイバチャネルを介して外部に接続された図示されないストレージ、LANを介して接続された図示されない他のコンピュータ等)に格納されたデータにアクセスし、コンピュータ1内の装置を制御するための処理を実行する。
【0018】
CPU2がメモリ5に格納されたデータにアクセスする場合、メモリコントローラ4は、CPU2が指定する仮想メモリ上のアドレスを実際の物理メモリアドレスに変換し、対応するデータをシステムバス3を介してCPU2に送信する。CPU2が周辺機器に格納されたデータにアクセスする場合、CPU2は処理要求を含むデータ(以下ワークリクエストと呼ぶ)をホストチャネルアダプタ(HCA)6のメモリ7に確保されたワークキュー(図示せず)に蓄積する。コプロセッサ8は、HCA内の制御に関する演算を実行する処理装置であり、特定のタイミングでワークキューに蓄積されたワークリクエストを処理し、処理結果のデータをメモリ7に確保されたコンプリーションキュー(図示せず)に格納する。CPU2は特定のタイミングでコンプリーションキューをチェックし、処理結果のデータを回収、削除する。
【0019】
インフィニバンドスイッチ9は、チャネルアダプタ間を接続し、チャネルアダプタ同士のポイントトゥポイント(point-to-point)のデータ伝送を可能にする。図1では、HCA6が、インフィニバンドスイッチ9を介して、コンピュータ1をネットワークに接続するためのネットワークインタフェースカード(NIC)11、コンピュータ1にSCSI機器を接続するためのSCSIカード13、ファイバチャネル(Fiber Channel)機器を接続するためのFCカード14のそれぞれに備えられたターゲットチャネルアダプタ(TCA)11、13、15と接続されている。また、インフィニバンドスイッチ9を介して他のHCAと直接接続することも可能である。これは、例えば、複数のコンピュータ1が同一筐体内に存在するブレードサーバ(この場合各コンピュータ1をブレードと呼ぶ)のような装置において、ブレード間を接続するバックプレーンと呼ばれる内部バスを介した接続がある。
【0020】
図2は、本発明の第一の実施形態においてCPU2が周辺機器に格納されたデータにアクセスする際の動作を示す図である。本発明の第一の実施形態においては、メモリ上にワークキュー24およびコンプリーションキュー28が1つずつ確保され、ワークキュー24に蓄積可能なワークリクエスト26の個数を示すセマフォ変数を設定することで、ワークキュー24が溢れることが防止される。
【0021】
セマフォ変数はワークリクエスト26がワークキュー24に1つ蓄積されると値が1減算され、ワークコンプリーション30が1つ回収されると値が1加算される。セマフォ変数の初期値をワークキュー24に蓄積可能なデータの最大数と設定することで、ワークキュー24のセマフォ変数が正の値であれば、ワークキュー24にデータを追加蓄積可能であることがわかる。
【0022】
また、セマフォ変数として、ワークキュー24に蓄積可能なデータの最大量(例えば、確保された領域のサイズ)を設定し、ワークリクエスト26の蓄積の度にそのワークリクエスト26のサイズが減算され、ワークコンプリーション30の回収により、ワークリクエスト26のサイズが加算されることによっても同じ効果を得ることができる。後者は、各ワークリクエスト26のサイズが一定でない場合等に有効な手段となる。
【0023】
図2のCPU2は、OSやアプリケーションプログラムからの処理要求を含むデータをワークリクエスト26として、開始番地と終了番地により特定される領域としてメモリ7に確保された、キュー番号WQ1のワークキュー24に蓄積する。CPU2はワークキュー24に対応して設定されるセマフォ変数が格納されたメモリ5のセマフォ変数表22を参照し、ワークリクエスト26の蓄積が可能か判定する。
【0024】
ワークリクエスト26の蓄積が可能であれば、ワークリクエスト26がワークキュー24の末尾に追加される。そしてCPU2はセマフォ変数表22を更新する。このワークリクエスト蓄積処理の詳細については後述する。
【0025】
コプロセッサ8は、特定のタイミングでワークキュー24から先頭のワークリクエスト26を取り出し、処理要求を実行する。ワークリクエスト26には、データの送信、受信といった処理要求内容と、データ送信先や送信するデータあるいは受信したデータの格納先等の情報が格納されており、コプロセッサ8は処理要求内容に沿った処理を実行する。
【0026】
コプロセッサ8は、処理要求内容に沿ってインフィニバンドスイッチ9を介して接続されたTCAとデータ伝送を行い、ワークリクエスト26を完了する。ワークリクエスト26を処理し終えたら、コプロセッサ8は処理されたワークリクエスト26に対応するワークコンプリーション30を作成し、開始番地と終了番地により特定される領域としてメモリ7に確保された、キュー番号CQ1のコンプリーションキュー28に蓄積する。
【0027】
CPU2は、特定のタイミングでコンプリーションキュー28からワークコンプリーション30を回収し、対応するワークリクエスト26が完了したことを確認し、メモリ5のセマフォ変数表22のセマフォ変数を更新する。このワークコンプリーション回収処理の詳細については後述する。こうして処理要求が完了する。次に、ワークリクエスト26、ワークコンプリーション30、セマフォ変数表22のデータ構成を説明する。
【0028】
図3は、ワークキュー24に蓄積されるワークリクエスト26のデータ構成例を示す図である。図3の各エントリには、ワークリクエスト26を特定する識別番号(Work Request ID)31と、処理要求に関連するデータ32が格納される。処理要求に関連するデータ32には、図示しないが例えば、データの送信や受信等の処理要求内容、データの送信先や送信するデータ、受信したデータの格納先といった情報が格納されている。
【0029】
図4は、コンプリーションキュー28に蓄積されるワークコンプリーション30のデータ構成例を示す図である。図4の各エントリには、処理されたワークリクエスト26を特定する識別番号(Work Request ID)41と、処理されたワークリクエスト26に関連するデータ42が格納される。処理されたワークリクエスト26に関連するデータ42には、図示しないが例えば、正常終了したか異常終了したかを示す終了ステータスや、エラー内容を示すエラーコード等が格納される。ワークコンプリーション30を参照することにより、どのワークリクエスト26がどのような状態で完了したのかを確認することができる。
【0030】
図5は、メモリ5に格納されるセマフォ変数表22である。図5の各エントリには、キュー番号51とそのキュー番号のセマフォ変数値52が格納される。
図5においては、WQ1がワークキュー24に対するキュー番号51を示し、SW1は、ワークキュー24に対するセマフォ変数値52である。
【0031】
また、本発明の第一の実施形態においては、1つのワークキュー24にのみセマフォ変数が設定されるが、複数のワークキュー24が存在する場合、各キューに設定されたセマフォ変数が図5の行データとしてセマフォ変数表に追加される。さらに、コンプリーションキュー28に対するセマフォ変数が設定され、セマフォ変数表に追加されてもよい。セマフォ変数表22を参照すれば、ワークキュー24あるいはコンプリーションキュー28に対応するセマフォ変数値52を得ることができ、ワークキュー24に対しワークリクエスト26の追加蓄積が可能か判定することができる。
【0032】
なお、本発明の第一の実施形態においては、セマフォ変数表22を用いるが、表を使わない実装も可能である。例えば、ハッシュ関数を用いて、ワークキュー番号に対応するセマフォを特定するポインタがわかるようにしてもよい。
【0033】
続いて、本発明の第一の実施形態におけるワークリクエスト蓄積処理、ワークコンプリーション回収処理をそれぞれ説明する。
【0034】
図6は、本発明の第一の実施形態におけるワークリクエスト蓄積処理を説明するフローチャートである。予め、セマフォ変数表22には、キュー番号WQ1のワークキュー24に対応するセマフォ変数の初期値として、ワークキュー24に蓄積可能なデータの最大数が設定されている。
【0035】
まず、CPU2は、ワークキュー24のセマフォ変数が正の値か判定する(S62)。CPU2は、メモリ5のセマフォ変数表22を参照し、キュー番号WQ1であるワークキュー24に対応するセマフォ変数値52を得る。得られたセマフォ変数値が正であれば、ワークキュー24には空きがあり、ワークリクエスト26が追加蓄積できることを意味する。
【0036】
ステップS62でワークキュー24に空きがある場合、CPU2はワークキュー24のセマフォ変数から1減算した値を新たなセマフォ変数としてセマフォ変数表22を更新する(S63)。これは、ワークリクエスト26が蓄積される場合ワーククキュー24の空きが1つ消費されることによるものである。
【0037】
そして、ステップS62で空きが無いと判定される場合、一定時間待機し再びステップS62の処理を実施する。こうして、ワークキュー24に空きができるのを待つ。もしくは、蓄積をあきらめる。
【0038】
ステップS63が済むと、ワークキュー24にワークリクエスト26を追加蓄積する(S66)。そして、ステップS64の蓄積処理が成功したか判定する(S67)。ワークキュー24への蓄積は可能な状態でも、蓄積処理の途中で装置の電源断や、割り込み処理による蓄積処理中止などで、蓄積処理に失敗した場合そのままワークリクエスト蓄積処理を中止する。
【0039】
ステップS67でワークリクエスト26の蓄積に成功すれば、ワークリクエスト蓄積処理を終了する。ステップS67で失敗した場合、ワークキュー24のセマフォ変数に1加算し(S69)、ワークリクエスト蓄積処理を終了する。ステップS63では、ワークリクエストが蓄積されワーククキュー24の空きが1つ消費されるものとしてセマフォ変数を更新したが、ステップS67でワークリクエストの蓄積に失敗したため、ワーククキュー24の空きは消費されていない。従ってステップS69では、ステップS63で減算した値を元に戻す。
【0040】
図6のワークリクエスト蓄積処理によって、ワークキューの空き状態を表すセマフォ変数が適切に更新され、空きが無い場合、ワークリクエスト26が追加されることはなく、ワークキュー24のオーバフローを防止することができる。
【0041】
図7は、本発明の第一の実施形態におけるワークコンプリーション回収処理を説明するフローチャートである。まず、コンプリーションキュー28にワークコンプリーション30が蓄積されているか判定する(S71)。CPU2は、コンプリーションキュー28の先頭からワークコンプリーション30を回収し、コンプリーションキュー28が空なら、そのままワークコンプリーション回収処理を終了する。
【0042】
そして、CPU2はワークキュー24のセマフォ変数に1加算した値をセマフォ変数として更新し(S73)、ワークコンプリーション回収処理を終了する。これは、ワークリクエスト26の処理が完了したため、ワーククキュー24で1つ空きができたことを確認できたからである。ワークキュー24に対応するセマフォ変数値52は、コプロセッサ8がワークリクエスト26の処理を完了した際に更新されるべきだが、CPU2はどのタイミングでコプロセッサ8がワークリクエスト26を処理するか知ることができない。そこで、ワークコンプリーション30の回収時にワークキュー24に空きができたものとみなし、セマフォ変数を更新する。
【0043】
図7のワークコンプリーション回収処理によって、ワークキュー24の空き状態を表すセマフォ変数が適切に更新され、ワークキュー24のあふれを防止することができる。また、ワークコンプリーション30の回収時にワークキュー24のセマフォ変数を更新することにより、本発明はHCAのコプロセッサ8の処理に関係なくOSやアプリケーション側のみで実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0044】
以上本発明の第一の実施形態によれば、ワークキュー24に対応するセマフォ変数を適切に更新し、ワークリクエストを追加する場合、セマフォ変数を参照することにより、ワークキュー24のオーバフローを防止することが可能である。
【0045】
また、第一の実施形態において予めコンプリーションキュー28に蓄積可能なデータ数がワークキュー24に蓄積可能なデータ数の最大数以上になるようコンプリーションキュー28のサイズを設定することにより(コンプリーションキュー28に対するセマフォ変数を設定することなく)、ワークキュー24に対して設定されたセマフォ変数のみを利用し本発明を適用することができる。
【0046】
すなわち、ある時点でワークキュー24に蓄積されたワークリクエスト26をすべてコンプリーションキュー28に移したとしても、コンプリーションキュー28が溢れないことが確約されるため、要求処理の実行にあたっては、各ワークキュー24へワークリクエスト26を蓄積する際のワークキュー24のオーバフローのみを防止すればよいからである。
【0047】
第一の実施形態においては、ワークキュー24にのみセマフォ変数を設定したが、コンプリーションキュー28にのみセマフォ変数を設定し、コンプリーションキュー28のオーバフローを防止することも可能である。図6、図7におけるステップS62、S63、S73のワークキュー24の箇所を適宜コンプリーションキュー28と読み替えることで本発明の適用が可能となる。
【0048】
コンプリーションキューに空きが無い場合、ワークリクエスト26が追加されることはない。ワークリクエスト26とワークコンプリーション30は1対1に対応するため、追加されたワークリクエスト26が原因でコンプリーションキュー28がオーバフローすることはない。こうして、コンプリーションキュー28のオーバフローを防止することができる。また、ワークリクエスト26の蓄積時にコンプリーションキュー28のセマフォ変数を更新することにより、本発明はHCAのコプロセッサの処理に関係なく実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0049】
また、第一の実施形態の変形例として、ワークキュー24、コンプリーションキュー28に共にセマフォ変数を設定し、両キューのオーバフローを防止することも可能である。第一の実施形態の変形例におけるワークリクエスト蓄積処理とワークコンプリーション回収処理について説明する。
【0050】
図8は、第一の実施形態の変形例におけるワークリクエスト蓄積処理を説明するフローチャートである。図6と同じステップには同じステップ番号が振られており、必要がなければ説明は省略する。予め、セマフォ変数表22には、キュー番号WQ1、CQ1のワークキュー24、コンプリーションキュー28に対応するセマフォ変数の初期値として、各キューに蓄積可能なデータの最大数が設定されている。
【0051】
まず、CPU2は、ワークキュー24に対応するセマフォ変数が正の値か判定する(S62)。これは、図6と同じステップであり説明を省略する。ステップS62でワークキュー24に空きがある場合、CPU2はワークキュー24のセマフォ変数から1減算した値を新たなセマフォ変数としてセマフォ変数表22を更新する(S63)。これは、ワークリクエスト26が蓄積される場合ワーククキュー24の空きが1つ消費されることによるものである。
【0052】
ステップS62で空きが無いと判定される場合、一定時間待機し再びステップS62の処理を実施する。こうして、ワークキュー24に空きができるのを待つ。もしくは、蓄積をあきらめる。
【0053】
ステップS63が済むと、コンプリーションキュー28に対応するセマフォ変数が正の値か判定する(S64)。CPU2は、セマフォ変数表22を参照し、キュー番号CQ1であるコンプリーションキュー28に対応するセマフォ変数値52を得る。セマフォ変数値が正であれば、コンプリーションキュー28に空きがあり、ワークコンプリーション30を蓄積できることを意味する。
【0054】
ステップS64で空きがあると判定される場合、CPU2はコンプリーションキュー28のセマフォ変数から1減算した値を新たなセマフォ変数としてセマフォ変数表22を更新する(S65)。コンプリーションキュー28に対応するセマフォ変数値は、コプロセッサ8がワークリクエスト26の処理を完了した後に更新されるべきだが、CPU2はどのタイミングでコプロセッサ8がワークリクエスト26を処理するか知ることができない。また、ワークキュー24に蓄積されたワークリクエスト26は必ず処理完了後にそのワークリクエスト26に対応するワークコンプリーション30がコンプリーションキュー28に蓄積され、1対1に対応するものである。そこで、ワークキュー24へのワークリクエスト26の蓄積時にコンプリーションキュー28が1つ消費されたものとみなし、コンプリーションキュー28のセマフォ変数を更新する。
【0055】
ステップS64で空きが無いと判定される場合、一定時間待機し再びステップS64の処理を実施する。こうして、コンプリーションキュー28に空きができるのを待つ。
【0056】
こうして、ワークキュー24とコンプリーションキュー28に共に空きがある場合、ワークキュー24にワークリクエスト26を蓄積する(S66)。そして、ステップS64の蓄積処理が成功したか判定する(S67)。
【0057】
ステップS67でワークリクエスト26の蓄積に成功すれば、ワークリクエスト蓄積処理を終了する。ステップS67で失敗した場合、ワークキュー24のセマフォ変数、コンプリーションキューのセマフォ変数にそれぞれ1加算し(S69)、ワークリクエスト蓄積処理を終了する。ステップS63、S65では、ワークリクエストが蓄積されワーククキュー24、コンプリーションキュー28の空きがそれぞれ1つ消費されるものとして、セマフォ変数を更新したが、ステップS67でワークリクエストの蓄積に失敗したため、ワーククキュー24、コンプリーションキュー28の空きは消費されていない。従ってステップS69では、ステップS63、S65で減算した値を元に戻す。
【0058】
図8のワークリクエスト26蓄積処理によって、各キューの空き状態を表すセマフォ変数が適切に更新され、ワークキューに空きが無い場合、ワークリクエスト26が追加されることはない。また、コンプリーションキューに空きが無い場合も同様にワークリクエスト26が追加されることはない。ワークリクエスト26とワークコンプリーション30は1対1に対応するため、追加されたワークリクエスト26が原因でコンプリーションキュー28がオーバフローすることはない。こうして、ワークキュー24、およびコンプリーションキュー28のオーバフローを防止することができる。また、ワークリクエスト26の蓄積時にコンプリーションキュー28のセマフォ変数を更新することにより、本発明はHCAのコプロセッサの処理に関係なく実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0059】
図9は、第一の実施形態の変形例におけるワークコンプリーション回収処理を説明するフローチャートである。図7と同じステップには同じステップ番号が振られており、必要がなければ説明は省略する。
【0060】
まず、コンプリーションキュー28にワークコンプリーション30が蓄積されているか判定する(S71)。そして、CPU2はワークキュー24のセマフォ変数に1加算した値をセマフォ変数として更新する(S73)。次に、コンプリーションキュー28のセマフォ変数に1加算した値を新たなセマフォ変数値として更新する(S74)。これは、ステップS82でワークコンプリーション30を1つ回収したことによりコンプリーションキュー28に空きができたためである。
【0061】
図9のワークコンプリーション30回収処理によって、各キューの空き状態を表すセマフォ変数が適切に更新され、ワークキュー24、およびコンプリーションキュー28のあふれを防止することができる。また、ワークコンプリーション30の回収時にワークキュー24のセマフォ変数を更新することにより、本発明はHCAのコプロセッサの処理に関係なく実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0062】
なお、上記の第一の実施形態の変形例は、ワークキュー24とコンプリーションキュー28が1対1に対応するのであれば、それぞれが複数存在する構成においても適用が可能である。
【0063】
次に本発明の第二の実施形態について説明する。第二の実施形態は、第一の実施形態と同じ図1の構成において、メモリ上に複数のワークキュー24が確保され、複数のワークキュー24に対し1つのコンプリーションキュー28が確保される場合である。本発明の第二の実施形態においては、ワークキュー24およびコンプリーションキュー28に対して、各キューに蓄積可能なデータ(ワークリクエスト26およびワークコンプリーション30)の個数を示すセマフォ変数を設定することで、各キューが溢れることを防止する。
【0064】
図10は、本発明の第二の実施形態においてCPU2が周辺機器に格納されたデータにアクセスする際の動作を示す図である。図2と同じ箇所には同じ番号が振られており、必要が無ければ説明を省略する。
【0065】
図10のCPU2は、OSやアプリケーションプログラムからの処理要求を含むデータをワークリクエスト26として、開始番地と終了番地により特定される領域としてそれぞれメモリ7に確保された、ワークキュー番号WQ1からWQnまでのn個(nは自然数)のワークキュー241からワークキュー24nに蓄積する。CPU2は各ワークキュー24と後述するコンプリーションキュー28に対応して設定されるセマフォ変数が格納されたメモリ5のセマフォ変数表22を参照し、ワークリクエスト26の蓄積が可能か判定する。
【0066】
ワークリクエスト26の蓄積が可能であれば、ワークリクエスト26がワークキュー24の末尾に追加される。CPU2は、ワークリクエスト26がどのワークキュー24に蓄積されたかを示す情報をメモリ5のワークキュー24対ワークリクエスト26対応表23に格納し、そしてセマフォ変数表22を更新する。このワークリクエスト26蓄積処理の詳細については後述する。
【0067】
コプロセッサ8は、特定のタイミングでワークキュー24から先頭のワークリクエスト26を取り出し、処理要求を実行し、処理要求内容に沿ってインフィニバンドスイッチ9を介しファブリックネットワークに接続されたTCAとデータ伝送を行い、ワークリクエスト26を完了する。取り出したワークリクエスト26を処理し終えたら、コプロセッサ8はワークコンプリーション30を作成し、コンプリーションキュー28に蓄積する。一般には、ワークキュー24とコンプリーションキュー28が1対1に対応している必要はなく、図10のように1つのコンプリーションキュー28に対して複数のワークキュー24を対応させることが可能である。
【0068】
CPU2は、特定のタイミングでコンプリーションキュー28からワークコンプリーション30を回収し、対応するワークリクエスト26が完了したことを確認し、処理要求が完了する。同時にCPU2はメモリ5のセマフォ変数表22のセマフォ変数を更新する。このワークコンプリーション回収処理の詳細については後述する。
【0069】
なお、図2では1つだが、コンプリーションキュー28を複数有する構成にすることも可能である。また各ワークキュー24には特定の役割を与えることができる。例えば、WQ1はInfinibandメッセージ送信用のワークリクエスト26が、WQ2はInfinibandメッセージ受信用のワークリクエスト26が蓄積されるよう設定することが可能である。また、ワークリクエスト26、ワークコンプリーション30、セマフォ変数表22のデータ構成は、第一の実施形態と同じくそれぞれ図3、図4、図5のようになっている。
【0070】
図11は、メモリ5に格納されるワークキュー対ワークリクエスト対応表23である。図11の各エントリには、キュー番号51とそのキュー番号で特定されるワークキュー24に蓄積されたワークリクエスト番号31のリスト111が格納される。この対応表を参照すれば、各ワークキュー24に蓄積されたワークリクエスト26番号のリストを得ることができる。従って、あるワークリクエスト26がどのワークキュー24に蓄積されたかを特定することが可能である。図11においては、例えば、キュー番号WQ1であるキューに、リストWRL1に含まれるワークリクエスト番号(1、12、28)で特定されるワークリクエスト26が蓄積されていることがわかる。
【0071】
次に本発明の第二の実施形態におけるワークリクエスト蓄積処理およびワークコンプリーションを説明する。
【0072】
図12は、本発明の第二の実施形態におけるワークリクエスト蓄積処理を説明するフローチャートである。図6および図8と同じステップには同じステップ番号が振られており、必要がなければ説明は省略する。予め、セマフォ変数表22には、各キューに対するセマフォ変数の初期値として、各キューに蓄積可能なデータの最大数が設定されている。
【0073】
まず、OSやアプリケーションプログラムからの処理要求に対応するワークキュー24が決定される(S61)。CPU2は、処理要求内容に応じて、適切なワークキュー24のワークキュー24番号を取得する。例えば、処理要求内容がデータ送信で、図10のキュー番号WQ1のワークキュー24がデータ送信用に割り当てられていれば、キュー番号WQ1のワークキュー24が選択される。各ワークキュー24への用途の割り当ては自由に定めることができる。また、各ワークキュー24に特に用途が設定されていなければ任意に1つのワークキュー24を選択してもよい。
【0074】
次にステップS61で決定されたワークキュー24のセマフォ変数が正の値か判定する(S62)。CPU2は、メモリ5のセマフォ変数表22を参照し、ステップS61で決定されたワークキュー24のセマフォ変数値を得る。
【0075】
ステップS62でセマフォ変数の値が正であれば、CPU2はステップS61で決定されたワークキュー24のセマフォ変数から1減算した値を新たなセマフォ変数としてセマフォ変数表22を更新する(S63)。ステップS62でセマフォ変数の値が正であれば、そのワークキュー24には空きがあり、ワークリクエスト26が蓄積できる。従って、ワークリクエスト26が蓄積された場合そのワーククキューの空きが1つ消費されることによるものである。
【0076】
ステップS62で空きが無いと判定される場合、一定時間待機し再びステップS62の処理を実施する。こうして、ワークキュー24に空きができるのを待つ。
【0077】
ステップS63が済むと、コンプリーションキュー28のセマフォ変数が正の値か判定する(S64)。CPU2は、セマフォ変数表22を参照し、コンプリーションキュー28のセマフォ変数値を得る。セマフォ変数値が正であれば、コンプリーションキュー28に空きがあり、ワークコンプリーション30を蓄積できる。
【0078】
ステップS64で空きがあると判定される場合、CPU2はコンプリーションキュー28のセマフォ変数から1減算した値を新たなセマフォ変数としてセマフォ変数表22を更新する(S65)。コンプリーションキュー28に対応するセマフォ変数値は、コプロセッサ8がワークリクエスト26の処理を完了した後に更新されるべきだが、CPU2はどのタイミングでコプロセッサ8がワークリクエスト26を処理するか知ることができない。また、ワークキュー24に蓄積されたワークリクエスト26は必ず処理完了後にそのワークリクエスト26に対応するワークコンプリーション30がコンプリーションキュー28に蓄積され、1対1に対応するものである。そこで、ワークキュー24へのワークリクエスト26の蓄積時にコンプリーションキュー28が1つ消費されたものとみなし、コンプリーションキュー28のセマフォ変数を更新する。
【0079】
ステップS64で空きが無いと判定される場合、一定時間待機し再びステップS64の処理を実施する。こうして、コンプリーションキュー28に空きができるのを待つ。
【0080】
こうして、ワークキュー24とコンプリーションキュー28に共に空きがある場合、ステップS61で決定されたワークキュー24にワークリクエスト26を蓄積する(S66)。次に、ステップS66の蓄積処理が成功したか判定する(S67)。ワークキュー24への蓄積は可能な状態であったが、蓄積処理の途中で装置の電源断や、割り込み処理による蓄積処理中止などで、蓄積処理に失敗した場合そのままワークリクエスト蓄積処理を中止する。
【0081】
ステップS67でワークリクエスト26の蓄積に成功すれば、ステップS66で蓄積されたワークリクエスト26と、そのワークリクエスト26が蓄積されたワークキュー24を対応付けて記録し(S68)、 ワークリクエスト蓄積処理を終了する。これは、メモリ5に格納されたワークキュー対ワークリクエスト対応表23で、ワークキュー24のキュー番号51に対応するワークリクエストIDリストに、ステップS64で蓄積されたワークリクエスト番号を追加すればよい。
【0082】
ステップS67で失敗した場合、ステップS61で特定されたワークキュー24のセマフォ変数、コンプリーションキューのセマフォ変数にそれぞれ1加算し(S69)、ワークリクエスト蓄積処理を終了する。ステップS63、S65では、ワークリクエストが蓄積されワーククキュー24、コンプリーションキュー28の空きがそれぞれ1つ消費されるものとして、セマフォ変数を更新したが、ステップS67でワークリクエストの蓄積に失敗したため、ワーククキュー24、コンプリーションキュー28の空きは消費されていない。従ってステップS69では、ステップS63、S65で減算した値を元に戻す。
【0083】
図12のワークリクエスト蓄積処理によって、各キューの空き状態を表すセマフォ変数が適切に更新され、ワークキューに空きが無い場合、ワークリクエスト26が追加されることはない。また、コンプリーションキューに空きが無い場合も同様にワークリクエスト26が追加されることはない。ワークリクエスト26とワークコンプリーション30は1対1に対応するため、追加されたワークリクエスト26が原因でコンプリーションキュー28がオーバフローすることはない。こうして、ワークキュー24、およびコンプリーションキュー28のオーバフローを防止することができる。また、ワークリクエスト26の蓄積時にコンプリーションキュー28のセマフォ変数を更新することにより、本発明はHCAのコプロセッサの処理に関係なく実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0084】
図13は、本発明の第二の実施形態におけるワークコンプリーション回収処理を説明するフローチャートである。まず、コンプリーションキュー28にワークコンプリーション30が蓄積されているか判定する(S71)。CPU2は、コンプリーションキュー28の先頭からワークコンプリーション30を取り出し、コンプリーションキュー28が空なら、そのまま処理を終了する。
【0085】
次に、抽出されたワークコンプリーション30からそのワークコンプリーション30に対応するワークリクエスト26が蓄積されたワークキュー24を特定する(S72)。ワークコンプリーション30は処理が完了したワークリクエスト26に対応して作成されるものであり、図4に示されているように、ワークコンプリーション30には、処理されたワークリクエスト番号41が格納されている。CPU2は、メモリ5のワークキュー対ワークリクエスト対応表23を参照し、得られたワークリクエスト番号41が含まれるワークリクエストIDリスト111を検索し、対応するキュー番号51を得る。
【0086】
そして、CPU2はステップS72で特定されたワークキュー24のセマフォ変数に1加算した値をセマフォ変数として更新する(S73)。これは、ワークリクエスト26の処理が完了したため、ステップS72で特定されたワーククキューで1つ空きができたことを確認できたからである。ワークキュー24に対応するセマフォ変数値は、コプロセッサ8がワークリクエスト26の処理を完了した際に更新されるべきだが、CPU2はどのタイミングでコプロセッサ8がワークリクエスト26を処理するか知ることができない。そこで、ワークコンプリーション30の回収時にワークキュー24に空きができたものとみなし、セマフォ変数を更新する。
【0087】
次に、コンプリーションキュー28のセマフォ変数に1加算した値を新たなセマフォ変数値として更新する(S74)。これは、ステップS72でワークコンプリーション30を1つ回収したことによりコンプリーションキュー28に空きができたためである。
【0088】
図13のワークコンプリーション回収処理によって、各キューの空き状態を表すセマフォ変数が適切に更新され、ワークキュー24、およびコンプリーションキュー28のオーバフローを防止することができる。また、ワークコンプリーションの回収時にワークキュー24のセマフォ変数を更新することにより、本発明はHCAのコプロセッサの処理に関係なく実装することができ、導入が容易になり、ハードウエアの実装を複雑化させずに済む。
【0089】
また、第二の実施形態において予めコンプリーションキュー28に蓄積可能なデータ数が各ワークキュー24に蓄積可能なデータ数の最大数の総和以上になるようコンプリーションキュー28のサイズを設定することにより、コンプリーションキュー28に対するセマフォ変数を設定することなく、ワークキュー24に対して設定されたセマフォ変数のみを利用し本発明を適用することができる。
【0090】
すなわち、ある時点で各ワークキュー24に蓄積されたワークリクエスト26をすべてコンプリーションキュー28に移したとしても、コンプリーションキュー28が溢れないことが確約されるため、処理要求の実行にあたっては、各ワークキュー24へワークリクエスト26を蓄積する際のワークキュー24のオーバフローのみを防止すればよいからである。
【0091】
本発明は、サーバ対サーバ、サーバ対ストレージ、ブレードサーバのバックプレーンを介したブレード間のプロセス間通信あるいは同一サーバ内のプロセス間通信にも適用が可能である。また、プログラムとしてOSやアプリケーションプログラムの機能として組み込んだり、OSとアプリケーションプログラムの仲介をするミドルウエアとして提供することが可能である。
【0092】
以上をまとめると付記のようになる。
【0093】
(付記1) 処理要求情報が蓄積される第一の領域を設定する工程と、処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定する工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定し、正の値であれば、前記第一の領域に前記処理要求情報を追加し、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として更新する工程と、前記要求された処理が完了した場合、該処理要求を特定する情報と前記処理完了情報を対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記処理完了情報を1つ削除する工程を有することを特徴とする情報蓄積制御方法。
【0094】
(付記2) 付記1において、前記第二の領域に蓄積可能な情報数の最大数が、前記第一の領域に蓄積可能な情報数の最大数以上であることを特徴とする情報蓄積制御方法。
【0095】
(付記3) 処理要求情報が蓄積される第一の領域を設定する工程と、処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、前記第一の領域および前記第二の領域にそれぞれ対応するセマフォ変数の初期値を前記第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定する工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値と前記第二の領域に対応するセマフォ変数の値から1を減算した値が共に正の値か判定し、共に正の値であれば、前記第一の領域に処理要求情報を追加し、かつ前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新する工程と、前記処理要求が完了した場合、該処理要求を特定する情報を前記処理完了情報と対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記処理完了情報を1つ削除する工程を有することを特徴とする情報蓄積制御方法。
【0096】
(付記4) 処理要求情報が蓄積される複数の第一の領域を設定する工程と、
処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、前記複数の第一の領域にそれぞれ対応するセマフォ変数の初期値を前記複数の第一の領域にそれぞれ蓄積可能な情報数の最大数として設定する工程と、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定し、正の値であれば、前記選択された第一の領域に処理要求情報を追加し、前記選択された第一の領域と前記処理要求を特定する情報を対応付けて対応表に蓄積し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として更新する工程と、前記処理要求が完了した場合、該処理要求を特定する情報を前記処理完了情報と対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、前記対応表を参照して該特定された処理要求が蓄積された前記第一の領域を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として更新し、前記読み出された処理完了情報を削除する工程を有することを特徴とする情報蓄積制御方法。
【0097】
(付記5) 付記4において、前記第二の領域に蓄積可能な情報数の最大数が、前記複数の第一の領域に蓄積可能な情報数の最大数の総和以上であることを特徴とする情報蓄積制御方法。
【0098】
(付記6) 処理要求情報が蓄積される複数の第一の領域を設定する工程と、処理要求の完了を示す情報である処理完了情報が蓄積される第二の領域を設定する工程と、複数の第一の領域の各第一の領域および第二の領域にそれぞれ対応するセマフォ変数の初期値を前記各第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定する工程と、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値と前記第二の領域に対応するセマフォ変数の値から1を減算した値が共に正の値か判定し、共に正の値であれば、前記選択された第一の領域に処理要求情報を追加し、前記選択された第一の領域と前記処理要求を特定する情報とを対応付けて対応表に蓄積し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新する工程と、前記処理要求が完了した場合、該処理要求を特定する情報を前記処理完了情報に対応付けて前記第二の領域に蓄積する工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、前記対応表を参照して該特定された処理要求が蓄積された前記第一の領域を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数に1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記読み出された処理完了情報を削除する工程を有することを特徴とする情報蓄積制御方法。
【0099】
(付記7) 処理要求情報が蓄積される第一の領域と、処理要求の完了を示す情報である処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域と、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御する制御部とを有する装置において実行されるプログラムであって、前記制御部に、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定させる工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値が正の値か判定させ、正の値であれば、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記第一の領域へ前記処理要求情報を追加させる工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定させ、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記処理完了情報を1つ削除させる工程を実行させるためのプログラム。
【0100】
(付記8) 処理要求情報が蓄積される第一の領域と、処理要求の完了を示す処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域と、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御する制御部とを有する装置において実行されるプログラムであって、前記制御部に、前記第一の領域および前記第二の領域にそれぞれ対応するセマフォ変数の初期値を前記第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定させる工程と、前記第一の領域に対応するセマフォ変数の値から1を減算した値と前記第二の領域に対応するセマフォ変数の値から1を減算した値が共に正の値か判定させ、共に正の値であれば、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ前記セマフォ変数表を更新させ、前記第一の領域へ前記処理要求情報を追加させる工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定させ、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ前記セマフォ変数表を更新させ、前記処理完了情報を1つ削除させる工程を実行させるためのプログラム。
【0101】
(付記9) 処理要求情報が蓄積される複数の第一の領域と、処理要求の完了を示す処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域と、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御する制御部とを有する装置において実行されるプログラムであって、前記制御部に、前記複数の第一の領域の各第一の領域および前記第二の領域にそれぞれ対応するセマフォ変数の初期値を前記第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定させる工程と、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値と前記第二の領域に対応するセマフォ変数の値から1を減算した値が共に正の値か判定させ、共に正の値であれば、前記選択された第一の領域と前記処理要求を対応付けて対応表に蓄積させ、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ前記セマフォ変数表を更新させ、前記選択された第一の領域へ前記処理要求情報を追加させる工程と、前記第二の領域に前記処理完了情報が蓄積されているか判定させ、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ前記セマフォ変数表を更新させ、前記処理完了情報を1つ削除させる工程を実行させるためのプログラム。
【0102】
(付記10) 処理要求情報が蓄積される第一の領域と、処理要求の完了を示す情報である処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求を実行する制御部を有する第一の装置と、前記第一の装置に接続され、前記第一の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求情報を前記第一の装置へ送信する制御部を有する第二の装置とを備え、前記第二の装置における制御部は、予め前記第一の領域に対するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定し、特定のタイミングで前記第一の領域に対応するセマフォ変数から1を減算した値が正の値か判定し、正の値であれば、前記第一の領域に対応するセマフォ変数から1を減算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第一の装置に新たな処理要求情報を送信し、前記第一の装置における制御部は、前記新たな処理要求情報を受信して前記第一の領域に追加し、特定のタイミングで前記第一の領域に蓄積された処理要求を実行し、該処理要求に対応する処理完了情報を作成して前記第二の領域に追加し、前記第二の装置における制御部は、特定のタイミングで前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第二の領域に蓄積された前記処理完了情報を1つ削除することを特徴とするシステム。
【0103】
(付記11) 処理要求情報が蓄積される第一の領域と、処理要求の完了を示す処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求を実行する制御部を有する第一の装置と、前記第一の装置に接続され、前記第一の領域および前記第二の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表とが格納される蓄積部と、前記蓄積部を制御し、前記処理要求情報を前記第一の装置へ送信する制御部を有する第二の装置とを備え、前記第二の装置における制御部は、予め前記第一の領域に対するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として、前記第二の領域に対するセマフォ変数の初期値を前記第二の領域に蓄積可能な情報数の最大数としてそれぞれ設定し、特定のタイミングで前記第一の領域に対応するセマフォ変数から1を減算した値と前記第二の領域に対応するセマフォ変数から1を減算した値が共に正の値か判定し、共に正の値であれば、前記第一の領域に対応するセマフォ変数から1を減算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記第一の装置に新たな処理要求情報を送信し、前記第一の装置における制御部は、前記新たな処理要求情報を受信して前記第一の領域に追加し、特定のタイミングで前記第一の領域に蓄積された処理要求を実行し、該処理要求に対応する処理完了情報を作成して前記第二の装置に送信し、前記第二の装置における制御部は、前記処理完了情報を受信して前記第二の領域に追加し、特定のタイミングで前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記第二の領域に蓄積された前記処理完了情報を1つ削除することを特徴とするシステム。
【0104】
(付記12) 処理要求情報が蓄積される複数の第一の領域と、処理要求の完了を示す処理完了情報が前記処理要求を特定する情報と対応付けられ蓄積される第二の領域とが格納される蓄積部と、前記蓄積部を制御し、かつ前記処理要求を実行する制御部を有する第一の装置と、前記第一の装置に接続され、前記複数の第一の領域の各第一の領域および前記第二の領域を特定する情報とセマフォ変数が対応付けられ蓄積されるセマフォ変数表と、前記処理要求を特定する情報と前記複数の第一の領域のうち該処理要求が蓄積される第一の領域を特定する情報が対応付けられ蓄積される対応表とが格納される蓄積部と、前記蓄積部を制御し、かつ前記処理要求情報を前記第一の装置へ送信する制御部を有する第二の装置とを備え、前記第二の装置における制御部は、予め複数の第一の領域の各第一の領域および第二の領域にそれぞれ対応するセマフォ変数の初期値を前記第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定し、特定のタイミングで前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数から1を減算した値と前記第二の領域に対応するセマフォ変数から1を減算した値が共に正の値か判定し、共に正の値であれば、前記選択された第一の領域に対応するセマフォ変数から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記第一の装置に新たな処理要求情報を送信し、前記選択された第一の領域と前記処理要求を対応付けて対応表に蓄積し、前記第一の装置における制御部は、前記新たな処理要求情報を受信して前記第一の領域に蓄積し、特定のタイミングで前記第一の領域に蓄積された処理要求を実行し、該処理要求に対応する処理完了情報を作成して前記第二の装置に送信し、前記第二の装置における制御部は、前記処理完了情報を受信して前記第二の領域に蓄積し、特定のタイミングで前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、かつ前記第二の領域に蓄積された前記処理完了情報を1つ削除することを特徴とするシステム。
【0105】
(付記13) 付記10において、
前記第一の装置が、サーバマシンに備えられたチャネルアダプタであり、前記第二の装置が、ネットワークインタフェースカードに備えられたチャネルアダプタであることを特徴とするシステム。
【0106】
(付記14) 付記10において、
前記第一の装置、前記第二の装置が共にサーバマシンに備えられたホストチャネルアダプタであることを特徴とするシステム。
【0107】
【発明の効果】
以上に説明したように、本発明によれば、2種類のキューをインタフェースとして介在させ処理要求を実行する場合、各キューがオーバフローすることなくキューに処理要求に関するデータを蓄積することができ、キューがオーバフローすることによる処理停止や処理遅延を防止することができる。また、本発明は処理要求の発行側装置における実装だけで済み、発行側装置がプログラムを実行可能な装置であれば、ソフトウエアによる実装が可能となる。
【図面の簡単な説明】
【図1】本発明の第一の実施形態に用いる情報処理装置の構成例を示す図である。
【図2】本発明の第一の実施形態においてCPUが周辺機器に格納されたデータにアクセスする際の動作を示す図である。
【図3】ワークキューに蓄積されるワークリクエストのデータ構成例を示す図である。
【図4】コンプリーションキューに蓄積されるワークコンプリーションのデータ構成例を示す図である。
【図5】メモリに格納されるセマフォ変数表である。
【図6】本発明の第一の実施形態におけるワークリクエスト蓄積処理を説明するフローチャートである。
【図7】本発明の第一の実施形態におけるワークコンプリーション回収処理を説明するフローチャートである。
【図8】第一の実施形態の変形例におけるワークリクエスト蓄積処理を説明するフローチャートである。
【図9】第一の実施形態の変形例におけるワークコンプリーション回収処理を説明するフローチャートである。
【図10】本発明の第二の実施形態においてCPUが周辺機器に格納されたデータにアクセスする際の動作を示す図である。
【図11】メモリに格納されるワークキュー対ワークリクエスト対応表である。
【図12】本発明の第二の実施形態におけるワークリクエスト蓄積処理を説明するフローチャートである。
【図13】本発明の第二の実施形態におけるワークコンプリーション回収処理を説明するフローチャートである。
【符号の説明】
1 コンピュータ、2 CPU、3 システムバス、4 メモリコントローラ、5メモリ、6 ホストチャネルアダプタ、7 メモリ、8 コプロセッサ、9 インフィニバンドスイッチ、10 ネットワークインタフェースカード、12 SCSIカード、14 ファイバチャネルカード、11、13、15ターゲットチャネルアダプタ、24 ワークキュー、26 ワークリクエスト、28 コンプリーションキュー、30 ワークコンプリーション
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a control method and program for executing processing requests stored in a queue, and a system using them.
[0002]
[Prior art]
Two types of queues are used as an interface with an issuing device that issues processing request information including a processing request and the receiving device that receives the processing request information, executes the processing request, and transmits the execution result to the issuing device. Sometimes used. In one queue, processing request information is accumulated as a queue, and is executed by the receiving apparatus in order from the processing request at the head of the queue.
[0003]
In the other queue, information indicating that the processing request is completed (processing completion information) is accumulated as a queue, and is collected by the issuing side device in order from the processing completion information at the head of the queue, and status confirmation at the time of processing completion, etc. Is done. For example, Infiniband (see Non-Patent Document 1) and VIA (Virtual Interface Architecture) (Non-Patent Document 2) proposed as next-generation input / output (I / O) technologies for connecting computers and peripheral devices In an architecture such as (see FIG. 4), processing requests are executed using the two types of queues described above.
[0004]
[Non-Patent Document 1]
Infiniband (SM) Trade Association, "Infiniband (TM) Architecture Specification Volume 1 Release 1.1", p. 80, section 3.2.1 Queuing, [online], Final, November 6,2002, [searched January 21, 2003 ] Internet <http://www.infinibandta.org/specs/>
[0005]
[Non-Patent Document 2]
Compaq Computer Corp., Intel Corporation, Microsoft Corporation, "Virtual Interface Architecture Specification", P.11, section 2.1. VI Architecture Components, [online], Draft Revision 1.0, December 4, 1997, [January 21, 2003 Search], Internet <ftp://download.intel.com/design/servers/vi/san_10.pdf>
[0006]
[Problems to be solved by the invention]
However, when processing requests are executed using the two types of queues described above as an interface, when processing request information or processing completion information is stored in each queue, the processing request information or processing completion information stored in the queue is stored. Is often not judged. Therefore, the number of storable data in each queue is exceeded, and the queue may overflow (overflow).
[0007]
When the queue overflows, the execution of the processing request is stopped, and the above-mentioned issuing side device or receiving side device is caused to perform a new process called a recovery process, which inevitably degrades the performance of the entire apparatus. As a matter of course, in order to perform the recovery process, implementation by software or hardware is required. In addition, in order to increase the number of data that can be stored, it is possible to secure a larger storage area and increase the size of each queue. Had occurred.
[0008]
In view of the above-described problems, the present invention provides an information accumulation control method for preventing each queue from overflowing when two types of queues are interposed as interfaces to execute processing requests accumulated in the queues. With the goal. Moreover, it is possible to prevent both queues from overflowing by using both in combination. In addition, it is necessary to simplify the implementation of hardware in order to reduce the implementation cost and achieve high performance. Therefore, it is desirable that hardware can be implemented by software implementation.
[0009]
[Means for Solving the Problems]
In order to solve the above problem, a step of setting a first area in which processing request information is accumulated, a step of setting a second area in which processing completion information that is information indicating completion of the processing request is stored, Setting the initial value of the semaphore variable corresponding to the first area as the maximum number of information that can be stored in the first area, and subtracting 1 from the value of the semaphore variable corresponding to the first area If the obtained value is a positive value, the processing request information is added to the first area, and a value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area The process of updating as the semaphore variable corresponding to the first area, and when the requested process is completed, the information specifying the process request and the process completion information are associated with each other and stored in the second area. Process and completion of the process in the second area It is determined whether information has been accumulated, and if accumulated, a value obtained by adding 1 to the semaphore variable corresponding to the first area is updated as the semaphore variable corresponding to the first area, and the processing completion information There is provided an information storage control method characterized by including a step of deleting one.
[0010]
In this case, it is possible to set the maximum number of information that can be stored in the second area to be equal to or greater than the maximum number of information that can be stored in the first area. It is also possible to set semaphore variables in both the first area and the second area.
[0011]
Further, the above-described problems include a step of setting a plurality of first areas in which processing request information is accumulated, and a step of setting a second area in which processing completion information that is information indicating completion of the processing request is accumulated. A step of setting an initial value of a semaphore variable corresponding to each of the plurality of first regions as a maximum number of pieces of information that can be stored in the plurality of first regions, and among the plurality of first regions If one is selected and a value obtained by subtracting 1 from the value of the semaphore variable corresponding to the selected first area is a positive value, and if it is a positive value, the selected first area Processing request information is added to the table, the information specifying the selected first area and the processing request is stored in the correspondence table, and the value of the semaphore variable corresponding to the selected first area is calculated. The value obtained by subtracting 1 corresponds to the selected first area. Updating as a semaphore variable; when the processing request is completed, storing information identifying the processing request in association with the processing completion information in the second area; and It is determined whether or not processing completion information is accumulated. If it is accumulated, one piece of the processing completion information is read, the processing request corresponding to the read processing completion information is specified, and the correspondence table is referred to The first area in which the specified processing request is stored is specified, and a value obtained by adding 1 to the semaphore variable corresponding to the specified first area corresponds to the specified first area. It is solved by providing an information storage control method characterized by comprising a step of updating as a semaphore variable to be performed and deleting the read processing completion information.
[0012]
In this case, it is also possible to set the maximum number of information that can be stored in the second area to be equal to or greater than the sum of the maximum number of information that can be stored in each first area. Furthermore, it is also possible to set semaphore variables in each of the plurality of first regions and the second region.
[0013]
In addition, the above-described problem is a first area in which processing request information is stored, and a second area in which processing completion information that is information indicating completion of the processing request is stored in association with information specifying the processing request. And a storage unit storing a semaphore variable table in which information specifying the first area and a semaphore variable are associated and stored, and a control unit that controls the storage unit A step of causing the control unit to set an initial value of a semaphore variable corresponding to the first area as a maximum number of information that can be stored in the first area; and corresponding to the first area It is determined whether the value obtained by subtracting 1 from the value of the semaphore variable is a positive value. If the value is positive, the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area is the first area. As a semaphore variable corresponding to Updating the semaphore variable table, adding the processing request information to the first area, and determining whether the processing completion information is accumulated in the second area. A program for executing a step of updating the semaphore variable table with a value obtained by adding 1 to a semaphore variable corresponding to one area as a semaphore variable corresponding to the first area and deleting one piece of the processing completion information It is solved by providing.
[0014]
In addition, the above-described problem is a first area in which processing request information is stored, and a second area in which processing completion information that is information indicating completion of the processing request is stored in association with information specifying the processing request. Are stored in the storage unit, the first device having the control unit that controls the storage unit and executes the processing request, and information that is connected to the first device and identifies the first region And a semaphore variable table in which semaphore variables are associated and stored, and a second device having a control unit that controls the storage unit and transmits the processing request information to the first device The control unit in the second device sets an initial value of a semaphore variable for the first area as a maximum number of information that can be stored in the first area, and at a specific timing, Semaphore change corresponding to the first region If the value obtained by subtracting 1 from the positive value is a positive value, the value obtained by subtracting 1 from the semaphore variable corresponding to the first area is updated as the semaphore variable corresponding to the first area. Then, new processing request information is transmitted to the first device, and the control unit in the first device receives the new processing request information and adds it to the first region at a specific timing. The processing request stored in the first area is executed, processing completion information corresponding to the processing request is created and stored in the second apparatus, and the control unit in the second apparatus is specified. It is determined whether the processing completion information is accumulated in the second area at the timing of, and if it is accumulated, a value obtained by adding 1 to the semaphore variable corresponding to the first area is stored in the first area. Update as the corresponding semaphore variable, Is solved by providing a system and deletes one said processing completion information stored in the region.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the technical scope of the present invention is not limited to such an embodiment, but covers the invention described in the claims and equivalents thereof.
[0016]
FIG. 1 is a diagram illustrating a configuration example of an information processing apparatus used in the first embodiment of the present invention. Although the application of the present invention is not limited to InfiniBand, in the embodiment of the present invention, a CPU that executes an OS command stored in a memory is a data (workpiece) including a processing request as a processing request issuing side device. A description will be given of how the present invention is applied when an InfiniBand host channel adapter in the same housing receives a work request as a receiving device.
[0017]
The memory 5 stores an operating system (OS), which is basic software for operating a computer, and application programs that operate on the OS. Based on the processing request from the OS or application program, the CPU 2 is connected to the memory 5 and various peripheral devices (hard disk not shown, storage not shown, connected to the outside via SCSI or fiber channel, LAN via the system bus 3. The data stored in the other computer (not shown) connected via the computer is accessed, and processing for controlling the devices in the computer 1 is executed.
[0018]
When the CPU 2 accesses the data stored in the memory 5, the memory controller 4 converts the virtual memory address designated by the CPU 2 into an actual physical memory address, and sends the corresponding data to the CPU 2 via the system bus 3. Send. When the CPU 2 accesses data stored in the peripheral device, the CPU 2 stores data including a processing request (hereinafter referred to as a work request) in a work queue (not shown) secured in the memory 7 of the host channel adapter (HCA) 6. To accumulate. The coprocessor 8 is a processing device that performs operations related to the control in the HCA, processes work requests accumulated in the work queue at a specific timing, and stores processing result data in a completion queue (memory 7). (Not shown). The CPU 2 checks the completion queue at a specific timing, and collects and deletes processing result data.
[0019]
The InfiniBand switch 9 connects channel adapters and enables point-to-point data transmission between the channel adapters. In FIG. 1, the HCA 6 has a network interface card (NIC) 11 for connecting the computer 1 to the network via the InfiniBand switch 9, a SCSI card 13 for connecting SCSI devices to the computer 1, and a fiber channel (Fiber channel). Channel) is connected to target channel adapters (TCAs) 11, 13, 15 provided in each of the FC cards 14 for connecting devices. It is also possible to connect directly to another HCA via the InfiniBand switch 9. For example, in a device such as a blade server (in this case, each computer 1 is referred to as a blade) in which a plurality of computers 1 exist in the same housing, the connection is made via an internal bus called a backplane that connects the blades. There is.
[0020]
FIG. 2 is a diagram showing an operation when the CPU 2 accesses data stored in the peripheral device in the first embodiment of the present invention. In the first embodiment of the present invention, one work queue 24 and one completion queue 28 are secured in the memory, and a semaphore variable indicating the number of work requests 26 that can be accumulated in the work queue 24 is set. The work queue 24 is prevented from overflowing.
[0021]
The value of the semaphore variable is decremented by 1 when one work request 26 is accumulated in the work queue 24, and is incremented by 1 when one work completion 30 is collected. By setting the initial value of the semaphore variable as the maximum number of data that can be stored in the work queue 24, if the semaphore variable in the work queue 24 is a positive value, it is possible that additional data can be stored in the work queue 24. Recognize.
[0022]
As the semaphore variable, the maximum amount of data that can be accumulated in the work queue 24 (for example, the size of the reserved area) is set, and the size of the work request 26 is subtracted every time the work request 26 is accumulated. The same effect can be obtained by adding the size of the work request 26 by collecting the completion 30. The latter is an effective means when the size of each work request 26 is not constant.
[0023]
The CPU 2 in FIG. 2 stores data including processing requests from the OS and application programs as work requests 26 in the work queue 24 with the queue number WQ1 secured in the memory 7 as an area specified by the start address and end address. To do. The CPU 2 refers to the semaphore variable table 22 in the memory 5 in which the semaphore variables set corresponding to the work queue 24 are stored, and determines whether or not the work requests 26 can be accumulated.
[0024]
If the work request 26 can be accumulated, the work request 26 is added to the end of the work queue 24. Then, the CPU 2 updates the semaphore variable table 22. Details of the work request accumulation process will be described later.
[0025]
The coprocessor 8 takes out the first work request 26 from the work queue 24 at a specific timing, and executes the processing request. The work request 26 stores processing request contents such as data transmission and reception, and information such as a data transmission destination, data to be transmitted, or storage location of received data, and the coprocessor 8 follows the processing request contents. Execute the process.
[0026]
The coprocessor 8 performs data transmission with the TCA connected via the InfiniBand switch 9 according to the processing request contents, and completes the work request 26. After processing the work request 26, the coprocessor 8 creates a work completion 30 corresponding to the processed work request 26, and the queue number secured in the memory 7 as an area specified by the start address and end address. Accumulate in the completion queue 28 of CQ1.
[0027]
The CPU 2 collects the work completion 30 from the completion queue 28 at a specific timing, confirms that the corresponding work request 26 is completed, and updates the semaphore variables in the semaphore variable table 22 of the memory 5. Details of the work completion collection process will be described later. Thus, the processing request is completed. Next, the data structure of the work request 26, the work completion 30, and the semaphore variable table 22 will be described.
[0028]
FIG. 3 is a diagram illustrating a data configuration example of the work request 26 accumulated in the work queue 24. Each entry of FIG. 3 stores an identification number (Work Request ID) 31 that identifies the work request 26 and data 32 related to the processing request. Although not shown, the data 32 related to the processing request stores information such as processing request contents such as data transmission and reception, data transmission destination and data to be transmitted, and storage location of the received data.
[0029]
FIG. 4 is a diagram illustrating a data configuration example of the work completion 30 accumulated in the completion queue 28. Each entry in FIG. 4 stores an identification number (Work Request ID) 41 that identifies the processed work request 26 and data 42 related to the processed work request 26. In the data 42 related to the processed work request 26, although not shown, for example, an end status indicating normal end or abnormal end, an error code indicating error content, and the like are stored. By referring to the work completion 30, it is possible to confirm which work request 26 is completed in which state.
[0030]
FIG. 5 is a semaphore variable table 22 stored in the memory 5. Each entry in FIG. 5 stores a queue number 51 and a semaphore variable value 52 of the queue number.
In FIG. 5, WQ1 indicates a queue number 51 for the work queue 24, and SW1 is a semaphore variable value 52 for the work queue 24.
[0031]
In the first embodiment of the present invention, a semaphore variable is set only for one work queue 24. However, when there are a plurality of work queues 24, the semaphore variable set for each queue is shown in FIG. It is added to the semaphore variable table as line data. Furthermore, a semaphore variable for the completion queue 28 may be set and added to the semaphore variable table. With reference to the semaphore variable table 22, a semaphore variable value 52 corresponding to the work queue 24 or the completion queue 28 can be obtained, and it can be determined whether or not additional work requests 26 can be accumulated in the work queue 24.
[0032]
In the first embodiment of the present invention, the semaphore variable table 22 is used, but implementation without using a table is also possible. For example, a pointer that identifies a semaphore corresponding to a work queue number may be known using a hash function.
[0033]
Subsequently, the work request accumulation process and the work completion collection process in the first embodiment of the present invention will be described.
[0034]
FIG. 6 is a flowchart for explaining work request accumulation processing in the first embodiment of the present invention. In the semaphore variable table 22, the maximum number of data that can be stored in the work queue 24 is set as an initial value of the semaphore variable corresponding to the work queue 24 with the queue number WQ1.
[0035]
First, the CPU 2 determines whether the semaphore variable in the work queue 24 is a positive value (S62). The CPU 2 refers to the semaphore variable table 22 in the memory 5 and obtains a semaphore variable value 52 corresponding to the work queue 24 having the queue number WQ1. If the obtained semaphore variable value is positive, it means that the work queue 24 is free and work requests 26 can be additionally accumulated.
[0036]
If the work queue 24 is free in step S62, the CPU 2 updates the semaphore variable table 22 with a value obtained by subtracting 1 from the semaphore variable in the work queue 24 as a new semaphore variable (S63). This is because when one work request 26 is accumulated, one empty work queue 24 is consumed.
[0037]
If it is determined in step S62 that there is no space, the process waits for a predetermined time and the process of step S62 is performed again. In this way, it waits for the work queue 24 to be free. Or give up the accumulation.
[0038]
After step S63, work requests 26 are additionally accumulated in the work queue 24 (S66). Then, it is determined whether or not the accumulation process in step S64 is successful (S67). Even if storage to the work queue 24 is possible, the work request storage process is canceled as it is when the storage process fails due to a power failure of the apparatus in the middle of the storage process or stop of the storage process due to interrupt processing.
[0039]
If the work request 26 is successfully accumulated in step S67, the work request accumulation process is terminated. If it fails in step S67, 1 is added to the semaphore variable in the work queue 24 (S69), and the work request accumulation process is terminated. In step S63, the semaphore variable is updated on the assumption that the work request is accumulated and one empty work queue 24 is consumed. However, since the work request accumulation fails in step S67, the empty work queue 24 is consumed. Not. Accordingly, in step S69, the value subtracted in step S63 is restored.
[0040]
The work request accumulation process in FIG. 6 appropriately updates the semaphore variable indicating the work queue availability, and if there is no available space, the work request 26 is not added, and overflow of the work queue 24 can be prevented. it can.
[0041]
FIG. 7 is a flowchart for explaining the work completion collection process according to the first embodiment of the present invention. First, it is determined whether or not the work completion 30 is accumulated in the completion queue 28 (S71). The CPU 2 collects the work completion 30 from the head of the completion queue 28, and if the completion queue 28 is empty, the work completion collection process is finished as it is.
[0042]
Then, the CPU 2 updates the value obtained by adding 1 to the semaphore variable of the work queue 24 as a semaphore variable (S73), and ends the work completion collection process. This is because the processing of the work request 26 has been completed, and it has been confirmed that one free space has been created in the work queue 24. The semaphore variable value 52 corresponding to the work queue 24 should be updated when the coprocessor 8 completes the processing of the work request 26, but the CPU 2 knows at what timing the coprocessor 8 processes the work request 26. I can't. Therefore, when the work completion 30 is collected, it is considered that the work queue 24 is empty, and the semaphore variable is updated.
[0043]
With the work completion collection process of FIG. 7, the semaphore variable indicating the empty state of the work queue 24 is appropriately updated, and overflow of the work queue 24 can be prevented. Further, by updating the semaphore variable of the work queue 24 when the work completion 30 is collected, the present invention can be implemented only on the OS or application side regardless of the processing of the HCA coprocessor 8 and can be easily introduced. Therefore, it is not necessary to complicate the hardware implementation.
[0044]
As described above, according to the first embodiment of the present invention, when a semaphore variable corresponding to the work queue 24 is appropriately updated and a work request is added, overflow of the work queue 24 is prevented by referring to the semaphore variable. It is possible.
[0045]
In the first embodiment, the size of the completion queue 28 is set in advance so that the number of data that can be accumulated in the completion queue 28 is equal to or larger than the maximum number of data that can be accumulated in the work queue 24 (completion). The present invention can be applied using only the semaphore variables set for the work queue 24 (without setting the semaphore variables for the queue 28).
[0046]
In other words, even if all the work requests 26 accumulated in the work queue 24 at a certain point in time are transferred to the completion queue 28, it is ensured that the completion queue 28 does not overflow. This is because it is only necessary to prevent the work queue 24 from overflowing when the work requests 26 are accumulated in the queue 24.
[0047]
In the first embodiment, the semaphore variable is set only in the work queue 24, but it is also possible to set the semaphore variable only in the completion queue 28 to prevent the completion queue 28 from overflowing. The present invention can be applied by appropriately replacing the work queue 24 in steps S62, S63, and S73 in FIGS. 6 and 7 with the completion queue 28.
[0048]
If there is no space in the completion queue, the work request 26 is not added. Since the work request 26 and the work completion 30 correspond one-to-one, the completion queue 28 does not overflow due to the added work request 26. In this way, overflow of the completion queue 28 can be prevented. In addition, by updating the semaphore variable in the completion queue 28 when the work request 26 is accumulated, the present invention can be implemented regardless of the processing of the HCA coprocessor, which is easy to introduce and implements hardware. It does not need to be complicated.
[0049]
As a modification of the first embodiment, semaphore variables can be set in both the work queue 24 and the completion queue 28 to prevent overflow of both queues. A work request accumulation process and a work completion collection process in a modification of the first embodiment will be described.
[0050]
FIG. 8 is a flowchart for explaining work request accumulation processing in a modification of the first embodiment. The same steps as those in FIG. 6 are assigned the same step numbers, and will not be described unless necessary. In the semaphore variable table 22, the maximum number of data that can be accumulated in each queue is set as initial values of semaphore variables corresponding to the work queue 24 and the completion queue 28 of queue numbers WQ1 and CQ1.
[0051]
First, the CPU 2 determines whether the semaphore variable corresponding to the work queue 24 is a positive value (S62). This is the same step as in FIG. If the work queue 24 is free in step S62, the CPU 2 updates the semaphore variable table 22 with a value obtained by subtracting 1 from the semaphore variable in the work queue 24 as a new semaphore variable (S63). This is because when one work request 26 is accumulated, one empty work queue 24 is consumed.
[0052]
If it is determined in step S62 that there is no space, the process waits for a predetermined time and performs the process of step S62 again. In this way, it waits for the work queue 24 to be free. Or give up the accumulation.
[0053]
After step S63, it is determined whether the semaphore variable corresponding to the completion queue 28 is a positive value (S64). The CPU 2 refers to the semaphore variable table 22 and obtains a semaphore variable value 52 corresponding to the completion queue 28 having the queue number CQ1. If the semaphore variable value is positive, it means that the completion queue 28 is empty and the work completion 30 can be accumulated.
[0054]
If it is determined in step S64 that there is a free space, the CPU 2 updates the semaphore variable table 22 using a value obtained by subtracting 1 from the semaphore variable in the completion queue 28 as a new semaphore variable (S65). Although the semaphore variable value corresponding to the completion queue 28 should be updated after the coprocessor 8 completes the processing of the work request 26, the CPU 2 can know when the coprocessor 8 processes the work request 26. Can not. The work requests 26 stored in the work queue 24 always have a work completion 30 corresponding to the work request 26 stored in the completion queue 28 after the processing is completed, and correspond one-to-one. Therefore, it is assumed that one completion queue 28 has been consumed when the work request 26 is accumulated in the work queue 24, and the semaphore variable in the completion queue 28 is updated.
[0055]
If it is determined in step S64 that there is no free space, the process waits for a predetermined time and performs the process of step S64 again. Thus, it waits for the completion queue 28 to be empty.
[0056]
Thus, when both the work queue 24 and the completion queue 28 are empty, the work request 26 is accumulated in the work queue 24 (S66). Then, it is determined whether or not the accumulation process in step S64 is successful (S67).
[0057]
If the work request 26 is successfully accumulated in step S67, the work request accumulation process is terminated. If it fails in step S67, 1 is added to each of the semaphore variables in the work queue 24 and the completion queue (S69), and the work request accumulation process is terminated. In steps S63 and S65, the semaphore variable is updated on the assumption that the work requests are accumulated and one of the work queue 24 and the completion queue 28 is consumed, but the accumulation of work requests failed in step S67. The empty space in the work queue 24 and the completion queue 28 is not consumed. Accordingly, in step S69, the value subtracted in steps S63 and S65 is restored.
[0058]
The semaphore variable indicating the free state of each queue is appropriately updated by the work request 26 accumulation process of FIG. 8, and the work request 26 is not added when there is no free space in the work queue. Similarly, the work request 26 is not added when there is no space in the completion queue. Since the work request 26 and the work completion 30 correspond one-to-one, the completion queue 28 does not overflow due to the added work request 26. Thus, overflow of the work queue 24 and the completion queue 28 can be prevented. In addition, by updating the semaphore variable in the completion queue 28 when the work request 26 is accumulated, the present invention can be implemented regardless of the processing of the HCA coprocessor, which is easy to introduce and implements hardware. It does not need to be complicated.
[0059]
FIG. 9 is a flowchart for explaining the work completion collection process in the modification of the first embodiment. The same steps as those in FIG. 7 are assigned the same step numbers, and will not be described unless necessary.
[0060]
First, it is determined whether or not the work completion 30 is accumulated in the completion queue 28 (S71). Then, the CPU 2 updates the value obtained by adding 1 to the semaphore variable of the work queue 24 as a semaphore variable (S73). Next, the value obtained by adding 1 to the semaphore variable in the completion queue 28 is updated as a new semaphore variable value (S74). This is because the completion queue 28 is vacated by collecting one work completion 30 in step S82.
[0061]
The semaphore variable indicating the free state of each queue is appropriately updated by the work completion 30 collection process of FIG. 9, and overflow of the work queue 24 and the completion queue 28 can be prevented. In addition, by updating the semaphore variable of the work queue 24 when the work completion 30 is collected, the present invention can be implemented regardless of the processing of the HCA coprocessor, which is easy to introduce and implements hardware. It does not need to be complicated.
[0062]
Note that the modification of the first embodiment described above can be applied to a configuration in which a plurality of work queues 24 and completion queues 28 correspond to each other as long as the work queue 24 and the completion queue 28 have a one-to-one correspondence.
[0063]
Next, a second embodiment of the present invention will be described. In the second embodiment, a plurality of work queues 24 are secured on the memory and one completion queue 28 is secured for the plurality of work queues 24 in the same configuration as in the first embodiment in FIG. It is. In the second embodiment of the present invention, a semaphore variable indicating the number of data (work request 26 and work completion 30) that can be stored in each queue is set for the work queue 24 and the completion queue 28. Thus, each queue is prevented from overflowing.
[0064]
FIG. 10 is a diagram showing an operation when the CPU 2 accesses data stored in the peripheral device in the second embodiment of the present invention. The same parts as those in FIG. 2 are given the same numbers, and the description thereof will be omitted if unnecessary.
[0065]
The CPU 2 in FIG. 10 uses data including processing requests from the OS and application programs as work requests 26, and each of the work queue numbers WQ1 to WQn secured in the memory 7 as areas specified by the start address and end address. n (n is a natural number) work queues 24 1 To work queue 24 n To accumulate. The CPU 2 refers to the semaphore variable table 22 in the memory 5 in which semaphore variables set corresponding to each work queue 24 and a completion queue 28 described later are stored, and determines whether or not work requests 26 can be accumulated.
[0066]
If the work request 26 can be accumulated, the work request 26 is added to the end of the work queue 24. The CPU 2 stores information indicating in which work queue 24 the work request 26 is accumulated in the work queue 24 to work request 26 correspondence table 23 of the memory 5 and updates the semaphore variable table 22. Details of the work request 26 accumulation process will be described later.
[0067]
The coprocessor 8 retrieves the first work request 26 from the work queue 24 at a specific timing, executes a processing request, and transmits data to and from the TCA connected to the fabric network via the InfiniBand switch 9 according to the processing request content. To complete the work request 26. After processing the retrieved work request 26, the coprocessor 8 creates a work completion 30 and stores it in the completion queue 28. In general, the work queue 24 and the completion queue 28 do not need to correspond one-to-one, and a plurality of work queues 24 can be associated with one completion queue 28 as shown in FIG. is there.
[0068]
The CPU 2 collects the work completion 30 from the completion queue 28 at a specific timing, confirms that the corresponding work request 26 is completed, and completes the processing request. At the same time, the CPU 2 updates the semaphore variables in the semaphore variable table 22 in the memory 5. Details of the work completion collection process will be described later.
[0069]
In addition, although it is one in FIG. 2, it is also possible to employ a configuration having a plurality of completion queues 28. Each work queue 24 can be given a specific role. For example, WQ1 can be set to store work requests 26 for sending Infiniband messages, and WQ2 can be set to store work requests 26 for receiving Infiniband messages. The data structures of the work request 26, the work completion 30, and the semaphore variable table 22 are respectively as shown in FIGS. 3, 4, and 5, as in the first embodiment.
[0070]
FIG. 11 is a work queue to work request correspondence table 23 stored in the memory 5. Each entry in FIG. 11 stores a queue number 51 and a list 111 of work request numbers 31 accumulated in the work queue 24 specified by the queue number. With reference to this correspondence table, a list of work request 26 numbers accumulated in each work queue 24 can be obtained. Therefore, it is possible to specify in which work queue 24 a certain work request 26 is accumulated. In FIG. 11, for example, it can be seen that the work request 26 specified by the work request number (1, 12, 28) included in the list WRL1 is accumulated in the queue having the queue number WQ1.
[0071]
Next, work request accumulation processing and work completion in the second embodiment of the present invention will be described.
[0072]
FIG. 12 is a flowchart illustrating work request accumulation processing in the second embodiment of the present invention. The same steps as those in FIGS. 6 and 8 are given the same step numbers, and the description thereof will be omitted if not necessary. The maximum number of data that can be accumulated in each queue is set in advance in the semaphore variable table 22 as an initial value of the semaphore variable for each queue.
[0073]
First, the work queue 24 corresponding to the processing request from the OS or application program is determined (S61). The CPU 2 obtains an appropriate work queue 24 number of the work queue 24 according to the processing request content. For example, if the processing request is data transmission and the work queue 24 with the queue number WQ1 in FIG. 10 is assigned for data transmission, the work queue 24 with the queue number WQ1 is selected. The assignment of uses to each work queue 24 can be freely determined. Further, one work queue 24 may be arbitrarily selected unless a use is set for each work queue 24.
[0074]
Next, it is determined whether or not the semaphore variable of the work queue 24 determined in step S61 is a positive value (S62). The CPU 2 refers to the semaphore variable table 22 in the memory 5 and obtains the semaphore variable value of the work queue 24 determined in step S61.
[0075]
If the value of the semaphore variable is positive in step S62, the CPU 2 updates the semaphore variable table 22 with the value obtained by subtracting 1 from the semaphore variable in the work queue 24 determined in step S61 as a new semaphore variable (S63). If the value of the semaphore variable is positive in step S62, the work queue 24 is empty, and work requests 26 can be accumulated. Therefore, when the work request 26 is accumulated, one empty work queue is consumed.
[0076]
If it is determined in step S62 that there is no space, the process waits for a predetermined time and performs the process of step S62 again. In this way, it waits for the work queue 24 to be free.
[0077]
After step S63, it is determined whether the semaphore variable in the completion queue 28 is a positive value (S64). The CPU 2 refers to the semaphore variable table 22 and obtains the semaphore variable value of the completion queue 28. If the semaphore variable value is positive, the completion queue 28 is empty and the work completion 30 can be accumulated.
[0078]
If it is determined in step S64 that there is a free space, the CPU 2 updates the semaphore variable table 22 using a value obtained by subtracting 1 from the semaphore variable in the completion queue 28 as a new semaphore variable (S65). Although the semaphore variable value corresponding to the completion queue 28 should be updated after the coprocessor 8 completes the processing of the work request 26, the CPU 2 can know when the coprocessor 8 processes the work request 26. Can not. The work requests 26 stored in the work queue 24 always have a work completion 30 corresponding to the work request 26 stored in the completion queue 28 after the processing is completed, and correspond one-to-one. Therefore, it is assumed that one completion queue 28 has been consumed when the work request 26 is accumulated in the work queue 24, and the semaphore variable in the completion queue 28 is updated.
[0079]
If it is determined in step S64 that there is no free space, the process waits for a predetermined time and performs the process of step S64 again. Thus, it waits for the completion queue 28 to be empty.
[0080]
Thus, if both the work queue 24 and the completion queue 28 are free, the work request 26 is stored in the work queue 24 determined in step S61 (S66). Next, it is determined whether or not the accumulation process in step S66 is successful (S67). The work request 24 can be stored in the work queue 24. However, if the storage process fails due to power interruption of the apparatus or stop of the storage process due to the interrupt process during the storage process, the work request storage process is stopped as it is.
[0081]
If the work request 26 is successfully accumulated in step S67, the work request 26 accumulated in step S66 and the work queue 24 in which the work request 26 is accumulated are associated and recorded (S68), and the work request accumulation process is performed. finish. The work request number accumulated in step S64 may be added to the work request ID list corresponding to the queue number 51 of the work queue 24 in the work queue-to-work request correspondence table 23 stored in the memory 5.
[0082]
If it fails in step S67, 1 is added to each of the semaphore variables of the work queue 24 and the completion queue specified in step S61 (S69), and the work request accumulation process is terminated. In steps S63 and S65, the semaphore variable is updated on the assumption that the work requests are accumulated and one of the work queue 24 and the completion queue 28 is consumed, but the accumulation of work requests failed in step S67. The empty space in the work queue 24 and the completion queue 28 is not consumed. Accordingly, in step S69, the value subtracted in steps S63 and S65 is restored.
[0083]
The work request accumulation process in FIG. 12 appropriately updates the semaphore variable indicating the free state of each queue, and when there is no free space in the work queue, the work request 26 is not added. Similarly, the work request 26 is not added when there is no space in the completion queue. Since the work request 26 and the work completion 30 correspond one-to-one, the completion queue 28 does not overflow due to the added work request 26. Thus, overflow of the work queue 24 and the completion queue 28 can be prevented. In addition, by updating the semaphore variable in the completion queue 28 when the work request 26 is accumulated, the present invention can be implemented regardless of the processing of the HCA coprocessor, which is easy to introduce and implements hardware. It does not need to be complicated.
[0084]
FIG. 13 is a flowchart illustrating the work completion collection process according to the second embodiment of the present invention. First, it is determined whether or not the work completion 30 is accumulated in the completion queue 28 (S71). The CPU 2 takes out the work completion 30 from the head of the completion queue 28, and if the completion queue 28 is empty, the processing is ended as it is.
[0085]
Next, the work queue 24 in which the work requests 26 corresponding to the work completion 30 are stored is identified from the extracted work completion 30 (S72). The work completion 30 is created corresponding to the work request 26 that has been processed, and the processed work request number 41 is stored in the work completion 30 as shown in FIG. ing. The CPU 2 refers to the work queue-to-work request correspondence table 23 in the memory 5, searches the work request ID list 111 including the obtained work request number 41, and obtains the corresponding queue number 51.
[0086]
Then, the CPU 2 updates the value obtained by adding 1 to the semaphore variable of the work queue 24 specified in step S72 as a semaphore variable (S73). This is because the processing of the work request 26 has been completed, and it has been confirmed that one free space has been created in the work queue identified in step S72. Although the semaphore variable value corresponding to the work queue 24 should be updated when the coprocessor 8 completes the processing of the work request 26, the CPU 2 can know when the coprocessor 8 processes the work request 26. Can not. Therefore, when the work completion 30 is collected, it is considered that the work queue 24 is empty, and the semaphore variable is updated.
[0087]
Next, the value obtained by adding 1 to the semaphore variable in the completion queue 28 is updated as a new semaphore variable value (S74). This is because the completion queue 28 is freed by collecting one work completion 30 in step S72.
[0088]
With the work completion collection process of FIG. 13, the semaphore variables representing the free state of each queue are appropriately updated, and overflow of the work queue 24 and the completion queue 28 can be prevented. In addition, by updating the semaphore variable of the work queue 24 when collecting work completion, the present invention can be implemented regardless of the processing of the HCA coprocessor, which is easy to introduce and complicated to implement hardware. It is not necessary to make it.
[0089]
In the second embodiment, the size of the completion queue 28 is set in advance so that the number of data that can be stored in the completion queue 28 is equal to or greater than the sum of the maximum number of data that can be stored in each work queue 24. The present invention can be applied using only the semaphore variables set for the work queue 24 without setting the semaphore variables for the completion queue 28.
[0090]
That is, even if all the work requests 26 accumulated in each work queue 24 at a certain point in time are transferred to the completion queue 28, it is ensured that the completion queue 28 does not overflow. This is because it is only necessary to prevent overflow of the work queue 24 when the work requests 26 are accumulated in the work queue 24.
[0091]
The present invention can also be applied to inter-process communication between blades via a server-to-server, server-to-storage, blade server backplane, or inter-process communication within the same server. Further, it can be incorporated as a function of the OS or application program as a program, or provided as middleware that mediates between the OS and the application program.
[0092]
The above is summarized as an appendix.
[0093]
(Additional remark 1) The process of setting the 1st area | region where process request information is accumulate | stored, the process of setting the 2nd area | region where process completion information which is the information which shows completion of a process request is accumulated, said 1st A step of setting the initial value of the semaphore variable corresponding to the first area as the maximum number of information that can be stored in the first area, and a value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area If it is a positive value, if it is a positive value, the processing request information is added to the first area, and a value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area Updating as a semaphore variable corresponding to the area, and when the requested process is completed, associating information for identifying the process request and the process completion information in the second area, The processing completion information is accumulated in the second area. If it has been accumulated, the value obtained by adding 1 to the semaphore variable corresponding to the first area is updated as the semaphore variable corresponding to the first area, and one piece of the processing completion information is deleted An information storage control method comprising the step of:
[0094]
(Supplementary note 2) The information accumulation control method according to supplementary note 1, wherein the maximum number of pieces of information that can be stored in the second area is equal to or greater than the maximum number of pieces of information that can be stored in the first area. .
[0095]
(Additional remark 3) The process of setting the 1st area | region where process request information is accumulate | stored, the process of setting the 2nd area | region where process completion information which is the information which shows completion of a process request is accumulated, said 1st Setting an initial value of a semaphore variable corresponding to each of the first region and the second region as a maximum number of information that can be stored in the first region and the second region, respectively, and the first region And the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the second area are both positive values. If both are positive values, A value obtained by adding processing request information to the first area and subtracting 1 from the value of the semaphore variable corresponding to the first area as a semaphore variable corresponding to the first area, and the second area 1 from the value of the semaphore variable corresponding to A step of updating the subtracted value as a semaphore variable corresponding to the second area, and when the processing request is completed, information specifying the processing request is associated with the processing completion information in the second area. And the process completion information is stored in the second area, and if it is stored, a value obtained by adding 1 to the semaphore variable corresponding to the first area is determined. The value obtained by adding 1 to the value of the semaphore variable corresponding to the second area is updated as the semaphore variable corresponding to the second area, and the processing completion information is set to 1 An information storage control method comprising a step of deleting two.
[0096]
(Additional remark 4) The process of setting the some 1st area | region where process request information is accumulate | stored,
A step of setting a second area in which processing completion information, which is information indicating completion of a processing request, is stored; and an initial value of a semaphore variable corresponding to each of the plurality of first areas Setting the maximum number of pieces of information that can be stored in each of them, selecting one of the plurality of first areas, and subtracting 1 from the value of the semaphore variable corresponding to the selected first area If the selected value is a positive value, if it is a positive value, processing request information is added to the selected first area, and information for specifying the selected first area and the processing request is added. Updating the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the selected first area as the semaphore variable corresponding to the selected first area; When the processing request is completed, the processing request is A step of storing information to be determined in association with the processing completion information in the second area, and determining whether the processing completion information is stored in the second area. Read one information, identify the processing request corresponding to the read processing completion information, identify the first area where the identified processing request is stored with reference to the correspondence table, Updating a value obtained by adding 1 to the semaphore variable corresponding to the identified first area as a semaphore variable corresponding to the identified first area, and deleting the read processing completion information; An information storage control method comprising:
[0097]
(Supplementary Note 5) In Supplementary Note 4, the maximum number of information that can be stored in the second region is equal to or greater than a sum of the maximum number of information that can be stored in the plurality of first regions. Information storage control method.
[0098]
(Additional remark 6) The process of setting the some 1st area | region where process request information is accumulate | stored, the process of setting the 2nd area | region where the process completion information which is the information which shows completion of a process request is accumulated, The initial value of the semaphore variable corresponding to each of the first region and the second region of the first region is set as the maximum number of information that can be stored in each of the first region and the second region. Selecting one of the plurality of first regions, subtracting 1 from the value of the semaphore variable corresponding to the selected first region, and the semaphore corresponding to the second region. It is determined whether the value obtained by subtracting 1 from the variable value is a positive value. If both are positive values, processing request information is added to the selected first area, and the selected first area And the information specifying the processing request are stored in the correspondence table in association with each other. The value obtained by subtracting 1 from the value of the semaphore variable corresponding to the selected first area is used as the semaphore variable corresponding to the selected first area, and the value of the semaphore variable corresponding to the second area is A step of updating a value obtained by subtracting 1 from a value as a semaphore variable corresponding to the second area, and when the processing request is completed, information specifying the processing request is associated with the processing completion information A step of accumulating in the second area, and determining whether or not the process completion information is accumulated in the second area, and if it is accumulated, one of the process completion information is read and the read process completion is completed The processing request corresponding to the information is identified, the first area where the identified processing request is stored is identified with reference to the correspondence table, and the semaphore variable corresponding to the identified first area Add 1 to And the value obtained by adding 1 to the semaphore variable corresponding to the second area is updated as the semaphore variable corresponding to the second area. An information storage control method comprising a step of deleting the read processing completion information.
[0099]
(Additional remark 7) The 1st area | region where process request information is accumulate | stored, the 2nd area | region where process completion information which is the information which shows completion of a process request is matched with the information which identifies the said process request, and is accumulate | stored, A program that is executed in an apparatus having an accumulation unit that stores information specifying the first area and a semaphore variable table in which semaphore variables are associated and accumulated, and a control unit that controls the accumulation unit. And causing the control unit to set an initial value of a semaphore variable corresponding to the first area as the maximum number of information that can be stored in the first area, and a semaphore corresponding to the first area. Determine whether the value obtained by subtracting 1 from the variable value is a positive value. If the value is positive, the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area corresponds to the first area. As the semaphore variable Updating the fore variable table, adding the processing request information to the first area, and determining whether the processing completion information is stored in the second area. A program for executing a step of updating the semaphore variable table with a value obtained by adding 1 to a semaphore variable corresponding to the first area as a semaphore variable corresponding to the first area, and deleting one piece of the processing completion information.
[0100]
(Additional remark 8) The 1st area | region where process request information is accumulate | stored, the 2nd area | region where process completion information which shows completion of a process request is matched and stored with the information which specifies the said process request, said 1st A program that is executed in an apparatus having a storage unit that stores information for specifying a region and a semaphore variable table in which a semaphore variable is associated and stored, and a control unit that controls the storage unit, Causing the control unit to set an initial value of a semaphore variable corresponding to each of the first area and the second area as a maximum number of pieces of information that can be stored in the first area and the second area, respectively. And whether the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area and the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the second area are both positive values. Even if the value of For example, the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area is used as the semaphore variable corresponding to the first area, and 1 is subtracted from the value of the semaphore variable corresponding to the second area. Updating the semaphore variable table as a semaphore variable corresponding to the second area and adding the processing request information to the first area, and the processing completion information in the second area. If it is accumulated, a value obtained by adding 1 to the semaphore variable corresponding to the first area is used as the semaphore variable corresponding to the first area, and also corresponds to the second area. Executing the step of updating the semaphore variable table with a value obtained by adding 1 from the value of the semaphore variable to be performed as a semaphore variable corresponding to the second area, and deleting one piece of the processing completion information A program for causing.
[0101]
(Supplementary Note 9) A plurality of first areas in which process request information is stored, a second area in which process completion information indicating completion of a process request is stored in association with information identifying the process request, A program executed in an apparatus having an accumulation unit that stores information for specifying a first area and a semaphore variable table in which semaphore variables are associated and accumulated, and a control unit that controls the accumulation unit. The initial value of the semaphore variable corresponding to each of the first region and the second region of the plurality of first regions can be stored in the control unit in the first region and the second region, respectively. A step of setting the maximum number of pieces of information, selecting one of the plurality of first regions, and subtracting 1 from the value of the semaphore variable corresponding to the selected first region, Corresponding to the second region If the values obtained by subtracting 1 from the value of the semaphore variable are both positive values, and if both are positive values, the selected first area and the processing request are associated with each other and accumulated in the correspondence table, A value obtained by subtracting 1 from the value of the semaphore variable corresponding to the selected first area is used as a semaphore variable corresponding to the selected first area, and the value of the semaphore variable corresponding to the second area Updating the semaphore variable table with a value obtained by subtracting 1 from the semaphore variable corresponding to the second area, and adding the processing request information to the selected first area; It is determined whether the processing completion information is accumulated in the area. If it is accumulated, one processing completion information is read, the processing request corresponding to the read processing completion information is identified, and the identified First The value obtained by adding 1 to the semaphore variable corresponding to the area is used as the semaphore variable corresponding to the specified first area, and the value obtained by adding 1 from the value of the semaphore variable corresponding to the second area is the first value. A program for executing a process of updating the semaphore variable table as a semaphore variable corresponding to a second area and deleting one piece of the processing completion information.
[0102]
(Additional remark 10) The 1st area | region where process request information is accumulate | stored, and the 2nd area | region where process completion information which is the information which shows completion of a process request is matched with the information which specifies the said process request, and are accumulate | stored. A storage unit to be stored; a first device having a control unit for controlling the storage unit and executing the processing request; and information and a semaphore connected to the first device to identify the first region. A storage unit storing a semaphore variable table in which variables are associated and stored; and a second device having a control unit that controls the storage unit and transmits the processing request information to the first device. A control unit in the second device sets in advance an initial value of a semaphore variable for the first area as a maximum number of information that can be stored in the first area; From the semaphore variable corresponding to the region It is determined whether the value obtained by subtracting 1 is a positive value. If the value is positive, the value obtained by subtracting 1 from the semaphore variable corresponding to the first area is updated as the semaphore variable corresponding to the first area. , Transmitting new process request information to the first apparatus, and the control unit in the first apparatus receives the new process request information and adds it to the first area, and at a specific timing, The processing request stored in the first area is executed, processing completion information corresponding to the processing request is created and added to the second area, and the control unit in the second device is configured at a specific timing. It is determined whether the processing completion information is accumulated in the second area, and if it is accumulated, a value obtained by adding 1 to the semaphore variable corresponding to the first area is set as the semaphore corresponding to the first area. Updated as a variable and accumulated in the second area System characterized in that to remove a said processing completion information.
[0103]
(Additional remark 11) The 1st area | region where process request information is accumulate | stored, and the 2nd area | region where process completion information which shows completion of a process request are matched with the information which specifies the said process request, and are accumulate | stored are stored. A first device having a storage unit, a control unit that controls the storage unit and executes the processing request, and is connected to the first device and identifies the first region and the second region A second storage unit that stores a semaphore variable table in which information and a semaphore variable are associated and stored; and a control unit that controls the storage unit and transmits the processing request information to the first device. And the control unit in the second device sets the initial value of the semaphore variable for the first region as the maximum number of information that can be stored in the first region in advance for the second region. The initial value of the semaphore variable is Set as the maximum number of information that can be stored in the area, and subtract 1 from the semaphore variable corresponding to the first area and 1 from the semaphore variable corresponding to the second area at a specific timing If both values are positive, and if both are positive, the value obtained by subtracting 1 from the semaphore variable corresponding to the first area is used as the semaphore variable corresponding to the first area, and A value obtained by subtracting 1 from the semaphore variable corresponding to the second area is updated as a semaphore variable corresponding to the second area, and new processing request information is transmitted to the first device, and the first The control unit in the apparatus receives the new process request information, adds it to the first area, executes the process request stored in the first area at a specific timing, and responds to the process request Processing completion information Create and send to the second device, the control unit in the second device receives the processing completion information and adds it to the second region, the specific region to the second region It is determined whether processing completion information is accumulated. If accumulated, a value obtained by adding 1 to the semaphore variable corresponding to the first area is used as the semaphore variable corresponding to the first area, and the second Updating a value obtained by adding 1 to the value of the semaphore variable corresponding to the second area as a semaphore variable corresponding to the second area, and deleting one piece of the processing completion information accumulated in the second area A system characterized by
[0104]
(Additional remark 12) The some 1st area | region where process request information is accumulate | stored, and the 2nd area | region where process completion information which shows completion of a process request are matched with the information which specifies the said process request, and are accumulate | stored And a first device having a control unit for controlling the storage unit and executing the processing request, and each first of the plurality of first regions connected to the first device. And a semaphore variable table in which information specifying the second area and the semaphore variable are associated and stored, information specifying the processing request, and the processing request among the plurality of first areas are stored. A storage unit that stores a correspondence table in which information specifying the first area is associated and stored, and a control unit that controls the storage unit and transmits the processing request information to the first device A second device comprising: the second device The control unit in the information in which the initial values of the semaphore variables respectively corresponding to the first area and the second area of the plurality of first areas can be stored in the first area and the second area, respectively. Set as the maximum number of numbers, select one of the plurality of first regions at a specific timing, and subtract 1 from the semaphore variable corresponding to the selected first region and the second It is determined whether the value obtained by subtracting 1 from the semaphore variable corresponding to the area is positive, and if both are positive values, the value obtained by subtracting 1 from the semaphore variable corresponding to the selected first area is determined. Update the value obtained by subtracting 1 from the semaphore variable corresponding to the second region as the semaphore variable corresponding to the second region, and the value obtained by subtracting 1 from the semaphore variable corresponding to the second region, respectively. New to one device Processing request information is transmitted, the selected first area and the processing request are associated with each other and accumulated in a correspondence table, and the control unit in the first device receives the new processing request information. Accumulating in the first area, executing the processing request stored in the first area at a specific timing, creating processing completion information corresponding to the processing request and transmitting to the second device, The control unit in the second device receives the processing completion information and accumulates it in the second area, determines whether the processing completion information is accumulated in the second area at a specific timing, and accumulates it. If so, a value obtained by adding 1 to the semaphore variable corresponding to the first area is set as a semaphore variable corresponding to the first area, and 1 is calculated from the value of the semaphore variable corresponding to the second area. The added value corresponds to the second area That is updated each as a semaphore variable, and characterized in that to remove a stored the processing completion information to the second region system.
[0105]
(Appendix 13) In Appendix 10,
The system, wherein the first device is a channel adapter provided in a server machine, and the second device is a channel adapter provided in a network interface card.
[0106]
(Appendix 14) In Appendix 10,
A system characterized in that both the first device and the second device are host channel adapters provided in a server machine.
[0107]
【The invention's effect】
As described above, according to the present invention, when processing requests are executed by interposing two types of queues as interfaces, the data related to the processing requests can be stored in the queues without overflowing each queue. Can be prevented from being stopped or delayed due to overflow. Further, the present invention only needs to be implemented in the processing request issuing side device, and if the issuing side device is a device capable of executing a program, it can be implemented by software.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a configuration example of an information processing apparatus used in a first embodiment of the present invention.
FIG. 2 is a diagram illustrating an operation when a CPU accesses data stored in a peripheral device in the first embodiment of the present invention.
FIG. 3 is a diagram illustrating a data configuration example of work requests accumulated in a work queue.
FIG. 4 is a diagram illustrating a data configuration example of work completion accumulated in a completion queue.
FIG. 5 is a semaphore variable table stored in a memory.
FIG. 6 is a flowchart illustrating work request accumulation processing according to the first embodiment of the present invention.
FIG. 7 is a flowchart illustrating work completion collection processing according to the first embodiment of the present invention.
FIG. 8 is a flowchart illustrating work request accumulation processing in a modification of the first embodiment.
FIG. 9 is a flowchart illustrating work completion collection processing according to a modification of the first embodiment.
FIG. 10 is a diagram showing an operation when a CPU accesses data stored in a peripheral device in the second embodiment of the present invention.
FIG. 11 is a work queue to work request correspondence table stored in a memory.
FIG. 12 is a flowchart illustrating work request accumulation processing according to the second embodiment of the present invention.
FIG. 13 is a flowchart illustrating a work completion collection process according to the second embodiment of the present invention.
[Explanation of symbols]
1 Computer, 2 CPU, 3 System bus, 4 Memory controller, 5 Memory, 6 Host channel adapter, 7 Memory, 8 Coprocessor, 9 Infiniband switch, 10 Network interface card, 12 SCSI card, 14 Fiber channel card, 11, 13, 15 Target channel adapter, 24 work queues, 26 work requests, 28 completion queues, 30 work completions

Claims (6)

第一のプロセッサにより、処理要求情報を第一の領域に蓄積し、前記第一の領域に蓄積された処理要求に従い実行される処理が完了したことを示す処理完了情報を第二のプロセッサにより第二の領域に蓄積する情報蓄積制御方法であって、
前記第一のプロセッサにより、
前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報数の最大数以上に設定し、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定する第1の工程と、
前記第1の工程の後に、前記第一の領域に対応するセマフォ変数が正の値かを判定し、正の値であれば、前記第一の領域に前記処理要求情報を追加し、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として更新する第2の工程と、
さらに、前記第1の工程の後に、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第二の領域から前記処理完了情報を1つ削除する第3の工程を行い、
前記第二のプロセッサにより、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報を前記第二の領域に蓄積する際に、前記処理完了情報と前記処理要求情報とを対応付けて前記第二の領域に蓄積する第4の工程を行うことを特徴とする情報蓄積制御方法。
Process request information is accumulated in the first area by the first processor, and process completion information indicating that the process executed in accordance with the process requests accumulated in the first area is completed by the second processor. An information storage control method for storing in a second area,
By the first processor,
The maximum number of information that can be stored in the second area is set to be greater than or equal to the maximum number of information that can be stored in the first area, and the initial value of the semaphore variable corresponding to the first area is A first step of setting as a maximum number of information that can be stored in the first area ;
After the first step, it is determined whether the semaphore variable corresponding to the first region is a positive value. If the semaphore variable is a positive value, the processing request information is added to the first region, and the first step and as the second factory to update a value obtained by subtracting 1 from the value of the semaphore variable corresponding to an area as a semaphore variable corresponding to said first region,
Furthermore, after the first step, wherein the processing completion information is determined whether it is accumulated in the second region, if it is accumulated, by adding 1 to the semaphore variable corresponding to the first region updates the value as a semaphore variable corresponding to said first region, performs a third step to delete one said processing completion information from said second region,
The process completion information is associated with the process request information when the process completion information indicating that the process executed according to the process request information is completed by the second processor is stored in the second area. information storage control method and performing as a fourth factory you accumulated in the second region Te.
第一のプロセッサにより、処理要求情報を第一の領域に蓄積し、前記第一の領域に蓄積された処理要求に従い実行される処理が完了したことを示す処理完了情報を第二のプロセッサにより第二の領域に蓄積する情報蓄積制御方法であって、
前記第一のプロセッサにより、
前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報数の最大数以上に設定し、前記第一の領域および前記第二の領域にそれぞれ対応するセマフォ変数の初期値を前記第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定するする第1の工程と、
前記第1の工程の後に、前記第一の領域に対応するセマフォ変数と前記第二の領域に対応するセマフォ変数が共に正の値かを判定し、共に正の値であれば、前記第一の領域に処理要求情報を追加し、かつ前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新する第2の工程と、
さらに、前記第1の工程の後に、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記第二の領域から前記処理完了情報を1つ削除する第3の工程を行い、
前記第二のプロセッサにより、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報を前記第二の領域に蓄積する際に、前記処理完了情報と前記処理要求情報とを対応付けて前記第二の領域に蓄積する第4の工程を行うことを特徴とする情報蓄積制御方法。
Process request information is accumulated in the first area by the first processor, and process completion information indicating that the process executed in accordance with the process requests accumulated in the first area is completed by the second processor. An information storage control method for storing in a second area,
By the first processor,
The maximum number of information that can be stored in the second area is set to be equal to or greater than the maximum number of information that can be stored in the first area, and corresponds to the first area and the second area, respectively. A first step of setting an initial value of a semaphore variable as the maximum number of pieces of information that can be accumulated in the first area and the second area ,
After the first step, it is determined whether the semaphore variable corresponding to the first area and the semaphore variable corresponding to the second area are both positive values. The processing request information is added to the area, and the value obtained by subtracting 1 from the value of the semaphore variable corresponding to the first area is used as the semaphore variable corresponding to the first area, and also corresponds to the second area. and as the second factory to update each a value obtained by subtracting 1 from the value of the semaphore variable as a semaphore variable corresponding to the second region,
Furthermore, after the first step, wherein the processing completion information is determined whether it is accumulated in the second region, if it is accumulated, by adding 1 to the semaphore variable corresponding to the first region The value is updated as a semaphore variable corresponding to the first area, and a value obtained by adding 1 from the value of the semaphore variable corresponding to the second area is updated as a semaphore variable corresponding to the second area, and the process completion information from the second area subjected to the third step to delete one,
The process completion information is associated with the process request information when the process completion information indicating that the process executed according to the process request information is completed by the second processor is stored in the second area. information storage control method and performing as a fourth factory you accumulated in the second region Te.
第一のプロセッサにより、処理要求情報を複数の第一の領域のいずれかに蓄積し、前記第一の領域に蓄積された処理要求に従い実行される処理が完了したことを示す処理完了情報を第二のプロセッサにより第二の領域に蓄積する情報蓄積制御方法であって、
前記第一のプロセッサにより、
前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報の最大数の総和以上に設定し、前記複数の第一の領域にそれぞれ対応するセマフォ変数の初期値を前記複数の第一の領域にそれぞれ蓄積可能な情報数の最大数として設定する第1の工程と、
前記第1の工程の後に、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数が正の値かを判定し、正の値であれば、前記選択された第一の領域に処理要求情報を追加し、前記選択された第一の領域と前記処理要求情報を対応付けて対応表に蓄積し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として更新する第2の工程と、
さらに、前記第1の工程の後に、前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、前記対応表を参照して該特定された処理要求が蓄積された前記第一の領域を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として更新し、前記第二の領域から前記読み出された処理完了情報を削除する第3の工程を行い、
前記第二のプロセッサにより、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報を前記第二の領域に蓄積する際に、前記処理完了情報と前記処理要求情報とを対応付けて前記第二の領域に蓄積する第4の工程を行うことを特徴とする情報蓄積制御方法。
The first processor accumulates the processing request information in any one of the plurality of first areas, and the processing completion information indicating that the processing executed in accordance with the processing requests stored in the first area is completed. An information accumulation control method for accumulating in a second area by two processors,
By the first processor,
The maximum number of information that can be stored in the second area is set to be equal to or greater than the sum of the maximum number of information that can be stored in the first area, and the semaphore variables respectively corresponding to the plurality of first areas A first step of setting an initial value as the maximum number of pieces of information that can be accumulated in each of the plurality of first regions ;
After the first step, select one of the plurality of first regions, determine whether the semaphore variable corresponding to the selected first region is a positive value, and if it is a positive value For example, processing request information is added to the selected first area, the selected first area and the processing request information are associated with each other and stored in a correspondence table, and the selected first area is stored in the selected first area. and as the second factory to update the obtained by subtracting 1 from the value of the corresponding semaphore variable value as a semaphore variable corresponding to the selected first region,
Furthermore, after the first step, the process completion information is determined whether the stored, if stored, reads one said processing completion information, corresponding to the read processing completion information the The processing request is specified, the first area in which the specified processing request is stored is specified with reference to the correspondence table, and 1 is added to the semaphore variable corresponding to the specified first area. updates the value as a semaphore variable corresponding to the first region the identified performs the third step to delete the read processing completion information from said second region,
The process completion information is associated with the process request information when the process completion information indicating that the process executed according to the process request information is completed by the second processor is stored in the second area. information storage control method and performing as a fourth factory you accumulated in the second region Te.
第一のプロセッサにより、処理要求情報を複数の第一の領域のいずれかに蓄積し、前記第一の領域に蓄積された処理要求に従い実行される処理が完了したことを示す処理完了情報を第二のプロセッサにより第二の領域に蓄積する情報蓄積制御方法であって、
前記第一のプロセッサにより、
前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報の最大数の総和以上に設定し、複数の第一の領域の各第一の領域および第二の領域にそれぞれ対応するセマフォ変数の初期値を前記各第一の領域および前記第二の領域にそれぞれ蓄積可能な情報数の最大数として設定する第1の工程と、
前記第1の工程の後に、前記複数の第一の領域のうち1つを選択し、前記選択された第一の領域に対応するセマフォ変数と前記第二の領域に対応するセマフォ変数が共に正の値かを判定し、共に正の値であれば、前記選択された第一の領域に処理要求情報を追加し、前記選択された第一の領域と前記処理要求情報とを対応付けて対応表に蓄積し、前記選択された第一の領域に対応するセマフォ変数の値から1を減算した値を前記選択された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数の値から1を減算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新する第2の工程と、
さらに、前記第1の工程の後に、前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記処理完了情報を1つ読み出し、前記読み出された処理完了情報に対応する前記処理要求を特定し、前記対応表を参照して該特定された処理要求が蓄積された前記第一の領域を特定し、該特定された第一の領域に対応するセマフォ変数に1を加算した値を前記特定された第一の領域に対応するセマフォ変数として、また前記第二の領域に対応するセマフォ変数に1を加算した値を前記第二の領域に対応するセマフォ変数としてそれぞれ更新し、前記第二の領域から前記読み出された処理完了情報を削除する第3の工程を行い、
前記第二のプロセッサにより、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報を前記第二の領域に蓄積する際に、前記処理完了情報と前記処理要求情報とを対応付けて前記第二の領域に蓄積する第4の工程を行うことを特徴とする情報蓄積制御方法。
The first processor accumulates the processing request information in any one of the plurality of first areas, and the processing completion information indicating that the processing executed in accordance with the processing requests stored in the first area is completed. An information accumulation control method for accumulating in a second area by two processors,
By the first processor,
The maximum number of information that can be stored in the second area is set to be equal to or greater than the sum of the maximum number of information that can be stored in the first area, and the first area and the first area of the plurality of first areas A first step of setting an initial value of a semaphore variable corresponding to each of the two regions as a maximum number of information that can be stored in each of the first region and the second region ;
After the first step, one of the plurality of first regions is selected, and a semaphore variable corresponding to the selected first region and a semaphore variable corresponding to the second region are both positive. If both are positive values, processing request information is added to the selected first area, and the selected first area is associated with the processing request information. A value obtained by subtracting 1 from the value of the semaphore variable corresponding to the selected first area as a semaphore variable corresponding to the selected first area and corresponding to the second area. and as the second factory to update each a value obtained by subtracting 1 from the value of the semaphore variable as a semaphore variable corresponding to the second region,
Furthermore, after the first step, wherein the processing completion information is determined whether it is accumulated in the second region, if stored, reads one said processing completion information was the read processing The processing request corresponding to the completion information is identified, the first area in which the identified processing request is stored is identified with reference to the correspondence table, and the semaphore corresponding to the identified first area is identified. A value obtained by adding 1 to a variable is used as a semaphore variable corresponding to the specified first area, and a value obtained by adding 1 to a semaphore variable corresponding to the second area is used as a semaphore corresponding to the second area. update each as a variable, performs the third step to delete the second the read processing completion information from the area of,
The process completion information is associated with the process request information when the process completion information indicating that the process executed according to the process request information is completed by the second processor is stored in the second area. information storage control method and performing as a fourth factory you accumulated in the second region Te.
処理要求情報が蓄積される第一の領域と、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報が蓄積される第二の領域と、前記第一の領域に対応するセマフォ変数が格納される蓄積部と、
前記蓄積部を制御する制御部とを有する装置において実行されるプログラムであって、
記制御部に、前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報数の最大数以上に設定させ、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定させる第1の工程と、
前記第1の工程の後に、前記第一の領域に対応するセマフォ変数が正の値か判定させ、正の値であれば、前記第一の領域に対応するセマフォ変数の値から1を減算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記第一の領域へ前記処理要求情報を追加させる第2の工程と、
さらに、前記第1の工程の後に、前記第二の領域に前記処理完了情報が蓄積されているか判定させ、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として前記セマフォ変数表を更新させ、前記第二の領域から前記処理完了情報を1つ削除させる第3の工程とを実行させるためのプログラム。
A first area in which processing request information is stored, a second area in which processing completion information indicating that processing executed in accordance with the processing request information is completed, and a semaphore corresponding to the first area An accumulator that stores variables;
A program to be executed in an apparatus having said storage unit controlling to that control section a,
Before SL control section, the second the maximum number of storable information area, is set to more than the maximum number of storable information number to the first region, corresponding to the first region A first step of setting an initial value of a semaphore variable as the maximum number of pieces of information that can be stored in the first area ;
After the first step, the semaphore variable corresponding to the first region is determined whether a positive value, if a positive value, obtained by subtracting 1 from the value of the semaphore variable corresponding to the first region wherein the value as a semaphore variable corresponding to said first region to update the semaphore variable table, as the second factory to the to the first region Ru is added to the processing request information,
Furthermore, after the first step, the second area is determined whether the process completion information is stored in, if it is accumulated, by adding 1 to the semaphore variable corresponding to the first region program for the value as a semaphore variable corresponding to said first region to update the semaphore variable table, to execute a third step of Ru is removed one the process completion information from said second region.
処理要求情報が蓄積される第一の領域と、前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報が蓄積される第二の領域とが格納される第一の蓄積部と、前記第一の蓄積部を制御する第一の制御部を有する第一の装置と、
前記第一の装置に接続され、前記第一の領域に対応するセマフォ変数が格納される第二の蓄積部と、前記第二の蓄積部を制御し、前記処理要求情報を前記第一の装置へ送信する第二の制御部を有する第二の装置とを備え、
前記第二の装置における第二の制御部は、前記第二の領域に蓄積可能な情報数の最大数を、前記第一の領域に蓄積可能な情報数の最大数以上に設定する第1の工程と、
前記第1の工程の後に、前記第一の領域に対応するセマフォ変数の初期値を前記第一の領域に蓄積可能な情報数の最大数として設定し、特定のタイミングで前記第一の領域に対応するセマフォ変数が正の値か判定し、正の値であれば、前記第一の領域に対応するセマフォ変数から1を減算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第一の装置に新たな処理要求情報を送信する第2の工程と、
さらに、前記第1の工程の後に、特定のタイミングで前記第二の領域に前記処理完了情報が蓄積されているか判定し、蓄積されていれば、前記第一の領域に対応するセマフォ変数に1を加算した値を前記第一の領域に対応するセマフォ変数として更新し、前記第二の領域から前記処理完了情報を1つ削除する第3の工程を行い、
記第一の装置における第一の制御部は、前記新たな処理要求情報を受信して前記第一の領域に蓄積し、
前記処理要求情報に従い実行される処理が完了したことを示す処理完了情報を前記第二の領域に蓄積する際に、特定のタイミングで前記処理要求情報と前記処理完了情報を対応づけて前記第二の領域に蓄積する第4の工程を行うことを特徴とするシステム。
A first storage unit that stores a first region in which processing request information is stored and a second region in which processing completion information indicating that processing executed in accordance with the processing request information has been completed is stored; A first device having a first control unit for controlling the first storage unit;
A second accumulator connected to the first device and storing a semaphore variable corresponding to the first area; and controlling the second accumulator and processing request information to the first device And a second device having a second control unit for transmitting to
The second control unit in the second unit, the first to the second maximum number of the number which can be stored information in the region, set to more than the maximum number of storable information number to the first region And the process of
After the first step, the initial value of the semaphore variable corresponding to the first area is set as the maximum number of information that can be stored in the first area, and the first area is set at a specific timing. It is determined whether the corresponding semaphore variable is a positive value, and if it is a positive value, a value obtained by subtracting 1 from the semaphore variable corresponding to the first area is updated as a semaphore variable corresponding to the first area, and as the second factory that sends a new processing request information to the first device,
Furthermore, after said first step, it is determined whether the processing completion information to the second region at a timing of specific are stored, if it is accumulated, the semaphore variable corresponding to said first region to a value obtained by adding 1 to update the semaphore variable corresponding to said first region, performs a third step to delete one said processing completion information from said second region,
First control portion before Symbol first device receives the new processing request information stored in said first region,
When the process completion information indicating that the process executed according to the process request information is completed is stored in the second area, the process request information and the process completion information are associated with each other at a specific timing. system characterized that you perform a fourth step of storing the region.
JP2003043097A 2003-02-20 2003-02-20 Information storage control method to storage device Expired - Fee Related JP4484436B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003043097A JP4484436B2 (en) 2003-02-20 2003-02-20 Information storage control method to storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003043097A JP4484436B2 (en) 2003-02-20 2003-02-20 Information storage control method to storage device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2010027577A Division JP5402698B2 (en) 2010-02-10 2010-02-10 Information storage control method to storage device

Publications (2)

Publication Number Publication Date
JP2004252755A JP2004252755A (en) 2004-09-09
JP4484436B2 true JP4484436B2 (en) 2010-06-16

Family

ID=33026195

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003043097A Expired - Fee Related JP4484436B2 (en) 2003-02-20 2003-02-20 Information storage control method to storage device

Country Status (1)

Country Link
JP (1) JP4484436B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5101195B2 (en) * 2007-07-09 2012-12-19 株式会社東芝 Interface controller
JP2022184255A (en) * 2021-05-31 2022-12-13 広海 大谷 BUSINESS PATENT ON INTERNET BUSINESS, PATENT AND IoT DEVICES ON SECURITY, AND BUSINESS APPLICATION PATENT OF ALGORITHM

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000099446A (en) * 1998-09-21 2000-04-07 Hitachi Ltd Method and device for controlling command issueing

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2697744B2 (en) * 1989-07-03 1998-01-14 富士通株式会社 Channel device
JPH052468A (en) * 1991-02-13 1993-01-08 Oki Electric Ind Co Ltd Buffer memory management system
JP3586522B2 (en) * 1996-09-26 2004-11-10 日本電気株式会社 Peripheral device controller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000099446A (en) * 1998-09-21 2000-04-07 Hitachi Ltd Method and device for controlling command issueing

Also Published As

Publication number Publication date
JP2004252755A (en) 2004-09-09

Similar Documents

Publication Publication Date Title
KR100810015B1 (en) System, management server, reception server, control method, control program, and recording medium
JP5364773B2 (en) System and method for managing a connection between a client and a server
US7080219B2 (en) Storage controlling device and control method for a storage controlling device
JP4943278B2 (en) Virus scanning method and computer system using the method
JP5029513B2 (en) Information processing apparatus, information processing apparatus control method, and program
JP2002222110A (en) Storage system and virtual private volume controlling method
JP2002328813A (en) Method for correcting program
JP6650483B2 (en) Storage device, data management method, and data management program
CN105739930A (en) Storage framework as well as initialization method, data storage method and data storage and management apparatus therefor
CN112346653A (en) Drive box, storage system and data transfer method
JP4625675B2 (en) Storage device resource allocation method and storage device
JP3748708B2 (en) Client / server system, client computer, and recording medium
JP4484436B2 (en) Information storage control method to storage device
JP5402698B2 (en) Information storage control method to storage device
EP3293625B1 (en) Method and device for accessing file, and storage system
US7240043B2 (en) Method of controlling storage control apparatus, storage control apparatus, and computer readable program for controlling the same
JP4218034B2 (en) Data communication system, data communication method, and data communication program
JP6836536B2 (en) Storage system and IO processing control method
WO2013065151A1 (en) Computer system, data transmission method, and data transmission program
JP4089506B2 (en) File sharing system, server and program
JP7116318B2 (en) Processing system, processing method, upper system, lower system, upper program and lower program
WO2001093032A1 (en) Computer system, method of controlling computer, and medium storing control program
JP5287938B2 (en) Device control system and program
JP3572650B2 (en) Interrupt controller and control method thereof
JP6152050B2 (en) Virtual machine management apparatus, server virtualization system, virtual machine management method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060215

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20081226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090323

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20091110

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100210

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20100219

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

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

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140402

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees