JPH11120011A - Interruption processing method and multitask execution system - Google Patents

Interruption processing method and multitask execution system

Info

Publication number
JPH11120011A
JPH11120011A JP28211097A JP28211097A JPH11120011A JP H11120011 A JPH11120011 A JP H11120011A JP 28211097 A JP28211097 A JP 28211097A JP 28211097 A JP28211097 A JP 28211097A JP H11120011 A JPH11120011 A JP H11120011A
Authority
JP
Japan
Prior art keywords
task
input
output
interrupt
logical
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
JP28211097A
Other languages
Japanese (ja)
Inventor
Masahiko Saito
雅彦 齊藤
Tadashi Kamiwaki
正 上脇
Kunihiko Tsunetomi
邦彦 恒冨
Shigenori Kaneko
茂則 金子
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP28211097A priority Critical patent/JPH11120011A/en
Publication of JPH11120011A publication Critical patent/JPH11120011A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To efficiently use a memory for an input/output interruption in the multitask execution system. SOLUTION: When tasks 131 to 134 operate while having individual logical spaces, this system 100 is provided with a logical space switching means 135 which switches only the logical spaces of the tasks. When an interruption corresponding to an input/output request that one of the tasks has issued is initiated, the logical space switching means 135, (1) saves register values needed for the interruption process, (2) switches the logical space to the logical space of the task having issued the input/output request, (3) executes an interruption process routine, (4) reswitches the logical space to the logical space right before the switching by the said process (2), and reloads the register values saved in the said (1).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はマルチタスク実行シ
ステムに関し、特に入出力割込みの効率的な処理方法に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multitask execution system, and more particularly to a method for efficiently processing an input / output interrupt.

【0002】[0002]

【従来の技術】複数のプログラム(タスク)が並行して
動作するマルチタスク実行システムでは、一つのタスク
が入出力を要求して入出力完了を待つ場合、通常、別の
タスクがシステム上で実行(スケジューリング)され、
入出力完了は割込みという形式でシステムに通知され
る。
2. Description of the Related Art In a multitasking execution system in which a plurality of programs (tasks) operate in parallel, when one task requests input / output and waits for completion of input / output, another task usually executes on the system. (Scheduled),
I / O completion is notified to the system in the form of an interrupt.

【0003】入出力要求に対する割込みは、タスクが入
出力要求を行った結果発生するものであり、(1)入力
完了であれば、入力データを要求発行元タスクの領域に
格納し、(2)出力完了であれば、結果を要求発行元タ
スクの領域に格納する、といったデータ転送処理(割り
込み処理)を行わなければならない。
An interrupt for an input / output request is generated as a result of a task making an input / output request. (1) If input is completed, input data is stored in the area of the task that issued the request, and (2) If the output is completed, data transfer processing (interrupt processing) such as storing the result in the area of the task that issued the request must be performed.

【0004】しかしながら、割込み発生時には、通常、
入出力要求を発行したタスクとは別のタスクが動作して
いるので、入出力要求時とは異なったタスク実行環境と
なっている。
However, when an interrupt occurs,
Since a task different from the task that issued the input / output request is operating, the task execution environment is different from that at the time of the input / output request.

【0005】このような入出力割込み発生時の処理とし
て、マイクロソフト社のOSであるWindows NTデバイス
ドライバにおけるAPC(Asynchronous Procedure Cal
l)のように、通常は入出力要求を発行したタスクが再
びオペレーティングシステムによってスケジューリング
され、入出力要求発行時と同一のタスク実行環境に戻る
ときまで、データ転送処理の実行を遅延させる。
[0005] As a process when such an input / output interrupt occurs, an APC (Asynchronous Procedure Cal.) In a Windows NT device driver, which is an OS of Microsoft Corporation, is used.
As in l), the task that normally issues the I / O request is again scheduled by the operating system, and the execution of the data transfer process is delayed until the task returns to the same task execution environment as when the I / O request was issued.

【0006】[0006]

【発明が解決しようとする課題】APCを用いた入出力
割込み処理では、入出力完了からタスクの再スケジュー
リングまでの間、別タスクの実行環境にあるため、入出
力データを要求元のタスクの領域に直接に格納すること
ができない。この間、入出力データを一時的に保存して
おくためのバッファ領域が必要となる。すなわち、入出
力データを保存するためにタスクが提供する領域の他
に、システムが一時的(入出力完了から入出力要求元タ
スクの再スケジューリングまで)にデータを保存するた
めの領域が必要となる。したがって、APCで大容量フ
ァイルなどの入力を行うと、メモリの活用が極端に非効
率となる。
In the input / output interrupt processing using the APC, the input / output data is stored in the area of the task which has requested the input / output data since the task is in the execution environment of another task from the completion of the input / output to the rescheduling of the task. Cannot be stored directly. During this time, a buffer area for temporarily storing input / output data is required. That is, in addition to the area provided by the task for storing the input / output data, an area for the system to temporarily store the data (from the completion of the input / output to the rescheduling of the task requesting the input / output) is required. . Therefore, when a large-capacity file or the like is input by the APC, utilization of the memory becomes extremely inefficient.

【0007】本発明の目的は、従来技術の問題点を克服
し、入出力割込みの発生時点に割込み処理を簡易に実行
できる方法と、メモリの有効活用が可能となるマルチタ
スク実行システムを提供することにある。
An object of the present invention is to provide a method capable of overcoming the problems of the prior art, easily executing an interrupt process at the time of occurrence of an input / output interrupt, and a multitask execution system capable of effectively utilizing a memory. It is in.

