JP2854667B2 - Disk cache control method - Google Patents

Disk cache control method

Info

Publication number
JP2854667B2
JP2854667B2 JP2106378A JP10637890A JP2854667B2 JP 2854667 B2 JP2854667 B2 JP 2854667B2 JP 2106378 A JP2106378 A JP 2106378A JP 10637890 A JP10637890 A JP 10637890A JP 2854667 B2 JP2854667 B2 JP 2854667B2
Authority
JP
Japan
Prior art keywords
data
cache
cache memory
requested
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2106378A
Other languages
Japanese (ja)
Other versions
JPH045739A (en
Inventor
享一 笹本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2106378A priority Critical patent/JP2854667B2/en
Publication of JPH045739A publication Critical patent/JPH045739A/en
Application granted granted Critical
Publication of JP2854667B2 publication Critical patent/JP2854667B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明は、ライトスルー方式のディスク・キャッシュ
方式において、キャッシュ・メモリのデータの読出し又
は書込みを制御するディスク・キャッシュ制御方式に関
する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Industrial application field) The present invention relates to a disk cache control system for controlling reading or writing of data in a cache memory in a write-through disk cache system. About.

(従来の技術) 例えば、磁気ディスク装置をデータメモリとして備え
たコンピュータには、ディスク・キャッシュ装置が設け
られる。このディスク・キャッシュ装置とは、磁気ディ
スク装置の所定のメモリエリア毎に対応して、RAM等で
構成されたキャッシュ・メモリを補助記憶エリアとして
設けたもので、つまり、磁気ディスク装置に記憶された
データのうち、アクセス頻度の高い一部データをキャッ
シュ・メモリに格納させることで、データアクセスの高
速化を図っている。
(Prior Art) For example, a computer having a magnetic disk device as a data memory is provided with a disk cache device. This disk cache device is a device in which a cache memory composed of RAM or the like is provided as an auxiliary storage area corresponding to each predetermined memory area of the magnetic disk device, that is, the disk cache device is stored in the magnetic disk device. By accessing some of the data with high access frequency in the cache memory, the speed of data access is increased.

ここで、ディスク・キャッシュ制御方式には、ライト
スルー方式とライトバック方式とがあり、前者ライトス
ルー方式は、ホストコンピュータよりデータの書込み要
求があった際に、該書込み要求データがキャッシュ・メ
モリに存在する場合(キャッシュ・ヒット)にはキャッ
シュ・メモリ及び磁気ディスク装置にデータ書込みを行
ない、該書込み要求データがキャッシュ・メモリに存在
しない場合(キャッシュ・ミスヒット)には磁気ディス
ク装置に対してのみデータ書込みを行なう。また、後者
ライトバック方式は、上記キャッシュ・ヒット,キャッ
シュ・ミスヒットに拘らずとりあえずキャッシュ・メモ
リに対してのみデータ書込みを行ない、後の処理により
磁気ディスク装置へキャッシュ・データをコピーしてい
る。
Here, the disk cache control method includes a write-through method and a write-back method. In the former write-through method, when a data write request is issued from the host computer, the write request data is stored in the cache memory. If it exists (cache hit), data is written to the cache memory and the magnetic disk device. If the write request data does not exist in the cache memory (cache miss), it is written only to the magnetic disk device. Write data. In the latter write-back method, data is written only to the cache memory for the time being regardless of the cache hit or cache mishit, and the cache data is copied to the magnetic disk device by a later process.

すなわち、上記ライトスルー方式では、データの書込
み処理は常に磁気ディスク装置に対しても行なわれるの
で、キャッシュ・ヒットした場合のデータの読出しに際
してのみ、磁気ディスク装置からのデータ読出しに比較
してデータアクセスの高速化が図られ、また、上記ライ
トバック方式では、キャッシュ・ヒットした場合のデー
タの読出し及びキャッシュ・メモリへのデータの書込み
に際し、磁気ディスク装置とのデータアクセスに比較し
て高速化が図られる。この場合、キャッシュ・メモリに
対するデータの読出し処理及び書込み処理に際しては、
そのアクセス対象となるデータのキャッシュ・メモリ内
における格納順位レベルが、最上位レベルに置換される
もので、これにより、アクセス頻度の高いデータが常に
キャッシュ・メモリの上位レベルに保持されることにな
る。
In other words, in the above write-through method, the data write processing is always performed on the magnetic disk drive, and therefore, only when data is read when a cache hit occurs, the data access processing is performed in comparison with the data read from the magnetic disk drive. In the above-mentioned write-back method, the speed of reading data in the case of a cache hit and the speed of writing data to the cache memory can be increased as compared with the data access to the magnetic disk device. Can be In this case, when reading and writing data to and from the cache memory,
The storage order level of the data to be accessed in the cache memory is replaced with the highest level, so that frequently accessed data is always held at the upper level of the cache memory. .

ここで、上記ライトバック方式のディスク・キャッシ
ュ装置では、データ読出し及び書込みの何れの処理にお
いてもデータアクセス時間の高速化が図れるが、キャッ
シュ・メモリに書込まれたデータが磁気ディスク装置に
コピーされるまでの間に停電等の障害が発生すると、そ
の内容が消失してしまう恐れが十分にあるので、一般に
は、ライトスルー方式のディスク・キャッシュ装置が用
いられている。
Here, in the write-back type disk cache device, the data access time can be shortened in both the data reading and writing processes, but the data written in the cache memory is copied to the magnetic disk device. If a failure such as a power failure occurs before the failure occurs, there is a sufficient possibility that the contents will be lost. Therefore, a write-through type disk cache device is generally used.

