JPS60221853A - Swapping method of computer operating system - Google Patents

Swapping method of computer operating system

Info

Publication number
JPS60221853A
JPS60221853A JP59076640A JP7664084A JPS60221853A JP S60221853 A JPS60221853 A JP S60221853A JP 59076640 A JP59076640 A JP 59076640A JP 7664084 A JP7664084 A JP 7664084A JP S60221853 A JPS60221853 A JP S60221853A
Authority
JP
Japan
Prior art keywords
swap
unit
swapper
swapped
swapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP59076640A
Other languages
Japanese (ja)
Inventor
Eiji Takasaki
高崎 英治
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP59076640A priority Critical patent/JPS60221853A/en
Publication of JPS60221853A publication Critical patent/JPS60221853A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To decrease the number of times of swap-in as small as possible when a control has reached the process again, by leaving a swap unit executed at the time of swap-out, without swapping out said unit to the end. CONSTITUTION:For instance, a swap unit A3 of a process P1 of a main storage process 4 is swapped out in a secondary storage device 1. Also, in case a restart address of the process P1 exists in a swap unit A1, a managing program 2 restarts the execution of the process P1 through a swapper 3, in a state that the swap unit A3 remains swapped out. Subsequently, the swapper 3 selects a process P2, and in case its executing address is in a swap unit B1, the swapper 3 selects a part of a unit B3 separated most distantly from the unit B1, and it is swapped out to the device 1. In such a case, the program 2 commands swap-in of the process P1 again to the swapper 3, and if a dead area required for a process 4 cannot be secured, a part of the units B2, B1 is selected.

Description

【発明の詳細な説明】 [発明の技術分野1 本発明は、コンビよ−ター・オペレーティング・システ
ムのスワツピング方法に関し、特にデマンド・ページン
グのr11能を備えたスワツピング方法に聞するもので
ある。
TECHNICAL FIELD OF THE INVENTION The present invention relates to a swapping method for a computer operating system, and more particularly to a swapping method with demand paging R11 capability.

[従来技術j 従来、この種のスワツピング方法としては第1図に示す
ものがあった。図において、1はオペレーティング・シ
ステムの実行[プロセス]のイメージを保存する二次記
憶装置、2は複数個ある実行プロセスを制御する管理プ
ログラム、3はスワツパ−5そして4は主記憶装置内の
プロセスである。
[Prior Art j] Conventionally, there has been a swapping method of this type as shown in FIG. In the figure, 1 is a secondary storage device that stores the image of the operating system execution [process], 2 is a management program that controls multiple execution processes, 3 is a swapper 5, and 4 is a process in the main storage device. It is.

スワツパ−3は、二次記憶装置1から主記憶装置プロセ
ス4への実行イメージの読み込み、及び主記憶装置プロ
セス4から二次記憶装置1への実行イメージの書き込み
を制御するスワップ・イン/アウト制御プログラムであ
り、主記憶装置プロセス4は、ある時期にスワツピング
の対象となったプロセスを示し、Plがスワツピング・
インすべきプロセス、1」2がスワップ・アウトされる
べきプロセス、A1及びA2はプロセスP1の1個のス
ワップ単位、そしてB1−84はそれぞれプロセスP2
の1個のスワップ単位を示す。
The swapper 3 is a swap in/out control that controls reading of an execution image from the secondary storage device 1 to the main storage device process 4 and writing of an execution image from the main storage device process 4 to the secondary storage device 1. program, main memory process 4 indicates a process that was swapped at a certain time, and Pl is a swapping target process.
1" 2 is the process to be swapped out, A1 and A2 are one swap unit of process P1, and B1-84 are each of process P2.
represents one swap unit.

次に、f51図に示されたコンピューター・オぺレーテ
ィング・システムのスワツピング動作について説明する
Next, the swapping operation of the computer operating system shown in Figure f51 will be explained.

ステップa)管理プログラム2が、所定の指令によって
、二次記憶装置1に既に一部分スワップ・アットされて
いるプロセスP1のスワップ単位A1(プロセスPIで
は破線部分、二次元1!装置1では実線部分)のプロセ
スを実行しようとする。
Step a) The management program 2 executes a swap unit A1 of the process P1 which has already been partially swapped into the secondary storage device 1 by a predetermined command (the broken line part for the process PI, the solid line part for the two-dimensional 1! device 1) attempt to run the process.

