JPH0540689A - Buffer memory control system - Google Patents

Buffer memory control system

Info

Publication number
JPH0540689A
JPH0540689A JP3196257A JP19625791A JPH0540689A JP H0540689 A JPH0540689 A JP H0540689A JP 3196257 A JP3196257 A JP 3196257A JP 19625791 A JP19625791 A JP 19625791A JP H0540689 A JPH0540689 A JP H0540689A
Authority
JP
Japan
Prior art keywords
lbs
buffer memory
cpu
exclusive
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP3196257A
Other languages
Japanese (ja)
Inventor
Motoyoshi Hirose
元義 廣瀬
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 JP3196257A priority Critical patent/JPH0540689A/en
Publication of JPH0540689A publication Critical patent/JPH0540689A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To solve a problem to generate data transfer frequently when a certain processor (CPU) makes access an area including a lock word in a buffer memory control system for an information processor providing with buffer memory (LBS) in plural CPUs controlled with a swap system. CONSTITUTION:This system is comprised in such a way that the holding state of the exclusive area of another CPU is changed from an exclusive state (E=1) to a shared state (E=0), and its own LBS is registered in the shared state, and when an area including the lock word that exists in the LBS of another CPU is rewritten, the area is updated to the exclusive area, and the data transfer can be prevented from being performed at the next exclusive readout by a compare and swap (CS) instruction when no block exists in its own LBS in the exclusive readout of the exclusive area including the lock word by the CS instruction.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、複数個のプロセサ(CP
U) に、スワップ方式で制御されるバッファメモリ(LBS)
を備えている情報処理装置におけるバッファメモリの
制御方式に関する。
BACKGROUND OF THE INVENTION The present invention relates to a plurality of processors (CP
U) is a buffer memory (LBS) controlled by swap method
The present invention relates to a control method of a buffer memory in an information processing device including the.

【0002】従来から、メモリアクセスを高速に行い、
処理能力を向上させる為に、プロセサ(CPU) にスワップ
方式のバッファメモリ(LBS) を備え、且つ、複数個のプ
ロセサ(CPU) を持つ情報処理装置(マルチプロセサシス
テム) が知られている。
Conventionally, memory access is performed at high speed,
An information processing apparatus (multiprocessor system) is known in which a processor (CPU) has a swap-type buffer memory (LBS) in order to improve the processing capacity, and also has a plurality of processors (CPU).

【0003】このようなシステムにおいて、あるプロセ
サ(CPU) が獲得した領域を排他状態にして、他のプロセ
サ(CPU) に使用させない手段として、例えば、読み出し
→比較→書き込みを一連の動作として行い、該命令が終
了するまでの間、他のプロセサ(CPU) による該領域の更
新を許可しない命令、即ち、コンペア&スワップ命令(C
S 命令) がある。
In such a system, an area acquired by a certain processor (CPU) is placed in an exclusive state so as not to be used by another processor (CPU), for example, read → comparison → write is performed as a series of operations. Until the instruction ends, an instruction that does not allow the update of the area by another processor (CPU), that is, a compare & swap instruction (C
S command).

【0004】該あるプロセサ(CPU) が獲得している排他
領域を、他のプロセサ(CPU) が使用する目的で、該領域
を、上記 CS 命令を使用してアクセスしたとき、該領域
が自己のプロセサ(CPU) のバッファメモリ(LBS) に存在
しないと、該他のバッファメモリ(LBS) から該当のブロ
ックを自己のバッファメモリ(LBS) に転送し、該他のバ
ッファメモリ(LBS) を無効化して、自己のバッファメモ
リ(LBS) を排他状態にして参照することになる。
When an exclusive area acquired by a certain processor (CPU) is used by another processor (CPU) for the purpose of accessing the area by using the CS instruction, the area is self-owned. If it does not exist in the buffer memory (LBS) of the processor (CPU), the corresponding block is transferred from the other buffer memory (LBS) to its own buffer memory (LBS) and the other buffer memory (LBS) is invalidated. Then, the own buffer memory (LBS) is set to the exclusive state and referred to.

【0005】従って、複数個のプロセサ(CPU) が、該 C
S 命令を使用する毎に、該排他領域を含むブロックのデ
ータ転送が生じ、当該情報処理装置の性能を阻害する要
因ともなっていた。
Therefore, a plurality of processors (CPUs) are
Each time the S instruction is used, data transfer of the block including the exclusive area occurs, which is also a factor that hinders the performance of the information processing apparatus.

【0006】このようなことから、該複数のプロセサ(C
PU) が、該CS 命令を使用しても、必要最小限のデータ
転送で済ませることができるバッファメモリ制御方式が
必要とされる。
From the above, the plurality of processors (C
Even if the PU) uses the CS instruction, a buffer memory control method that can complete the minimum required data transfer is required.

【0007】[0007]

【従来の技術】図3〜図6は、従来のバッファメモリ制
御方式を説明する図であり、図3は情報処理装置の概念
図を示し、図4はバッファメモリ(LBS) の概念図を示
し、図5,図6は、バッファメモリをアクセスするとき
の動作フローの例を示している。
2. Description of the Related Art FIGS. 3 to 6 are views for explaining a conventional buffer memory control system, FIG. 3 shows a conceptual diagram of an information processing apparatus, and FIG. 4 shows a conceptual diagram of a buffer memory (LBS). 5 and 6 show an example of the operation flow when accessing the buffer memory.