【0008】[0008]

【課題を解決するための手段】前記目的を達成するた
め、複数のタスクがそれぞれの論理空間を有して動作す
るときの入出力割込み方法において、前記タスクの一つ
が発行した入出力要求に対応する割込みが発生した場
合、タスク実行環境のうち、論理空間のみを稼働中のタ
スクから前記入出力要求元のタスクのそれに切り替える
ことを特徴とする。
In order to achieve the above object, in an input / output interrupt method when a plurality of tasks operate with respective logical spaces, an input / output request issued by one of the tasks is provided. When an interrupt occurs, the task execution environment is switched from the task that is operating only the logical space to that of the task that is the input / output request source.

【0009】ここで、タスク実行環境とは、(a)タス
クの論理空間、(b)レジスタ値(プログラムカウン
タ、汎用レジスタなど)、(c)ファイルなどを総称し
た概念である。個々のタスクはそれぞれのタスク環境を
有し、マルチタスク実行システムでは、タスク実行環境
を順次切り替えることにより、複数のタスクを並行動作
させる。
Here, the task execution environment is a general term for (a) a logical space of a task, (b) a register value (a program counter, a general-purpose register, etc.), and (c) a file. Each task has its own task environment. In a multitask execution system, a plurality of tasks are operated in parallel by sequentially switching the task execution environment.

【0010】本発明のマルチタスク実行システムでは、
入出力割込み発生時に、タスク実行環境のうち、論理空
間のみを入出力要求発行元のタスクの論理空間に切り替
える論理空間切り替え手段を有する。論理空間切り替え
手段は、通常、マルチタスク実行システムのオペレーテ
ィングシステムの一部として提供される。
[0010] In the multitask execution system of the present invention,
When an input / output interrupt occurs, there is provided a logical space switching means for switching only the logical space in the task execution environment to the logical space of the task which issued the input / output request. The logical space switching means is usually provided as a part of the operating system of the multitask execution system.

【0011】前記論理空間切り替え手段を有することに
より、本発明のマルチタスク実行システムの割込み処理
は、入出力割込み発生時の処理として、以下の一連の動
作を実行する。
With the logical space switching means, the interrupt processing of the multitask execution system of the present invention executes the following series of operations as processing when an input / output interrupt occurs.

【0012】(1)入出力割込み発生時に、割込み処理
に必要なレジスタの値を退避する。すなわち、稼働中の
タスクの処理に用いられるレジスタのうち、競合するレ
ジスタ値を退避する。
(1) When an input / output interrupt occurs, the value of a register required for interrupt processing is saved. That is, among the registers used for the processing of the running task, the conflicting register values are saved.

【0013】(2)論理空間切り替え手段により入出力
要求発行元のタスクの論理空間に切り替える。論理空間
の切り替えは、ページテーブルを切り替えた後、必要に
応じてTLB(Translation Look-aside Buffer)やキ
ャッシュ記憶の無効化を行うことにより達成される。ハ
ードウェアの種類によっては、この無効化の処理が不要
な場合もある。
(2) Switching to the logical space of the task that issued the I / O request by the logical space switching means. Switching of the logical space is achieved by invalidating a TLB (Translation Look-aside Buffer) or cache storage as needed after switching the page table. Depending on the type of hardware, this invalidation processing may not be necessary.

【0014】(3)割込み処理を実行する。すなわち、
入出力データを入出力要求発行元のタスクの領域に格納
する。
(3) Execute interrupt processing. That is,
Store the input / output data in the task area of the input / output request issuer.

【0015】(4)前記(2)の処理で切り替える直前
の論理空間に再切り替えを行う。
(4) Switching to the logical space immediately before switching in the process of (2) is performed again.

【0016】(5)前記(1)で退避したレジスタ値を
復帰する。
(5) The register value saved in (1) is restored.

【0017】これらの一連の処理を行うことにより、入
出力割込み発生時点で、入出力データを要求発行元タス
クの領域に格納することができる。この結果、システム
が一時的にデータを保存するための領域が不要となり、
効率的なメモリ活用を行うことができる。また、全ての
タスク実行環境を切り替えるのではなく、論理空間のみ
を切り替えるので、割込み処理に至るまでの時間を短く
することができる。
By performing these series of processes, the input / output data can be stored in the area of the task that issued the request when the input / output interrupt occurs. This eliminates the need for the system to temporarily store data,
Efficient use of memory can be performed. Also, since only the logical space is switched instead of switching all task execution environments, the time required for interrupt processing can be shortened.

【0018】[0018]

【発明の実施の形態】本発明の一実施形態を図面を用い
て詳細に説明する。図1に、本発明のマルチタスク実行
システムの一実施例を示す。本システムでは、複数のタ
スクが1台の計算機上でそれぞれ独立の論理空間を有し
て動作する。図中、100は計算機システムであり、そ
の内部装置として、中央処理装置(CPU)110、主
記憶装置111、入出力制御装置(I/O)112があ
り、CPUバス120によって接続されている。入出力
制御装置112には、ディスク装置113や端末114
が接続される。CPU110内部には、TLB115や
キャッシュ記憶116が存在する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described in detail with reference to the drawings. FIG. 1 shows an embodiment of the multitask execution system of the present invention. In this system, a plurality of tasks operate on a single computer with independent logical spaces. In the figure, reference numeral 100 denotes a computer system, which includes a central processing unit (CPU) 110, a main storage device 111, and an input / output control device (I / O) 112 as internal devices, which are connected by a CPU bus 120. The input / output control device 112 includes a disk device 113 and a terminal 114.
Is connected. The TLB 115 and the cache memory 116 exist inside the CPU 110.