ステップb)管理プログラム2がスウッパ−3にプロセ
スP1のスワップ単位A1を二次記憶装置1から主記憶
装置プロセス4ヘスワツプ・インするよう指令する。
Step b) The management program 2 instructs the swapper 3 to swap in the swap unit A1 of the process P1 from the secondary storage device 1 to the main storage device process 4.

ステップC)スワツパ−3は主記憶装置プロセス4にス
ワップ単位A1を読み込めるだけの領域を確保できるか
どうか問い合わせする。
Step C) The swapper 3 inquires whether the main memory process 4 has enough space to read the swap unit A1.

ステップd)その結果、その領域が確保出来ると分かれ
ば、二次記憶装置1から主記憶装置プロセス4に読み込
んでスワップ・イン処理は終了し、プロセスP1の実行
が再開される。
Step d) As a result, if it is determined that the area can be secured, the data is read from the secondary storage device 1 to the main storage device process 4, the swap-in processing is completed, and execution of the process P1 is resumed.

ステップe)fj域が確保出来ないと分かれば、スワツ
パ−3は管理プログラム2にスワップ・イン処理の失敗
を通知する。
Step e) If it is found that the fj area cannot be secured, the swapper 3 notifies the management program 2 of the failure of the swap-in process.

ステップf)管理プログラム2は、今度はスワツパ−3
に実行プロセスのスワップ・アウトを指令する。
Step f) The management program 2 now runs the swapper 3
command to swap out running processes.

ステップg)スワンパー3は主記憶装置プロセス4を占
めている実行プロセスを検索し、一つの実行プロセス、
例えばプロセスP2を選択する。′ステップト)スワツ
パ−3はプロセスP2の先頭のスワップ単位(B1)を
読み出して二次記憶装置1に書き込む(スワップ・アウ
ト動作)。
Step g) Swamper 3 searches for running processes occupying main memory process 4 and selects one running process,
For example, select process P2. 'Stepped) The swapper 3 reads the first swap unit (B1) of the process P2 and writes it to the secondary storage device 1 (swap out operation).

ステップi)スワツパ−3は管理プログラム2にスワッ
プ・アウトの終了を通知しステップらに戻る。そしてス
テップCで再度必要な領域が確保出来ないと分かれば、
ステップgで更に次のスワップ単位(B2)がスワップ
・アウトサれることになる。
Step i) Swapper 3 notifies management program 2 of the completion of swap out and returns to step et al. And if it turns out that the necessary area cannot be secured again in step C,
In step g, the next swap unit (B2) will be swapped out.

従来の方法では、以上のようにプロセスの先頭4から無
条件にスワップ・アウトされていき、そのプロセスが実
行権を得″たとき、スワップ・アウトされている部分が
スワップ・イン後に実行されない部分であっても、必ず
スワップ・イン処理がされてしまう。即ち、第1図の場
合、プロセス1ノ1の再開アドレスがスワップ単位A2
の中であり、かつ二次とスワップ単位A1をアクセスし
ないとしても必ずスワップ単位Atの部分がスワップ・
インされてからプロセスP1が再開されることになる。
In the conventional method, as described above, the process is unconditionally swapped out from the top 4, and when that process gains execution rights, the part that has been swapped out is the part that will not be executed after being swapped in. Even if it is, swap-in processing is always performed.In other words, in the case of Figure 1, the restart address of process 1-1 is swap unit A2.
, and even if the secondary and swap unit A1 are not accessed, the swap unit At is always swapped.
The process P1 will be restarted after the process is read in.

従って、無駄な入出力処理が行なわれるという欠点があ
った。
Therefore, there is a drawback that unnecessary input/output processing is performed.