【0008】図3に示したように、本発明の関連する情
報処理装置は、複数個のプロセサ(CPU) 1 からなり、そ
れぞれが、図4に示したバッファメモリ(LBS) 10を備え
ており、メモリアクセスの際には、自己のバッファメモ
リ(LBS) 10のタグメモリ(TAG) 11を検索し、該バッファ
メモリ(LBS) 10に、所望のデータを含むブロックが存在
しないとき、主記憶制御装置(MCU) 2 にリード/ライト
要求を送出して、他のプロセサ(CPU) 1 のバッファメモ
リ(LBS) 10, 又は、主記憶装置(MSU) 3 に存在するブロ
ックをムーブインして自己のバッファメモリ(LBS) 10に
登録する。
As shown in FIG. 3, an information processing apparatus related to the present invention comprises a plurality of processors (CPU) 1, each of which is provided with a buffer memory (LBS) 10 shown in FIG. During memory access, the tag memory (TAG) 11 of its own buffer memory (LBS) 10 is searched, and when there is no block containing the desired data in the buffer memory (LBS) 10, main memory control is performed. Send a read / write request to the device (MCU) 2, move the block existing in the buffer memory (LBS) 10, or the main memory (MSU) 3 of the other processor (CPU) 1 to the own buffer. Register in memory (LBS) 10.

【0009】図4は、該バッファメモリ(LBS) 10と、タ
グメモリ(TAG) 11の構成例を示している。本図におい
て、Vはブロックの有効ビットを示し、該ブロックが有
効であるとき、V=1 で、上位アドレス部で示される主記
憶装置(MSU) 3 の部分に対応するデータが存在すること
を示し、V=0 のときは、未使用の状態であることを示し
ている。
FIG. 4 shows a configuration example of the buffer memory (LBS) 10 and the tag memory (TAG) 11. In this figure, V indicates a valid bit of a block, and when the block is valid, V = 1 indicates that data corresponding to the main memory unit (MSU) 3 indicated by the upper address portion exists. When V = 0, it means that it is in an unused state.

【0010】又、本図において、Eは該当のブロックの
排他/共有の状態を示すフラグであり、E=0 のとき、共
有状態を示し、E=1 のときは、排他状態であることを示
している。
Further, in the figure, E is a flag showing the exclusive / shared state of the corresponding block. When E = 0, the shared state is shown, and when E = 1, the exclusive state is shown. Shows.

【0011】このように構成されたバッファメモリ(LB
S) 10をアクセスするときの動作フローの例を示したも
のが、図5,図6である。スワップ方式のバッファメモ
リ装置では、読出しは全プロセサ(CPU0 〜CPUn)1 が保
持可能{即ち、複数のプロセサ(CPU) 1 が最新データを
保持できる}で、読出し可能/書込み不可な“共有”状
態で、バッファメモリ(以下、LBSという)10内のブ
ロックを保持し、書込みの場合には、要求したプロセサ
(CPU) 1 のみ保持して、読出し/書込み可能な“排他”
状態で該ブロックを保持する。
The buffer memory (LB
5 and 6 show examples of the operation flow when S) 10 is accessed. In the swap type buffer memory device, all processors (CPU0 to CPUn) 1 can hold the read (that is, multiple processors (CPU) 1 can hold the latest data), and read / write is not possible in the “shared” state. Then, the block in the buffer memory (hereinafter referred to as LBS) 10 is held, and in the case of writing, the requested processor
(CPU) Holds only 1 and is readable / writable "exclusive"
Hold the block in the state.

【0012】又、複数のプロセサ(CPU0 〜CPUn) 1 間の
排他制御のために、前述のように、読出し−比較−書込
みを一連の動作として行い、命令が終了するまでの間に
他プロセサの更新を許可しない命令(CS:Compare an
d Swap命令など)が提供されており、排他領域(ロック
ワード)の参照更新を行う。
Further, for exclusive control among a plurality of processors (CPU0 to CPUn) 1, as described above, read-compare-write is performed as a series of operations, and the other processors wait until the instruction is completed. Command that does not allow update (CS: Compare an
d Swap instruction, etc.) is provided, and references and updates of the exclusive area (lock word) are performed.

【0013】従来のスワップ方式のバッファメモリ装置
では、このようなCS命令の場合には、最初の読出し時
にも、書込みを前提として動作することにより排他制御
を実現できる。
In the conventional swap type buffer memory device, in the case of such a CS instruction, exclusive control can be realized by operating on the premise of writing even at the first reading.

【0014】即ち、図5の動作フローにおいて、排他読
出しのときを見ると、自 LBS 10 に排他状態で存在して
いるときは、該自己の LBS 10 を読出すが、自 LBS 10
に存在しないとき、従来方式では、他のプロセサ(CPU)
1 の LBS 10 に存在するとき、他の LBS 10 からムーブ
アウト (転送) し、該ムーブアウトした他の LBS 10の
該当ブロックを無効(BI)化して、自己の LBSを排他状態
にしていた。{処理ステップ 100〜102 参照} そして、該他のプロセサ(CPU) 1 の LBS 10 にも存在し
ないときには、主記憶装置(MSU) 3 から“排他”で読み
出し登録していた。{処理ステップ 100〜103参照} 具体例で説明すると、あるプロセサ(CPU0) 1a が、該排
他領域を獲得している状態において、他のプロセサ(CPU
1) 1b が、該ロックワードを含む排他領域に対して、前
述のCS命令を実行すると、上記の排他読出しが実行さ
れ、該排他領域が自己の LBS 10 に存在しないので、処
理ステップ 101,102に移って、プロセサ(CPU0) 1a の L
BS 10 から該当のブロックをムーブアウト (転送) し、
該プロセサ(CPU0) 1a の LBS 10 を無効(BI)化して、自
己の LBS 10 を排他状態とする。
That is, looking at the time of exclusive read in the operation flow of FIG. 5, when the own LBS 10 exists in the exclusive state, the own LBS 10 is read, but the own LBS 10 is read.
When not present in the conventional method, other processors (CPU)
When it exists in LBS 10 of 1, it moves out (transfers) from another LBS 10 and invalidates (BI) the corresponding block of the other LBS 10 that has been moved out to put its own LBS in an exclusive state. {Refer to processing steps 100 to 102} Then, when it does not exist in the LBS 10 of the other processor (CPU) 1, it is read and registered as “exclusive” from the main memory unit (MSU) 3. {Refer to processing steps 100 to 103} As a specific example, when a certain processor (CPU0) 1a has acquired the exclusive area, another processor (CPU0)
1) When 1b executes the above-mentioned CS command for the exclusive area including the lock word, the above exclusive read is executed, and since the exclusive area does not exist in its own LBS 10, the processing moves to processing steps 101 and 102. L of processor (CPU0) 1a
Move out (transfer) the corresponding block from BS 10,
The LBS 10 of the processor (CPU0) 1a is invalidated (BI), and its own LBS 10 is set to the exclusive state.

【0015】ここで、該プロセサ(CPU0) 1a が、該ロッ
クを解除しようとして、該当のブロックをアクセスする
と、該当のブロックは、上記のようにして、既に、プロ
セサ(CPU1) 1の LBS 10 に移っているので、上記と同じ
動作となり、再度、ムーブアウト (転送) が行われる。
Here, when the processor (CPU0) 1a tries to release the lock and accesses the block concerned, the block is already in the LBS 10 of the processor (CPU1) 1 as described above. Since it has moved, the same operation as above is performed, and moveout (transfer) is performed again.

【0016】[0016]

【発明が解決しようとする課題】このような排他制御で
は、プロセサ (以下、CPUという) 台数が多くなり、
上記排他領域へのCPUのアクセスのぶつかりが増加し
た場合、ロックワードの待合せ(ロックワードの獲得の
待ち)のために排他領域を定期的にアクセスすると、実
際に排他領域を使用中であるCPUのLBSから、待合
せているCPUのLBSへのデータ転送(上記ムーブア
ウト)が頻繁に生じるため、情報処理装置の性能上問題
となる。
In such exclusive control, the number of processors (hereinafter, CPU) increases,
When the number of collisions of CPU access to the exclusive area increases, if the exclusive area is regularly accessed to wait for a lock word (wait for acquisition of a lock word), the CPU that is actually using the exclusive area Data transfer from the LBS to the LBS of the waiting CPU frequently occurs (the above moveout), which causes a problem in the performance of the information processing apparatus.

【0017】本発明は上記従来の欠点に鑑み、CS命令
でロックワードの待ち合わせを行う場合、ロックワード
が開放される迄のCPU間のデータ転送を削減すること
ができるバッファメモリ制御方式を提供することを目的
とするものである。
In view of the above-mentioned conventional drawbacks, the present invention provides a buffer memory control system capable of reducing the data transfer between CPUs until the lockword is released when waiting for the lockword by a CS instruction. The purpose is that.

【0018】[0018]

【課題を解決するための手段】図1, 図2は本発明の一
実施例を流れ図で示した図である。上記の問題点は下記
の如くに構成したバッファメモリ制御方式によって解決
される。複数個のプロセサ(CPU) 1a,1b,〜に、スワップ
方式で制御されるバッファメモリ(LBS) 10を備えている
情報処理装置において,バッファメモリ(LBS) 10内のブ
ロックを書替えられたブロックであること, 或いは、書
替えを行う為に読出したブロックであることを示す“排
他”(E=1) 状態と,読出しのみを行う為に読み出したブ
ロックであることを示す“共有”(E=0)状態との2状態
を基本として制御するバッファメモリ装置であって、あ
るプロセサ(CPU) 1aのバッファメモリ(LBS) 10内のある
ブロックが該プロセサ(CPU) 1aにより書き替えられてい
る場合に、該プロセサ(CPU) 1a以外のプロセサ(CPU) 1b
が該ブロックの内容がある値 (全"0")である場合にのみ
書き替える為に、該ブロックの読出しを行った時、該プ
ロセサ(CPU) 1aのバッファメモリ(LBS) 10の該ブロック
が排他状態であった場合には、該ブロックを排他状態(E
=1) から共有状態(E=0) に変更するとともに、該排他的
読出しを要求したプロセサ(CPU) 1bに対しては排他処理
が失敗したことを示す信号を読出しデータとともに伝達
して、該要求プロセサ(CPU) 1b内のバッファメモリ(LB
S) 10にも共有状態で登録{処理ステップ 100,101,104,
106}し、該要求プロセサ(CPU)1b内のバッファメモリ(L
BS) 10に共有状態で保持されていた場合には、そのまま
読出し{処理ステップ 100,107,108}て、該プロセサ(C
PU) 1aのバッファメモリ(LBS) 10の該ブロックに書込み
が生じた場合にのみ、該プロセサ(CPU) 1aのブロックを
排他状態(E=1) にする{処理ステップ 110,111,112,11
3}ように構成する。
1 and 2 are flowcharts showing an embodiment of the present invention. The above problems can be solved by the buffer memory control method configured as follows. In an information processing device having a plurality of processors (CPUs) 1a, 1b, ... each having a buffer memory (LBS) 10 controlled by a swap method, a block in the buffer memory (LBS) 10 is a rewritten block. Yes, or the "exclusive" (E = 1) state that indicates that the block has been read for rewriting, and the "shared" (E = 0) that indicates that the block has been read for only reading. ) Is a buffer memory device which controls on the basis of two states, and when a block in the buffer memory (LBS) 10 of a processor (CPU) 1a is rewritten by the processor (CPU) 1a. , Processor (CPU) 1b other than the processor (CPU) 1a
Is rewritten only when the content of the block has a certain value (all "0"), when the block is read, the block of the buffer memory (LBS) 10 of the processor (CPU) 1a If the block is in the exclusive state, the block is in the exclusive state (E
= 1) to the shared state (E = 0), and the processor (CPU) 1b that has requested the exclusive read transmits a signal indicating that the exclusive processing has failed together with the read data, Request processor (CPU) 1b buffer memory (LB
S) 10 also registered in shared state {processing steps 100, 101, 104,
106}, and the buffer memory (L) in the request processor (CPU) 1b
If it is held in the BS) 10 in a shared state, it is read as it is {processing steps 100, 107, 108} and the processor (C
The block of the processor (CPU) 1a is set to the exclusive state (E = 1) only when writing is performed to the block of the buffer memory (LBS) 10 of the PU) 1a {processing steps 110, 111, 112, 11
3} is configured.

【0019】[0019]

【作用】即ち、本発明では、CS命令での読出しでは排
他読出しを行うが、他のCPUのLBSに共有状態で保
持されていた場合には、状態変更を行わず、そのまま自
LBSにデータを転送し、自LBSに共有状態で保持さ
れていた場合にも、そのまま読出しを行う。
That is, in the present invention, the exclusive read is performed in the read by the CS instruction, but when it is held in the shared state in the LBS of another CPU, the state is not changed and the data is directly stored in the own LBS. Even if the data is transferred and held in the shared state in the own LBS, the read is performed as it is.

【0020】又、他CPUのLBSに排他状態で保持さ
れていた場合には、他CPUの保持状態を排他(E=1) か
ら共有(E=0) に変更し、自LBSに共有状態で登録を行
うように構成する。
If the LBS of the other CPU is held in the exclusive state, the holding state of the other CPU is changed from exclusive (E = 1) to shared (E = 0), and the shared state is maintained in the own LBS. Configure to register.

【0021】従って、CS命令でロックワードの待合せ
を行う場合、最初、該ロックワードを参照するときの
み、自己のLBSへのムーブアウトによるデータ転送を
生じるが、該ロックワードを含むブロックは共有状態(E
=0) に変更されて、該当のLBSに残っているので、次
の待ち合わせの為のアクセスでは、自己のLBSを参照
するだけで事足り、該ロックワードを含むブロックのデ
ータ転送を行うことはない。
Therefore, when waiting for a lock word with the CS instruction, data is transferred by moving out to its own LBS only when the lock word is first referenced, but the block containing the lock word is in a shared state. (E
= 0), it remains in the corresponding LBS, so it is sufficient to refer to its own LBS for the next access for waiting, and the data transfer of the block containing the lock word is not performed. ..

【0022】そして、該当のLBSに属するCPUが、
該ロックワードを解除する為に、該ロックワードを含む
領域が書替えられた場合にのみ、該CPUが自己のLB
Sを排他にして書き込むので、以後において、他のCP
Uから待ち合わせの為のアクセスがあると、そのときの
み、データ転送が生じるのみであり、ロックが解放され
るまでのCPU間のデータ転送を削減することができる
効果がある。
Then, the CPU belonging to the corresponding LBS is
Only when the area containing the lock word is rewritten in order to release the lock word, the CPU has its own LB.
Since S is written exclusively, other CPs will be written later.
When there is a wait access from U, data transfer occurs only at that time, and there is an effect that the data transfer between CPUs until the lock is released can be reduced.

【0023】[0023]

【実施例】以下本発明の実施例を図面によって詳述す
る。前述の図1, 図2が本発明の一実施例を流れ図で示
した図である。
Embodiments of the present invention will now be described in detail with reference to the drawings. 1 and 2 are flow charts showing an embodiment of the present invention.

【0024】本発明においては、複数個のプロセサ(CP
U) 1 に、スワップ方式で制御されるバッファメモリ(LB
S) 10を備えている情報処理装置において、 CS 命令で
ロックワードを含む排他領域の排他読み出しを行うと
き、該当のブロックが自己のバッファメモリ(LBS) 10に
存在しないとき、該ブロックの存在する他のプロセサ(C
PU) 1 のバッファメモリ(LBS) 10の保持状態を排他状態
(E=1) から共有状態(E=0)に変更して、自己のバッファ
メモリ(LBS)10に共有状態で登録し、該他のプロセサ(CP
U) 1 のバッファメモリ(LBS) 10に存在する上記ロック
ワードを含む領域が書き替えられたとき、該共有状態の
領域を排他領域に更新して、該 CS 命令による次の排他
読み出しのときにデータ転送を生じさせる手段が、本発
明を実施させるのに必要な手段である。尚、全図を通し
て同じ符号は同じ対象物を示している。
In the present invention, a plurality of processors (CP
U) 1 is the buffer memory (LB
In the information processing device equipped with S) 10, when the exclusive read of the exclusive area including the lock word is performed by the CS instruction, if the corresponding block does not exist in its own buffer memory (LBS) 10, the block exists. Other processors (C
PU) 1 buffer memory (LBS) 10 holding status is exclusive
Change from (E = 1) to the shared state (E = 0), register it in its own buffer memory (LBS) 10 in the shared state, and
U) When the area containing the lock word in the buffer memory (LBS) 10 of 1 is rewritten, the area in the shared state is updated to the exclusive area, and the next exclusive read is performed by the CS instruction. The means by which data transfer occurs is the means necessary for practicing the present invention. The same reference numerals denote the same objects throughout the drawings.

【0025】以下、図3, 図4を参照しながら、図1,
図2の流れ図によって、本発明のバッファメモリ制御方
式を説明する。前述の図3は情報処理装置の概念図を示
しており、図4はLBSの概念図を示している。上記図
3で示した情報処理装置において、各プロセサ(CPU0,CP
U1, 〜) 1 が、以下の命令列を実行している場合を例に
する。
Hereinafter, referring to FIG. 3 and FIG.
The buffer memory control method of the present invention will be described with reference to the flowchart of FIG. FIG. 3 described above shows a conceptual diagram of the information processing apparatus, and FIG. 4 shows a conceptual diagram of the LBS. In the information processing device shown in FIG. 3, each processor (CPU0, CP
For example, U1, ~) 1 executes the following instruction sequence.

【0026】 XR R0,R0 : ロックワ
ードがアンロック状態の時の値 LA R1,X'FFFFFFFF' : ロックワードをロック
状態にするための値 LOOP:CS R0,R1,LOCK : ロック獲得処理 BNZ LOOP : ロックが獲得できなか
った場合の再処理 L R2,LOCK+4 : ロックを獲得して行う
処理 A R2,LOCK+4 : ロックを獲得して行う
処理 ST R0,LOCK : ロック解放処理 B *** : ここで、プロセサ(CPU1) 1a がロックを獲得して処理を
行い、プロセサ(CPU2)1b がロックの待合せを行う場合
について説明する。但し、各命令は基本的には1サイク
ルで処理が終了し、MSUのアクセスタイムは、例え
ば、20サイクル,他CPUのLBSのアクセスタイム
は、例えば、10サイクル,他CPUのLBSの無効化
あるいは状態変更は、例えば、5サイクルかかるとす
る。
XR R0, R0: Value when the lock word is unlocked LA R1, X'FFFFFFFF ': Value for putting the lock word in the lock state LOOP: CS R0, R1, LOCK: Lock acquisition processing BNZ LOOP : Re-processing when lock cannot be acquired L R2, LOCK + 4: Processing performed by acquiring lock A R2, LOCK + 4: Processing performed by acquiring lock ST R0, LOCK: Lock release processing B ** *: Here, the case where the processor (CPU1) 1a acquires the lock to perform processing and the processor (CPU2) 1b waits for the lock will be described. However, each instruction is basically processed in one cycle, the access time of the MSU is, for example, 20 cycles, the access time of the LBS of the other CPU is, for example, 10 cycles, and the LBS of the other CPU is invalidated or It is assumed that the state change takes, for example, 5 cycles.

【0027】プロセサ(CPU1) 1a が先行してロックを獲
得(上記命令, , の実行) していて、プロセサ(CP
U2) 1b も続いてロックを獲得しようとして、上記CS
命令を実行 (上記命令, , の実行) して排他読出
しを行うが、既に、プロセサ(CPU1) 1a のLBS 10 に
排他状態(E=1) で存在するので、本発明の場合には、プ
ロセサ(CPU1) 1a のLBS 10 の該ブロックを共有状態
(E=0) として、該プロセサ(CPU1) 1a の該ブロックのデ
ータをプロセサ(CPU2) 1b のLBS 10 に転送して共有
状態(E=0) で登録する。{図1の処理ステップ 100,10
1,104,106参照}ロックはすでにプロセサ(CPU1) 1a に
取られており、CS命令はコンディションコード (CC
=1: ロック獲得失敗) となり、上記の命令列で、ラベ
ル「LOOP」に戻り再度CS命令の実行にかかる。
The processor (CPU1) 1a acquires the lock in advance (executes the above instruction ,,,) and the processor (CP
U2) 1b also tries to acquire the lock, and the above CS
An exclusive read is performed by executing an instruction (execution of the above instructions ,,), but since it already exists in the LBS 10 of the processor (CPU1) 1a in the exclusive state (E = 1), in the case of the present invention, the processor is used. (CPU1) Sharing the block of LBS 10 of 1a
As (E = 0), the data of the block of the processor (CPU1) 1a is transferred to the LBS 10 of the processor (CPU2) 1b and registered in the shared state (E = 0). {Processing steps 100, 10 in FIG. 1
See 1,104,106} The lock has already been taken by the processor (CPU1) 1a, and the CS instruction uses the condition code (CC
= 1: Lock acquisition failure), the label “LOOP” is returned to the above instruction sequence, and the CS instruction is executed again.