(発明が解決しようとする課題) しかしながら、上記ライトスルー方式による従来のデ
ィスク・キャッシュ装置では、データの読出し処理及び
キャッシュ・ヒット時の書込み処理の何れにおいても、
常に、キャッシュ・メモリにおけるデータレベルの置換
更新を行なうため、あるデータファイルの属性として書
込み要求ばかりを受けるデータのアクセス頻度が高い
と、キャッシュ・メモリには書込み用のデータばかりが
上位レベルに残ることになり、ディスク・キャッシュの
効果を発揮する読出し用のデータが徐々に下位レベルに
置換されてしまうことになる。すなわち、ライトスルー
方式のディスク・キャッシュ装置では、キャッシュ・ヒ
ットデータの読出し処理を行なう場合にのみ、ディスク
・キャッシュの効果が発揮されるので、後に読出し要求
を受ける確率が少ないデータの書込み処理を行なう場合
までキャッシュ・ヒットデータの最上位レベルへの置換
制御を行なうと、キャッシュ・メモリ内の読出し頻度の
高いデータが下位レベルへ先送りになり、ディスク・キ
ャッシュの効果が低下することになる。
(Problems to be Solved by the Invention) However, in the conventional disk cache device based on the above write-through method, both of the data read process and the write process at the time of a cache hit,
Since data level replacement in the cache memory is always performed, if data that receives only a write request is frequently accessed as an attribute of a certain data file, only the data to be written remains in the cache memory at an upper level. , And the data for reading which exerts the effect of the disk cache is gradually replaced with a lower level. That is, in the write-through type disk cache device, the effect of the disk cache is exhibited only when the cache hit data is read, so that the data write process with a low probability of receiving a read request later is performed. If the replacement control of the cache hit data to the highest level is performed until that time, the data with high read frequency in the cache memory is postponed to the lower level, and the effect of the disk cache is reduced.

一方、上記従来のディスク・キャッシュ装置によって
も、書込みデータが直ぐに読出しデータとして要求され
るファイル処理を行なう場合には、十分なキャッシュ効
果を得ることができる。
On the other hand, even with the above-described conventional disk cache device, a sufficient cache effect can be obtained when performing file processing in which write data is immediately required as read data.

本発明は、上記課題に鑑みなされたもので、書込みデ
ータが直ぐに読出しデータとして要求されるファイル処
理を行なう場合、及び書込み要求のみを受けるデータの
アクセス頻度が高いファイル処理を行なう場合の何れの
ファイル処理においても、最大限のディスク・キャッシ
ュ効果を得ることが可能になるディスク・キャッシュ制
御方式を提供することを目的とする。
The present invention has been made in view of the above-described problems, and it is an object of the present invention to perform a file process in which write data is immediately requested as read data and a file process in which a high frequency of access to data that receives only a write request is performed. It is another object of the present invention to provide a disk cache control method capable of obtaining a maximum disk cache effect in processing.

[発明の効果] (課題を解決するための手段) すなわち、本発明に係わるディスク・キャッシュ制御
方式は、ライトスルー方式のディスク・キャッシュ装置
におけるキャッシュ・メモリのデータの読出し又は書込
みを制御するもので、磁気ディスク装置と、この磁気デ
ィスク装置に記憶されているデータの一部を記憶するキ
ャッシュ・メモリと、このキャッシュ・メモリに記憶さ
れる複数のデータの格納順位を置換するデータ置換手段
と、データの読出し又は書込み要求時に該要求されたデ
ータが上記キャッシュ・メモリに存在するか否かを検索
するキャッシュ・データ検索手段と、上記データ読出し
要求時に該読出し要求されたデータが上記キャッシュ・
データ検索手段により上記キャッシュ・メモリに存在す
ることが検索された場合には、該読出し要求されたデー
タの格納順位を最上位位置に置換して読出し、該読出し
要求されたデータが上記キャッシュ・メモリに存在しな
いことが検索された場合には、該読出し要求されたデー
タを上記磁気ディスク装置から上記キャッシュ・メモリ
に転送格納すると共に格納順位を最上位にして読出し、
これに伴ない、上記キャッシュ・メモリに空きがない場
合には格納順位が最下位にあるデータを上記キャッシュ
・メモリから追出すデータ読出し手段と、上記データ書
込み要求時に該書込み要求されたデータが上記キャッシ
ュ・データ検索手段により上記キャッシュ・メモリに存
在することが検索された場合には、該書込み要求された
データの格納順位を最上位位置に置換し、該書込み要求
されたデータが上記キャッシュ・メモリに存在しないこ
とが検索された場合には、該書込み要求されたデータを
上記キャッシュ・メモリには格納せずに上記磁気ディス
ク装置に書込む第1のデータ書込み手段と、上記データ
書込み要求時に該書込み要求されたデータが上記キャッ
シュ・データ検索手段により上記キャッシュ・メモリに
存在することが検索された場合には、該書込み要求され
たデータの格納順位を同順位位置に保持し、該書込み要
求されたデータが上記キャッシュ・メモリに存在しない
ことが検索された場合には、該書込み要求されたデータ
を上記キャッシュ・メモリには格納せずに上記磁気ディ
スク装置に書込む第2のデータ書込み手段と、上記第1
のデータ書込み手段と上記第2のデータ書込み手段とを
データファイルの属性に応じて選択する書込みモード選
択手段とを備えて構成したものである。
[Effects of the Invention] (Means for Solving the Problems) That is, the disk cache control method according to the present invention controls the reading or writing of data in a cache memory in a write-through type disk cache device. , A magnetic disk device, a cache memory for storing a part of data stored in the magnetic disk device, data replacement means for replacing a storage order of a plurality of data stored in the cache memory, A cache data retrieval means for retrieving whether or not the requested data is present in the cache memory at the time of a read or write request of the cache memory; and transmitting the data requested at the time of the data read request to the cache memory.
When the data retrieving means finds that the data exists in the cache memory, the storage order of the read-requested data is replaced with the highest position, and the data is read. If it is found that the data does not exist in the cache memory, the read requested data is transferred from the magnetic disk device to the cache memory and read out with the storage order being the highest,
Along with this, if there is no free space in the cache memory, data reading means for expelling the data having the lowest storage order from the cache memory, and the data requested to be written at the time of the data write request is When the cache data search means finds that the data exists in the cache memory, the storage order of the write-requested data is replaced with the highest position, and the write-requested data is stored in the cache memory. If it is found that the data does not exist in the cache memory, the first data writing means writes the requested data to the magnetic disk device without storing the data in the cache memory; The cache data search means detects that the data requested to be written exists in the cache memory. In this case, the storage order of the write-requested data is held at the same position, and if it is found that the write-requested data does not exist in the cache memory, the write-requested data is not stored. Second data writing means for writing the written data to the magnetic disk drive without storing the data in the cache memory;
And a write mode selecting means for selecting the second data writing means according to the attribute of the data file.