[発明の概要1 本発明は、上記のような従来方法の欠点を除去すること
を目的としてなされたもので、この目的を達成するため
の本発明の技術的手段たる構成は、スワップ・アウトす
るとき、実行していたところから最も離れたスワップ単
位から順次スワ・2プ・アウトさせ、既にスワップ・ア
ウトされているプロセスに制御が渡ったときスワップ・
アウトされているまま前記プロセスの実行をスワップ・
イン後の再開アドレスから再1mさせ、前記スワップ・
アウトされているプロセスが実行される時点で初めてス
ワップ・イン処理を行うことを特徴としたコンピュータ
ー・オペレーティング・システムのスワッピング力法、
に在る。従って、あたかもデマンド・ページングの81
能を持ったスワツピングは能を実現し、不要な入出力処
理をできるだけ減らしシステムの運用を効果的に行うこ
とができる。
[Summary of the Invention 1 The present invention was made with the purpose of eliminating the drawbacks of the conventional method as described above, and the technical means of the present invention to achieve this purpose is a swap-out method. When the process is swapped out, the swap unit is swapped out in sequence starting from the swap unit farthest from the process being executed, and when control is passed to a process that has already been swapped out, the swap unit is swapped out.
Swap execution of said process while it is out.
1m again from the restart address after in, and the swap
A computer operating system swapping method characterized in that a swap-in process is performed for the first time when an out process is executed;
is in Therefore, it is as if 81 of demand paging
Swapping has the ability to realize functionality, reduce unnecessary input/output processing as much as possible, and enable effective system operation.

1発明の実施例J 以下、本発明の好ましい一実施例を図に基づいて説明す
る。
1 Embodiment J of the invention A preferred embodiment of the invention will be described below with reference to the drawings.

第2図は本発明にかかるコンピューター・オペレーティ
ング・システムのスワツピング方法ヲ示すブロック図で
基本的には第1 klと変わらないが、理解を容易にす
るため、主記憶装置プロセス4のプロセスP1には新た
にスワップ単位A3が設けられているとする。
FIG. 2 is a block diagram showing a swapping method for a computer operating system according to the present invention. It is basically the same as the first kl, but for ease of understanding, the process P1 of the main memory process 4 is Assume that a new swap unit A3 is provided.

このようなシステムのスワツピング動作は次のように行
なわれる。
The swapping operation of such a system is performed as follows.

ステップa)今、二次記憶装置lには、主記憶装置フロ
セス4のプロセスP1のスワップ!−位A 3がスワッ
プ・アウトされているものとする。
Step a) Now, the process P1 of the main memory process 4 is swapped to the secondary storage l. - It is assumed that position A3 has been swapped out.

ステップb)プロセス1〕1のI11開アドレスがスワ
ップ単位A1の中にあったとすると、管理プログラム2
はスワツパ−3を経てプロセスP1の実行を、スワップ
単位A3がスワップ・アウトされているまま再開させる
Step b) If process 1]1's I11 open address is in swap unit A1, then management program 2
causes the swapper 3 to resume execution of the process P1 with the swap unit A3 swapped out.

ステップC)もし、スワップ単位A3が実行されなけれ
ば処理が続行し、いずれスワップ・アウトされるか、あ
るいはプロセスP1が終了することとなる。
Step C) If swap unit A3 is not executed, processing continues and will eventually be swapped out or process P1 will terminate.

ステップd)スワップ単位A3を大好しようとすると、
デマンド・ページが存在しない旨、管理プログラム2が
指令を受けるので、その時点で、管理プログラム2はス
ワツパ−3に対してプロセスP1のスワップ・インを指
令する。
Step d) If you try to change swap unit A3,
Since the management program 2 receives a command that the demand page does not exist, at that point, the management program 2 commands the swapper 3 to swap in the process P1.

ステップe)スワツパ−3は、主記憶装置プロセス4に
必要なだけの領域(スワップ単位A3の分)が確保でき
ると分かれば、二次記憶装置1から主記憶装置プロセス
4に読み込みスワップ・インの終了を管理プログラム2
に通知したのち大行が再開される。
Step e) If the swapper 3 finds that the required amount of space (swap unit A3) can be secured in the main memory process 4, it reads from the secondary memory 1 into the main memory process 4 and performs swap-in. End management program 2
The line will be resumed after notification.

ステップf)ステップCで、主記憶装置プロセス4に必
要なだけの領域が確保できないと分かればスワップ・イ
ンの失敗を管理プログラム2に通知し、??埋プログラ
ム2はスワツパ−3に実行プロセス1〕1のスワップ・
アウトを指令する。
Step f) In step C, if it is determined that the required amount of space cannot be secured in the main memory process 4, the management program 2 is notified of the swap-in failure. ? Embedded program 2 instructs swapper 3 to swap execution process 1〕1.
Command out.

ステップg)このときスワツパ−3によって選択された
プロセスがP2であり、かつそのときの実行アドレスが
スワップ単位B1の中であったとすれば、スワツパ−3
はスワップ単位B1から最も離れたスワップ単位B3の
部分を選択し、これを二次記憶装置1にスワップ・アウ
トする。
Step g) If the process selected by swapper 3 at this time is P2 and the execution address at that time is within swap unit B1, then swapper 3
selects the portion of swap unit B3 that is farthest from swap unit B1 and swaps it out to secondary storage device 1.

ステップh)管理プログラム2はスワツパ−3カ・らス
ワップ・アウトの終了を通知され、スワツパ−3に再度
プロセスP1のスワップ・インを指令してステップeに
戻る。もし、まだ主記憶装置プロセス4に必要なだけの
空き領域が確保できなければ、今度はスワップ単位B2
の部分、次にはスワップ単位131の部分と選択されス
ワップ・アウトされることになる。
Step h) The management program 2 is notified of the completion of the swap out by the swapper 3, instructs the swapper 3 to swap in the process P1 again, and returns to step e. If you still cannot secure enough free space in main memory process 4, then swap unit B2
, and then the swap unit 131 is selected and swapped out.

ステップi)このようにしてプロセスP1がスワップ・
インされ実行が再1j(されることとなる。
Step i) In this way process P1 swaps
The program will be read in and executed again (1j).

以−1−のように、本発明はスワップ・アウト時に実行
していたスワップ単位を最後までスワップ・アウトせず
に残すことによって、再度、そのプロセスに制御が渡っ
た時にスワップ・インの回数を出来るだけ少なくして実
行できるように工夫したらのである。
As described in -1- above, the present invention allows the swap unit being executed at the time of swap out to remain unswapped out until the end, thereby reducing the number of swap ins when control is handed over to that process again. I tried to do it with as few steps as possible.

尚、本発明では、スワップ・アウトすべきスワップ単位
の選択に単純なあるアルゴリズムを使用しているが、 (1)スワップ単位毎に基準ビットを設け、スワップ単
位の実行毎にこの基準ビットをセットしてスワップ・ア
ウトするとき、基準ビットが0のものからスワップ・ア
ウトする、 (2)スワ・7プ単位が参照された順番を憶えるような
アルゴリズムを付加し、スワップ・アウト時、最も古く
参照されたスワップ単位からスワップ・アウトする、 などの手法を用いれば、より効果的なスワツピングが可
能となる。
In the present invention, a simple algorithm is used to select the swap unit to be swapped out. (1) A reference bit is provided for each swap unit, and this reference bit is set each time the swap unit is executed. (2) An algorithm is added to remember the order in which swap units are referenced, and when swapping out, the one with the reference bit of 0 is swapped out first. More effective swapping can be achieved by using techniques such as swapping out from swap units that have been swapped.

