JPH0776941B2 - Data prefetch control method - Google Patents

Data prefetch control method

Info

Publication number
JPH0776941B2
JPH0776941B2 JP1240348A JP24034889A JPH0776941B2 JP H0776941 B2 JPH0776941 B2 JP H0776941B2 JP 1240348 A JP1240348 A JP 1240348A JP 24034889 A JP24034889 A JP 24034889A JP H0776941 B2 JPH0776941 B2 JP H0776941B2
Authority
JP
Japan
Prior art keywords
read request
data
read
access
stored
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP1240348A
Other languages
Japanese (ja)
Other versions
JPH03102443A (en
Inventor
裕樹 高嶋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1240348A priority Critical patent/JPH0776941B2/en
Publication of JPH03102443A publication Critical patent/JPH03102443A/en
Publication of JPH0776941B2 publication Critical patent/JPH0776941B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔概要〕 外部記憶装置からデータを先読みしてメモリに格納する
データ先読み制御方式に関し、 アクセス形態を検出して先読みが不要/必要となったと
きに先読みを中止/開始し、データの読み性能を向上さ
せると共にメモリの効率的な使用を行うことを目的と
し、 アクセス元からのリード要求に対応して、このリード要
求に続く先読みデータを外部記憶装置から読み出して格
納するキャッシュバッファと、アクセス元からのリード
要求のあったアドレスを記憶するファイルポインタとを
備え、アクセス元からのリード要求が上記キャッシュバ
ッファに格納されていない状態が連続して所定回数を越
えないとき(あるいはリード要求のあったアドレスが上
記ファイルポインタに記憶されているアドレスに連続す
るとき)にシーケンシャンアクセスと判定して先読みを
行い(あるいは先読みを再開し)、一方、リード要求が
上記キャッシュバッファに格納されていない状態が連続
して所定回数を越えたときにランダムアクセスと判定し
て先読みを停止するように構成する。
DETAILED DESCRIPTION [Overview] Regarding a data prefetch control method of prefetching data from an external storage device and storing it in a memory, the prefetch is stopped / started when the access mode is detected and the prefetch is unnecessary / necessary. In response to a read request from the access source, the read-ahead data following this read request is read from the external storage device and stored in order to improve the data reading performance and to use the memory efficiently. A cache buffer and a file pointer for storing an address for which a read request from the access source is stored, and when the read request from the access source is not stored in the cache buffer and does not exceed a predetermined number of times continuously ( Or when the read-requested address continues to the address stored in the above file pointer ) Is determined as sequential access, and prefetching is performed (or prefetching is restarted), while when the number of read requests that are not stored in the cache buffer exceeds the prescribed number of times in succession, random access is determined. Read-ahead to stop prefetching.

〔産業上の利用分野〕[Industrial application field]

本発明は、外部記憶装置からデータを先読みしてメモリ
に格納するデータ先読み制御方式に関するものである。
外部記憶装置のファイルからデータを先読みしてキャッ
シュバッファに格納する際に、必要なとき(シーケンシ
ャルアクセス時)のみ先読みを行うことが望まれてい
る。
The present invention relates to a data prefetch control system for prefetching data from an external storage device and storing it in a memory.
When prefetching data from a file of an external storage device and storing it in a cache buffer, it is desired to perform prefetching only when necessary (during sequential access).

〔従来の技術と発明が解決しようとする課題〕[Problems to be Solved by Conventional Techniques and Inventions]

従来、ディスク装置などのファイルからデータを先読み
してキャッシュバッファに格納するか否かの判定は、フ
ァイルの使用開始時(オープン時)にアクセス状態(例
えばシーケンシャルアクセスあるいはランダムアクセス
などの形態)を指定し、シーケンシャルアクセスが指定
されたときに先読みを行うようにしていた。
Conventionally, the determination of whether to prefetch data from a file such as a disk device and store it in the cache buffer specifies the access state (for example, sequential access or random access) at the start of use (opening) of the file. However, prefetching is performed when sequential access is specified.

しかし、オープン時にアクセス形態が指定されない場
合、判定ができないために無条件に先読みを行い、途中
でランダムアクセスに変わっ先読みが不要となっても無
用な先読みを続けてしまい、先読みの効率が良くないと
共にキャッシュバッファを非効率に使用してしまうとい
う問題があった。
However, if the access mode is not specified at the time of opening, pre-reading is unconditionally performed because the determination cannot be made, and even if the pre-reading is changed to random access in the middle and unnecessary pre-reading is continued, the pre-reading is not efficient. In addition, there is a problem that the cache buffer is used inefficiently.

本発明は、アクセス形態を検出して先読みが不要/必要
となったときに先読みを中止/開始し、データの先読み
性能を向上させると共にメモリの効率的な使用を行うこ
とを目的としている。
An object of the present invention is to stop / start the prefetch when the access mode is detected and the prefetch is unnecessary / necessary, improve the data prefetch performance, and efficiently use the memory.

〔課題を解決する手段〕[Means for solving the problem]

第1図を参照して課題を解決する手段を説明する。 Means for solving the problems will be described with reference to FIG.

第1図において、キャッシュバッファ1は、アクセス元
からのリード要求に対応して、このリード要求に続く先
読みデータを外部記憶装置7から読み出して格納するも
のである。
In FIG. 1, the cache buffer 1 reads the read-ahead data following the read request from the external storage device 7 and stores the read-ahead data in response to the read request from the access source.

ファイルポインタ4は、リード要求のあったアドレスを
記憶するものである。
The file pointer 4 stores the address of the read request.

〔作用〕[Action]

本発明は、第1図に示すように、キャッシュバッファ1
およびファイルポインタ4を設け、アクセス元からのリ
ード要求がキャッシュバッファ1に格納されていない状
態が連続して所定回数を越えないとき(あるいはリード
要求のあったアドレスがファイルポインタ4に記憶され
ているアドレスに連続するとき)にシーケンシャンアク
セスと判定して先読みを行い(あるいは先読みを再開
し)、一方、リード要求がキャッシュバッファ1に格納
されていない状態が連続して所定回数を越えたときにラ
ンダムアクセスと判定して先読みを停止するようにして
いる。
The present invention, as shown in FIG.
And a file pointer 4 are provided, and when the read request from the access source is not stored in the cache buffer 1 continuously for a predetermined number of times (or the address for which the read request is made is stored in the file pointer 4). When it is determined that the access is sequential, the prefetch is performed (or the prefetch is restarted). On the other hand, when the read request is not stored in the cache buffer 1 for a certain number of times continuously, It is determined that the access is random and the prefetch is stopped.

従って、アクセス形態を検出してシーケンシャルアクセ
スのときに先読みを行い、ランダムアクセスのときに先
読みを停止することにより、データの先読み性能を向上
させると共にメモリの使用効率を向上させることが可能
となる。
Therefore, it is possible to improve the data read-ahead performance and the memory usage efficiency by detecting the access form and performing the read-ahead at the time of sequential access and stopping the read-ahead at the time of random access.

〔実施例〕〔Example〕

次に、第1図から第3図を用いて本発明の1実施例の構
成および動作を順次詳細に説明する。
Next, the configuration and operation of one embodiment of the present invention will be sequentially described in detail with reference to FIGS. 1 to 3.

第1図において、メモリ5は、CPU6と、外部記憶装置7
との間に位置する先読み装置内のメモリである。このメ
モリ5には、外部記憶装置7から先読みしたデータを格
納するキャッシュバッファ1、このキャッシュバッファ
1に格納したデータを管理する情報を格納するキャッシ
ュバッファ管理部2、CPU6(アクセス元)からリード要
求されたデータがキャッシュバッファ1に連続して存在
しない回数を計数するカウンタ3、およびリード要求の
あったファイル内の相対位置(オフセットアドレス)を
格納するファイルポインタ4などが設けられている。
In FIG. 1, the memory 5 includes a CPU 6 and an external storage device 7.
It is a memory in the prefetching device located between and. In this memory 5, a cache buffer 1 for storing data prefetched from the external storage device 7, a cache buffer management unit 2 for storing information for managing the data stored in the cache buffer 1, a read request from the CPU 6 (access source) There are provided a counter 3 for counting the number of times that the generated data does not continuously exist in the cache buffer 1 and a file pointer 4 for storing a relative position (offset address) in the file for which a read request has been made.

第2図を用いて第1図構成の具体例を説明する。ここ
で、現在のキャッシュバッファ1の状態として、図示の
ようにレコード1ないしレコード10が外部記憶装置7か
ら読み込まれて格納されている。
A specific example of the configuration shown in FIG. 1 will be described with reference to FIG. Here, as the current state of the cache buffer 1, records 1 to 10 are read from the external storage device 7 and stored as shown in the figure.

:レコード20のread要求がある。: There is a read request for record 20.

:のread要求について、キャッシュバッファ1内に
存在しないので、カウンタ3を“1"にすると共に、この
read要求のあったレコード20をファイルポインタ4に記
憶する。
: The read request of: does not exist in the cache buffer 1, so the counter 3 is set to “1” and
The record 20 requested to be read is stored in the file pointer 4.

:レコード30のread要求がある。: There is a read request for record 30.

:のread要求について、キャッシュバッファ1内に
存在しないので、カウンタ3が“2"となったのでランダ
ムアクセスと判定し、先読みを停止すると共に、このre
ad要求のあったレコード30をファイルポインタ4に記憶
する。
For the read request of :, since it does not exist in the cache buffer 1, the counter 3 becomes “2”, so it is determined to be random access, the prefetch is stopped, and this re
The record 30 for which an ad request is made is stored in the file pointer 4.

:レコード31のread要求がある。ファイルポインタ4
に記憶されている直前のリード要求がレコード“30"で
あり、現在のリード要求がレコード“31"であり、連続
するデータの読み込みであるのでシーケンシャルアクセ
スと判定し、先読みを再開する。
: There is a read request for record 31. File pointer 4
Since the immediately preceding read request stored in the record is record “30”, the current read request is record “31”, and continuous data is read, it is determined to be sequential access, and prefetch is restarted.

以上のように、リード要求のあったレコードについてキ
ャッシュバッファ1内にデータが存在しないことが連続
して所定回数(ここでは2回)を越えたときにランダム
アクセスと判定して先読みを停止し、一方、データが存
在しないことが連続して所定回数(ここでは2回)を越
えないときおよびリード要求が直前のリード要求のレコ
ードに連続するときにシーケンシャルアクセスと判定し
て先読みを行い/再開することにより、データの先読み
性能を向上させることが可能となる。
As described above, when there is no data in the cache buffer 1 for a record for which a read request has been made, the random access is determined and the prefetch is stopped when the number of times exceeds a predetermined number of times (here, twice). On the other hand, when the absence of data does not exceed the predetermined number of times (here, twice) and when the read request continues to the record of the immediately preceding read request, it is determined as sequential access and prefetching / restart is performed. As a result, the data read-ahead performance can be improved.

第3図は、本発明の動作説明フローチャートを示す。FIG. 3 shows a flowchart for explaining the operation of the present invention.

第3図において、は、初期状態である。例えば第2図
キャッシュバッファの状態である。
In FIG. 3, is the initial state. For example, this is the state of the cache buffer shown in FIG.

は、先読み状態である。これは、最初はシーケンシャ
ルアクセスとみなして先読み状態に設定し、外部記憶装
置7から先読みしたデータをキャッシュバッファ1に格
納する。
Is a prefetch state. At first, this is regarded as a sequential access and is set in a prefetch state, and prefetched data from the external storage device 7 is stored in the cache buffer 1.

は、リード要求されたレコードがキャッシュバッファ
1にありか否かを判別する。YESの場合には、を行
う。NOの場合には、キャッシュバッファ1にリード要求
のあったデータが存在しなかったので、カウンタをイン
クリメントし、を行う。
Determines whether the read-requested record is in the cache buffer 1. If yes, do. In the case of NO, since there is no read-requested data in the cache buffer 1, the counter is incremented and is performed.

は、カウンタが2か否かを判別する。YESの場合(リ
ード要求のあったデータが連続してキャッシュバッファ
1に2回、存在しなかった場合)には、ランダムアクセ
スと判定し、で先読み停止状態とし、を行う。NOの
場合には、シーケンシャルアクセスと判定し、を実行
する。
Determines whether the counter is 2. In the case of YES (when the data for which the read request has been made does not exist twice in the cache buffer 1 in succession), it is determined to be random access, and the pre-reading stop state is executed. In the case of NO, it is judged as sequential access and is executed.

は、ファイルポインタ4が直前のリード要求から連続
しているか否かを判別する。これは、現在のリード要求
のあったレコードが、ファイルポインタ4に格納されて
いる直前のリード要求のあったレコードから連続してい
るか否かを判別する。YESの場合には、シーケンシャル
アクセスと判定し、で先読み状態に設定して先読みを
再開する。NOの場合にはで先読み停止状態を継続す
る。
Determines whether the file pointer 4 is continuous from the immediately preceding read request. This determines whether or not the record for which the current read request has been issued is continuous from the record for which there was a previous read request stored in the file pointer 4. In the case of YES, it is determined to be sequential access, and the pre-reading state is set by and the pre-reading is restarted. In the case of NO, the prefetch stop state is continued with.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明によれば、アクセス形態を
検出してシーケンシャルアクセスのときに先読みを行
い、ランダムアクセスのときに先読みを停止する構成を
採用しているため、データの先読み性能を向上させるこ
とができると共に、メモリを効率的に使用することがで
きる。
As described above, according to the present invention, since the prefetching is performed when the access mode is detected and the sequential access is performed, and the prefetching is stopped when the random access is performed, the data prefetching performance is improved. The memory can be used efficiently.

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

第1図は本発明の原理構成図、第2図は本発明の具体例
説明図、第3図は本発明の動作説明フローチャートを示
す。 図中、1はキャッシュバッファ、2はキャッシュバッフ
ァ管理部、3はカウンタ、4はファイルポインタ、6は
アクセス元のCPU、7は外部記憶装置を表す。
FIG. 1 is a block diagram showing the principle of the present invention, FIG. 2 is an explanatory view of a concrete example of the present invention, and FIG. 3 is a flowchart for explaining the operation of the present invention. In the figure, 1 is a cache buffer, 2 is a cache buffer management unit, 3 is a counter, 4 is a file pointer, 6 is an access source CPU, and 7 is an external storage device.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】外部記憶装置からデータを先読みしてメモ
リに格納するデータ先読み制御方式において、 アクセス元からのリード要求に対応して、このリード要
求に続く先読みデータを外部記憶装置から読み出して格
納するキャッシュバッファ(1)と、 アクセス元からのリード要求のあったアドレスを記憶す
るファイルポインタ(4)とを備え、 アクセス元からのリード要求が上記キャッシュバッファ
(1)に格納されていない状態が連続して所定回数を越
えないとき(あるいはリード要求のあったアドレスが上
記ファイルポインタ(4)に記憶されているアドレスに
連続するとき)にシーケンシャンアクセスと判定して先
読みを行い(あるいは先読みを再開し)、一方、リード
要求が上記キャッシュバッファ(1)に格納されていな
い状態が連続して所定回数を越えたときにランダムアク
セスと判定して先読みを停止するように構成したことを
特徴とするデータ先読み制御方式。
1. A data pre-reading control system for pre-reading data from an external storage device and storing it in a memory, in response to a read request from an access source, pre-read data following this read request is read from the external storage device and stored. And a file pointer (4) for storing an address for which a read request is issued from the access source, and a read request from the access source is not stored in the cache buffer (1). When the number of consecutive times does not exceed the predetermined number (or when the read request address continues to the address stored in the file pointer (4)), it is determined as sequential access and prefetching is performed (or prefetching is performed). However, the read request is not stored in the cache buffer (1). There data prefetch control method characterized by being configured to stop prefetching determines that the random access when a exceeds a predetermined number of times in succession.
JP1240348A 1989-09-16 1989-09-16 Data prefetch control method Expired - Fee Related JPH0776941B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1240348A JPH0776941B2 (en) 1989-09-16 1989-09-16 Data prefetch control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1240348A JPH0776941B2 (en) 1989-09-16 1989-09-16 Data prefetch control method

Publications (2)

Publication Number Publication Date
JPH03102443A JPH03102443A (en) 1991-04-26
JPH0776941B2 true JPH0776941B2 (en) 1995-08-16

Family

ID=17058150

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1240348A Expired - Fee Related JPH0776941B2 (en) 1989-09-16 1989-09-16 Data prefetch control method

Country Status (1)

Country Link
JP (1) JPH0776941B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3516963B2 (en) * 1993-03-12 2004-04-05 株式会社東芝 Memory access control device
JP2001109663A (en) * 1999-10-06 2001-04-20 Alps Electric Co Ltd System and method for controlling disk
JP2012133416A (en) * 2010-12-17 2012-07-12 Toshiba Corp Memory system
US10242053B2 (en) 2013-08-29 2019-03-26 Hitachi, Ltd. Computer and data read method

Also Published As

Publication number Publication date
JPH03102443A (en) 1991-04-26

Similar Documents

Publication Publication Date Title
US7383392B2 (en) Performing read-ahead operation for a direct input/output request
EP0080875B1 (en) Data storage system for a host computer
JP3183993B2 (en) Disk control system
JP2531907B2 (en) Buffer memory management method and device for permitting division
JPH03164840A (en) Method and system for optimizing data caching in disk-base computer system
US7000077B2 (en) Device/host coordinated prefetching storage system
JPH0776941B2 (en) Data prefetch control method
JPH0328947A (en) Peripheral controller
JPH04259048A (en) Pre-read data control system using statistic information
JPH11212733A (en) External storage system
JPH0944315A (en) Memory device and its method
JPH0415493B2 (en)
JP3710351B2 (en) Data processing device
JPH045723A (en) Disk device
JPH01303547A (en) Control system for information memory
JP2002182978A5 (en)
JPH04199444A (en) File controller
JPH04340637A (en) Cache control system
JPH06342401A (en) Secondary memory controller
JP2000347810A (en) File device
JP3057883B2 (en) File reference method
JP2005166073A (en) Control device and control method of storage device
JPH0520188A (en) Cache controller
JPS6125168B2 (en)
JP3491335B2 (en) Information transfer device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees