JPH08137748A - Computer having copyback cache and copyback cache control method - Google Patents
Computer having copyback cache and copyback cache control methodInfo
- Publication number
- JPH08137748A JPH08137748A JP6273530A JP27353094A JPH08137748A JP H08137748 A JPH08137748 A JP H08137748A JP 6273530 A JP6273530 A JP 6273530A JP 27353094 A JP27353094 A JP 27353094A JP H08137748 A JPH08137748 A JP H08137748A
- Authority
- JP
- Japan
- Prior art keywords
- cache
- write
- cache block
- main memory
- data
- 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
Links
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
(57)【要約】
【目的】本来不必要なキャッシュブロックのメインメモ
リへの書き戻しを抑制して性能を向上させる。
【構成】キャッシュブロック単位で管理されるコピーバ
ック方式のキャッシュメモリ20を有したコンピュータ
であって、キャッシュメモリ20を管理するステータス
として、キャッシュブロックの内容をメインメモリ12
に書き戻さずに同キャッシュブロックに書き込むことが
できる書き込み専用状態であることを示すデータを、キ
ャッシュブロック単位で設定するものであって、所定の
条件によりキャッシュブロックの内容をメインメモリ1
2に書き戻す必要が発生した場合に、該当するキャッシ
ュブロックが書き込み専用状態であることを示すデータ
が設定されていればメインメモリへの書き戻しを行なわ
ないキャッシュ制御部22を具備して構成する。
(57) [Summary] [Purpose] To improve performance by suppressing the writing back of an originally unnecessary cache block to the main memory. A computer having a copy-back type cache memory 20 managed in cache block units, wherein the contents of the cache block are used as a status for managing the cache memory 20.
The data indicating that the data is in the write-only state that can be written in the same cache block without writing back to the cache block is set in cache block units, and the contents of the cache block are stored in the main memory 1 according to a predetermined condition.
When the data needs to be written back to 2, if the data indicating that the corresponding cache block is in the write-only state is set, the cache control unit 22 that does not write back to the main memory is provided. .
Description
【0001】[0001]
【産業上の利用分野】本発明は、コピーバックキャッシ
ュを有するコンピュータ及びコピーバックキャッシュ制
御方法に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer having a copyback cache and a copyback cache control method.
【0002】[0002]
【従来の技術】一般に、コンピュータではプロセッサと
メインメモリとの間にキャッシュメモリが設けられ、プ
ロセッサにおける処理速度とメインメモリに対する読み
書きの速度との速度差が埋められるようになっている。
キャッシュには、プログラムの局所性を利用して、最近
アクセスされた命令やデータを保持して、見かけ上のメ
モリアクセス性能を向上させている。2. Description of the Related Art Generally, in a computer, a cache memory is provided between a processor and a main memory so that the speed difference between the processing speed in the processor and the read / write speed with respect to the main memory is filled.
The cache uses the locality of the program to hold recently accessed instructions and data to improve the apparent memory access performance.
【0003】キャッシュメモリは、データ本体を保持す
るデータ領域と、データのアドレスやアクセス履歴を保
持するタグ領域から成る。何れの領域も複数のブロック
(キャッシュブロック)に分割して管理されている。The cache memory is composed of a data area that holds the data body and a tag area that holds the address and access history of the data. Each area is divided into a plurality of blocks (cache blocks) and managed.
【0004】また、キャッシュメモリ内のデータは、最
終的にはメインメモリに書き戻さなくてはならないが、
その書き戻しの方式の1つにコピーバック方式がある。
コピーバック方式により書き戻しを行なうコピーバック
キャッシュは、以下のような機能を有している。The data in the cache memory must be finally written back to the main memory.
A copy-back method is one of the write-back methods.
The copyback cache that performs writeback by the copyback method has the following functions.
【0005】(1)コピーバックキャッシュ コンピュータに設けられたコピーバックキャッシュは、
各キャッシュブロック毎(タグ領域)に、キャッシュブ
ロックに記憶されたデータが書き替えられたか否かを示
すフラグ(ダーティビット)を持っている。キャッシュ
ブロックのデータにリプレースが生じたとき、キャッシ
ュから追い出されるキャッシュブロック中のデータがダ
ーティ(書き替えられている)であることが、ダーティ
ビットにより判定された場合には、このデータをメイン
メモリに書き戻す。メインメモリに書き戻す理由は、次
にこのブロックが参照された時、変更結果が消失しない
ようにするためである。(1) Copyback cache The copyback cache provided in the computer is
Each cache block (tag area) has a flag (dirty bit) indicating whether or not the data stored in the cache block has been rewritten. If the dirty bit determines that the data in the cache block that is evicted from the cache is dirty (rewritten) when the data in the cache block is replaced, this data is stored in the main memory. Write back. The reason for writing back to the main memory is to prevent the change result from being lost the next time this block is referenced.
【0006】しかしながら、多くのプログラム言語にお
けるプログラム中の変数は、最後に参照されてから、以
後、新たに値が設定されるまで参照されない期間(これ
を変数が「死んでいる」期間」という)が比較的長いと
いう性質をもっている。この変数が「死んでいる」期間
に、対応するキャッシュブロックのデータがキャッシュ
から追い出されると、本来は必要のないメインメモリへ
の書き戻しが発生してしまう。However, a variable in a program in many programming languages is not referenced until a new value is set after the variable is last referenced (this is called a "dead" period). Has the property of being relatively long. If the data in the corresponding cache block is evicted from the cache while this variable is "dead", writing back to the main memory, which is not necessary originally, will occur.
【0007】「死んでいる」期間にある変数に対して
は、キャッシュブロックを無効化することによって、書
き戻しの発生を抑制することはできるが、死んでいる変
数への書き込みが発生したときキャッシュミスとなるた
め、メインメモリからの読み込みが発生し、かえって処
理時間が増えることもあり有効ではない。For variables in the "dead" period, invalidation of the cache block can suppress the occurrence of write-back, but when a write to a dead variable occurs, the cache is cached. Since it becomes a mistake, reading from the main memory will occur and the processing time will increase, which is not effective.
【0008】(2)コピーバックキャッシュを用いたフ
ォールトトレラント コピーバックキャッシュを用いてフォールトトレラント
コンピュータを実現することができる。このフォールト
トレラントコンピュータでは、キャッシュからメインメ
モリへの書き戻しが必要となったとき、同時にプロセッ
サのコンテキスト(レジスタ等が保持する値等などのプ
ロセッサで命令を実行している状態)、及び全ての書き
替えられたキャッシュブロックのデータをメインメモリ
に書き戻す(この動作をチェックポイントと称する)。(2) Fault Tolerant Using Copy Back Cache A fault tolerant computer can be realized by using a copy back cache. In this fault-tolerant computer, when it is necessary to write back data from the cache to the main memory, at the same time, the context of the processor (state in which the processor executes instructions such as values held by registers etc.) and all the writing The changed cache block data is written back to the main memory (this operation is called a checkpoint).
【0009】チェックポイント直後では、メインメモリ
とキャッシュのそれぞれに格納されたデータの値は完全
に一致している。プロセッサに故障が発生した場合に
は、別のプロセッサがチェックポイントによってメイン
メモリに書き戻されたプロセッサのコンテキストを用い
て、チェックポイント生成時点から処理を再実行させ
る。故障が発生したプロセッサのキャッシュメモリの値
は消失してしまうが、チェックポイント時点ではメイン
メモリと一致しているので、矛盾無く動作を実行するこ
とができる。Immediately after the checkpoint, the values of the data stored in the main memory and the data stored in the cache completely match. When a processor fails, another processor uses the context of the processor written back to the main memory by the checkpoint to re-execute the process from the time when the checkpoint is generated. The value of the cache memory of the processor in which the failure has occurred is lost, but since it matches the main memory at the checkpoint, the operation can be executed without contradiction.
【0010】このようなフォールトトレラントコンピュ
ータでは、チェックポイントにおける処理時間はメイン
メモリに書き戻すキャッシュブロックの数によって大き
く影響されるため、不要な書き戻しブロックを削減する
ことが、性能上、非常に重要となっている。しかしなが
ら、実際には、本来必要のないキャッシュブロックの書
き戻しが存在しているために性能低下を招いている。In such a fault-tolerant computer, the processing time at the checkpoint is greatly influenced by the number of cache blocks to be written back to the main memory, so reducing unnecessary writeback blocks is very important in terms of performance. Has become. However, in reality, there is cache block write-back that is not originally necessary, which causes performance degradation.
【0011】[0011]
【発明が解決しようとする課題】このように従来のコピ
ーバックキャッシュを有するコンピュータでは、本来は
必要のないデータのメインメモリへの書き戻しが発生す
る場合があり性能の低下を招いていた。また、コピーバ
ックキャッシュを用いてフォールトトレラントコンピュ
ータにおいても、チェックポイントにおいて、本来必要
のないキャッシュブロックの書き戻しが存在しているた
めに性能低下を招いていた。As described above, in the computer having the conventional copy-back cache, there is a case where the originally unnecessary data is written back to the main memory, and the performance is deteriorated. Further, even in a fault tolerant computer using the copyback cache, there is a cache block write-back that is not originally necessary at the checkpoint, which causes performance degradation.
【0012】本発明は前記のような事情を考慮してなさ
れたもので、本来不必要なキャッシュブロックのメイン
メモリへの書き戻しを抑制して性能を向上させることが
可能なコピーバックキャッシュを有するコンピュータ及
びコピーバックキャッシュ制御方法を提供することを目
的とする。The present invention has been made in consideration of the above circumstances, and has a copyback cache capable of improving the performance by suppressing the writing back of an originally unnecessary cache block to the main memory. An object of the present invention is to provide a computer and a copyback cache control method.
【0013】[0013]
【課題を解決するための手段】本発明は、キャッシュブ
ロック単位で管理されるキャッシュメモリを有し、更新
のあったキャッシュブロックの内容を、所定の条件に応
じてメインメモリへ書き戻すコンピュータにおいて、前
記キャッシュメモリを管理するステータスとして、キャ
ッシュブロックの内容をメインメモリに書き戻さずに同
キャッシュブロックに書き込むことができる書き込み専
用状態であることを示すデータを、キャッシュブロック
単位で設定するものであって、前記所定の条件によりキ
ャッシュブロックの内容をメインメモリに書き戻す必要
が発生した場合に、該当するキャッシュブロックが書き
込み専用状態であることを示すデータが設定されていれ
ばメインメモリへの書き戻しを行なわないキャッシュ制
御手段を具備したことを特徴とする。According to the present invention, there is provided a computer which has a cache memory managed in cache block units and which writes back the contents of an updated cache block to a main memory according to a predetermined condition. As a status for managing the cache memory, data indicating a write-only state in which the contents of the cache block can be written to the main memory without being written back to the main memory is set for each cache block. , When it is necessary to write back the contents of the cache block to the main memory under the above-mentioned predetermined conditions, if the data indicating that the corresponding cache block is in the write-only state is set, the data is written back to the main memory. Equipped with cache control means not to perform And wherein the door.
【0014】また、前記キャッシュ制御手段は、前記書
き込み専用状態を、プログラムの実行によって出力され
るキャッシュ制御命令に基づいて設定するものであり、
前記キャッシュ制御命令は、コンパイラがプログラムを
コンパイルする際に、プログラムの適切な位置に埋め込
まれることを特徴とする。The cache control means sets the write-only state based on a cache control instruction output by execution of a program.
The cache control instruction is embedded in an appropriate position of the program when the compiler compiles the program.
【0015】また、前記コンピュータはチェックポイン
トによって、プロセッサのコンテキストと共に、キャッ
シュメモリ中の全ての書き替えられたキャッシュブロッ
クのデータをメインメモリに書き戻すフォールトトレラ
ントコンピュータを実現するもので、メインメモリへの
書き戻しを、前記書き込み専用状態であることを示すデ
ータに基づいて行なうことを特徴とする。Further, the computer realizes a fault-tolerant computer that writes back the data of all rewritten cache blocks in the cache memory to the main memory together with the processor context by the checkpoint. The writing back is performed based on the data indicating the write-only state.
【0016】さらに、本発明は、キャッシュブロック単
位で管理されるキャッシュメモリを有し、更新のあった
キャッシュブロックの内容を、所定の条件に応じてメイ
ンメモリへ書き戻すコンピュータにおいて、キャッシュ
ブロックの内容をメインメモリに書き戻さずに同キャッ
シュブロックに書き込むことができる書き込み専用状態
であることを示すデータを、前記キャッシュメモリを管
理するステータスとして設定し、書き込み専用状態であ
ることを示すデータが設定されたキャッシュブロックに
対する書き込み要求がキャッシュヒットした場合に、同
キャッシュブロックのデータをメインメモリに書き戻さ
ずに書き込みを実行すると共に書き込み専用状態を解除
し、書き込み専用状態であることを示すデータが設定さ
れたキャッシュブロックに対する読み出し要求がキャッ
シュヒットした場合に、予め決められた処理を実行する
ことを特徴とする。Further, according to the present invention, in a computer having a cache memory managed in cache block units and writing back the contents of the updated cache block to the main memory according to a predetermined condition, the contents of the cache block The data indicating that it is in the write-only state that can be written to the same cache block without writing it back to the main memory is set as the status for managing the cache memory, and the data indicating that it is in the write-only state is set. When a write request for a cache block causes a cache hit, the data in the cache block is written without being written back to the main memory, the write-only state is canceled, and data indicating the write-only state is set. Cashe If the read request for click results in a cache hit, and executes the predetermined processing.
【0017】[0017]
【作用】このような構成によれば、コピーバックキャッ
シュのキャッシュブロックに対応して、同キャッシュブ
ロックに格納されたデータが、最後に参照されてから、
以後、新たに値が書き込まれるまでは参照されない期間
では、「書き込み専用状態」であることを示すフラグを
タグ領域に設定することにより、メインメモリへの書き
戻しを抑制することができる。According to such a configuration, the data stored in the cache block of the copyback cache corresponding to the cache block of the copyback cache is last referenced, and
After that, during a period in which no reference is made until a new value is written, a flag indicating the “write-only state” is set in the tag area, so that writing back to the main memory can be suppressed.
【0018】また、キャッシュブロックを「書き込み専
用状態」にするためにプロセッサからキャッシュ制御命
令を出すことによって行なうが、プログラムのコンパイ
ル時にプログラム中に埋め込むことで、適切かつ有効に
キャッシュブロックが「書き込み専用状態」に設定され
る。すなわち、コンパイラでは、例えばプログラム中の
変数に関して、あるプログラムの実行時点において、変
数に格納されている値が、以後のプログラムの実行で読
み出されるか否かを的確に判別できるためである。Further, in order to put the cache block into the "write-only state", the cache control instruction is issued from the processor. By embedding the cache block in the program at the time of compiling the program, the cache block is "write-only" properly and effectively. State "is set. That is, for example, with respect to the variables in the program, the compiler can accurately determine whether the value stored in the variable is read by the subsequent execution of the program at the time of execution of the certain program.
【0019】また、フォールトトレラントコンピュータ
では、チェックポイントによってキャッシュ中の全ての
書き替えられたキャッシュブロックのデータをメインメ
モリに書き戻す動作を実行するが、この処理に多くの時
間を要している。そこで、本来メインメモリに書き戻す
必要のないキャッシュブロックを「書き込み専用状態」
にしておくことで、チェックポイントでの処理時間を短
縮でき、システムの性能向上が図れる。In the fault-tolerant computer, the operation of writing back all the rewritten cache block data in the cache to the main memory by the checkpoint is executed, but this processing requires a lot of time. Therefore, the cache block that originally does not need to be written back to the main memory is "write-only".
By doing so, the processing time at the checkpoint can be shortened and the system performance can be improved.
【0020】[0020]
【実施例】以下、図面を参照して本発明の実施例を説明
する。図1は実施例に係わるコンピュータの構成を示す
ブロック図である。図1に示すように、本実施例におけ
るコンピュータは、CPU10とメインメモリ12との
間に、コピーバック方式によるキャッシュメモリ20が
設けられている。Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of a computer according to the embodiment. As shown in FIG. 1, the computer according to the present embodiment is provided with a cache memory 20 of a copyback system between a CPU 10 and a main memory 12.
【0021】キャッシュメモリ20は、キャッシュ制御
部22、記憶部24を有している。記憶部24は、デー
タ本体を保持するデータメモリ(領域)24aと、デー
タのアドレス(アドレスタグ)やアクセス履歴(キャッ
シュブロックを管理するためのステータス)を保持する
タグメモリ(領域)24bから成る。The cache memory 20 has a cache control unit 22 and a storage unit 24. The storage unit 24 includes a data memory (area) 24a that holds the data body and a tag memory (area) 24b that holds the address (address tag) of the data and the access history (status for managing the cache block).
【0022】CPU10は、キャッシュ制御部22に、
アドレスとキャッシュ制御信号を渡して、記憶部24と
の間でデータのやりとりを行なう。メインメモリ12
は、プログラムやデータが格納されている。The CPU 10 causes the cache control unit 22 to
Data is exchanged with the storage unit 24 by passing an address and a cache control signal. Main memory 12
Stores programs and data.
【0023】キャッシュ制御部22は、タグ領域24b
に格納された内容に基づいて、キャッシュブロック単位
でキャッシュアクセスを制御するものである。記憶部2
4のタグ領域24bには、キャッシュブロック毎に、ア
ドレスタグ及びデータが書き替えられたかどうかを示す
状態フラグ(ダーティフラグ)、及び書き込み専用状態
(詳細については後述する)であるかどうかを示す書き
込み専用状態フラグが格納される。The cache control unit 22 has a tag area 24b.
The cache access is controlled in cache block units based on the contents stored in. Storage unit 2
In the tag area 24b of No. 4, for each cache block, a status flag (dirty flag) indicating whether the address tag and the data have been rewritten, and a write indicating whether the status is a write-only state (details will be described later). The dedicated status flag is stored.
【0024】書き込み専用状態フラグは、CPU10が
データ書き込み用の領域を確保した時(例えばスタック
領域の割り付け)、そのアドレスの指定に連動して、あ
るいはプログラム中に埋め込まれた所定の命令によって
明示的に、対応するキャッシュブロックにセットされる
ものとする。また、書き込み専用状態フラグがセットさ
れているキャッシュブロックでは、書き込みに対しては
通常と同じ書き込みが実行されるが、コピーバックの
際、キャッシュブロック中のデータについてメインメモ
リ12への書き戻しは行なわない。When the CPU 10 secures an area for writing data (for example, allocation of a stack area), the write-only state flag is explicitly linked with the designation of the address or by a predetermined instruction embedded in the program. First, it is set in the corresponding cache block. Further, in the cache block in which the write-only status flag is set, the same writing is executed as usual, but at the time of copy back, the data in the cache block is written back to the main memory 12. Absent.
【0025】すなわち、プログラム中には、例えばある
関数を実行する場合にのみ使用される変数、または、あ
るプロセスの中で使用されるが他のプロセスでは参照さ
れない変数など、ローカルなデータが存在する。また、
一時的に確保されるスタック領域中で扱われるデータが
ある。この種のデータは、他では参照されず、また最後
に参照されてから、以後、新たに値が設定されるまで参
照されない期間(「死んでいる」期間)が比較的長いと
いう性質を持っているため、キャッシュ上で扱うことが
できれば十分であり、「死んでいる」期間に、本来では
メインメモリ12に書き戻す必要がないものである。That is, local data exists in a program, for example, a variable used only when executing a certain function, or a variable used in a certain process but not referred to by another process. . Also,
There is data handled in the stack area that is temporarily secured. This kind of data has the property that it is not referenced elsewhere, and the period after it is last referenced is not referenced until a new value is set (“dead” period). Therefore, it is sufficient if it can be handled on the cache, and it is not necessary to write it back to the main memory 12 during the "dead" period.
【0026】本発明では前述のような、本来メインメモ
リ12に書き戻す必要のないデータが格納されるキャッ
シュブロックに対して、CPU10の動作に連動して、
あるいは命令によって明示的に、書き込み専用状態フラ
グをセットして、該当するキャッシュブロックを書き込
み専用状態にし、リプレース等が必要となった場合にメ
インメモリ12に書き戻しが発生しないようにするもの
である。In the present invention, as described above, the cache block in which the data that originally does not need to be written back to the main memory 12 is stored is linked with the operation of the CPU 10,
Alternatively, the write-only state flag is explicitly set by an instruction to put the corresponding cache block in the write-only state so that write-back does not occur in the main memory 12 when replacement or the like becomes necessary. .
【0027】次に、本実施例の動作について、図2及び
図3に示すフローチャートを参照しながら説明する。こ
こでは、本来、メインメモリ12に書き戻す必要のない
データが格納されるキャッシュブロックを、明示的に書
き込み専用状態にする場合について、図2を参照して説
明する(CPU10の動作に連動してセットされる場合
については、スタック操作を例にして後述する)。Next, the operation of this embodiment will be described with reference to the flow charts shown in FIGS. Here, a case where a cache block that originally stores data that does not need to be written back to the main memory 12 is explicitly set to the write-only state will be described with reference to FIG. 2 (in synchronization with the operation of the CPU 10). When set, it will be described later using the stack operation as an example).
【0028】CPU10は、特定のアドレスに対応した
キャッシュブロックを、書き込み専用状態にするため、
キャッシュ制御部22にアドレスと要求信号を出力する
(ステップA1)。例えば、ローカルな変数であって、
最後に参照されてから、以後、新たに値が設定されるま
で参照されない変数が「死んでいる」期間に入る場合
に、CPU10は、この変数のデータが格納されるキャ
ッシュブロックを書き込み専用状態に設定する。The CPU 10 puts the cache block corresponding to the specific address into the write-only state.
The address and the request signal are output to the cache control unit 22 (step A1). For example, a local variable
When a variable that is not referred to until a new value is set after the last reference enters a "dead" period, the CPU 10 puts the cache block in which the data of this variable is stored into a write-only state. Set.
【0029】なお、書き込み専用状態にするため要求信
号は、プログラム中に埋め込まれた所定の命令に応じて
出力される。この命令は、例えばプログラムをコンパイ
ルする際に、プログラムの内容に応じて適切な実行位置
に埋め込まれたものである(詳細については後述す
る)。A request signal for setting the write-only state is output according to a predetermined instruction embedded in the program. This instruction is, for example, embedded in an appropriate execution position according to the content of the program when the program is compiled (details will be described later).
【0030】キャッシュ制御部22は、記憶部24のタ
グ領域24bを調べ、CPU10からのアドレスに対応
するキャッシュブロックが存在するか否かを判別する
(ステップA2)。The cache control unit 22 examines the tag area 24b of the storage unit 24 and determines whether or not there is a cache block corresponding to the address from the CPU 10 (step A2).
【0031】ここで、該当するキャッシュブロックが存
在する場合には、キャッシュ制御部22は、そのキャッ
シュブロックに対応する書き込み状態専用フラグをセッ
トする(ステップA3)。If there is a corresponding cache block, the cache control unit 22 sets the write state exclusive flag corresponding to the cache block (step A3).
【0032】こうして書き込み専用状態に設定されたキ
ャッシュブロックに対しては、図3に示すようにして制
御する。CPU10からキャッシュ制御部22に書き込
み要求があった場合(ステップB1)、キャッシュ制御
部22は、記憶部24のタグ領域24bを調べ、CPU
10からのアドレスに対応するキャッシュブロックが存
在するか否かを判別する(ステップB2)。キャッシュ
ヒットしていれば、キャッシュ制御部22は、データ領
域24aの該当するキャッシュブロックに書き込みを行
なう(ステップB3)。The cache block thus set in the write-only state is controlled as shown in FIG. When there is a write request from the CPU 10 to the cache control unit 22 (step B1), the cache control unit 22 checks the tag area 24b of the storage unit 24, and the CPU
It is determined whether or not there is a cache block corresponding to the address from 10 (step B2). If there is a cache hit, the cache control unit 22 writes to the corresponding cache block in the data area 24a (step B3).
【0033】この時、キャッシュ制御部22は、書き込
みの対象となったキャッシュブロックに対応するダーテ
ィフラグをセット(書き替えられたことを示す)し、ま
た書き込み専用状態フラグをリセットする(ステップB
4)。すなわち、書き替えられることによって、メイン
メモリ12に書き戻しが必要な状態になる場合もあるた
め書き込み専用状態を解放する(変数が「死んでる」期
間を外れる場合)。At this time, the cache control unit 22 sets (indicates that it has been rewritten) the dirty flag corresponding to the write-target cache block and resets the write-only state flag (step B).
4). That is, since the data may be rewritten to the main memory 12 by being rewritten, the write-only state is released (when the variable is out of the "dead" period).
【0034】また、CPU10からキャッシュ制御部2
2に読み出し要求があった場合(ステップB5)、キャ
ッシュ制御部22は、記憶部24のタグ領域24bを調
べ、CPU10からのアドレスに対応するキャッシュブ
ロックが存在するか否かを判別する(ステップB6)。
キャッシュヒットしていれば、キャッシュ制御部22
は、該当するキャッシュブロックに対して、書き込み専
用状態フラグがセットされているか調べる(ステップB
7)。Further, from the CPU 10 to the cache control unit 2
When there is a read request to the memory 2 (step B5), the cache control unit 22 checks the tag area 24b of the storage unit 24 and determines whether or not there is a cache block corresponding to the address from the CPU 10 (step B6). ).
If there is a cache hit, the cache control unit 22
Checks whether the write-only status flag is set for the corresponding cache block (step B
7).
【0035】書き込み専用状態フラグがセットされてい
ない場合、キャッシュ制御部22は、該当するキャッシ
ュブロックからデータを読み出して、CPU10に返す
(ステップB8)。If the write-only status flag is not set, the cache controller 22 reads the data from the corresponding cache block and returns it to the CPU 10 (step B8).
【0036】一方、書き込み専用状態フラグがセットさ
れている場合、キャッシュ制御部22は、プログラムエ
ラーステイタスをCPU10に返す(ステップB9)。
すなわち、対象とするキャッシュブロックが、例えばロ
ーカルな変数であって他の処理では参照されず、また変
数が「死んでいる」期間に入ったために書き込み専用状
態にしたにもかかわらず、読み出し要求があるというこ
とはプログラムのエラーであるものとみなしエラーを通
知する。On the other hand, when the write-only status flag is set, the cache control unit 22 returns the program error status to the CPU 10 (step B9).
That is, even though the target cache block is a local variable that is not referenced by other processing, and the variable has entered the "dead" period and has been placed in the write-only state, the read request is still If there is, it is regarded as a program error and the error is notified.
【0037】CPU10からキャッシュ制御部22に書
き込み要求あるいは読み出し要求がありミスヒットとな
った場合、キャッシュ制御部22は、リプレースの必要
があれば、リプレースの対象とするキャッシュブロック
を決定する(ステップB10,B11)。When a write request or a read request is issued from the CPU 10 to the cache control unit 22 and a mishit occurs, the cache control unit 22 determines the cache block to be replaced if the replacement is necessary (step B10). , B11).
【0038】ここで、リプレースの対象とするキャッシ
ュブロックに対して、書き込み専用状態フラグがセット
されておらず、ダーティフラグがセットされている場合
には、キャッシュ制御部22は、該当するキャッシュブ
ロックのデータをメインメモリ12に書き戻し、同キャ
ッシュブロックにアクセス対象とするデータを書き込む
(ステップB12〜B15)。Here, when the write-only status flag is not set and the dirty flag is set for the cache block to be replaced, the cache control unit 22 sets the cache block of the corresponding cache block. The data is written back to the main memory 12, and the data to be accessed is written to the same cache block (steps B12 to B15).
【0039】一方、リプレースの対象とするキャッシュ
ブロックに対して、書き込み専用状態フラグがセットさ
れている場合には、キャッシュ制御部22は、該当する
キャッシュブロックのデータを、ダーティフラグがセッ
トされていてもメインメモリ12に書き戻さない。キャ
ッシュ制御部22は、同キャッシュブロックにアクセス
対象とするデータを書き込む(ステップB12,B1
5)。On the other hand, when the write-only status flag is set for the cache block to be replaced, the cache control unit 22 sets the dirty flag for the data of the corresponding cache block. Is not written back to the main memory 12. The cache control unit 22 writes the data to be accessed in the same cache block (steps B12 and B1).
5).
【0040】このようにして、「死んでいる」期間にあ
る変数を格納したキャッシュブロックに対しては書き込
み専用状態フラグをセットすることにより、リプレース
の対象となってもメインメモリ12への本来不要な書き
戻しが抑制されるので、メモリ制御に要する時間が短縮
されシステム性能の向上を図ることができる。In this way, by setting the write-only status flag for the cache block storing the variables in the "dead" period, even if the cache block is to be replaced, it is not necessary for the main memory 12. Since the write back is suppressed, the time required for memory control can be shortened and the system performance can be improved.
【0041】また、プログラムの実行において、本来参
照されることのない未定義変数、すなわち書き込み専用
とされるキャッシュブロックに対して読み出しの要求が
あった場合には、プログラムエラーとして検出されるの
で、プログラムのデバッグに利用することもできる。In the execution of the program, if there is a read request for an undefined variable that is not originally referred to, that is, a write-only cache block, it is detected as a program error. It can also be used for program debugging.
【0042】次に、CPU10の動作に連動して書き込
み専用状態がセットされる場合について、スタック操作
を例にして説明する。CPU10は、スタック領域を確
保するための命令「alloc(<サイズ>)」によっ
て、図4(a)の状態にあるスタック(スタックポイン
タSPによって示す)上に、新たに<サイズ>分の領域
を図4(b)に示すように確保したものとする。そし
て、処理が完了した後、スタック領域を解放するための
命令「free<サイズ>」によって、図4(c)の状
態にあるスタックを、図4(d)に示すように<サイズ
>分縮小するものとする。Next, the case where the write-only state is set in conjunction with the operation of the CPU 10 will be described by taking a stack operation as an example. By the instruction "alloc (<size>)" for allocating a stack area, the CPU 10 newly creates an area of <size> on the stack (indicated by the stack pointer SP) in the state of FIG. 4A. It is assumed to be secured as shown in FIG. After the processing is completed, the stack in the state of FIG. 4C is reduced by <size> by the instruction “free <size>” for releasing the stack area as shown in FIG. 4D. It shall be.
【0043】「free」命令を実行する際、CPU1
0は、解放される領域の各アドレスについて書き込み専
用状態にするための要求を、キャッシュ制御部22に対
して出力する。キャッシュ制御部22は、CPU10か
らの要求に応じて、該当するキャッシュブロックに対応
して書き込み専用状態フラグをセットし、書き込み専用
状態にする。すなわち、解放された領域には、他では参
照されず、メインメモリ12に書き戻しの必要のないデ
ータが存在する。When executing the "free" instruction, the CPU 1
0 outputs to the cache control unit 22 a request for putting each address in the released area into a write-only state. In response to a request from the CPU 10, the cache control unit 22 sets the write-only state flag corresponding to the relevant cache block and puts it in the write-only state. That is, in the released area, there is data that is not referred to by others and does not need to be written back in the main memory 12.
【0044】これによって、再び、「alloc」命令
によって、前回に解放された領域の上にスタック領域を
確保したとき、初期化のデータ書き込みのときキャッシ
ュヒットになる可能性は従来と同等であり、かつ解放さ
れた領域がリプレースの対象となってもメインメモリ1
2への書き込みが発生しない。As a result, when the stack area is secured on the area previously released by the "alloc" instruction again, the possibility of a cache hit at the time of writing data for initialization is equivalent to that of the conventional case. And even if the released area becomes a replacement target, the main memory 1
Writing to 2 does not occur.
【0045】このようにして、CPU10の動作に連動
して、該当するキャッシュブロックを書き込み専用状態
にすることもできる。次に、前述したようにキャッシュ
ブロックに書き込み専用状態の設定が可能なコンピュー
タにおいて実行されるプログラムのコンパイラの具体例
について説明する。In this way, the corresponding cache block can be put into the write-only state in synchronization with the operation of the CPU 10. Next, a specific example of a compiler of a program executed in a computer capable of setting a write-only state in a cache block as described above will be described.
【0046】ここで、本実施例におけるCPU10は、
「lwo」(load to write only)命令を新たにサポー
トするものとする。「lwo」命令は、「load」命
令の1つであるが、メインメモリ12から値をロードす
ると同時に、もしデータが記憶部24上にあり、かつダ
ーティフラグがセットされていれば、このデータを格納
するキャッシュブロックを書き込み専用状態にする命令
である。Here, the CPU 10 in this embodiment is
The "lwo" (load to write only) instruction is newly supported. The "lwo" instruction is one of the "load" instructions, but at the same time as loading the value from the main memory 12, if the data is in the storage unit 24 and the dirty flag is set, this data is This is an instruction to put a cache block to be stored in a write-only state.
【0047】コンパイラは、プログラム変数の生存情報
(あるプログラムの実行時点において変数に格納されて
いる値が、以後のプログラムの実行で読み出されるか否
かの情報)に基づいて、静的に変数に対する参照を解析
して、変数が「死んでいる」状態となる時点、すなわち
新たに値が設定されるまでは参照されることがなくなる
最後の参照の位置を求める。The compiler statically sets the variable to the variable based on the survival information of the program variable (information indicating whether the value stored in the variable at the time of execution of a certain program is read by the subsequent execution of the program). The reference is parsed to determine when the variable is "dead", that is, the position of the last reference that will not be referenced until a new value is set.
【0048】コンパイラは、前述のような条件に一致す
る、変数に対する参照位置において、通常の「loa
d」命令ではなく、対象とする変数を格納するキャッシ
ュブロックを書き込み専用状態にする「lwo」命令に
置き換える。The compiler uses the normal "loa" at the reference position for the variable that matches the above condition.
Instead of the "d" instruction, the cache block that stores the target variable is replaced with the "lwo" instruction that puts it in the write-only state.
【0049】従って、変数が「死んでいる」期間では
「lwo」命令によって明示的に、この変数が格納され
るキャッシュブロックは書き込み専用状態に設定される
ので、メインメモリ12に書き戻されることがなくな
り、コピーバックの発生量を低減させることができる。Therefore, in the period when the variable is "dead", the cache block in which this variable is stored is explicitly set to the write-only state by the "lwo" instruction, so that it may be written back to the main memory 12. Therefore, the amount of copy back generated can be reduced.
【0050】このようにして、コンパイラでは変数の生
存情報に基づいて、変数が「死んでいる」状態をより厳
密に求められるので、キャッシュブロックを書き込み専
用状態にセットすることができるコンピュータで実行さ
れるプログラムをコンパイルする際に、変数が「死んで
いる」期間に対応するキャッシュブロックを「書き込み
専用状態」にするようにして、本来、メインメモリに反
映させる必要のないデータの書き戻しを抑制することが
できる。従って、システム性能の向上が図れる。In this way, the compiler can more strictly determine the state of the variable being "dead" based on the survival information of the variable, so that it can be executed by the computer that can set the cache block to the write-only state. When a program that compiles is compiled, the cache block corresponding to the "dead" period of the variable is set to "write-only state" to suppress the write-back of data that does not need to be reflected in the main memory. be able to. Therefore, the system performance can be improved.
【0051】次に、コピーバックキャッシュを用いて実
現したフォールトトレラントコンピュータについて説明
する。本実施例におけるフォールトトレラントコンピュ
ータは、前述したような、キャッシュブロックに書き込
み専用状態の設定が可能なコピーバックキャッシュを用
い、また書き込み専用状態にする命令をコンパイル時に
埋め込むコンパイラを用いているものとする。Next, a fault tolerant computer realized by using the copyback cache will be described. It is assumed that the fault-tolerant computer according to the present embodiment uses the above-described copyback cache in which the write-only state can be set in the cache block and the compiler that embeds the instruction for making the write-only state at compile time. .
【0052】コピーバックキャッシュを用いて実現した
フォールトトレラントコンピュータでは、キャッシュメ
モリ20からメインメモリ12への書き戻しが必要とな
ったとき、同時にCPU10のコンテキスト(レジスタ
等が保持する値等などのプロセッサで命令を実行してい
る状態)、及びデータメモリ24a中の全ての書き替え
られたキャッシュブロックのデータをメインメモリ12
に書き戻す(フラッシュ動作)。In the fault-tolerant computer realized by using the copy-back cache, when write-back from the cache memory 20 to the main memory 12 becomes necessary, the context of the CPU 10 (processor such as a value held by a register etc.) is simultaneously processed. The state of executing the instruction) and the data of all rewritten cache blocks in the data memory 24a are stored in the main memory 12
Write back to (flash operation).
【0053】障害が発生した場合には、チェックポイン
トによりメインメモリ12に保存したコンテキスト及び
データを書き戻し、前回のチェックポイントの時点か
ら、多重化された他の正常なCPUにより再実行するこ
とで障害を回避する。When a failure occurs, the context and data saved in the main memory 12 are written back by the checkpoint, and re-executed by another normal CPU that has been multiplexed from the time of the previous checkpoint. Avoid obstacles.
【0054】本実施例におけるキャッシュメモリ20で
は、メインメモリ12に書き戻す必要のないデータが格
納されたキャッシュブロックは書き込み専用状態にセッ
トされている。従って、フラッシュ動作の際、書き込み
専用状態にあるキャッシュブロックのデータは、ダーテ
ィであっても(書き替えられていても)メインメモリ1
2には書き戻されない。In the cache memory 20 of this embodiment, the cache block in which data that need not be written back to the main memory 12 is stored is set to the write-only state. Therefore, during the flush operation, the data in the cache block in the write-only state is dirty (rewritten) in the main memory 1
It is not written back to 2.
【0055】このようにして、フォールトトレラントコ
ンピュータにおいて、本発明によるコピーバックキャッ
シュを用いることにより、メモリに書き戻しの必要のな
い全てのキャッシュブロックを「書き込み専用状態」に
することができるので、このシステムで最大の問題であ
るチェックポイント生成に要する時間を大幅に削減する
ことができる。In this way, in the fault tolerant computer, by using the copyback cache according to the present invention, all the cache blocks that do not need to be written back to the memory can be set to the "write only state". The time required for checkpoint generation, which is the biggest problem in the system, can be greatly reduced.
【0056】なお、前記実施例においては、書き込み専
用状態フラグがセットされたキャッシュブロックに対し
て読み出し要求があった場合には、プログラムエラース
テイタスを返すものとして説明したが、予め決められた
特定の処理を実行するようにしても良い。In the above embodiment, the program error status is returned when a read request is made to a cache block in which the write-only status flag is set, but a predetermined specific You may make it perform a process.
【0057】[0057]
【発明の効果】以上詳述したように本発明によれば、本
来不必要なキャッシュブロックに対して書き込み専用状
態を設定することにより、メインメモリへの書き戻しを
抑制することができるので、メモリ制御に要する時間が
短縮されシステム性能を向上させることが可能となるも
のである。As described in detail above, according to the present invention, the write-back state to the main memory can be suppressed by setting the write-only state for an originally unnecessary cache block. The time required for control can be shortened and the system performance can be improved.
【図1】本発明の実施例に係わるコンピュータの構成を
示すブロック図。FIG. 1 is a block diagram showing the configuration of a computer according to an embodiment of the present invention.
【図2】本実施例におけるキャッシュブロックを明示的
に書き込み専用状態にする場合の処理を説明するための
フローチャート。FIG. 2 is a flowchart for explaining a process when a cache block is explicitly set to a write-only state in this embodiment.
【図3】本実施例における書き込み専用状態に設定され
たキャッシュブロックに対する処理を説明するためのフ
ローチャート。FIG. 3 is a flowchart for explaining a process for a cache block set to a write-only state in this embodiment.
【図4】本実施例におけるCPU10の動作に連動して
書き込み専用状態がセットされる場合を説明するための
図。FIG. 4 is a diagram for explaining a case where a write-only state is set in association with the operation of the CPU 10 in the present embodiment.
10…CPU、12…メインメモリ、20…キャッシュ
メモリ、22…キャッシュ制御部、24…記憶部、24
a…データメモリ(領域)、24b…タグメモリ(領
域)。10 ... CPU, 12 ... Main memory, 20 ... Cache memory, 22 ... Cache control unit, 24 ... Storage unit, 24
a ... Data memory (area), 24b ... Tag memory (area).
Claims (4)
ャッシュメモリを有し、更新のあったキャッシュブロッ
クの内容を、所定の条件に応じてメインメモリへ書き戻
すコンピュータにおいて、 前記キャッシュメモリを管理するステータスとして、キ
ャッシュブロックの内容をメインメモリに書き戻さずに
同キャッシュブロックに書き込むことができる書き込み
専用状態であることを示すデータをキャッシュブロック
単位で設定し、 前記所定の条件によりキャッシュブロックの内容をメイ
ンメモリに書き戻す必要が発生した場合に、該当するキ
ャッシュブロックが書き込み専用状態であることを示す
データが設定されていればメインメモリへの書き戻しを
行なわないキャッシュ制御手段を具備したことを特徴と
するコンピュータ。1. A computer having a cache memory managed on a cache block basis and writing back the contents of an updated cache block to a main memory according to a predetermined condition, as a status for managing the cache memory. , The data indicating that the cache block is in a write-only state that can be written to the main memory without being written back to the main memory is set for each cache block, and the content of the cache block is set to the main memory according to the predetermined condition. When it is necessary to write back data to the main memory, cache control means is provided that does not write back to the main memory if data indicating that the corresponding cache block is in the write-only state is set. Computer.
み専用状態をプログラムの実行によって出力されるキャ
ッシュ制御命令に基づいて設定し、 前記キャッシュ制御命令は、コンパイラがプログラムを
コンパイルする際に、プログラムの適切な位置に埋め込
まれることを特徴とする請求項1記載のコンピュータ。2. The cache control means sets the write-only state based on a cache control instruction output by execution of a program, and the cache control instruction is appropriate for the program when the compiler compiles the program. The computer according to claim 1, wherein the computer is embedded in various positions.
よって、プロセッサのコンテキストと共に、キャッシュ
メモリ中の全ての書き替えられたキャッシュブロックの
データをメインメモリに書き戻すフォールトトレラント
コンピュータを実現するもので、メインメモリへの書き
戻しを、前記書き込み専用状態であることを示すデータ
に基づいて行なうことを特徴とする請求項1記載のコン
ピュータ。3. The computer realizes a fault-tolerant computer that writes back the data of all rewritten cache blocks in the cache memory to the main memory together with the context of the processor by a checkpoint. 2. The computer according to claim 1, wherein write-back is performed based on the data indicating the write-only state.
ャッシュメモリを有し、更新のあったキャッシュブロッ
クの内容を、所定の条件に応じてメインメモリへ書き戻
すコンピュータにおいて、 キャッシュブロックの内容をメインメモリに書き戻さず
に同キャッシュブロックに書き込むことができる書き込
み専用状態であることを示すデータを、前記キャッシュ
メモリを管理するステータスとして設定し、 書き込み専用状態であることを示すデータが設定された
キャッシュブロックに対する書き込み要求がキャッシュ
ヒットした場合に、同キャッシュブロックのデータをメ
インメモリに書き戻さずに書き込みを実行すると共に書
き込み専用状態を解除し、 書き込み専用状態であることを示すデータが設定された
キャッシュブロックに対する読み出し要求がキャッシュ
ヒットした場合に、予め決められた処理を実行すること
を特徴とするコピーバックキャッシュ制御方法。4. A computer having a cache memory managed in cache block units, wherein the contents of the updated cache block are written back to the main memory according to a predetermined condition, and the contents of the cache block are stored in the main memory. Data that can be written to the same cache block without writing back is set as the status for managing the cache memory, and for the cache block to which the data that is write-only is set When a write request results in a cache hit, the data in the same cache block is written without being written back to the main memory, the write-only state is canceled, and the cache block for which the data indicating the write-only state is set Read A copy-back cache control method, wherein predetermined processing is executed when a cache request hits a protruding request.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6273530A JPH08137748A (en) | 1994-11-08 | 1994-11-08 | Computer having copyback cache and copyback cache control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6273530A JPH08137748A (en) | 1994-11-08 | 1994-11-08 | Computer having copyback cache and copyback cache control method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH08137748A true JPH08137748A (en) | 1996-05-31 |
Family
ID=17529135
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP6273530A Pending JPH08137748A (en) | 1994-11-08 | 1994-11-08 | Computer having copyback cache and copyback cache control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH08137748A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6700292B2 (en) | 2001-10-25 | 2004-03-02 | Tris Inc. | Metal-graphite brush |
| JP2004303232A (en) * | 2003-03-20 | 2004-10-28 | Matsushita Electric Ind Co Ltd | Data memory cache device and data memory cache system |
| US8271853B2 (en) | 2008-06-24 | 2012-09-18 | Kabushiki Kaisha Toshiba | Cache memory, computer system and memory access method |
| WO2013114540A1 (en) * | 2012-01-30 | 2013-08-08 | 富士通株式会社 | Control device, analysis device, analysis method, and analysis program |
| JP2017510902A (en) * | 2014-04-13 | 2017-04-13 | クアルコム,インコーポレイテッド | Method and apparatus for reducing bandwidth and power in a cache using reads with invalidation |
-
1994
- 1994-11-08 JP JP6273530A patent/JPH08137748A/en active Pending
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6700292B2 (en) | 2001-10-25 | 2004-03-02 | Tris Inc. | Metal-graphite brush |
| JP2004303232A (en) * | 2003-03-20 | 2004-10-28 | Matsushita Electric Ind Co Ltd | Data memory cache device and data memory cache system |
| US8271853B2 (en) | 2008-06-24 | 2012-09-18 | Kabushiki Kaisha Toshiba | Cache memory, computer system and memory access method |
| US8381072B2 (en) | 2008-06-24 | 2013-02-19 | Kabushiki Kaisha Toshiba | Cache memory, computer system and memory access method |
| WO2013114540A1 (en) * | 2012-01-30 | 2013-08-08 | 富士通株式会社 | Control device, analysis device, analysis method, and analysis program |
| JP2017510902A (en) * | 2014-04-13 | 2017-04-13 | クアルコム,インコーポレイテッド | Method and apparatus for reducing bandwidth and power in a cache using reads with invalidation |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2916420B2 (en) | Checkpoint processing acceleration device and data processing method | |
| JP3661614B2 (en) | Cache memory control method and multiprocessor system | |
| US7111134B2 (en) | Subsystem and subsystem processing method | |
| US6981104B2 (en) | Method for conducting checkpointing within a writeback cache | |
| JP6040176B2 (en) | Read and write monitoring attributes in transactional memory (TM) systems | |
| KR100204741B1 (en) | How to use the first and second cache memory | |
| US20150106588A1 (en) | Computer Processor Employing Hardware-Based Pointer Processing | |
| US20080235477A1 (en) | Coherent data mover | |
| US6345351B1 (en) | Maintenance of speculative state of parallel executed jobs in an information processing system | |
| US5016169A (en) | Data processor capable of correctly re-executing instructions | |
| EP0833248A2 (en) | Memory update history storing apparatus and method | |
| US6904490B2 (en) | Method and system of managing virtualized physical memory in a multi-processor system | |
| US11119925B2 (en) | Apparatus and method for managing capability metadata | |
| US20060149940A1 (en) | Implementation to save and restore processor registers on a context switch | |
| JP2004326758A (en) | Local cache block flash command | |
| JP2019503009A (en) | Vector atomic memory update instruction | |
| US11513962B2 (en) | Draining operation to cause store data to be written to persistent memory | |
| KR20210021521A (en) | Load-only instruction processing on devices that support transactional memory | |
| US20070005906A1 (en) | Information processing apparatus and cache memory control method | |
| US5737568A (en) | Method and apparatus to control cache memory in multiprocessor system utilizing a shared memory | |
| JPH08137748A (en) | Computer having copyback cache and copyback cache control method | |
| US7478203B2 (en) | Technique for eliminating dead stores in a processor | |
| TWI801622B (en) | Apparatus, method, computer program, and storage medium for handling guard tag loss | |
| JP2009230479A (en) | Microprocessor | |
| US6401173B1 (en) | Method and apparatus for optimizing bcache tag performance by inferring bcache tag state from internal processor state |