【0019】主記憶装置111上には、オペレーティン
グシステム(OS)130、タスク131〜134が存
在し、CPU110によって順次実行される。OS13
0がタスク131〜134の実行状態を管理して、複数
のタスクが並行して動作するマルチタスク実行環境を構
成している。なお、本実施例では、4つのタスク131
〜134の存在を示しているが、これ以上または以下の
タスクが動作するシステム構成も可能である。
An operating system (OS) 130 and tasks 131 to 134 exist on the main storage device 111 and are sequentially executed by the CPU 110. OS13
0 manages the execution states of the tasks 131 to 134 and constitutes a multitask execution environment in which a plurality of tasks operate in parallel. In this embodiment, the four tasks 131
Although the presence of .about.134 is shown, a system configuration in which more or less tasks operate is also possible.

【0020】図2に、論理空間の構成を説明する概念図
を示す。図示のように、論理空間はOS用空間とタスク
用論理空間からなり、後者はタスク毎に物理空間にマッ
ピングされている。ページテーブルなどの情報は全てO
S用空間に配置され、これを切り替えることによりタス
ク用論理空間を切り替えることができる。
FIG. 2 is a conceptual diagram illustrating the configuration of a logical space. As shown in the figure, the logical space includes an OS space and a task logical space, and the latter is mapped to a physical space for each task. All information such as page tables is O
It is arranged in the S space, and by switching this, the task logical space can be switched.

【0021】論理空間切り替えルーチン135は、OS
130の一つのルーチンとして提供される。このルーチ
ン135は、タスクやユーザから直接実行することはで
きないが、OS内に組み込まれて動作する入出力割込み
処理ルーチンから実行することができ、論理空間の切り
替え処理を実行する。論理空間の切り替えは、OS内部
のデータであるページテーブルなどを切り替えることに
より行われる。
The logical space switching routine 135 is executed by the OS
130 are provided as one routine. Although this routine 135 cannot be directly executed by a task or a user, it can be executed from an input / output interrupt processing routine incorporated and operated in the OS, and executes a logical space switching process. Switching of the logical space is performed by switching a page table or the like which is data inside the OS.

【0022】図3に、論理空間切り替えのために使用さ
れるOS内部のデータ構造を示す。OS内部には、ペー
ジテーブルエントリアドレス140とページテーブル1
41〜144、実行中タスク番号150、タスク制御ブ
ロック151〜154が存在し、各タスクの実行状況を
管理する。
FIG. 3 shows a data structure inside the OS used for switching the logical space. In the OS, the page table entry address 140 and the page table 1
41 to 144, an executing task number 150, and task control blocks 151 to 154 exist to manage the execution status of each task.

【0023】ページテーブル141〜144は、それぞ
れ、タスク131〜134の論理空間と物理空間の対応
を示す。本実施例では、ページテーブルは各タスク毎に
設けられているが、システムで一つのページテーブルを
構成することも可能である。ページテーブルの論理空間
と物理空間の対応の一部は、TLB115内に転写さ
れ、ハードウェアによる高速なアドレス変換を可能にし
ている。ページテーブルエントリアドレス140は、現
在使用中の論理空間に対応するページテーブルの先頭ア
ドレスを示す。例えば、タスク133が実行中であれ
ば、ページテーブルエントリアドレス140はページテ
ーブル143の先頭アドレスを示す。
The page tables 141 to 144 indicate the correspondence between the logical space and the physical space of the tasks 131 to 134, respectively. In the present embodiment, a page table is provided for each task, but one page table can be configured by the system. A part of the correspondence between the logical space and the physical space of the page table is transcribed in the TLB 115, and enables high-speed address translation by hardware. The page table entry address 140 indicates the head address of the page table corresponding to the currently used logical space. For example, if the task 133 is being executed, the page table entry address 140 indicates the head address of the page table 143.

【0024】タスク制御ブロック151〜154は、そ
れぞれタスク131〜134の実行状況を管理するデー
タで、レジスタ値、状態(タスクが実行状態であるか待
ち状態であるかなど)、実行中の入出力処理の種類、使
用中のファイル、ページテーブルの位置などが退避さ
れ、タスクをスケジューリングする際に用いられる。
The task control blocks 151 to 154 are data for managing the execution status of the tasks 131 to 134, respectively, and include register values, states (whether the task is in an execution state or a waiting state), and input / output during execution. The type of processing, the file being used, the position of the page table, and the like are saved, and are used when scheduling a task.

【0025】実行中タスク番号150は、現在、システ
ムで実行されているタスクの番号(ID)を示す値であ
る。CPU110の種類によっては、実行中タスク番号
を格納するための領域がハードウェアで提供されている
ものもある。
The running task number 150 is a value indicating the number (ID) of the task currently being executed in the system. Depending on the type of CPU 110, an area for storing the task number being executed may be provided by hardware.

【0026】TLB115には、タスク131〜134
における論理空間と物理空間との対応を示すページテー
ブルの一部が記憶されている。TLB115の内容は、
CPU110の種類によって異なるが、論理空間を32
ビットアドレス(最大4Gバイト)で参照する場合、通
常、4Kバイトもしくは1Kバイトの空間(ページ)に
分割し、これを物理空間におけるページにマッピングす
る。したがって、TLB115は、20ビットもしくは
22ビットで表される論理空間のページと物理空間のペ
ージとの対応表を示す。
The TLB 115 has tasks 131 to 134
A part of the page table indicating the correspondence between the logical space and the physical space is stored. The contents of TLB115 are
Depending on the type of CPU 110, the logical space is 32
When referring to a bit address (4 Gbytes at maximum), it is usually divided into a 4 Kbyte or 1 Kbyte space (page) and mapped to a page in the physical space. Therefore, the TLB 115 indicates a correspondence table between pages in the logical space and pages in the physical space represented by 20 bits or 22 bits.

【0027】CPU110は、このページ対応表を利用
して論理アドレスを物理アドレスに高速に変換し、変換
後の物理アドレスを用いて主記憶装置111の命令、デ
ータ参照を行う。指定された論理ページ番号がTLB内
に存在しなければ、ページテーブルから論理空間と物理
空間との対応表を読み出し、TLB内に登録する。
The CPU 110 converts a logical address into a physical address at high speed using the page correspondence table, and refers to the instruction and data of the main storage device 111 using the converted physical address. If the specified logical page number does not exist in the TLB, a correspondence table between the logical space and the physical space is read from the page table and registered in the TLB.

【0028】通常のTLBは、論理ページ番号と物理ペ
ージ番号との対応のみを有しているため、異なった論理
空間を有するタスク間でスケジューリングが行われた場
合、TLBが示す論理空間と物理空間の対応が無効とな
るので、TLBの内容をすべて削除(無効化)しなけれ
ばならない。しかし、CPUの種類によっては、TLB
内に論理ページ番号、実行中タスク番号と物理ページ番
号との対応を記憶でき、マルチタスク実行システムに適
した構成となっているものが存在する。
Since a normal TLB has only a correspondence between a logical page number and a physical page number, when scheduling is performed between tasks having different logical spaces, the logical space and the physical space indicated by the TLB are determined. Is invalidated, so all contents of the TLB must be deleted (invalidated). However, depending on the type of CPU, TLB
Some of them can store the correspondence between the logical page number, the task number being executed, and the physical page number, and have a configuration suitable for a multitask execution system.

【0029】図4に、論理空間の切り替え時に無効化の
不要なTLBの内部構成を示す。TLB115は複数の
エントリに分割され、各エントリが論理ページ番号16
0、タスク番号161と物理ページ番号162との対応
を示す。このようなTLBを用いるCPUの場合、タス
ク間スケジューリングが行われても、TLBの内容を削
除する必要はない。
FIG. 4 shows the internal structure of the TLB which does not need to be invalidated when switching between logical spaces. The TLB 115 is divided into a plurality of entries, and each entry has a logical page number 16
0 indicates the correspondence between the task number 161 and the physical page number 162. In the case of a CPU using such a TLB, there is no need to delete the contents of the TLB even when the inter-task scheduling is performed.

【0030】キャッシュ記憶116は、主記憶装置11
1から読み出したデータを一旦格納しておく高速なバッ
ファである。キャッシュ記憶116もCPUの種類によ
って、(1)物理アドレスをインデクスとしてデータを
記憶する物理キャッシュ (2)論理アドレスをインデクスとしてデータを記憶す
る論理キャッシュ (3)論理アドレスとタスク番号の対をインデクスとす
る論理キャッシュ のいずれかの構成を採用する。(2)の論理キャッシュ
を使用する場合には、タスク間スケジューリングの際
に、キャッシュ記憶上のデータをすべて削除しておかな
ければならない。
The cache memory 116 stores the main storage device 11
This is a high-speed buffer that temporarily stores the data read from No. 1. Depending on the type of CPU, the cache memory 116 also has (1) a physical cache that stores data using a physical address as an index, (2) a logical cache that stores data using a logical address as an index, and (3) a pair of a logical address and a task number as an index. Either logical cache configuration is adopted. When the logical cache of (2) is used, all data on the cache storage must be deleted at the time of inter-task scheduling.

【0031】図5に、入出力割込み処理のフローチャー
トを示す。本実施例では、入出力割込み発生によりOS
130が全ての割込み処理を行うものとして説明する。
まず、入出力割込み発生時には、システムを割込み以前
の状態に復帰できるように、割込み処理中に使用するレ
ジスタの値を退避する(s171)。
FIG. 5 shows a flowchart of the input / output interrupt processing. In this embodiment, the occurrence of an input / output interrupt
Description will be made assuming that 130 performs all interrupt processing.
First, when an input / output interrupt occurs, the value of a register used during interrupt processing is saved so that the system can return to the state before the interrupt (s171).

【0032】CPU110の種類によっては、汎用レジ
スタを2面(バンク0、バンク1)有し、割込み発生と
同時にハードウェア的にバンク切り替えが行われるもの
もある。このようなプロセッサを使用する場合は、レジ
スタ値の退避を行わなくてもよい。なお、以降の割込み
処理は割込み禁止状態(別の割込みが受け付けられない
状態)で実行する必要があるが、通常のプロセッサは割
込み発生と同時に割込み禁止状態に移行するため、図示
を省略している。
Some types of CPU 110 have two general-purpose registers (bank 0 and bank 1), and the bank is switched by hardware simultaneously with the occurrence of an interrupt. When such a processor is used, it is not necessary to save the register value. Note that the subsequent interrupt processing must be executed in an interrupt disabled state (a state in which another interrupt cannot be accepted), but is omitted from the drawing because a normal processor shifts to the interrupt disabled state simultaneously with the occurrence of an interrupt. .