(作用) つまり、書込みデータが直ぐに読出しデータとして要
求されるファイル処理を行なう場合には、上記第1のデ
ータ書込み手段に基づきデータアクセス頻度に応じたキ
ャッシュ・データ格納順位の置換制御を行なうことによ
り、読出しデータを常にキャッシュ・メモリの上位の格
納レベルに位置させることができ、また、書込要求のみ
を受けるデータのアクセス頻度が高いファイル処理を行
なう場合には、上記第2のデータ書込み手段に基づきデ
ータ読出し頻度に応じたキャッシュ・データ格納順位の
置換制御を行なうことにより、読出し要求を受けないデ
ータを優先的にキャッシュ・メモリの下位の格納レベル
に位置させることができる。これにより、常に、読出し
要求の比率が高いデータが優先的にキャッシュ・メモリ
の上位の格納レベルに残されることになり、キャッシュ
・メモリの使用効率が向上して最大限のディスク・キャ
ッシュ効率を得ることが可能になる。
(Operation) In other words, when performing file processing in which write data is immediately required as read data, the cache data storage order is controlled in accordance with the data access frequency based on the first data writing means. The read data can always be located at a higher storage level of the cache memory, and when performing file processing in which data that receives only a write request is accessed frequently, the second data writing means is used. By performing the replacement control of the cache data storage order according to the data read frequency based on the data, data that is not requested to be read can be preferentially positioned at the lower storage level of the cache memory. As a result, data having a high ratio of read requests is always preferentially left in the upper storage level of the cache memory, so that the use efficiency of the cache memory is improved and the maximum disk cache efficiency is obtained. It becomes possible.

(実施例) 以下図面により本発明の一実施例について説明する。Embodiment An embodiment of the present invention will be described below with reference to the drawings.

第1図はこのディスク・キャッシュ制御方式が適用さ
れるディスク・キャッシュ装置11とその周辺構成を示す
もので、ディスク・キャッシュ装置11には、キャッシュ
・メモリ12を始め、ディレクトリ管理テーブル13とディ
レクトリ制御部14、及びLRU情報管理テーブル15とLRU制
御部16が、そけぞれバスライン17を介して接続される。
FIG. 1 shows a disk cache device 11 to which the disk cache control method is applied and its peripheral configuration. The disk cache device 11 includes a cache memory 12, a directory management table 13, and a directory control table 13. The unit 14, the LRU information management table 15, and the LRU control unit 16 are connected via bus lines 17, respectively.

一方、上記ディスク・キャッシュ装置11のバスライン
17には、外部において磁気ディスクコントローラ18が接
続され、この磁気ディスクコントローラ18には、ホスト
コンピュータ側のチャネル装置19、及び磁気ディスク装
置20が接続される。
On the other hand, the bus line of the disk cache device 11
A magnetic disk controller 18 is connected to the external device 17, and a channel device 19 on the host computer side and a magnetic disk device 20 are connected to the magnetic disk controller 18.

上記ディスクトリ管理テーブル13は、磁気ディスク装
置20のどのメモリエリアのデータがキャッシュ・メモリ
12の何処のメモリエリアに記憶されているかを示すタグ
情報を記憶管理するもので、ディレクトリ制御部14は、
このディレクトリ管理テーブル13に記憶されるタグ情報
に基づき、磁気ディスクコントローラ18に与えられた読
出し要求あるいは書込み要求の対象となるデータがキャ
ッシュ・メモリ12に存在するか否かを判定し、キャッシ
ュ・ヒット信号又はキャッシュ・ミスヒット信号をLRU
(Least Recentry Used)制御部16に出力する。LRU制御
部16は、LRU情報管理テーブル15に記憶されるLRU情報に
基づき、キャッシュ・メモリ12における記憶データの格
納レベルの置換制御を行なうもので、このLRU制御部16
によるキャッシュ・データの置換制御は、処理されるフ
ァイルの属性に応じてモード1とモード2とが選択され
る。ここで、キャッシュ・メモリ12に対する書込みデー
タが直ぐに読出しデータとして要求されるファイル処理
を行なう場合にはモード1の置換制御が選択され、ま
た、書込要求のみを受けるデータのアクセス頻度が高い
ファイル処理を行なう場合にはモード2の置換制御が選
択される。このLRU制御部16における置換モードの選択
手段は、OS(Operating System)により予め設定して
も、ハード的に指示設定してもよい。
The disk directory management table 13 indicates which memory area of the magnetic disk device 20 stores data in the cache memory.
The tag information indicating where in the memory area 12 is stored and managed, and the directory control unit 14
Based on the tag information stored in the directory management table 13, it is determined whether or not the data to be read or written to the magnetic disk controller 18 exists in the cache memory 12, and a cache hit is determined. LRU signal or cache miss signal
(Least Recentry Used) Output to the control unit 16. The LRU control unit 16 controls the replacement of the storage level of the storage data in the cache memory 12 based on the LRU information stored in the LRU information management table 15.
Mode 1 and mode 2 are selected according to the attribute of the file to be processed. Here, when performing file processing in which write data to the cache memory 12 is immediately requested as read data, the mode 1 replacement control is selected, and file processing in which only a write request is accessed frequently is performed. Is performed, mode 2 replacement control is selected. The replacement mode selection means in the LRU control unit 16 may be set in advance by an OS (Operating System) or may be instructed and set by hardware.