【0028】プロセサ(CPU1) 1a は、後続命令で自L
BS 10 を読出した後、命令で書替えようとするが、
該ブロックが共有状態(E=0) {即ち、書き込み付加}で
あるため、プロセサ(CPU2) 1b のLBS 10 の該ブロッ
クを無効化し、自LBS 10の該書き込みブロックを排
他状態にしてから書込みを行う。{図1の処理ステップ
110,111,112,113参照}プロセサ(CPU2)1b は、2回め
のCS命令実行時には、自LBS 10 の該ブロックが無
効化されているので、プロセサ(CPU1) 1a のLBS 10
から前述と同様に読出す。即ち、該プロセサ(CPU1) 1a
のLBS 10 からムーブアウトによりデータ転送が行わ
れる。
The processor (CPU1) 1a uses its own L as a subsequent instruction.
After reading BS 10, I try to rewrite it with an instruction,
Since the block is in the shared state (E = 0) {that is, write added}, the block of the LBS 10 of the processor (CPU2) 1b is invalidated, and the write block of its own LBS 10 is set to the exclusive state before writing. To do. {Processing steps in FIG. 1
110,111,112,113} The processor (CPU2) 1b has the LBS 10 block of the processor (CPU1) 1a because the block of its own LBS 10 is invalidated when the second CS instruction is executed.
From the same as above. That is, the processor (CPU1) 1a
Data transfer is performed by moving out from LBS 10 of.

【0029】然し、ロックは解放されていないので、再
度CS命令は、上記コンディションコード (CC=
1: ロック獲得失敗) で終了する。最後に、プロセサ(C
PU1) 1a はロック解放のために、ロックワードを書替え
ようとするが、又、該ブロックが共有状態であるので、
プロセサ(CPU2) 1b の該ブロックを無効化し、自LBS
の該ブロックを排他状態にしてロック解放のための書込
みを行う。
However, since the lock has not been released, the CS command is executed again by the condition code (CC =
(1: Lock acquisition failure) ends. Finally, the processor (C
PU1) 1a tries to rewrite the lock word to release the lock, but since the block is in the shared state,
Disable the block of processor (CPU2) 1b, and set its own LBS
The block is put in the exclusive state and writing for releasing the lock is performed.

【0030】プロセサ(CPU2) 1b は再再度CS命令に
よってロックワードを読出す(この結果、データ転送が
生じる)と、今度はロックが獲得できて、CS命令がコ
ンディションコード正常 (CC=0: ロック獲得) で終
了する。
When the processor (CPU2) 1b again reads the lock word by the CS instruction (resulting in data transfer), the lock can be acquired this time, and the CS instruction receives the normal condition code (CC = 0: lock). Acquire) ends.

【0031】このように、本発明によればロックを獲得
したプロセサ(CPU1) 1a がロックを解除する迄の間、プ
ロセサ(CPU2) 1b からのロック獲得の為のCS命令の実
行に際して、プロセサ(CPU2) 1a のLBS 10 からプロ
セサ(CPU1) 1b のLBS10にデータ転送が生じることが
無くなり、ロックを獲得しているプロセサ(CPU1) 1a の
実行時間が短縮させることができる。
As described above, according to the present invention, the processor (CPU1) 1a, which has acquired the lock, releases the lock until the processor (CPU2) 1b executes the CS instruction for acquiring the lock. Data transfer does not occur from the LBS 10 of the CPU2) 1a to the LBS 10 of the processor (CPU1) 1b, and the execution time of the processor (CPU1) 1a that has acquired the lock can be shortened.

