JPS63231650A - Cache memory control system - Google Patents

Cache memory control system

Info

Publication number
JPS63231650A
JPS63231650A JP62066061A JP6606187A JPS63231650A JP S63231650 A JPS63231650 A JP S63231650A JP 62066061 A JP62066061 A JP 62066061A JP 6606187 A JP6606187 A JP 6606187A JP S63231650 A JPS63231650 A JP S63231650A
Authority
JP
Japan
Prior art keywords
instruction
shared data
cache memory
cpus
lock
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.)
Pending
Application number
JP62066061A
Other languages
Japanese (ja)
Inventor
Hideho Masuzawa
増沢 秀穂
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 JP62066061A priority Critical patent/JPS63231650A/en
Publication of JPS63231650A publication Critical patent/JPS63231650A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To improve the performance by providing with the function which retries a lock instruction to a CPU. CONSTITUTION:Plural CPUs 11-13 retry shared data access instruction on demand at the time of accessing shared data to attain the same effect as lock of shared data on cache memories 21-23, thereby to execute the instruction effectively. Cache memories 21-23 are controlled in accordance with the write back system. CPUs 11-13 have the function to retry instructions requiring lock such as an update reference instruction (TEST & SET, COMPARE & SWAP or the like) on demand.

Description

【発明の詳細な説明】 [概 要] 共通バスに主記憶装置と、複数のプロセッサが接続され
ていて、それぞれのプロセッサがキャッシュメモリを保
有しており、キャッシュメモリの内容の更新に際しては
、まず、キャッシュメモリについてのみ変更を行ない、
その後、当該ブロックが主記憶装置に返却されるとき主
記憶装置の内容を更新するごとく制御されるライトバッ
ク方式のマルチプロセッサにおいては、キャッシュメモ
リに存在する各プロセッサの共有データの変更(書き込
み)を行なおうとするときにはその同一性を保つため、
他のプロセッサに対して該当するデータの無効化を周知
する必要がある。このような無効化はロック命令等によ
って行なわれるが、この種の命令は、共通データをフェ
ッチ(FETCH)したのち、テストを行ない、その結
果によってストアを行なうという処理から成っている。
[Detailed Description of the Invention] [Summary] A main storage device and a plurality of processors are connected to a common bus, each processor has a cache memory, and when updating the contents of the cache memory, first , change only the cache memory,
After that, in a write-back multiprocessor that is controlled so that the contents of the main memory are updated when the block is returned to the main memory, changes (writes) to the shared data of each processor in the cache memory are performed. In order to maintain its identity when trying to
It is necessary to notify other processors of the invalidation of the corresponding data. Such invalidation is performed by a lock instruction or the like, and this type of instruction consists of processing of fetching common data (FETCH), then performing a test, and performing a store based on the result.

従って、前記テストの結果、ストアを行なわないことと
なった場合には前記無効化の処理は全く無駄なものとな
り、そのためプロセッサの処理効率が低下するなどの問
題点があった。
Therefore, if the result of the test is that no storage is to be performed, the invalidation process is completely wasteful, resulting in problems such as a decrease in the processing efficiency of the processor.

本発明はこのような従来の問題点を解決するため、ロッ
ク命令の実行に際して、他のプロセッサからの共有デー
タのアクセスに係る制限の少ない制御方式を開示してい
る。
In order to solve these conventional problems, the present invention discloses a control method that has fewer restrictions on access to shared data from other processors when executing a lock instruction.

[産業上の利用分野コ 本発明はマルチプロセッサシステムにおける、メモリア
クセスの制御に間するものであって、特にライトバック
方式の系におけるキャッシュメモリの共有データの内容
更新に際する制御に係る。
[Industrial Field of Application] The present invention relates to control of memory access in a multiprocessor system, and particularly relates to control of updating the content of shared data in a cache memory in a write-back system.

[従来の技術] 複数のCPUをコモンバスで接続した形態のマルチプロ
セッサにおいて、複数のCPUがそれぞれのキャッシュ
メモリに存在する共有データ領域に書き込み(STOR
E)を行なおうとした場合、他のCPUに対してその共
有データの無効化を行なう必要がある。このような共有
データをアクセスする場合、従来からのアーキテクチャ
を踏襲したCPUでは、TEST&SET、COMPA
RE&5WAP等の命令を使用して、共有データに対す
るロックを行なっている(以後、このような命令をロッ
ク命令ということにする。)このような命令は、共有デ
ータのFETCHとそのデータのテストの結果に従った
5TORE等から成る。この場合、システムでは、ある
CPUがそのような命令を実行していたときには、その
FETCHと5TOREとの間には、他のCPUがらの
その共有データへの同様の命令によるアクセスは禁止し
ている。
[Prior Art] In a multiprocessor in which multiple CPUs are connected via a common bus, the multiple CPUs write to a shared data area in their respective cache memories (STOR).
If E) is attempted, it is necessary to invalidate the shared data for other CPUs. When accessing such shared data, CPUs that follow the conventional architecture use TEST & SET, COMPA, etc.
Instructions such as RE&5WAP are used to lock shared data. It consists of 5TORE etc. according to the following. In this case, when a certain CPU is executing such an instruction, the system prohibits other CPUs from accessing the shared data between that FETCH and 5TORE using a similar instruction. .

[発明が解決しようとする問題点] 上述したような従来のロック命令に係る制御方式におい
ては、以下に述べるような性能に影響する問題点があっ
た。
[Problems to be Solved by the Invention] The conventional control system related to the lock command as described above has the following problems that affect performance.

すなわち、ロック命令を実行する場合、その命令を行う
前に、他のCPUに対して、その共有データを含むブロ
ックの無効化を指示するやこの場合、データのFETC
Hを行ない、そのデータのテストの結果、5TOREを
行なわない状況であった場合には、他のCPUでの無効
化は無駄になってしまう、更にそのブロックを無効化さ
れたCPUが、そのブロックにアクセスしたい場合には
そのブロックを再度FETCHしてくる必要があった。
That is, when executing a lock instruction, before executing that instruction, instruct other CPUs to invalidate the block containing the shared data.
If the result of testing the data is that 5TORE is not performed, invalidation by other CPUs will be in vain, and furthermore, the CPU whose block was invalidated will If you wanted to access a block, you had to FETCH that block again.

また、データのFETCHの後、そのデータのテストの
結果、共有データ領域に5TOREする場合に、他CP
Uに対して、その共有データを含むブロックの無効化を
指示するが、その場合には、その共有データに対してロ
ックを行なう必要性から、データのFETCHの前にL
OCKを取ることを他のCPUに周知する必要があった
Also, after data FETCH, as a result of the data test, when performing 5TORE to the shared data area, other CP
Instructs U to invalidate the block containing the shared data, but in that case, it is necessary to lock the shared data, so L is sent before FETCHing the data.
It was necessary to notify other CPUs that OCK was to be taken.

本発明はこのような従来の問題点に鑑み、従来システム
のアーキテクチャの制限、具体的には「あるCPUが上
記のLOCK命令を実行しているとき、その命令のFE
TCHと5TOREとの間においては、他のCPUから
その共有データへの同様の命令によるアクセスを禁止す
る」を変えて、ロック命令のFETCHと5TOREと
の間において、他のCPUからの共有データへのアクセ
スを許し、しかもデータのフェッチ後のテストの結果の
タイミングで他CPUに対して無効化を行ない、更にデ
ータのFETCHの前にLOCKを取ることを他のCP
Uに周知する必要がない方式を提供することを目的とし
ている。
In view of these conventional problems, the present invention addresses the limitations of the architecture of conventional systems, specifically, ``When a certain CPU is executing the above LOCK instruction,
Between TCH and 5TORE, access to the shared data from other CPUs by similar instructions is prohibited.'' By changing the lock command FETCH and 5TORE, access to the shared data from other CPUs is prohibited. In addition, it disables other CPUs at the timing of the test result after fetching data, and it also allows other CPUs to access LOCK before data FETCH.
The purpose is to provide a method that does not require notification to the U.

[問題点を解決するための手段] 本発明によれば上述の目的は前記特許請求の範囲に記載
した手段により達成される。
[Means for Solving the Problems] According to the present invention, the above objects are achieved by the means described in the claims.

すなわち、本発明は、複数のCPU(各CPUはキャッ
シュメモリを有する)をコモンバスで接続した形態のマ
ルチプロセッサ構成において、複数CPUが共有データ
をアクセスをする場合に共有データにアクセスする命令
を、必要に応じて再試行することにより、キャッシュメ
モリ上の共有データに対するロックと同様の効果を得て
、効率よく命令の実行を行なうことを目的とするもので
あって、キャッシュメモリの制御はライトバック方式に
従うものであり、またCPUは、更新参照命令(例えば
、TEST&SET、COMPARE&5WAP等)の
ようにロックを必要とする命令を必要により再試行する
機能を有するものである。
That is, in a multiprocessor configuration in which a plurality of CPUs (each CPU has a cache memory) are connected via a common bus, the present invention provides instructions for accessing shared data when the plurality of CPUs access the shared data. The purpose of this method is to achieve the same effect as locking shared data on the cache memory and execute instructions efficiently by retrying according to the cache memory.The cache memory is controlled using the write-back method. In addition, the CPU has a function to retry instructions that require locking, such as update reference instructions (for example, TEST & SET, COMPARE & 5WAP, etc.), as necessary.

[実施例] 以下、本発明の構成と作用等に関し、実施例に基づいて
詳細に説明する。
[Examples] Hereinafter, the structure, operation, etc. of the present invention will be described in detail based on Examples.

第1図は本発明を適用するマルチプロセッサシステムの
構成の例を示す図である。
FIG. 1 is a diagram showing an example of the configuration of a multiprocessor system to which the present invention is applied.

第1図において、1.〜1.はそれぞれCPU0〜CP
U2.21〜2.はキャッシュメモリ、3はコモンバス
、4はメモリ制御ユニット、5はメモリストレージユニ
ットを表している。
In FIG. 1, 1. ~1. are CPU0 to CP, respectively.
U2.21-2. 3 represents a cache memory, 3 represents a common bus, 4 represents a memory control unit, and 5 represents a memory storage unit.

第1図において、各CPUはそれぞれのキャッシュメモ
リを持っており、複数CPUにおけるそれらは、ライト
ツク方式により、$1gJされている。
In FIG. 1, each CPU has its own cache memory, and each of the cache memories in multiple CPUs is saved at $1gJ using the write-to-task method.

第1図におけるCPU0〜CPU2の内の一つについて
、その構成を更に詳細に示すと第2図のようになる。
FIG. 2 shows the configuration of one of CPU0 to CPU2 in FIG. 1 in more detail.

すなわち、第2図は本発明の1実施例のCPUの構成を
示すブロック図であって、6は命令ユニット、7はスト
レージ@御ユニット、8はロック命令i!IN御部、9
はコモンバス・コマンド制御部、10はキャッシュメモ
リ制御部、11はキャッシュメモリを表している。
That is, FIG. 2 is a block diagram showing the configuration of a CPU according to an embodiment of the present invention, in which 6 is an instruction unit, 7 is a storage@control unit, and 8 is a lock instruction i! IN Gobe, 9
10 represents a common bus command control unit, 10 represents a cache memory control unit, and 11 represents a cache memory.

第2図において、命令ユニット6はキャッシュメモリ1
1、あるいはメモリストレージユニット5から命令を取
り出して、実行するユニットであって、メモリ・アクセ
スが起こると、その旨をストレージ制御ユニット7に知
らせる。
In FIG. 2, the instruction unit 6 is the cache memory 1.
1 or the memory storage unit 5 and executes the instruction, and when a memory access occurs, it notifies the storage control unit 7 to that effect.

ここで、ロック命令は分解(FETCHと5TORE)
Lないで、そのまま送る。
Here, the lock instructions are decomposed (FETCH and 5TORE)
Don't use L, send it as is.

ストレージ制御ユニット7はキャッシュメモリの制御2
0ツク命令の制御、コモンバス・コマンドに対する制御
等を行なう。
Storage control unit 7 controls cache memory 2
Controls 0-tsk commands, common bus commands, etc.

ロック命令制御部8は命令ユニット6から来るアクセス
を保持し、それがロック命令のアクセスの場合状のよう
に動作する。
The lock instruction controller 8 holds the access coming from the instruction unit 6 and operates as if it were a lock instruction access.

・F E T CHした共有データのテストの結果、5
TOREをする必要がない場合にはその結果を命令ユニ
ット6に知らせる。
・As a result of the test of shared data that was FETCH, 5
If there is no need to perform TORE, the instruction unit 6 is informed of the result.

・FETCHした共有のデータのテストの結果、5TO
REをする必要が生じ、しかも他のCPUへの無効化コ
マンドがコモンバスで受は付けられた場合にはデータを
5TOREL、その旨を命令ユニットに知らせる。
・As a result of testing the shared data that was FETCHed, 5TO
When it becomes necessary to perform RE, and an invalidation command to another CPU is accepted on the common bus, the data is sent to 5TOREL, and the instruction unit is notified of this fact.

・FETCHした共有データのテストの結果、5TOR
Eをする必要が生じたが、しかし他のCPUへの無効化
コマンドがコモンバスで受は付けられなかった場合(他
のCPUが発した無効化コマンドがコモンバスで受は付
けられたため)には、そのままの状態で待っている。他
のCPUからのそのブロックへの無効化コマンドがきた
ら、その5TOREを取り消して、ブロックを無効化す
る。そして、再度そのロック命令アクセスをやり直す。
・As a result of the FETCH shared data test, 5TOR
If it becomes necessary to do E, but the invalidation command to other CPUs is not accepted on the common bus (because the invalidation commands issued by other CPUs are accepted on the common bus), Waiting as is. When an invalidation command for that block comes from another CPU, the 5TORE is canceled and the block is invalidated. Then, the lock instruction access is performed again.

コモンバス・コマンド制御部9はストレージ制御ユニッ
ト7で発生するコモンバスに対するコマンドの制御を行
なう、またキッシュブロックに対する無効化の制御も行
なう。
The common bus command control section 9 controls commands to the common bus generated by the storage control unit 7, and also controls invalidation of the quiche block.

いま、CPU0と1がそれらのキャッシュメモリに存在
する共有データに対してロック命令を行なった例を考え
る。
Now, consider an example in which CPUs 0 and 1 issue a lock instruction to shared data existing in their cache memories.

(1)CP U Ollが共にFETCHに対するテス
トの結果、共に5TOREする必要が無い場合: この場合には、なにもしない。
(1) When both CPUs do not need to perform 5TORE as a result of the FETCH test: In this case, nothing is done.

(2)何方か一方(例えば、CPU0)がFETCHに
対するテストの結果、5TORHする必要が生じ、もう
一方(例えば、CPUI)はSTORHする必要がない
場合には、 第3図に示すようにCPU0はそのブロックに5TOR
Hする前に、他のCPUに対するそのブロックの無効化
のコマンドを出す。
(2) If one side (for example, CPU0) needs to perform 5TORH as a result of the test for FETCH, and the other side (for example, CPUI) does not need to perform STORH, as shown in Figure 3, CPU0 5TOR to that block
Before doing H, issue a command to other CPUs to invalidate that block.