【0033】s172〜s175は論理空間の切り替え
処理を示している。これらの処理が論理空間切り替えル
ーチン135に対応するが、実際の論理空間の切り替え
を行なう部分はs174〜s175である。図6のOS
データ構造を参照しながら、基本的な論理空間の切り替
え処理を説明する。
Steps s172 to s175 indicate a logical space switching process. These processes correspond to the logical space switching routine 135, but the actual logical space switching is performed in steps s174 to s175. OS of FIG.
The basic logical space switching process will be described with reference to the data structure.

【0034】まず、ページテーブルの切り替えを行う
(s174)。ここでは、ページテーブルエントリアド
レス140に、入出力要求発行元タスクに対応するペー
ジテーブルの先頭アドレスを登録するだけである。例え
ば、入出力要求発行元タスクがタスク134であった場
合、ページテーブル144の先頭アドレスをページテー
ブルエントリアドレス140に格納する。
First, the page table is switched (s174). Here, only the head address of the page table corresponding to the input / output request issuing task is registered in the page table entry address 140. For example, when the task issuing the input / output request is the task 134, the head address of the page table 144 is stored in the page table entry address 140.

【0035】次に、入出力要求発行元タスクの番号を実
行中タスク番号150に登録する(s175)。この処
理は、CPU110の種類によって異なる。例えば、日
立製作所の提供するプロセッサSH−3などでは、現在
実行中のタスク番号を登録しておくためのレジスタが存
在する。一方、モトローラ社の提供するプロセッサMC
68030などでは、実行中タスク番号を登録するハー
ドウェアは存在しない。このため、MC68030など
のプロセッサを使用する場合、実行中タスク番号150
をOS内部データとして確保しておく必要があるが、S
H−3などのプロセッサではハードウェア上にそのまま
用意されているレジスタを、実行中タスク番号150と
して用いることができる。
Next, the number of the task issuing the input / output request is registered in the task number under execution 150 (s175). This process differs depending on the type of the CPU 110. For example, in a processor SH-3 provided by Hitachi, for example, there is a register for registering a task number currently being executed. On the other hand, the processor MC provided by Motorola
In 68030 and the like, there is no hardware for registering the task number under execution. Therefore, when a processor such as MC68030 is used, the running task number 150
Must be secured as OS internal data, but S
In a processor such as the H-3, a register prepared as it is on hardware can be used as the task number 150 being executed.

【0036】以上で、基本的な論理空間切り替え処理は
終了する。しかし、割込み直前まで実行していたタスク
の論理空間のデータがTLB115、キャッシュ記憶1
16内に残っている可能性がある。この場合、s172
〜s173で予めデータを削除しておかなければならな
い。
Thus, the basic logical space switching processing is completed. However, the data in the logical space of the task that was being executed until immediately before the interruption is stored in the TLB 115, the cache storage 1
16 may remain. In this case, s172
The data must be deleted in advance in steps s173.

【0037】まず、s172でTLBの内容の無効化を
行う。通常のプロセッサでは、TLBの全内容を無効化
するための機能を有しており、これによりTLBの内容
をすべて削除する。しかし、タスク番号をエントリ内に
有するTLB(図4)では、異なったタスクの同一論理
ページ番号を区別することができるので、TLBエント
リの無効化を行う必要が無い。
First, the contents of the TLB are invalidated in s172. An ordinary processor has a function of invalidating all the contents of the TLB, thereby deleting all the contents of the TLB. However, in a TLB having a task number in an entry (FIG. 4), the same logical page number of a different task can be distinguished, so that there is no need to invalidate the TLB entry.

【0038】論理アドレスをインデクスとする論理キャ
ッシュを装備したCPUを使用している場合、新たな論
理空間の下でs173の処理を実行して、キャッシュ記
憶上のデータをすべて無効化する。なお、ライトバック
キャッシュの場合は、書き戻す必要がある。
When a CPU equipped with a logical cache having a logical address as an index is used, the process in s173 is executed under a new logical space, and all data in the cache memory is invalidated. In the case of a write-back cache, it is necessary to rewrite.

【0039】次に、s176で割込み処理を行う。入出
力割込み処理では、入出力制御装置112を介して読み
出したデータまたは出力した結果を、入出力要求を発行
したタスクが提供する領域に格納する。上述の切り替え
処理で、入出力要求発行元のタスクの論理空間への切り
替えが済んでいるので、本割込み処理ではデータを直
接、入出力要求発行元のタスクが提供する領域に格納す
ることができる。
Next, an interrupt process is performed in s176. In the input / output interrupt processing, the data read or output result via the input / output control device 112 is stored in an area provided by the task which issued the input / output request. In the above switching process, the task of the I / O request issuing task has been switched to the logical space. Therefore, in this interrupt processing, data can be directly stored in the area provided by the I / O request issuing task. .

【0040】このため、入出力データを一時的にOSの
バッファなどに格納する必要はなく、メモリを効率的に
活用することができる。また、タスク実行環境のすべて
を切り替える必要が無いため、特に、タスク番号を格納
できるTLBと物理キャッシュ(もしくは、論理アドレ
スとタスク番号をインデクスとする論理キャッシュ)を
用いたCPUの場合、ページテーブルエントリアドレス
140と実行中タスク番号の書き換えのオーバヘッドの
みで、入出力データを要求元タスクの領域に格納するこ
とができる。
Therefore, there is no need to temporarily store input / output data in a buffer or the like of the OS, and the memory can be used efficiently. In addition, since it is not necessary to switch all of the task execution environments, especially in the case of a CPU using a TLB capable of storing a task number and a physical cache (or a logical cache having a logical address and a task number as an index), a page table entry is used. The input / output data can be stored in the area of the request source task only by the overhead of rewriting the address 140 and the task number being executed.

【0041】次に、s177〜s180で、再び、割込
み発生前の論理空間へ切り替える。これらの処理は、s
172〜s175と同様になる。最後に、s181で退
避したレジスタを回復し、割込み発生前に実行していた
処理を継続する。なお、2面のレジスタを有しているC
PUでは、割込み終了と同時にバンク切り替えが行われ
るため、レジスタ回復を行う必要はない。
Next, in s177 to s180, the logical space is switched again to the logical space before the occurrence of the interrupt. These processes are:
172 to s175. Finally, the register saved in step s181 is restored, and the processing executed before the interrupt is generated is continued. In addition, C having two registers
In the PU, since bank switching is performed at the same time as the end of the interrupt, there is no need to perform register recovery.

【0042】図7に、入出力割込み処理のシステム動作
をタイムチャートで示す。同図(a)が従来例、(b)
が本実施例の処理で、時点〜の動作は同じとなる。
FIG. 7 is a time chart showing the system operation of the input / output interrupt processing. FIG. 1A shows a conventional example, and FIG.
However, in the processing of the present embodiment, the operations from the time point are the same.

【0043】マルチタスク実行システムで一つのタスク
が入出力要求を発行すると、その入出力処理の完了まで
の間、当該タスクは処理を継続することなく待ち状態に
移行する。このとき、CPUを効率的に使用するため、
別の実行可能状態にあるタスクが処理を実行する(別タ
スクがスケジューリングされる)。このようなタスクの
状態として、run(実行)状態(タスクがCPUによ
り実行されている状態)、ready(実行可能)状態
(処理可能であるが、別タスクがCPUを占有している
状態)、wait(待ち)状態(入出力完了などを待っ
ている状態)の3通りがある。
When one task issues an input / output request in the multitask execution system, the task enters a waiting state without continuing the processing until the input / output processing is completed. At this time, in order to use the CPU efficiently,
A task in another executable state executes a process (another task is scheduled). Such task states include a run (execution) state (a state in which the task is being executed by the CPU), a ready (executable) state (a state in which the task can be processed but another task occupies the CPU), There are three types of wait (waiting) state (waiting for completion of input / output).

【0044】図7の例は2つのタスクが存在し、初期状
態として、タスク1(Task1)が実行状態、タスク2(T
ask2)が実行可能状態である。この状況で、タスク1が
入出力処理要求を発行したとする(の時点)。これを
受け付けたOSは、直にタスク1を待ち状態に移行さ
せ、入出力制御装置(I/O)に対して、I/O要求を
発行する(の時点)。
In the example of FIG. 7, there are two tasks. As an initial state, task 1 (Task 1) is in an execution state, and task 2 (T
ask2) is in an executable state. In this situation, it is assumed that task 1 issues an input / output processing request (at). The OS that has received the request immediately shifts the task 1 to the waiting state and issues an I / O request to the input / output control device (I / O) (at the time).

【0045】次に、OSは、タスク1が待ち状態の間も
CPUを利用するため、実行可能状態のタスク2をスケ
ジューリングする。このため、タスク1の実行環境(論
理空間、レジスタ値、ファイルなど)をタスク2の実行
環境に切り替え(〜)、タスク2が実行状態に移行
する。
Next, the OS schedules the executable task 2 to use the CPU while the task 1 is in the waiting state. Therefore, the execution environment (logical space, register value, file, etc.) of task 1 is switched to the execution environment of task 2 (-), and task 2 transitions to the execution state.

【0046】タスク2の実行中に入出力制御装置から、
I/O完了割込みが発生したとする(の時点)。この
時点はタスク2の実行環境であるため、タスク1の論理
空間を参照することができない。このため、従来は入出
力処理の結果をOS内のバッファにコピーしておく
((a)の〜)。ここで、OSは、タスク1を実行
可能状態にすると同時に、タスク2の処理を継続させ
る。
During execution of task 2, the input / output control unit
It is assumed that an I / O completion interrupt has occurred (at). At this point, since the task 2 is in the execution environment, the logical space of the task 1 cannot be referred to. For this reason, conventionally, the result of the input / output processing is copied to a buffer in the OS (from (a)). Here, the OS makes the task 1 executable, and at the same time, continues the processing of the task 2.

【0047】タスク2の処理が終了すると(の時
点)、OSは直ちにタスク1の実行環境に切り替える
((a)の〜)、次に、バッファにコピーしておい
た入出力処理の結果をタスク1の論理空間に転送し
((a)の〜)、その後、タスク1が実行状態に移
行する。
When the processing of the task 2 is completed (at the time), the OS immediately switches to the execution environment of the task 1 (from (a)), and then, the result of the input / output processing copied to the buffer is transferred to the task. Then, the task 1 is transferred to the logical space 1 (from (a)), and then the task 1 transitions to the execution state.