すなわち、チャネル装置19からの読出し要求によりキ
ャッシュ・ヒットした場合には、上記モード1及びモー
ド2の何れの置換制御においても、そのキャッシュ・ヒ
ットデータはキャッシュ・メモリ12の最上位レベルに置
換更新され、キャッシュ・ヒットしない場合でも、磁気
ディスク装置20から読出されるデータがキャッシュ・メ
モリ12の最上位レベルに書込まれる(ステージング)。
また、チャネル装置19からの書込み要求によりキャッシ
ュ・ヒットした場合、上記モード1の置換制御では、上
記読出し要求時同様そのキャッシュ・ヒットデータはキ
ャッシュ・メモリ12の最上位レベルに置換更新され、ま
た、上記モード2の置換制御では、そのキャッシュ・ヒ
ットデータはキャッシュ・メモリ12に格納レベルの変更
なしで更新される。そして、書込要求時にキャッシュ・
ヒットしない場合には、磁気ディスク装置20に対しての
み書込みが行なわれる。
That is, when a cache hit occurs due to a read request from the channel device 19, the cache hit data is replaced and updated to the highest level of the cache memory 12 in both the mode 1 and mode 2 replacement control. Even when a cache hit does not occur, data read from the magnetic disk device 20 is written to the highest level of the cache memory 12 (staging).
Further, when a cache hit occurs due to a write request from the channel device 19, in the mode 1 replacement control, the cache hit data is replaced and updated to the highest level of the cache memory 12, as in the case of the read request, and In the mode 2 replacement control, the cache hit data is updated in the cache memory 12 without changing the storage level. Then, when a write request is issued,
If there is no hit, writing is performed only on the magnetic disk device 20.

第2図はチャネル装置19からの磁気ディスク書込み要
求に伴なうデータ書込み処理を示すフローチャートであ
り、先ず、ステップS1において、チャネル装置19から磁
気ディスクコントローラ18に対し磁気ディスク書込み要
求があると、ステップS2において、ディレクトリ制御部
14は書込み要求に対応するデータがキャッシュ・メモリ
12に存在するか否かを検索し、該キャッシュ・メモリ12
に書込み要求データが存在する場合には、キャッシュ・
ヒット信号を、また、存在しない場合には、キャッシュ
・ミスヒット信号を、それぞれステップS3においてLRU
制御部16に対し出力する。このステップS3において、書
込み要求データがキャッシュ・メモリ12内に存在し、LR
U制御部16に対しキャッシュ・ヒット信号が与えられた
場合には、ステップS4において、LRU制御部16における
置換制御モードが、モード1であるかモード2であるか
が判断される。
FIG. 2 is a flowchart showing a data write process accompanying a magnetic disk write request from the channel device 19. First, in step S1, when there is a magnetic disk write request from the channel device 19 to the magnetic disk controller 18, In step S2, the directory control unit
14 is the cache memory where the data corresponding to the write request is
12 to determine whether it exists in the cache memory 12.
If write request data exists in the cache,
The hit signal, and if not present, the cache miss signal is sent to the LRU in step S3.
Output to the control unit 16. In this step S3, the write request data exists in the cache memory 12, and the LR
When the cache hit signal is given to the U control unit 16, it is determined in step S4 whether the replacement control mode in the LRU control unit 16 is mode 1 or mode 2.

ここで、キャッシュ・メモリ12に対する書込みデータ
が直ぐに読出しデータとして要求されるファイル処理を
行なう場合で、上記モード1が選択された状態では、ス
テップS5において、LRU制御部16は、キャッシュ・メモ
リ12におけるキャッシュ・ヒットしたデータを、最上位
レベルに置換更新させる。
Here, when performing file processing in which write data to the cache memory 12 is immediately requested as read data, and the mode 1 is selected, in step S5, the LRU control unit 16 The cache hit data is replaced and updated to the highest level.

一方、書込要求のみを受けるデータのアクセス頻度が
高いファイル処理を行なう場合で、上記モード2が選択
された状態では、ステップS6において、LRU制御部16
は、キャッシュ・メモリ12におけるキャッシュ・ヒット
したデータを、その格納レベルを変更せずに書込み更新
させる。
On the other hand, when performing file processing in which data receiving only a write request is frequently accessed and the mode 2 is selected, the LRU controller 16
Causes the cache hit data in the cache memory 12 to be written and updated without changing its storage level.

そして、ステップS7において、上記磁気ディスクコン
トローラ18は、上記チャネル装置19から書込み要求の有
ったデータを磁気ディスク装置20に対して書込むことに
なる。
Then, in step S7, the magnetic disk controller 18 writes the data requested to be written from the channel device 19 to the magnetic disk device 20.

すなわち、チャネル装置19からの書込み要求に対しキ
ャッシュ・ヒットした場合、キャッシュ・メモリ12に対
する置換制御モード1では、このキャッシュ・ヒットデ
ータは格納レベルの最上位への置換を受け、また、置換
制御モード2では、このキャッシュ・ヒットデータは格
納レベルの最上位への置換を受けずにそのままの格納レ
ベルで更新されることになる。
That is, when a cache hit occurs in response to a write request from the channel device 19, in the replacement control mode 1 for the cache memory 12, this cache hit data is replaced to the highest storage level. In 2, the cache hit data is updated at the same storage level without being replaced with the highest storage level.

一方、上記ステップS3において、書込み要求データが
キャッシュ・メモリ12内に存在せず、LRU制御部16に対
しキャッシュ・ミスヒット信号が与えられた場合には、
キャッシュ・メモリ12に対するデータ書込みは全く行な
われず、直ちにステップS7に進み、磁気ディスクコント
ローラ18は、上記チャネル装置19から書込み要求の有っ
たデータを磁気ディスク装置20に対してのみ書込むこと
になる。
On the other hand, if the write request data does not exist in the cache memory 12 and a cache mishit signal is given to the LRU control unit 16 in step S3,
No data is written to the cache memory 12 at all, and the process immediately proceeds to step S7, where the magnetic disk controller 18 writes the data requested to be written from the channel device 19 only to the magnetic disk device 20. .