[発明の効果1 以上のように、本発明によれば、スワツピング時の不必
要な入出力処理をできるだけなくしたことにより、高速
かつ効率的なシステム運用が可能になる。
[Advantageous Effects of the Invention 1] As described above, according to the present invention, unnecessary input/output processing during swapping is eliminated as much as possible, thereby enabling high-speed and efficient system operation.

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

第1図は従来の方法の全体構成図、及び第2図は本発明
の一実施例を示す全体構成図、である。 1は二次記憶装置、2は管理プログラム、3はスワツパ
−3,4は主記憶装置プロセス、A1−A3.B1−B
5はスワップ単位、である。 尚、図中、同一符号は同一または相当部分を示す。 手続補正書「自発」 Il′$059 M 2.ハ9B 特許庁長官殿 1、事件の表示 昭和!r9年特許願第’144410 号スワツピング
方法 に、補正の内容 (1)特許請求の範囲を別紙のとおり補正す゛る。 (2)明#I岩・第3頁第4〜7行 [一部分スワップ・アウトされている・・・プロセスを
実行しようとする。」を次のとおり補正する。 「スワップ単位AI(プロセスP1では破線部分、二次
記憶装置1では実線部分)がスワップ・アウトされてい
るプロセスP1を実行しようとする。」(3)同第5頁
第20行 「プロセス」を「スワップ単位」と補正する。 (4)同第6頁第3行 「スワツピング方法、に在る。」を「スワツピング方法
である。」と補正する。 (5)同第8頁第5行 「Pl」を削除する。 2、特許請求の範囲 スワップ・アウトするとき、実行していたところから最
も離れたスワップ単位から順次スワップ・アウトさせ、
既にスワップ・アウトされているプロセスに制御が渡っ
たときスワップ・アウトサれているまま前記プロセスの
実行をスワップ・イン後の再rJIIアドレスから再υ
nさせ、前記スワップ・アウトされているy=ムムL1
附が実行される時点で初めてスワップ・イン処理を行う
ことを特徴としたコンピューター・オペレーティング・
システムのスワツピング方法。
FIG. 1 is an overall configuration diagram of a conventional method, and FIG. 2 is an overall configuration diagram showing an embodiment of the present invention. 1 is a secondary storage device, 2 is a management program, 3 is a swapper 3, 4 is a main storage process, A1-A3 . B1-B
5 is the swap unit. In the drawings, the same reference numerals indicate the same or corresponding parts. Procedural amendment “Voluntary” Il’$059 M 2. Ha9B Mr. Commissioner of the Japan Patent Office 1, Display of the incident Showa! Contents of amendment to the swapping method of Patent Application No. '144410 of 1999 (1) The scope of claims is amended as shown in the attached sheet. (2) Akira #Iiwa, page 3, lines 4-7 [Partially swapped out... Attempts to execute the process. ' shall be amended as follows. "Attempt to execute process P1 whose swap unit AI (broken line part for process P1, solid line part for secondary storage device 1) has been swapped out." (3) "Process" on page 5, line 20 of the same page. Correct as "swap unit". (4) On page 6, line 3, "It is a swapping method." is amended to "It is a swapping method." (5) Delete "Pl" on page 8, line 5. 2. When swapping out claims, swap out sequentially from the swap unit farthest from the one being executed,
When control is passed to a process that has already been swapped out, the execution of the process that is swapped out is restarted from the rJII address after being swapped in.
n, the swapped out y = mm L1
A computer operating system characterized by performing swap-in processing for the first time when a program is executed.
How to swat the system.

Claims (1)

【特許請求の範囲】[Claims] スワップ・アウトするとき、実行していたところから最
も離れたスワップ単位から順次スワップ・アウトさせ、
既にスワップ・アウトされているプロセスに制御が渡っ
たときスワップ・アウトされているまま前記プロセスの
実行をスワップ・イン後の再開アドレスから再開させ、
前記スワップ・アウトされているプロセスが実行される
時点で初めでスワップ・イン処理を行うことを特徴とし
たコンピューター・オペレーティング・システムのスワ
ツピング方法。
When swapping out, the swap unit is swapped out in sequence starting from the swap unit furthest from where it was being executed.
When control is transferred to a process that has already been swapped out, the execution of the process is resumed from the restart address after the swap-in while being swapped out;
A method for swapping a computer operating system, characterized in that a swap-in process is performed for the first time when the swapped-out process is executed.
JP59076640A 1984-04-18 1984-04-18 Swapping method of computer operating system Pending JPS60221853A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59076640A JPS60221853A (en) 1984-04-18 1984-04-18 Swapping method of computer operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59076640A JPS60221853A (en) 1984-04-18 1984-04-18 Swapping method of computer operating system

Publications (1)

Publication Number Publication Date
JPS60221853A true JPS60221853A (en) 1985-11-06

Family

ID=13610975

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59076640A Pending JPS60221853A (en) 1984-04-18 1984-04-18 Swapping method of computer operating system

Country Status (1)

Country Link
JP (1) JPS60221853A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0969381A2 (en) * 1990-06-11 2000-01-05 Cray Research, Inc. Method of efficient non-virtual main memory management

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0969381A2 (en) * 1990-06-11 2000-01-05 Cray Research, Inc. Method of efficient non-virtual main memory management
EP0969381A3 (en) * 1990-06-11 2000-02-02 Cray Research, Inc. Method of efficient non-virtual main memory management

Similar Documents

Publication Publication Date Title
US9244883B2 (en) Reconfigurable processor and method of reconfiguring the same
JP2560988B2 (en) Information processing apparatus and processing method
US20090276575A1 (en) Information processing apparatus and compiling method
CN1777875B (en) Instruction caching management method, cache and integrated circuit
JPS60221853A (en) Swapping method of computer operating system
JPH02197924A (en) Central arithmetic processor
JPH1139214A (en) Controlling method for shared memory of multiprocessor system
JPH02189658A (en) Cache memory
JP3022398B2 (en) Virtual computer system
JP2002259209A (en) Arithmetic processing system
JP2927102B2 (en) Instruction string switching method and arithmetic processor using the same
JPH04291642A (en) Cache control system
JPS59144955A (en) Information processor
JPH0447350A (en) Main storage read/response control
JPS60178539A (en) By-pass control system of information processor
JPH0554141B2 (en)
JP2001022581A (en) Data processor and computer readable storage medium
JPS6235694B2 (en)
JP5644539B2 (en) Processor, information processing apparatus, information processing method, and system startup program
JPH04113432A (en) Virtual storage control method
JPH10247182A (en) Multiprocessor system
JPH0150936B2 (en)
JPH08212068A (en) Information processor
JPS6215645A (en) Central processing unit
JPS60183652A (en) Cache memory control method