【0032】このプロセサ(CPU1) 1a の実行時間の短縮
効果は、ロックを待合せているCPUの台数が増加する
と、この差は指数関数的に増加する。このように、本発
明によるバッファメモリ制御方式は、複数個のプロセサ
(CPU) 1 に、スワップ方式で制御されるバッファメモリ
(LBS) 10を備えている情報処理装置において、 CS 命令
でロックワードを含む排他領域の排他読み出しを行うと
き、該当のブロックが自己のバッファメモリ(LBS) 10に
存在しないとき、該排他ブロックの存在する他のプロセ
サ(CPU) 1 のバッファメモリ(LBS) 10の保持状態を排他
状態(E=1) から共有状態(E=0) に変更して、自己のバッ
ファメモリ(LBS) 10に共有状態で登録し、該他のプロセ
サ(CPU) 10のバッファメモリ(LBS) 10に存在する上記ロ
ックワードを含む領域が書き替えられたとき、該領域を
排他領域に更新して、該 CS 命令による次の排他読み出
しのときにデータ転送を生じさせるようにした所に特徴
がある。
The effect of shortening the execution time of the processor (CPU1) 1a is that the difference increases exponentially as the number of CPUs waiting for the lock increases. As described above, the buffer memory control method according to the present invention is provided with a plurality of processors.
(CPU) 1, buffer memory controlled by swap method
In an information processing device equipped with (LBS) 10, when performing exclusive read of an exclusive area including a lock word with a CS instruction, if the corresponding block does not exist in its own buffer memory (LBS) 10, Change the holding state of the buffer memory (LBS) 10 of another existing processor (CPU) 1 from the exclusive state (E = 1) to the shared state (E = 0) and share it with its own buffer memory (LBS) 10. When the area containing the lock word existing in the buffer memory (LBS) 10 of the other processor (CPU) 10 is rewritten, the area is updated to the exclusive area and the CS instruction is issued. The feature is that data transfer is caused at the next exclusive read.

【0033】[0033]

【発明の効果】以上、詳細に説明したように、本発明の
バッファメモリ制御方式は、複数個のプロセサ(CPU)
に、スワップ方式で制御されるバッファメモリ(LBS) を
備えている情報処理装置において、 CS 命令でロックワ
ードを含む排他領域の排他読み出しを行うとき、該当の
ブロックが自己のバッファメモリ(LBS) に存在しないと
き、他のプロセサ(CPU) の保持状態を排他状態(E=1) か
ら共有状態(E=0) に変更して、自己のバッファメモリ(L
BS) に共有状態で登録し、該他のプロセサ(CPU) のバッ
ファメモリ(LBS) に存在する上記ロックワードを含む領
域が書き替えられたとき、該共有状態の領域を排他状態
に更新して、該 CS 命令による次の排他読み出しのとき
にデータ転送を生じさせるようにしたものであるので、
ロックワードの解放を待合せているCPUが存在する場
合に、ロックワードを獲得しているCPUの実行時間を
削減することができ、複数プロセサの処理性能を向上さ
せることができる効果がある。
As described above in detail, the buffer memory control system of the present invention is provided with a plurality of processors (CPUs).
In addition, in an information processing device that has a buffer memory (LBS) that is controlled by the swap method, when performing an exclusive read of the exclusive area including the lock word with the CS instruction, the corresponding block becomes its own buffer memory (LBS). When it does not exist, the holding state of other processors (CPU) is changed from the exclusive state (E = 1) to the shared state (E = 0), and its own buffer memory (L
BS) in a shared state, and when the area containing the lock word existing in the buffer memory (LBS) of the other processor (CPU) is rewritten, the area in the shared state is updated to the exclusive state. , The data transfer is caused at the next exclusive read by the CS instruction.
When there is a CPU waiting for the release of the lock word, the execution time of the CPU acquiring the lock word can be reduced, and the processing performance of the multiple processors can be improved.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例を流れ図で示した図(その
1)
FIG. 1 is a diagram (1) showing a flow chart of an embodiment of the present invention.

【図2】本発明の一実施例を流れ図で示した図(その
2)
FIG. 2 is a flowchart showing an embodiment of the present invention (part 2).

【図3】従来のバッファメモリ制御方式を説明する図
(その1)
FIG. 3 is a diagram explaining a conventional buffer memory control method (No. 1).

【図4】従来のバッファメモリ制御方式を説明する図
(その2)
FIG. 4 is a diagram for explaining a conventional buffer memory control system (part 2).

【図5】従来のバッファメモリ制御方式を説明する図
(その3)
FIG. 5 is a diagram explaining a conventional buffer memory control method (No. 3).

【図6】従来のバッファメモリ制御方式を説明する図
(その4)
FIG. 6 is a diagram for explaining a conventional buffer memory control system (part 4).

【符号の説明】[Explanation of symbols]