第3図(A)及び(B)はそれぞれキャッシュ・メモ
リ12におけるデータ置換動作を置換制御モード1を選択
した場合と置換制御モード2を選択した場合とで対比し
て示すもので、ここで、キャッシュ・メモリ12はブロッ
ク単位でデータを扱うものとし、[A]〜[G]は、そ
の対応するブロック内のデータが磁気ディスク装置20の
何処のメモリエリアに記憶されているかを示すタグ情報
とする。
FIGS. 3A and 3B show the data replacement operation in the cache memory 12 when the replacement control mode 1 is selected and when the replacement control mode 2 is selected, respectively. The cache memory 12 handles data in units of blocks, and [A] to [G] denote tag information indicating in which memory area the data in the corresponding block is stored in the magnetic disk device 20. I do.

例えばチャネル装置19から磁気ディスクコントローラ
18に対しデータ読出し要求があり、その読出し要求デー
タに対応するタグ情報[D]がキャッシュ・メモリ12内
に存在することにより、ディレクトリ制御部14からLRU
制御部16に対しキャッシュ・ヒット信号が出力される
と、LRU制御部16は上記モード1及びモード2の何れに
おいても該タグ情報[D]に対応するブロックをキャッ
シュ・メモリ12の最上位レベルに置換更新させる。そし
て、このキャッシュ・メモリブロック[D]に記憶され
たデータが磁気ディスクコントローラ18を通してチャネ
ル装置19側に読出されることになる。
For example, from the channel device 19 to the magnetic disk controller
When a data read request is issued to tag 18 and tag information [D] corresponding to the read request data exists in cache memory 12, directory control unit 14 sends LRU
When the cache hit signal is output to the control unit 16, the LRU control unit 16 sets the block corresponding to the tag information [D] to the highest level of the cache memory 12 in both the mode 1 and the mode 2. Replace and update. Then, the data stored in the cache memory block [D] is read out to the channel device 19 through the magnetic disk controller 18.

この場合、キャッシュ・メモリ12からのデータ読出し
を行ない、磁気ディスク装置20からのデータ読出しを行
なわずに済むので、データアクセス時間を短縮すること
ができる。
In this case, since data is read from the cache memory 12 and data is not read from the magnetic disk device 20, the data access time can be reduced.

次に、前記第2図のフローチャートを参照して説明す
ると、チャネル装置19から磁気ディスクコントローラ18
に対しデータ書込み要求があり(ステップS1)、その書
込み要求データに対応するタグ情報[A]がキャッシュ
・メモリ12内に存在することにより(ステップS2)、デ
ィレクトリ制御部14からLRU制御部16に対しキャッシュ
・ヒット信号が出力されると(ステップS3)、LRU制御
部16は該タブ情報[A]に対応するブロックを、モード
1の場合その格納レベルを最上位レベルに置換して更新
させ(ステップS5,S6)、また、モード2の場合その格
納レベルを置換させずに更新させる(ステップS6)。
Next, a description will be given with reference to the flowchart of FIG.
Has been requested (step S1), and the tag information [A] corresponding to the write request data exists in the cache memory 12 (step S2). On the other hand, when the cache hit signal is output (step S3), the LRU control unit 16 updates the block corresponding to the tab information [A] by replacing the storage level thereof with the highest level in mode 1 (step S3). In steps S5 and S6), in the case of mode 2, the storage level is updated without being replaced (step S6).

そして、このキャッシュ・メモリブロック[A]に記
憶されたデータが磁気ディスクコントローラ18を通して
磁気ディスク装置20のメモリエリア[A]に書込まれる
ことになる(ステップS7)。
Then, the data stored in the cache memory block [A] is written to the memory area [A] of the magnetic disk device 20 through the magnetic disk controller 18 (step S7).

ここで、上記置換制御モード1は、書込みデータが直
ぐに読出しデータとして要求されるファイル処理を行な
う場合に選択されるもので、上記ブロックデータ[A]
の書込み処理の場合、読出し処理同様キャッシュ・メモ
リ12における書込み要求データの最上位レベルへの置換
制御を行なうので、その読出し要求時には容易にディス
ク・キャッシュの効果を発揮することができる。また、
上記置換制御モード2は、書込要求のみを受けるデータ
のアクセス頻度が高いファイル処理を行なう場合に選択
されるもので、上記ブロックデータ[A]の書込み処理
の場合、キャッシュ・メモリ12における書込み要求デー
タの最上位レベルへの置換制御は行なわないので、読出
し要求の比率が高い他のデータを下位の格納レベルに先
送りにせずに、キャッシュ・メモリ12を効率良く使用す
ることができる。
Here, the replacement control mode 1 is selected when performing file processing in which write data is immediately required as read data, and the block data [A] is selected.
In the case of the write process, since the replacement control of the write request data in the cache memory 12 to the highest level is performed as in the read process, the effect of the disk cache can be easily exerted at the time of the read request. Also,
The replacement control mode 2 is selected when performing file processing in which data that receives only a write request has a high access frequency. In the case of the write processing of the block data [A], the write control in the cache memory 12 is performed. Since the replacement control of the data to the highest level is not performed, the cache memory 12 can be used efficiently without delaying other data having a high read request ratio to the lower storage level.

次に、チャネル装置19から磁気ディスクコントローラ
18に対しデータ読出し要求があり、その読出し要求デー
タに対応するタグ情報[G]がキャッシュ・メモリ12内
に存在しないことにより、ディレクトリ制御部14からLR
U制御部16に対しキャッシュ・ミスヒット信号が出力さ
れると、LRU制御部16は該タグ情報[G]に対応するブ
ロックを磁気ディスク装置20から転送させキャッシュ・
メモリ12の最上位レベルに書込み更新させる(ステージ
ング)。そして、このキャッシュ・メモリブロック
[G]に記憶されたデータが磁気ディスクコントローラ
18を通してチャネル装置19側に読出されることになる。
Next, from the channel device 19, the magnetic disk controller
Since a data read request is issued to the memory 18 and the tag information [G] corresponding to the read request data does not exist in the cache memory 12, the directory control unit 14
When the cache mishit signal is output to the U control unit 16, the LRU control unit 16 transfers the block corresponding to the tag information [G] from the magnetic disk device 20 and causes the cache
The highest level of the memory 12 is written and updated (staging). The data stored in the cache memory block [G] is stored in the magnetic disk controller.
The data is read out to the channel device 19 through 18.