ここで、“5TOREする前”というのは、他のCPU
でもその共有データに対するロック命令を行ない、その
結果5TORELようとするCPUがあるかも知れない
為である。無効化コマンドがコモンバスで受は付けられ
てから、cpuoは共有データを5TOREする。CP
UIは無効化のコマンドを受は取り、共有データのキャ
ッシュブロックを無効化する。
Here, "before 5TORE" means that other CPUs
However, this is because there may be a CPU that performs a lock instruction on the shared data and attempts to perform 5TOREL as a result. After the invalidation command is accepted on the common bus, the CPUO performs 5TOREs on the shared data. C.P.
The UI receives the invalidation command and invalidates the shared data cache block.

(3)CP U O21が共にFETCHに対するテス
トの結果、5TORHする必要が生じた場合には、第4
図に示すように、CPU0及び1はそのブロックに5T
OREする前に、他のCPUに対するそのブロックの無
効化のコマンドを出す、いま、CPU0のコマンドがコ
モンバスで受は付けられたときには、CPU0は、共有
データを5TOREする。
(3) If it is necessary to perform 5TORH as a result of the test for both CPU O21 and FETCH, the fourth
As shown in the figure, CPUs 0 and 1 have 5T in their blocks.
Before performing the ORE, issue a command to other CPUs to invalidate the block.Currently, when the command from CPU0 is accepted on the common bus, CPU0 performs 5 TOREs on the shared data.

一方、CPUIは、無効化のコマンドを受は取り、共有
データのキャッシュブロックを無効化する。そして、再
度そのブロック命令を始めから行なう。
On the other hand, the CPUI receives the invalidation command and invalidates the shared data cache block. Then, the block command is executed again from the beginning.

[発明の効果] 以上説明したように本発明の方式によればCPUにロッ
ク命令を再度やりなおす機能を付加しているのでブロッ
クの無効化コマンドを利用して、共有データにロックを
掛けたと同様の効果をもたらすことができる。これによ
り、従来よりも、有効に命令を処理し、またロックの為
にCPU間のコマンドを設けることも無くなるので、性
能の向上を図ることが可能となる。
[Effects of the Invention] As explained above, according to the method of the present invention, the CPU is provided with a function to retry the locking command, so it is similar to locking shared data by using the block invalidation command. can bring about effects. As a result, instructions can be processed more effectively than in the past, and since there is no need to provide commands between CPUs for locking, performance can be improved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明を適用するマルチプロセッサシステムの
構成の例を示す図、第2図は本発明の1実施例のCPU
の構成を示すブロック図、第3図および第4図は無効化
の制御について説明する図である。 】、〜13・・・・・・cpuo〜CPU2.21〜2
゜・・・・・・キャッシュメモリ、3・・・・・・コモ
ンバス、4・・・・・・メモリ制御ユニット、5・・−
・・・メモリストレージユニット、6・・・・・・命令
ユニット、7・・・・・・ストレージ制御ユニット、8
・・・・・・ロック命令制御部、9・・・・・・コモン
バス・コマンド制御部、10・・・・・・キャッシュメ
モリ制御部、11・・・・・・キヤ・ンシュメモリ 代理人 弁理士 井 桁 貞′某 、4”i−:、−/ 一−1/ 本発用乞逢用するマルチプロセッサシステムの構成の第
 f 図    側を示−を閂 水死列の一炙施例めCPUの構)#、芝示すブロック図