1 中央処理装置(CPU0,CPU1, 〜CPUn) 1a 中央処理装置(CPU0), 1b 中央処理
装置(CPU1) 10 バッファメモリ(LBS) 11 タグメモ
リ(TAG) 2 主記憶制御装置(MCU) 3 主記憶装
置(MSU) 100 〜108,110 〜113 処理ステップ V 有効ビット E フラグ
(共有/排他)
1 Central processing unit (CPU0, CPU1, to CPUn) 1a Central processing unit (CPU0), 1b Central processing unit (CPU1) 10 Buffer memory (LBS) 11 Tag memory (TAG) 2 Main memory control unit (MCU) 3 Main memory Unit (MSU) 100 to 108,110 to 113 Processing step V Effective bit E flag
(Shared / exclusive)

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】複数個のプロセサ(CPU)(1a,1b,〜) に、ス
ワップ方式で制御されるバッファメモリ(LBS)(10) を備
えている情報処理装置において,バッファメモリ(LBS)
(10) 内のブロックを書替えられたブロックであること,
或いは、書替えを行う為に読出したブロックであること
を示す“排他”(E=1) 状態と,読出しのみを行う為に読
み出したブロックであることを示す“共有”(E=0) 状態
との2状態を基本として制御するバッファメモリ装置で
あって、 あるプロセサ(CPU)(1a) のバッファメモリ(LBS)(10)内
のあるブロックが該プロセサ(CPU)(1a) により書き替え
られている場合に、該プロセサ(CPU)(1a) 以外のプロセ
サ(CPU)(1b) が該ブロックの内容がある値 (全"0")であ
る場合にのみ書き替える為に、該ブロックの読出しを行
った時、 該プロセサ(CPU)(1a) のバッファメモリ(LBS)(10) の該
ブロックが排他状態であった場合には、該ブロックを排
他状態(E=1) から共有状態(E=0) に変更するとともに、
該排他的読出しを要求したプロセサ(CPU)(1b) に対して
は排他処理が失敗したことを示す信号を読出しデータと
ともに伝達して、該要求プロセサ(CPU)(1b) 内のバッフ
ァメモリ(LBS)(10) にも共有状態で登録し、該要求プロ
セサ(CPU)(1b) 内のバッファメモリ(LBS)(10) に共有状
態で保持されていた場合には、そのまま読出して、該プ
ロセサ(CPU)(1a) のバッファメモリ(LBS)(10) の該ブロ
ックに書込みが生じた場合にのみ、該プロセサ(CPU)(1
a)の該ブロックを排他状態(E=1) にすることを特徴とす
るバッファメモリの制御方式。
1. A buffer memory (LBS) in an information processing device comprising a plurality of processors (CPU) (1a, 1b, ...) and a buffer memory (LBS) (10) controlled by a swap method.
The block in (10) is a rewritten block,
Alternatively, there is a “exclusive” (E = 1) state that indicates that the block has been read for rewriting and a “shared” (E = 0) state that indicates that the block has been read for only reading. It is a buffer memory device which controls on the basis of the two states, and a block in the buffer memory (LBS) (10) of a processor (CPU) (1a) is rewritten by the processor (CPU) (1a). If a processor (CPU) (1a) other than the processor (CPU) (1a) has a certain value (all "0") in the block, the block is read. If the block of the buffer memory (LBS) (10) of the processor (CPU) (1a) is in the exclusive state when it is executed, the block is changed from the exclusive state (E = 1) to the shared state (E = (0) and
A signal indicating that the exclusion process has failed is transmitted to the processor (CPU) (1b) requesting the exclusive read together with the read data, and the buffer memory (LBS) in the request processor (CPU) (1b) is transmitted. ) (10) is also registered in the shared state, and if it is held in the shared state in the buffer memory (LBS) (10) in the request processor (CPU) (1b), it is read as it is and the processor ( CPU (1a) buffer memory (LBS) (10) only when the write occurs in the block, the processor (CPU) (1
A buffer memory control method in which the block of a) is placed in an exclusive state (E = 1).
JP3196257A 1991-08-06 1991-08-06 Buffer memory control system Withdrawn JPH0540689A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3196257A JPH0540689A (en) 1991-08-06 1991-08-06 Buffer memory control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3196257A JPH0540689A (en) 1991-08-06 1991-08-06 Buffer memory control system

Publications (1)

Publication Number Publication Date
JPH0540689A true JPH0540689A (en) 1993-02-19

Family

ID=16354806

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3196257A Withdrawn JPH0540689A (en) 1991-08-06 1991-08-06 Buffer memory control system

Country Status (1)

Country Link
JP (1) JPH0540689A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010517144A (en) * 2007-01-23 2010-05-20 インターナショナル・ビジネス・マシーンズ・コーポレーション Method and system for achieving both locking fairness and locking performance with spin lock

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010517144A (en) * 2007-01-23 2010-05-20 インターナショナル・ビジネス・マシーンズ・コーポレーション Method and system for achieving both locking fairness and locking performance with spin lock

Similar Documents

Publication Publication Date Title
JP3705836B2 (en) Memory sharing method for computer system
US5333297A (en) Multiprocessor system having multiple classes of instructions for purposes of mutual interruptibility
US5598550A (en) Cache controller for processing simultaneous cache accesses
US4831581A (en) Central processor unit for digital data processing system including cache management mechanism
US5119484A (en) Selections between alternate control word and current instruction generated control word for alu in respond to alu output and current instruction
JPH02288927A (en) Shared memory management system
US5339397A (en) Hardware primary directory lock
JPH0532775B2 (en)
JP2829115B2 (en) File sharing method
JP3814521B2 (en) Data processing method and apparatus
JP2776759B2 (en) Lock request control device
JPS6319058A (en) Memory device
JPH0540689A (en) Buffer memory control system
US5276892A (en) Destination control logic for arithmetic and logic unit for digital data processor
GB2107091A (en) Device for data processing
JPS6152505B2 (en)
JP2642851B2 (en) Cache memory control method
JPH03271859A (en) Information processor
JP2703255B2 (en) Cache memory writing device
JP2982197B2 (en) Bus monitor circuit for cache
JPH01300365A (en) Exclusive control system for multi-processor system
JPH03225452A (en) Processing for inserting/extracting tag bit for bit encode data processing system and data word
JPS6135583B2 (en)
KR100201671B1 (en) Computing system with a cache memory and an additional look-aside cache memory
Preiss et al. A cache-based message passing scheme for a shared-bus multiprocessor

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19981112