ここで、上記モード1の設定状態では、前回のブロッ
クデータ[A]の書込み時においてキャッシュ・メモリ
12の最下位レベルに先送りされたブロック[B]が追出
される。この場合、読出し要求を受ける可能性がある高
いアクセス頻度のブロックがキャッシュ・メモリ12の上
位レベルに残され、低いアクセス頻度のブロックが優先
的に追出されるので、読出し頻度の高いデータは勿論、
書込み後直ぐに読出されるデータを多く扱うファイル処
理に対して、最大限のディスク・キャッシュの効果を得
ることができる。
Here, in the setting state of the mode 1, when the previous block data [A] is written, the cache memory
The block [B] advanced to the 12 lowest levels is expelled. In this case, a block with a high access frequency that is likely to receive a read request is left in the upper level of the cache memory 12, and a block with a low access frequency is preferentially evicted.
The maximum disk cache effect can be obtained for file processing that handles a large amount of data that is read immediately after writing.

また、上記モード2の設定状態では、前回のブロック
データ[A]の書込み時において最下位レベルのまま更
新された該ブロック[A]が追出される。この場合、読
出し頻度の高いブロックがキャッシュ・メモリ12の上位
レベルに優先的に残され、書込み要求ばかりを受けるブ
ロックが優先的に追出されるので、読出し頻度の高いデ
ータは勿論、書込要求のみを受けるデータのアクセス頻
度が高いファイル処理に対して、最大限のディスク・キ
ャッシュの効果を得ることができる。
In the setting state of the mode 2, the block [A] updated at the lowest level when the previous block data [A] is written is expelled. In this case, blocks with high read frequency are preferentially left in the upper level of the cache memory 12, and blocks that receive only write requests are preferentially evicted. The maximum disk cache effect can be obtained for file processing in which the frequency of access to the received data is high.

第4図はキャッシュ・メモリ内のブロック(a)とブ
ロック(b)に対するアクセスパターンの一例を示すも
ので、置換制御モード1を選択した場合のディスク・キ
ャッシュ装置では、書込みデータでも直ぐに読出しアク
セスを受ければディスク・キャッシュの効果が得られる
アクセス頻度の高いブロック(a)がキャッシュ・メモ
リの上位に位置することになる。
FIG. 4 shows an example of an access pattern for the block (a) and the block (b) in the cache memory. In the disk cache device when the replacement control mode 1 is selected, read access is immediately performed even with write data. If received, the block (a) with a high access frequency at which the effect of the disk cache can be obtained is located at the upper level of the cache memory.

また、置換制御モード2を選択した場合のディスク・
キャッシュ装置では、書込み要求により頻繁にキャッシ
ュ・ヒットしたブロック(a)がキャッシュ・メモリの
上位レベルに位置することがないので、時々読出し要求
を受けるブロック(b)が追出される恐れはなく、全体
的なアクセス回数は少なくてもブロック(b)の読出し
要求時には確実にディスク・キャッシュの効果を発揮す
ることができる。
In addition, when the replacement control mode 2 is selected,
In the cache device, the block (a) that is frequently hit by the write request is not located at the upper level of the cache memory, so that the block (b) that receives the read request from time to time is not expelled. Even if the number of times of access is small, the effect of the disk cache can be surely exerted at the time of a read request for block (b).

したがって、上記のようにしたディスク・キャッシュ
制御方式によれば、例えば書込みデータが直ぐに読出し
データとして要求されるファイル処理を行なう場合に
は、置換制御モード1を選択することで、読出し及び書
込み共にアクセス頻度の高いデータがキャッシュ・メモ
リの上位レベルに存在することになり、高いキャッシュ
の効果を得ることができる。また、書込要求のみを受け
るデータのアクセス頻度が高いファイル処理を行なう場
合には、置換モード2を選択することで、キャッシュ・
メモリ12における書込み要求データの最上位レベルへの
置換制御は行なわないので、読出し要求の比率が高いデ
ータを下位の格納レベルに先送りせずに、キャッシュ・
メモリ12を効率良く使用することができ、高いキャッシ
ュの効果を得ることができる。
Therefore, according to the disk cache control method as described above, for example, when performing file processing in which write data is immediately required as read data, by selecting the replacement control mode 1, both read and write access can be performed. Frequent data exists in the upper level of the cache memory, and the effect of high cache can be obtained. Also, when performing file processing in which data that receives only a write request is accessed frequently, selecting the replacement mode 2 enables
Since the replacement control of the write request data in the memory 12 to the highest level is not performed, data having a high ratio of read requests is not postponed to the lower storage level, and the cache
The memory 12 can be used efficiently, and a high cache effect can be obtained.