【0048】このように、従来はI/O完了割込み時に
入出力処理結果を一時格納するバッファが必要である。
また、タスク1の再実行時にバッファからの転送が必要
となり、直ちにタスク1を実行することができない。
As described above, conventionally, a buffer for temporarily storing an input / output processing result at the time of an I / O completion interrupt is required.
Further, when the task 1 is re-executed, the transfer from the buffer is required, so that the task 1 cannot be executed immediately.

【0049】一方、本実施例では、I/O完了割込みが
発生すると(の時点)、OSは論理空間のみをタスク
1のそれに切り替える((b)の〜)。この切り替
え処理は、レジスタ値、ファイルなど、論理空間以外の
タスク実行環境に対しての切替えを行わないため、非常
に高速に行うことができる。切り替え後、OSは入出力
処理の結果を直接タスク1の論理空間に書き込む
((b)の〜)。次に、論理空間のみを再びタスク
2のそれに切り替え((b)の〜)、タスク2の処
理を再開させる。
On the other hand, in this embodiment, when an I / O completion interrupt occurs (at the time), the OS switches only the logical space to that of the task 1 (from (b)). This switching process can be performed at a very high speed because switching to a task execution environment other than the logical space, such as a register value and a file, is not performed. After the switching, the OS directly writes the result of the input / output processing into the logical space of the task 1 (from (b)). Next, only the logical space is switched to that of the task 2 again (from (b)), and the processing of the task 2 is restarted.

【0050】タスク2が(b)のの時点で終了する
と、既に入出力処理の結果がタスク1の論理空間に格納
されているので、OSはタスク1の実行環境に切り替え
る((b)の〜)だけで、タスク1が実行される。
When the task 2 ends at the point of (b), the result of the input / output processing has already been stored in the logical space of the task 1, so the OS switches to the execution environment of the task 1 (from (b) to (b)). ) Alone executes task 1.

【0051】本実施例によれば、I/O完了時点でタス
ク1の論理空間に結果を書き込むため、バッファが不要
で、かつタスク1はタスク2の終了後、直ちにスケジュ
ーリングされる。
According to the present embodiment, since the result is written to the logical space of task 1 at the time of completion of I / O, a buffer is not required, and task 1 is scheduled immediately after completion of task 2.

【0052】[0052]

【発明の効果】本発明のマルチタスク実行システムによ
れば、入出力割込み発生時に、入出力要求発行元のタス
クの領域で直接入出力データを参照することができるた
め、該タスクが再スケジューリングされるまでの一時的
な入出力データ用領域を設ける必要が無く、効率的なメ
モリ管理を行うことができる。
According to the multitask execution system of the present invention, when an input / output interrupt occurs, the input / output data can be directly referred to in the area of the task that issued the input / output request. Thus, there is no need to provide a temporary input / output data area until the data is stored, and efficient memory management can be performed.

【0053】また、本発明の割込み処理方法によれば、
OSから入出力要求元タスクへの入出力データの転送が
不要で、かつ、入出力割込みと復帰時に論理空間のみを
切り替えればよいので、オーバーヘッドが小さく処理を
高速化できる。
According to the interrupt processing method of the present invention,
Since it is not necessary to transfer input / output data from the OS to the input / output request source task and only the logical space needs to be switched at the time of input / output interrupt and return, the overhead can be reduced and the processing speed can be increased.

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

【図1】本発明の一実施例を示すシステム構成図。FIG. 1 is a system configuration diagram showing an embodiment of the present invention.

【図2】論理空間の構成を示す概念図。FIG. 2 is a conceptual diagram showing a configuration of a logical space.

【図3】OS内部のデータ構造を示す概念図。FIG. 3 is a conceptual diagram showing a data structure inside an OS.

【図4】タスク番号を登録できるTLBの構成を示す概
念図。
FIG. 4 is a conceptual diagram showing a configuration of a TLB in which a task number can be registered.

【図5】本発明の一実施例を示す入出力割込み処理のフ
ローチャート。
FIG. 5 is a flowchart of an input / output interrupt process according to an embodiment of the present invention.

【図6】論理空間切り替えのOS内部のデータ構造を示
す概念図。
FIG. 6 is a conceptual diagram showing a data structure inside an OS for switching a logical space.

【図7】入出力割込み処理のシステム動作の従来例と本
実施例を示すタイムチャート。
FIG. 7 is a time chart showing a conventional example of a system operation of input / output interrupt processing and a present example.