率 2 図
FIG. 1 is a diagram showing an example of the configuration of a multiprocessor system to which the present invention is applied, and FIG. 2 is a diagram showing a CPU according to an embodiment of the present invention.
3 and 4 are diagrams illustrating invalidation control. ], ~13...cpuo~CPU2.21~2
゜...Cache memory, 3...Common bus, 4...Memory control unit, 5...-
...Memory storage unit, 6...Instruction unit, 7...Storage control unit, 8
...Lock instruction control unit, 9...Common bus command control unit, 10...Cache memory control unit, 11...Cache memory agent Patent attorney Mr. Sada Igeta, 4"i-:, -/ 1-1/ Figure f shows the configuration of the multiprocessor system used in this application. This is an example of a CPU that has been used as an example of a series of CPUs. structure) #, block diagram rate showing grass 2 figure

Claims (1)

【特許請求の範囲】 主記憶装置と、それぞれキャッシュメモリを保有する複
数のプロセッサとがコモンバスに接続されていて、キャ
ッシュメモリの内容の更新に際してはキャッシュメモリ
のみを変更し、その後該ブロックが主記憶に返却される
とき変更内容が主記憶に反映されるごとく制御されるラ
イトバック方式を採るマルチプロセッサの系において、 各プロセッサに、各プロセッサが更新参照命令のごとき
ロックを必要とする命令をしているとき、他のCPUか
らの無効化コマンドを受信した場合に、当該ブロックを
無効化した後、再度、前記命令を実行する手段を設けた
ことを特徴とするキャッシュメモリ制御方式。
[Claims] A main storage device and a plurality of processors each having a cache memory are connected to a common bus, and when updating the contents of the cache memory, only the cache memory is changed, and then the block is transferred to the main memory. In a multiprocessor system that employs a write-back method in which changes are controlled so that they are reflected in main memory when returned to the main memory, each processor issues an instruction that requires a lock, such as an update reference instruction, to each processor. 1. A cache memory control system comprising means for invalidating the block and then executing the instruction again when an invalidation command is received from another CPU.
JP62066061A 1987-03-20 1987-03-20 Cache memory control system Pending JPS63231650A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62066061A JPS63231650A (en) 1987-03-20 1987-03-20 Cache memory control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62066061A JPS63231650A (en) 1987-03-20 1987-03-20 Cache memory control system

Publications (1)

Publication Number Publication Date
JPS63231650A true JPS63231650A (en) 1988-09-27

Family

ID=13304969

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62066061A Pending JPS63231650A (en) 1987-03-20 1987-03-20 Cache memory control system

Country Status (1)

Country Link
JP (1) JPS63231650A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04227552A (en) * 1990-04-05 1992-08-17 Internatl Business Mach Corp <Ibm> Store-through-cache control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04227552A (en) * 1990-04-05 1992-08-17 Internatl Business Mach Corp <Ibm> Store-through-cache control system

Similar Documents

Publication Publication Date Title
JP3206914B2 (en) Multiprocessor system
JPH03219345A (en) Multiport cache memory control device
US4831581A (en) Central processor unit for digital data processing system including cache management mechanism
US7051163B2 (en) Directory structure permitting efficient write-backs in a shared memory computer system
JP2825906B2 (en) Computer system
JP3797570B2 (en) Apparatus and method using semaphore buffer for semaphore instructions
EP0480858A2 (en) Hardware primary directory lock
JPH0467242A (en) Cache memory control system
WO1997004392A1 (en) Shared cache memory device
US6477622B1 (en) Simplified writeback handling
JP2002202960A (en) Data processing method and device
JPS63253448A (en) Multi-computer device
JPS63231650A (en) Cache memory control system
JP2552704B2 (en) Data processing device
JPS63223846A (en) Cache memory
JPH0528038A (en) Cache memory control system
JPH03172943A (en) Cache memory control system
JP3378270B2 (en) Multiprocessor system
JP3088293B2 (en) Cache memory storage consistency control device and storage consistency control method
JPS62203252A (en) Cache memory control system
JPH0656611B2 (en) Vector processor
JPH02294761A (en) Sequential processing method for multiprocessor system
JPH09198310A (en) Multi-processor system
JPH01145746A (en) Cache memory
JPH0195344A (en) Cash memory