[発明の効果] 以上のように本発明によれば、ライトスルー方式のデ
ィスク・キャッシュ装置におけるキャッシュ・メモリの
データの読出し又は書込みを制御するもので、磁気ディ
スク装置と、この磁気ディスク装置に記憶されているデ
ータの一部を記憶するキャッシュ・メモリと、このキャ
ッシュ・メモリに記憶される複数のデータの格納順位を
置換するデータ置換手段と、データの読出し又は書込み
要求時に該要求されたデータが上記キャッシュ・メモリ
に存在するか否かを検索するキャッシュ・データ検索手
段と、上記データ読出し要求時に該読出し要求されたデ
ータが上記キャッシュ・データ検索手段により上記キャ
ッシュ・メモリに存在することが検索された場合には、
該読出し要求されたデータの格納順位を最上位位置に置
換して読出し、該読出し要求されたデータが上記キャッ
シュ・メモリに存在しないことが検索された場合には、
該読出し要求されたデータを上記磁気ディスク装置から
上記キャッシュ・メモリに転送格納すると共に格納順位
を最上位にして読出し、これに伴ない、上記キャッシュ
・メモリに空きがない場合には格納順位が最下位にある
データを上記キャッシュ・メモリから追出すデータ読出
し手段と、上記データ書込み要求時に該書込み要求され
たデータが上記キャッシュ・データ検索手段により上記
キャッシュ・メモリに存在することが検索された場合に
は、該書込み要求されたデータの格納順位を最上位位置
に置換し、該書込み要求されたデータが上記キャッシュ
・メモリに存在しないことが検索された場合には、該書
込み要求されたデータを上記キャッシュ・メモリには格
納せずに上記磁気ディスク装置に書込む第1のデータ書
込み手段と、上記データ書込み要求時に該書込み要求さ
れたデータが上記キャッシュ・データ検索手段により上
記キャッシュ・メモリに存在することが検索された場合
には、該書込み要求されたデータの格納順位を同順位位
置に保持し、該書込み要求されたデータが上記キャッシ
ュ・メモリに存在しないことが検索された場合には、該
書込み要求されたデータを上記キャッシュ・メモリには
格納せずに上記磁気ディスク装置に書込む第2のデータ
書込み手段と、上記第1のデータ書込み手段と上記第2
のデータ書込み手段とをデータファイルの属性に応じて
選択する書込みモード選択手段とを備えて構成したの
で、書込みデータが直ぐに読出しデータとして要求され
るファイル処理を行なう場合、及び書込要求のみを受け
るデータのアクセス頻度が高いファイル処理を行なう場
合の何れのファイル処理においても、常に、読出し要求
の比率が高いデータが優先的にキャッシュ・メモリの上
位に残されることになり、最大限のディスク・キャッシ
ュ効果を得ることが可能になる。
[Effects of the Invention] As described above, according to the present invention, the reading or writing of data in a cache memory in a write-through type disk cache device is controlled, and the magnetic disk device and the storage in the magnetic disk device are controlled. Memory for storing a part of the data stored in the cache memory, data replacement means for replacing the storage order of a plurality of data stored in the cache memory, and data requested at the time of a data read or write request. Cache data search means for searching whether or not the data exists in the cache memory; and when the data read request, the cache data search means searches for the presence of the data requested in the cache memory. If
When the storage order of the read-requested data is replaced with the highest position and read, and it is found that the read-requested data does not exist in the cache memory,
The read-requested data is transferred from the magnetic disk device to the cache memory and stored in the cache memory, and is read out with the highest storage order. If there is no free space in the cache memory, the storage order is highest. Data reading means for expelling lower-order data from the cache memory; and when the data requested to be written is found by the cache data search means to be present in the cache memory at the time of the data write request. Replaces the storage order of the write-requested data with the highest position, and if it is found that the write-requested data does not exist in the cache memory, replaces the write-requested data with the above-described data. First data writing means for writing to the magnetic disk device without storing the data in the cache memory; When the cache data search means finds that the requested data exists in the cache memory at the time of the data write request, the storage order of the write requested data is held at the same position. If it is found that the write-requested data does not exist in the cache memory, the write-requested data is not stored in the cache memory but is written to the magnetic disk device. 2 data writing means, the first data writing means, and the second data writing means.
And a write mode selecting means for selecting the data writing means in accordance with the attribute of the data file. Therefore, when performing file processing in which write data is immediately required as read data, and receiving only a write request In any file processing in the case of performing file processing in which data access frequency is high, data having a high read request ratio is always preferentially left in the upper part of the cache memory. The effect can be obtained.

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