【符号の説明】 100…計算機、110…中央処理装置、111…主記
憶装置、112…入出力制御装置、113…ディスク装
置、114…端末、115…TLB、116…キャッシ
ュ記憶、120…CPUバス、130…OS、131〜
134…タスク、135…論理空間切り替えルーチン、
140…ページテーブルエントリアドレス、141〜1
44…ページテーブル、150…実行中タスク番号、1
51〜154…タスク制御ブロック、160…論理ペー
ジ番号、161…タスク番号、162…物理ページ番
号。
DESCRIPTION OF SYMBOLS 100: Computer, 110: Central processing unit, 111: Main storage device, 112: Input / output control device, 113: Disk device, 114: Terminal, 115: TLB, 116: Cache storage, 120: CPU bus , 130 ... OS, 131-
134: task, 135: logical space switching routine,
140 ... Page table entry address, 141-1
44: Page table, 150: Running task number, 1
51 to 154: task control block, 160: logical page number, 161: task number, 162: physical page number.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 金子 茂則 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Shigenori Kaneko 5-2-1, Omika-cho, Hitachi City, Ibaraki Prefecture Inside the Omika Plant of Hitachi, Ltd.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 複数のタスクがそれぞれの論理空間を有
して動作するときの入出力割込み方法において、 前記タスクの一つが発行した入出力要求に対応する割込
みが発生した場合、タスク実行環境のうち、論理空間の
みを稼働中のタスクから前記入出力要求元のタスクのそ
れに切り替えることを特徴とする割込み処理方法。
1. An input / output interrupt method when a plurality of tasks operate with respective logical spaces, wherein when an interrupt corresponding to an input / output request issued by one of the tasks occurs, a task execution environment An interrupt processing method characterized in that only the logical space is switched from the running task to that of the input / output request source task.
【請求項2】 複数のタスクがそれぞれの論理空間を有
して動作するときの入出力割込み方法において、 前記タスクの一つが発行した入出力要求に対応する入出
力完了の割込みが他のタスクの実行中に発生した場合
に、当該割込み処理に必要なレジスタの値を退避し、前
記入出力要求を発行したタスクの論理空間に切り替え、
割込み処理ルーチンを実行し、その後、前記割込みを受
けたタスクの論理空間に再切り替えを行い、前記レジス
タの値を復帰することを特徴とする割込み処理方法。
2. An input / output interrupt method when a plurality of tasks operate with respective logical spaces, wherein an input / output completion interrupt corresponding to an input / output request issued by one of the tasks is interrupted by another task. If it occurs during execution, save the register values required for the interrupt processing, switch to the logical space of the task that issued the I / O request,
An interrupt processing method comprising: executing an interrupt processing routine; thereafter, re-switching to a logical space of the interrupted task, and restoring the value of the register.
【請求項3】 請求項2において、 前記割込み処理ルーチンは、前記入出力要求を発行した
タスクの論理空間上の領域との間で直接、入出力データ
を読み書きすることを特徴とする割込み処理方法。
3. The interrupt processing method according to claim 2, wherein the interrupt processing routine reads / writes input / output data directly from / to an area in a logical space of the task that issued the input / output request. .
【請求項4】 複数のタスクがそれぞれの論理空間を有
して動作するマルチタスク実行システムにおいて、 前記タスクの一つが発行した入出力要求に対応する入出
力完了割込みが発生した場合、稼働中のタスクと入出力
要求元タスクの論理空間のみを切り替える手段を備えた
ことを特徴とするマルチタスク実行システム。
4. In a multitask execution system in which a plurality of tasks operate with respective logical spaces, when an I / O completion interrupt corresponding to an I / O request issued by one of the tasks occurs, A multitask execution system comprising means for switching only a logical space between a task and an input / output request source task.
【請求項5】 複数のタスクがそれぞれの論理空間を有
して動作するマルチタスク実行システムにおいて、 オペレーティングシステム(OS)が、入出力要求の発
行元タスクを記憶し、前記入出力要求に対応する割込み
が発生した場合、前記発行元タスクの論理空間に切り替
えた後、割込み処理を実行させることを特徴とするマル
チタスク実行システム。
5. In a multitask execution system in which a plurality of tasks operate with respective logical spaces, an operating system (OS) stores an input / output request issuing task and responds to the input / output request. A multitask execution system, in which, when an interrupt occurs, an interrupt process is executed after switching to a logical space of the issuing task.
JP28211097A 1997-10-15 1997-10-15 Interruption processing method and multitask execution system Pending JPH11120011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28211097A JPH11120011A (en) 1997-10-15 1997-10-15 Interruption processing method and multitask execution system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28211097A JPH11120011A (en) 1997-10-15 1997-10-15 Interruption processing method and multitask execution system

Publications (1)

Publication Number Publication Date
JPH11120011A true JPH11120011A (en) 1999-04-30

Family

ID=17648263

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28211097A Pending JPH11120011A (en) 1997-10-15 1997-10-15 Interruption processing method and multitask execution system

Country Status (1)

Country Link
JP (1) JPH11120011A (en)

Similar Documents

Publication Publication Date Title
US6408325B1 (en) Context switching technique for processors with large register files
US8032716B2 (en) System, method and computer program product for providing a new quiesce state
JPH08278918A (en) System and method for execution of endian task
KR20030072550A (en) A data processing apparatus and method for saving return state
US20090216995A1 (en) System, method and computer program product for providing quiesce filtering for shared memory
US20060149940A1 (en) Implementation to save and restore processor registers on a context switch
JP2821345B2 (en) Asynchronous I / O control method
JP2829115B2 (en) File sharing method
JP5131269B2 (en) Multi-processing system
JP3088303B2 (en) Cache memory bank controller
JP2002202960A (en) Data processing method and device
JPH11120011A (en) Interruption processing method and multitask execution system
JPS603229B2 (en) Information processing method
JP3163196B2 (en) Instruction interruption information storage control method in virtual storage control
JPH0552539B2 (en)
JPH0133856B2 (en)
JPH0447350A (en) Main storage read/response control
JPH0553912A (en) Control method for cache memory
JPH03154139A (en) Cache memory
JP2735400B2 (en) Asynchronous I / O control method
JPH04340145A (en) Cache memory device
JPS6232554A (en) Extended memory controlling system
JPH04113432A (en) Virtual storage control method
JPH10289113A (en) Register context storage and restoration system for computer
JPH0384636A (en) Computer control system