第1図は本発明の一実施例に係わるディスク・キャッシ
ュ制御方式が適用されるディスク・キャッシュ装置とそ
の周辺構成を示すブロック図、第2図は上記ディスク・
キャッシュ制御方式に基づくデータ書込み処理を示すフ
ローチャート、第3図(A)及び(B)はそれぞれ上記
ディスク・キャッシュ制御方式に基づくキャッシュ・メ
モリにおけるデータ置換動作を置換制御モード1を選択
した場合と置換制御モード2を選択した場合とで対比し
て示す図、第4図はキャッシュ・メモリ内のブロック
(a)とブロック(b)に対するアクセスパターンの一
例を示す図である。 11……ディスク・キャッシュ装置、12……キャッシュ・
メモリ、13……ディレクトリ管理テーブル、14……ディ
レクトリ制御部、15……LRU情報管理テーブル、16……R
LU制御部、17……バスライン、18……磁気ディスクコン
トローラ、19……チャネル装置、20……磁気ディスク装
置。
FIG. 1 is a block diagram showing a disk cache device to which a disk cache control method according to one embodiment of the present invention is applied and its peripheral configuration. FIG.
FIGS. 3A and 3B are flow charts showing data write processing based on the cache control method, and FIGS. 3A and 3B show the data replacement operation in the cache memory based on the disk cache control method as compared with the case where the replacement control mode 1 is selected. FIG. 4 is a diagram showing an example of an access pattern for the block (a) and the block (b) in the cache memory in comparison with the case where the control mode 2 is selected. 11 ... Disk cache device, 12 ... Cache
Memory, 13 directory management table, 14 directory control unit, 15 LRU information management table, 16 R
LU control unit, 17 bus line, 18 magnetic disk controller, 19 channel device, 20 magnetic disk device.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ライトスルー方式のディスク・キャッシュ
装置におけるキャッシュ・メモリのデータの読出し又は
書込みを制御するディスク・キャッシュ制御方式におい
て、 磁気ディスク装置と、 この磁気ディスク装置に記憶されているデータの一部を
記憶するキャッシュ・メモリと、 このキャッシュ・メモリに記憶される複数のデータの格
納順位を置換するデータ置換手段と、 データの読出し又は書込み要求時に該要求されたデータ
が上記キャッシュ・メモリに存在するか否かを検索する
キャッシュ・データ検索手段と、 上記データ読出し要求時に該読出し要求されたデータが
上記キャッシュ・データ検索手段により上記キャッシュ
・メモリに存在することが検索された場合には、該読出
し要求されたデータの格納順位を最上位位置に置換して
読出し、該読出し要求されたデータが上記キャッシュ・
メモリに存在しないことが検索された場合には、該読出
し要求されたデータを上記磁気ディスク装置から上記キ
ャッシュ・メモリに転送格納すると共に格納順位を最上
位にして読出し、これに伴ない、上記キャッシュ・メモ
リに空きがない場合には格納順位が最下位にあるデータ
を上記キャッシュ・メモリから追出すデータ読出し手段
と、 上記データ書込み要求時に該書込み要求されたデータが
上記キャッシュ・データ検索手段により上記キャッシュ
・メモリに存在することが検索された場合には、該書込
み要求されたデータの格納順位を最上位位置に置換し、
該書込み要求されたデータが上記キャッシュ・メモリに
存在しないことが検索された場合には、該書込み要求さ
れたデータを上記キャッシュ・メモリには格納せずに上
記磁気ディスク装置に書込む第1のデータ書込み手段
と、 上記データ書込み要求時に該書込み要求されたデータが
上記キャッシュ・データ検索手段により上記キャッシュ
・メモリに存在することが検索された場合には、該書込
み要求されたデータの格納順位を同順位位置に保持し、
該書込み要求されたデータが上記キャッシュ・メモリに
存在しないことが検索された場合には、該書込み要求さ
れたデータを上記キャッシュ・メモリには格納せずに上
記磁気ディスク装置に書込む第2のデータ書込み手段
と、 上記第1のデータ書込み手段と上記第2のデータ書込み
手段とをデータファイルの属性に応じて選択する書込み
モード選択手段と、 を具備したことを特徴とするディスク・キャッシュ制御
方式。
In a disk cache control method for controlling reading or writing of data in a cache memory in a write-through type disk cache device, a magnetic disk device and one of data stored in the magnetic disk device are provided. A data storage unit for replacing the storage order of a plurality of data stored in the cache memory; and the requested data is present in the cache memory at the time of a data read or write request. A cache data search means for searching whether or not to perform the data read request, when the data requested to be read is found in the cache memory by the cache data search means at the time of the data read request, The storage order of the data requested to be read is placed at the highest position. To read, said read requested data is above mentioned cache
If it is found that the data does not exist in the memory, the read-requested data is transferred from the magnetic disk device to the cache memory and stored, and is read out with the highest storage order. Data reading means for expelling the data having the lowest storage order from the cache memory when there is no free space in the cache memory, and the data requested to be written at the time of the data write request by the cache data search means. If it is found that the data exists in the cache memory, the storage order of the data requested to be written is replaced with the highest position,
When it is found that the data requested to be written does not exist in the cache memory, the first data to be written to the magnetic disk device without storing the data requested to be written in the cache memory is stored. Data writing means, when the data requested to be written is found to be present in the cache memory by the cache data searching means at the time of the data writing request, the storage order of the data requested to be written is changed. Hold in the same position,
If it is found that the write-requested data does not exist in the cache memory, a second step of writing the write-requested data to the magnetic disk device without storing the data in the cache memory is performed. A disk cache control system comprising: a data write unit; and a write mode selection unit that selects the first data write unit and the second data write unit according to an attribute of a data file. .
JP2106378A 1990-04-24 1990-04-24 Disk cache control method Expired - Lifetime JP2854667B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2106378A JP2854667B2 (en) 1990-04-24 1990-04-24 Disk cache control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2106378A JP2854667B2 (en) 1990-04-24 1990-04-24 Disk cache control method

Publications (2)

Publication Number Publication Date
JPH045739A JPH045739A (en) 1992-01-09
JP2854667B2 true JP2854667B2 (en) 1999-02-03

Family

ID=14432055

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2106378A Expired - Lifetime JP2854667B2 (en) 1990-04-24 1990-04-24 Disk cache control method

Country Status (1)

Country Link
JP (1) JP2854667B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7035860B2 (en) 2003-01-17 2006-04-25 International Business Machines Corporation Trusted access by an extendible framework method, system, article of manufacture, and computer program product
US10877675B2 (en) * 2019-02-15 2020-12-29 Sap Se Locking based on categorical memory allocation

Also Published As

Publication number Publication date
JPH045739A (en) 1992-01-09

Similar Documents

Publication Publication Date Title
EP0077453B1 (en) Storage subsystems with arrangements for limiting data occupancy in caches thereof
US6216199B1 (en) Hardware mechanism for managing cache structures in a data storage system
US6615318B2 (en) Cache management system with multiple cache lists employing roving removal and priority-based addition of cache entries
US5717893A (en) Method for managing a cache hierarchy having a least recently used (LRU) global cache and a plurality of LRU destaging local caches containing counterpart datatype partitions
JP2637290B2 (en) System and method for dynamically controlling cache management
US5418929A (en) Controller for storage unit and method of controlling storage unit
JPH0458051B2 (en)
JPH1063578A (en) Information recording and reproducing device
US7032093B1 (en) On-demand allocation of physical storage for virtual volumes using a zero logical disk
US5694570A (en) Method and system of buffering data written to direct access storage devices in data processing systems
JPH04259048A (en) Pre-read data control system using statistic information
JP2854667B2 (en) Disk cache control method
JP2854668B2 (en) Disk cache control method
JPH0773107A (en) Control method for disk system
EP0665499A2 (en) Hierarchic data storage system
JPH08137753A (en) Disk cache device
JP3083530B2 (en) Cache memory data management method and cache control device
JP2912657B2 (en) File access processor
JPH01131940A (en) Disk cache controller
JP2000047941A (en) Disk cache controller
JPH0436847A (en) Method for selecting data transfer path
JPH04288647A (en) Substitution controller for cache memory
JPH07334425A (en) Disk cache control system
JPH0612328A (en) Method for storing data in cache memory
JPH0262643A (en) Cache control system and information processing system