JPH05233572A - Process dispatch system for multiprocessor - Google Patents

Process dispatch system for multiprocessor

Info

Publication number
JPH05233572A
JPH05233572A JP3476092A JP3476092A JPH05233572A JP H05233572 A JPH05233572 A JP H05233572A JP 3476092 A JP3476092 A JP 3476092A JP 3476092 A JP3476092 A JP 3476092A JP H05233572 A JPH05233572 A JP H05233572A
Authority
JP
Japan
Prior art keywords
run queue
processes
local
global
local run
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
JP3476092A
Other languages
Japanese (ja)
Inventor
Takaaki Sawada
貴章 澤田
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 JP3476092A priority Critical patent/JPH05233572A/en
Publication of JPH05233572A publication Critical patent/JPH05233572A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To repeat the execution with a single processor corresponding to a local run queue based on the time slice by holding the processes or the process groups in the local run queues for a fixed time based on the order of priority from the process groups which ere connected to an accessable global run queue from all processors. CONSTITUTION:The processes included in a global run queue 112 ere fetched to the local run queues 106-108 provided in the processors respectively in the order of priority. Then these processes are successively carried out based on the time slice. The processors 101-103 contain the processing means which return again the processes fetched to the local run queues and carried out to the queue 112 after a fixed time.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、プロセッサ毎にキャッ
シュメモリを有してなるマルチプロセッサシステムに於
いて、プロセッサ間の負荷バランスを維持しつつ、キャ
ッシュメモリ効果(キャッシュヒット率)を向上させる
ことのできるマルチプロセッサに於けるプロセスディス
パッチ方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention, in a multiprocessor system having a cache memory for each processor, improves the cache memory effect (cache hit ratio) while maintaining the load balance between the processors. The present invention relates to a process dispatch method in a multiprocessor capable of performing.

【0002】[0002]

【従来の技術】従来、マルチプロセッサシステムに於い
て、実行可能な複数のプロセス(タスク、ジョブ、スレ
ッド等)を到着順や優先度順等で全プロセッサからアク
セス可能なランキュー(レディキューともいう)に並
べ、各プロセッサがキューの先頭からプロセスを順番に
タイムスライスでディスパッチしてゆくという方式が存
在する。
2. Description of the Related Art Conventionally, in a multiprocessor system, a run queue (also called a ready queue) in which a plurality of executable processes (tasks, jobs, threads, etc.) can be accessed from all processors in the order of arrival or priority There is a method in which each processor dispatches processes sequentially from the head of the queue in time slices.

【0003】しかしながら、この方式によるプロセスス
ケジューリングを用いた場合、プロセスが頻繁に複数プ
ロセッサ間を移動してしまう。極端な例では、コンテク
ストスイッチが発生し、そのプロセスが再度ディスパッ
チされる度に実行プロセッサが変わる。
However, when the process scheduling according to this method is used, the process frequently moves among a plurality of processors. In the extreme case, a context switch occurs and the executing processor changes each time the process is redispatched.

【0004】このような状態下では、プロセス(プログ
ラム)のアクセス局所性によるキャッシングの効果が低
下するため、各CPUのキャッシュのヒット率が低下
し、システム全体のスループットが下がってしまうとい
う問題が生じる。
In such a state, the effect of caching due to the locality of access of the process (program) is reduced, so that the cache hit rate of each CPU is reduced and the throughput of the entire system is reduced. ..

【0005】この問題を回避するために、プロセスの実
行プロセッサを固定にしてしまうという方法がある。し
かしながらこの方法は実行可能なプロセス数が均等にな
らず、プロセッサ間の負荷バランスが悪くなるという問
題が生じる。
In order to avoid this problem, there is a method of fixing the process execution processor. However, this method has a problem that the number of processes that can be executed is not uniform and the load balance between the processors is deteriorated.

【0006】[0006]

【発明が解決しようとする課題】上述したように従来の
マルチプロセッサに於けるディスパッチ方式に於いて
は、プロセッサ間の負荷バランスを崩すことなく、キャ
ッシングの効果を高めることができないので、システム
のスループットが上がらないという問題があった。
As described above, in the conventional dispatching method in the multiprocessor, the caching effect cannot be enhanced without disturbing the load balance between the processors, so that the system throughput is improved. There was a problem that could not rise.

【0007】本発明は上記したような従来技術の欠点を
除去し、マルチプロセッサシステムに於いて、プロセッ
サ間の負荷バランスを崩さずに、キャッシングによる効
果を高め、システムのスループットを向上させることの
できるプロセスディスパッチ方式を提供することを目的
とする。
The present invention eliminates the above-mentioned drawbacks of the prior art, and in a multiprocessor system, the effect of caching can be enhanced and the system throughput can be improved without disturbing the load balance between the processors. The purpose is to provide a process dispatch method.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
に、本発明に係るマルチプロセッサにおけるプロセスデ
ィスパッチ方式に於いては、実行可能なプロセスを保持
するために全プロセッサからアクセス可能なグローバル
ランキューと、個々のプロセッサ毎に設けたローカルラ
ンキューとを持ち、プロセッサ毎にキャッシュメモリを
有してなるマルチプロセッサシステムに於いて、上記グ
ローバルランキュー内にあるプロセス中から優先度順に
プロセスをローカルランキューにフェッチしてくる手段
と、上記ローカルランキューにフェッチしてきたプロセ
スをタイムスライスに基づき順次実行する手段と、一定
時間経過後、ローカルランキューにフェッチしてきて実
行していたプロセスを再びグローバルランキューに戻す
手段とを具備してなることを特徴とする。
In order to achieve the above object, in a process dispatch system in a multiprocessor according to the present invention, a global run queue accessible from all processors to hold an executable process is provided. , In a multiprocessor system having a local run queue provided for each processor and having a cache memory for each processor, processes are fetched into the local run queue from the processes in the global run queue in order of priority. And means for sequentially executing the processes fetched to the local run queue based on the time slice, and means for returning the processes fetched to the local run queue and executed after a certain time to the global run queue again. do it And wherein the Rukoto.

【0009】又、本発明に於いては、実行可能なプロセ
スを保持するために全プロセッサからアクセス可能なグ
ローバルランキューと、個々のプロセッサ毎に設けたロ
ーカルランキューとを持ち、プロセッサ毎にキャッシュ
メモリを有したマルチプロセッサシステムに於いて、上
記グローバルランキュー内にあるプロセス中から同一ア
ドレス空間を共有する複数のプロセスをローカルランキ
ューにフェッチしてくる手段と、ローカルランキューに
フェッチしてきたプロセスをタイムスライスに基づき順
次実行する手段と、一定時間経過後ローカルランキュー
にフェッチしてきたプロセスを再びグローバルランキュ
ーに戻す手段とを具備してなることを特徴とする。
Further, in the present invention, a global run queue accessible from all processors to hold an executable process and a local run queue provided for each processor are provided, and a cache memory is provided for each processor. In a multiprocessor system that has, based on a time slice, a method for fetching a plurality of processes sharing the same address space from among the processes in the global run queue to a local run queue and a process fetched to the local run queue. It is characterized by comprising means for sequentially executing and means for returning the process fetched to the local run queue to the global run queue again after a certain period of time.

【0010】[0010]

【作用】本発明によれば、複数の各プロセッサが、グロ
ーバルランキュー内にあるプロセス中から、プロセスま
たはプロセス群を、優先度、アドレス空間等に従い、あ
る一定時間だけローカルランキュー内に保持して、タイ
ムスライスに基づき実行を繰り返し行なうことによっ
て、プロセッサのアクセスにおけるキャッシュのヒット
率の向上が図れる。また、これと同時に、あるタイミン
グで全プロセッサからアクセス可能なグローバルランキ
ューと各ローカルランキュー間でプロセスまたはプロセ
ス群の移動を行なうことによって、プロセッサ間の負荷
バランスの崩れが防げる。このようにして、マルチプロ
セッサにおいて、プロセッサ間の負荷バランスを崩さ
ず、かつキャッシングによる効果を高め、システムのス
ループットを向上させることができる。
According to the present invention, each of the plurality of processors holds a process or a group of processes from the processes in the global run queue in the local run queue for a certain period of time according to the priority, the address space, etc. By repeating the execution based on the time slice, the cache hit rate in the processor access can be improved. At the same time, by moving a process or a group of processes between a global run queue accessible from all processors and each local run queue at a certain timing, it is possible to prevent the load balance between processors from being lost. In this way, in a multiprocessor, it is possible to improve the throughput of the system without disturbing the load balance between the processors and enhancing the effect of caching.

【0011】[0011]

【実施例】以下図面を参照して本発明の実施例を説明す
る。図1は本発明の第1実施例の構成を示すブロック図
である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the first embodiment of the present invention.

【0012】この図1に示す本実施例の共有メモリ型マ
ルチプロセッサシステムは、3つのプロセッサ(PM
0,PM1,PM2)101,102,103と、これ
ら複数のプロセッサ(PM0,PM1,PM2)10
1,102,103にメモリバス(BUS)104を介
して接続された共有メモリ(CM)105とでなる構成
を例示している。上記各プロセッサ(PM0,PM1,
PM2)101,102,103はそれぞれ専用のキャ
ッシュメモリを持つ。
The shared memory type multiprocessor system of this embodiment shown in FIG. 1 has three processors (PM).
0, PM1, PM2) 101, 102, 103 and a plurality of these processors (PM0, PM1, PM2) 10
1, a shared memory (CM) 105 connected to a memory bus (BUS) 104 is illustrated as an example. Each of the above processors (PM0, PM1,
The PM2) 101, 102, 103 each have a dedicated cache memory.

【0013】上記共有メモリ(CM)105上には、全
てのプロセッサ(PM0,PM1,PM2)101,1
02,103からアクセス可能なグローバルランキュー
(GRQ)112と、そのグローバルランキュー(GR
Q)112につながっている実行待ちプロセス(P)の
数を格納するグローバルランキューカウンタ(GC)1
13と、各プロセッサ(PM0,PM1,PM2)10
1,102,103毎に設けられた、実行待ちプロセス
(P)114をつないでおくローカルランキュー(LR
Q0,LRQ1,LRQ2)106,107,108
と、このローカルランキュー(LRQ0,LRQ1,L
RQ2)106,107,108内のプロセス数を格納
するローカルランキューカウンタ(LC0,LC1,L
C2)109,110,111とが保持される。
On the shared memory (CM) 105, all the processors (PM0, PM1, PM2) 101, 1
02 and 103, the global run queue (GRQ) 112 and the global run queue (GRQ)
Q) Global run queue counter (GC) 1 that stores the number of pending processes (P) connected to 112
13 and each processor (PM0, PM1, PM2) 10
A local run queue (LR) that is provided for each of the 1, 102, and 103 and connects the waiting process (P) 114
Q0, LRQ1, LRQ2) 106, 107, 108
And this local run queue (LRQ0, LRQ1, L
RQ2) Local run queue counters (LC0, LC1, L that store the number of processes in 106, 107, 108)
C2) 109, 110 and 111 are held.

【0014】即ち、プロセッサ(PM0)101にはロ
ーカルランキュー(LRQ0)106とローカルランキ
ューカウンタ(LC0)109、プロセッサ(PM1)
102にはローカルランキュー(LRQ1)107とロ
ーカルランキューカウンタ(LC1)110、プロセッ
サ(PM2)103にはローカルランキュー(LRQ
2)108とローカルランキューカウンタ(LC2)1
11がそれぞれ対応して設けられる。
That is, the processor (PM0) 101 has a local run queue (LRQ0) 106, a local run queue counter (LC0) 109, and a processor (PM1).
The local run queue (LRQ1) 107 and the local run queue counter (LC1) 110 are shown in 102, and the local run queue (LRQ) is shown in the processor (PM2) 103.
2) 108 and local run queue counter (LC2) 1
11 are provided correspondingly.

【0015】上記グローバルランキューカウンタ(G
C)113、及び各ローカルランキューカウンタ(LC
0,LC1,LC2)109,110,111は、各ラ
ンキュー内のプロセスの生成、削除操作時に値が変更
(更新)される。
The global run queue counter (G
C) 113 and each local run queue counter (LC
The values of 0, LC1, LC2) 109, 110, and 111 are changed (updated) at the time of creating and deleting processes in each run queue.

【0016】例えば、各プロセッサ(PM0,PM1,
PM2)101,102,103のスケジューラが、そ
れぞれグローバルランキュー(GRQ)112から自ロ
ーカルランキュー(LRQ0,LRQ1,LRQ2)1
06,107,108へフェッチしてくるプロセス数を
一度にX個と固定しておく。
For example, each processor (PM0, PM1,
The schedulers of PM2) 101, 102, and 103 respectively transmit from the global run queue (GRQ) 112 to their own local run queues (LRQ0, LRQ1, LRQ2) 1
The number of processes fetched to 06, 107, 108 is fixed at X at a time.

【0017】そして、各プロセッサ(PM0,PM1,
PM2)101,102,103は、ローカルランキュ
ー(LRQ0,LRQ1,LRQ2)106,107,
108へフェッチしてきたプロセス群を、タイムスライ
スに基づき順次実行し、各プロセスのCPU消費時間の
総和(ここでは[TCT]と呼ぶ)がY秒以内なら、そ
のプロセス群は自ローカルランキュー内に留め、[TC
T]がY秒経過後には、自ローカルランキューにつなが
っている全てのプロセス、及び自プロセッサで実行して
いたプロセスをグローバルランキュー(GRQ)112
へ戻すとする。また、空になったローカルランキューに
はグローバルランキュー(GRQ)112から再びX個
のプロセスをフェッチするものとする。
Then, each processor (PM0, PM1,
PM2) 101, 102, 103 are local run queues (LRQ0, LRQ1, LRQ2) 106, 107,
The process groups fetched to 108 are sequentially executed based on the time slice, and if the total CPU consumption time of each process (referred to as [TCT] here) is within Y seconds, the process group remains in its own local run queue. , [TC
After [T] has passed Y seconds, the global run queue (GRQ) 112 is executed for all processes connected to the local run queue and processes executed by the local processor.
I will return to. Further, it is assumed that X processes are fetched again from the global run queue (GRQ) 112 to the empty local run queue.

【0018】但し[TCT]の計算に使用するCPU消
費量は、プロセスが生成された時刻を「0」としたとき
の消費時間ではなく、プロセスが各ローカルランキュー
にフェッチされてからの消費時間である。図2は、上記
図1に示す実施例によるディスパッチ方式のアルゴリズ
ムを示すフローチャートである。
However, the CPU consumption used for the calculation of [TCT] is not the consumption time when the time when the process is generated is "0", but the consumption time after the process is fetched into each local run queue. is there. FIG. 2 is a flowchart showing an algorithm of the dispatch method according to the embodiment shown in FIG.

【0019】各プロセッサ(PM0,PM1,PM2)
101,102,103に対応するスケジューラは、先
ず、グローバルランキュー(GRQ)112からX個の
プロセスを自ローカルランキュー(LRQ0,LRQ
1,LRQ2)106,107,108へフェッチして
くる(図2ステップa1)。
Each processor (PM0, PM1, PM2)
The schedulers corresponding to 101, 102 and 103 first send X processes from the global run queue (GRQ) 112 to their own local run queues (LRQ0, LRQ).
1, LRQ2) 106, 107, 108 are fetched (step a1 in FIG. 2).

【0020】このとき、ローカルランキューカウンタ
(LC0,LC1,LC2)109,110,111の
値はXにセットされる。また、この時点では、[TC
T]を「0」に初期化する(図2ステップa2)。
At this time, the values of the local run queue counters (LC0, LC1, LC2) 109, 110, 111 are set to X. At this point, [TC
T] is initialized to "0" (step a2 in FIG. 2).

【0021】次に、プロセッサ(PM0,PM1,PM
2)101,102,103は、自ローカルランキュー
(LRQ0,LRQ1,LRQ2)106,107,1
08につながっているX個のプロセスの中の一つをディ
スパッチし、タイムスライスに基づき実行を行なう(図
2ステップa3,a4)。
Next, the processors (PM0, PM1, PM
2) 101, 102, 103 are local local queues (LRQ0, LRQ1, LRQ2) 106, 107, 1
One of the X processes connected to 08 is dispatched and executed based on the time slice (steps a3 and a4 in FIG. 2).

【0022】そして、そのプロセスが実行の時間刻みを
使い果たした後、プロセスのCPU消費時間(この場
合、時間きざみの値)が[TCT]に加算される(図2
ステップa5)。
Then, after the process runs out of time intervals of execution, the CPU consumption time of the process (in this case, the value of the time step) is added to [TCT] (FIG. 2).
Step a5).

【0023】ここで、[TCT]の値がY秒を越えてい
たときには、そのプロセッサのスケジューラが自ローカ
ルランキューにフェッチしてきたX個のプロセスを全て
グローバルランキュー(GRQ)112へ戻し、再び、
グローバルランキュー(GRQ)112から新たにX個
のプロセスを自ローカルランキューへフェッチする(図
2ステップa7,a1)。
When the value of [TCT] exceeds Y seconds, the scheduler of the processor returns all the X processes fetched to the local run queue to the global run queue (GRQ) 112, and again,
X new processes are fetched from the global run queue (GRQ) 112 to the local run queue (steps a7 and a1 in FIG. 2).

【0024】又、逆に[TCT]の値がY秒以内のとき
は、プロセッサはそれまで実行していたプロセスを自ロ
ーカルランキューへ戻したあと、自ローカルランキュー
より次のプロセスをディスパッチして実行を続ける(図
2ステップa6,a3,a4,…)。
On the contrary, when the value of [TCT] is within Y seconds, the processor returns the process which was being executed up to that time to its own local run queue, and then dispatches and executes the next process from its own local run queue. (Steps a6, a3, a4, ... in FIG. 2) are continued.

【0025】このようなアルゴリズムで行なわれるディ
スパッチ方式をとった場合、ある時点におけるグローバ
ルランキューとローカルランキューの状態は例えば図3
のようになる。
When the dispatch method performed by such an algorithm is adopted, the states of the global run queue and the local run queue at a certain time point are shown in FIG.
become that way.

【0026】尚、図3に於いて、301,302,30
3は、図1のプロセッサ(PM0,PM1,PM2)1
01,102,103に相当し、304,305,30
6は、図1のローカルランキュー(LRQ0,LRQ
1,LRQ2)106,107,108に相当し、30
8は図1のグローバルランキュー(GRQ)112に相
当する。307は実行待ちプロセス(P)である。
Incidentally, in FIG. 3, 301, 302, 30
3 is the processor (PM0, PM1, PM2) 1 of FIG.
01, 102, 103, 304, 305, 30
6 is the local run queue (LRQ0, LRQ of FIG.
1, LRQ2) 106, 107, 108, and 30
Reference numeral 8 corresponds to the global run queue (GRQ) 112 in FIG. 307 is an execution waiting process (P).

【0027】この図3に示す状態下に於いて、各ローカ
ルランキュー(LRQ0,LRQ1,LRQ2)30
4,305,306には、常にX−1個以内のプロセス
(P)がつながっている(即ち、一つのプロセスはプロ
セッサで実行中である。また、入出力待ちや実行の終了
などによる実行待ちプロセスの消滅がおこるので、ロー
カルランキュー内のプロセス数は減る)。
Under the condition shown in FIG. 3, the local run queues (LRQ0, LRQ1, LRQ2) 30 are provided.
No more than X-1 processes (P) are always connected to 4, 305, 306 (that is, one process is being executed by the processor. Also, waiting for execution due to I / O wait, execution termination, etc.) The number of processes in the local run queue is reduced because the process disappears).

【0028】各ローカルランキュー(LRQ0,LRQ
1,LRQ2)304,305,306内のプロセス群
は、各々が現時点で割り当てられているプロセッサ(P
M0,PM1,PM2)301,302,303に対応
したスケジューラによって、グローバルランキュー(G
RQ)308へ戻される間での間は、何度コンテクスト
スイッチが起きても他のプロセッサへディスパッチされ
ることはない。これによって、プロセスの頻繁なプロセ
ッサ間移動を抑制することができ、キャッシング効果を
上げることが可能となる。
Each local run queue (LRQ0, LRQ
1, LRQ2) 304, 305, and 306 are respectively assigned to the processors (P
M0, PM1, PM2) 301, 302, 303 corresponding to the global run queue (G
While it is being returned to the RQ) 308, it will not be dispatched to another processor no matter how many context switches occur. As a result, it is possible to suppress frequent movement of processes between processors, and it is possible to improve the caching effect.

【0029】更に、プロセッサ間の負荷バランスが大き
く崩れるのを防ぐことができる。これを図4を参照して
説明する。尚、図4に於いて、401,402,403
は、図1のプロセッサ(PM0,PM1,PM2)10
1,102,103(図3の301,302,303)
に相当し、404,405,406は、図1のローカル
ランキュー(LRQ0,LRQ1,LRQ2)106,
107,108(図3の304,305,306)に相
当し、408は図1のグローバルランキュー(GRQ)
112(図3の308)に相当する。407は実行待ち
プロセス(P)である。
Further, it is possible to prevent the load balance between the processors from being largely lost. This will be described with reference to FIG. In FIG. 4, 401, 402, 403
Is the processor (PM0, PM1, PM2) 10 of FIG.
1, 102, 103 (301, 302, 303 in FIG. 3)
1 corresponds to the local run queues (LRQ0, LRQ1, LRQ2) 106,
107, 108 (304, 305, 306 in FIG. 3), and 408 is the global run queue (GRQ) in FIG.
This corresponds to 112 (308 in FIG. 3). Reference numeral 407 is an execution waiting process (P).

【0030】図4は、上記図3の状態から各プロセスの
実行時間が数秒間経過後([TCT]はY秒以内)の状
態の一例であるが、この例では、プロセスの消滅によっ
て、各プロセッサに対する実行待ちプロセス数がプロセ
ッサ間で不均等になってしまっている。即ち、この例で
は、プロセッサ(PM2)403のプロセス処理に、例
えばプロセス間のスイッチ、I/Oの処理待ち(アイド
ル)等が介在して、プロセッサ(PM2)403の[T
CT]が他のプロセッサ(PM0,PM1)401,4
02に比し極端に小さい状態となっている。
FIG. 4 shows an example of a state in which the execution time of each process has passed several seconds ([TCT] is within Y seconds) from the state of FIG. 3 above. The number of pending processes for processors is uneven among the processors. That is, in this example, in the process processing of the processor (PM2) 403, for example, a switch between processes, waiting for I / O processing (idle), and the like intervene, and [T
CT] is another processor (PM0, PM1) 401, 4
It is extremely smaller than 02.

【0031】しかし、これはプロセッサ(PM0,PM
1)401,402の[TCT]がY秒を超過すると、
そのプロセッサがもつローカルランキュー(LRQ0,
LRQ1)404,405内のプロセスが再びグローバ
ルランキュー(GRQ)408からフェッチされるの
で、各プロセッサ(PM0,PM1,PM2)401,
402,403に対する実行待ちプロセス数が各プロセ
ッサ間で均等になり、図3の状態に戻る。
However, this is a processor (PM0, PM
1) When [TCT] of 401 and 402 exceeds Y seconds,
The local run queue (LRQ0,
Since the processes in the LRQ1) 404 and 405 are fetched again from the global run queue (GRQ) 408, each processor (PM0, PM1, PM2) 401,
The number of pending processes for 402 and 403 becomes equal among the processors, and the state returns to the state of FIG.

【0032】このように、ローカルランキューとグロー
バルランキュー間での定期的なプロセス入れ替え処理の
実行により、プロセッサ間の負荷バランスが大きく崩れ
るのを防ぐことができる。
As described above, it is possible to prevent the load balance between the processors from being greatly disturbed by executing the periodical process replacement processing between the local run queue and the global run queue.

【0033】ここで、上記実施例において、各プロセッ
サに対し、キャッシング効果を更に向上させるために、
プロセスのアクセス局所性を意識したスケジューリング
が考えられる。
Here, in the above embodiment, in order to further improve the caching effect for each processor,
Scheduling considering the access locality of the process is possible.

【0034】例えば、今、F0,F1,F2という三つ
のファイルがあり、ファイルF0にアクセスするプロセ
スはアドレス空間A0を、ファイルF1にアクセスする
プロセスはアドレス空間A1を、ファイルF2にアクセ
スするプロセスはアドレス空間A2をそれぞれ共有して
いるとする。
For example, now, there are three files F0, F1, and F2. The process accessing the file F0 has the address space A0, the process accessing the file F1 has the address space A1, and the process accessing the file F2 has the file F2. It is assumed that the address space A2 is shared.

【0035】このとき、図1に於ける各プロセッサ(P
M0,PM1,PM2)101,102,103のスケ
ジューラが、グローバルランキュー(GRQ)112か
ら自ローカルランキュー(LRQ0,LRQ1,LRQ
2)106,107,108へフェッチしてくるプロセ
スを選択する際に、単に優先度順で選ぶのではなく、プ
ロセッサ(PM0)101にはファイルF0へアクセス
するプロセス、即ちアドレス空間A0を共有するプロセ
スを、プロセッサ(PM1)102にはファイルF1へ
アクセスするプロセス、即ちアドレス空間A1を共有す
るプロセスを、プロセッサ(PM2)103にはファイ
ルF2へアクセスするプロセス、即ちアドレス空間A2
を共有するプロセスをそれぞれ優先的に選ぶようにす
る。
At this time, each processor (P
The schedulers of M0, PM1, PM2) 101, 102, 103 from the global run queue (GRQ) 112 to their own local run queues (LRQ0, LRQ1, LRQ).
2) When selecting the processes fetched to 106, 107, 108, the process to access the file F0, that is, the address space A0 is shared by the processor (PM0) 101, rather than simply selecting them in order of priority. A process for accessing the file F1 to the processor (PM1) 102, that is, a process sharing the address space A1, and a process accessing to the file F2 for the processor (PM2) 103, that is, the address space A2.
Priority should be given to each process that shares the.

【0036】このようにすれば、各プロセッサ(PM
0,PM1,PM2)101,102,103に割り当
てられるプロセス群が、ある程度、アクセス空間を共有
することになるので、よりキャッシュのヒット率が上が
り、キャッシング効果が大幅に向上する。
In this way, each processor (PM
0, PM1, PM2) 101, 102, 103 share the access space to some extent, so that the cache hit rate is further increased and the caching effect is significantly improved.

【0037】上記した第1実施例のディスパッチ方式で
は、ローカルランキューとグローバルランキューとの間
のプロセス移動に於いて、ローカルランキュー内のプロ
セスの[TCT](各プロセスのCPU消費時間の総
和)が、ある一定値(前記例ではY秒)に達したとき
に、ある一定個数(前記例ではX個)のプロセス群をひ
とまとまりとして扱う方法である。このように、プロセ
スをグループ化して扱う実施例に対して、プロセス単体
を扱う第2実施例を以下に挙げる。この第2実施例で
は、ローカルランキュー内の各プロセスのCPU消費時
間を[CT]とする。
In the dispatch method of the first embodiment described above, in the process migration between the local run queue and the global run queue, the [TCT] of the processes in the local run queue (total CPU consumption time of each process) is In this method, when a certain value (Y seconds in the above example) is reached, a certain number (X in the example) of process groups are treated as a group. As described above, a second example of handling a single process will be described below, as compared to an example of handling a group of processes. In the second embodiment, the CPU consumption time of each process in the local run queue is [CT].

【0038】但し、ここでの[CT]はプロセスがグロ
ーバルランキューからローカルランキューへフェッチさ
れてきた時点を「0」として、それからCPUをどのく
らい使用したかを示す時間である。従って、あるプロセ
スの[CT]は、そのプロセスがローカルランキュー内
にあるときに限り有効な値である。
However, [CT] here is the time indicating how much the CPU has been used since the time when the process is fetched from the global run queue to the local run queue is "0". Therefore, the [CT] of a process is a valid value only when the process is in the local run queue.

【0039】ここで、各プロセッサのスケジューラが、
ローカルランキュー内にあるプロセスの[CT]を調
べ、Z秒よりも大きい値の[CT]をもつプロセスはグ
ローバルランキューへ戻し、代わりにグローバルランキ
ューから一つのプロセスを取り出し、自ローカルランキ
ューへつなぐ処理を行なう。
Here, the scheduler of each processor is
Check the [CT] of the process in the local run queue, and return the process with the [CT] greater than Z seconds to the global run queue. Instead, retrieve one process from the global run queue and connect it to the local run queue. To do.

【0040】また、このときローカルランキュー内のプ
ロセスの実行が進むにつれて、実行待ちプロセスの消滅
がおこりローカルランキュー内のプロセス数が減ってし
まう場合がある。
Further, at this time, as the execution of the processes in the local run queue progresses, the number of processes in the local run queue may decrease due to the disappearance of the waiting process.

【0041】そこで、各プロセッサのスケジューラは、
適当なタイミングでローカルランキューカウンタの値に
よりプロセス数をチェックして、もし、ある一定数(プ
ロセス数の上限値)よりも少ないときにはグローバルラ
ンキューより、その一定数になるまでローカルランキュ
ーへプロセスの補充を行なう。この第2実施例のディス
パッチ方式のアルゴリズムを図5に示す。
Therefore, the scheduler of each processor is
The number of processes is checked by the value of the local run queue counter at an appropriate timing, and if the number is less than a certain number (upper limit of the number of processes), the global run queue is replenished with processes until the number reaches the certain number. To do. FIG. 5 shows the dispatch type algorithm of the second embodiment.

【0042】ローカルランキュー内のプロセス数の上限
値をMXPとすると、まず、グローバルランキューから
ローカルランキューへ[(MXP)−(ローカルランキ
ューカウンタ)]個のプロセスをフェッチしてくる。こ
のとき、フェッチしてきたプロセスの[CT]を「0」
に初期化する(図5ステップb1,b2)。プロセッサ
はローカルランキュー内の一プロセスをディスパッチ
し、タイムスライスに基づき実行を行なう(ステップb
3,b4)。そして、実行が終了したら[CT]を更新
する(ステップb5)。
When the upper limit value of the number of processes in the local run queue is MXP, first, [(MXP)-(local run queue counter)] processes are fetched from the global run queue to the local run queue. At this time, [CT] of the fetched process is set to "0".
Initialization (steps b1 and b2 in FIG. 5). The processor dispatches a process in the local run queue and executes it based on the time slice (step b).
3, b4). Then, when the execution is completed, [CT] is updated (step b5).

【0043】[CT]を更新した後、グローバルランキ
ューとローカルランキュー間でのプロセス入れ替えを決
定するため、Z秒よりも大きければ、いま実行を終了し
たプロセスをローカルランキューではなくグローバルラ
ンキューへ戻し、逆にグローバルランキューからはロー
カルランキューへプロセスを補充する(ステップb6,
b7,b1,…)。
After [CT] is updated, in order to determine the process switching between the global run queue and the local run queue, if it is longer than Z seconds, the process that has just finished being executed is returned to the global run queue instead of the local run queue, and the process is reversed. Then, the process is replenished from the global run queue to the local run queue (step b6).
b7, b1, ...).

【0044】一方、[CT]がZ秒以下の場合、プロセ
スはローカルランキューへ戻され実行を待ち、プロセッ
サは新たなプロセスの実行を行なう(ステップb6,b
3)。このアルゴリズムでは、ローカルランキューへの
プロセス補充のタイミングを[CT]がZ秒を越えたと
きと同期して行なっている。
On the other hand, if [CT] is less than Z seconds, the process is returned to the local run queue and waits for execution, and the processor executes a new process (steps b6, b).
3). In this algorithm, the timing of replenishing the process to the local run queue is synchronized with the time when [CT] exceeds Z seconds.

【0045】図6は第2実施例での動作を示している。
尚、図6に於いて、601,602,603は、図1の
プロセッサ(PM0,PM1,PM2)101,10
2,103に相当し、604,605,606は、図1
のローカルランキュー(LRQ0,LRQ1,LRQ
2)106,107,108に相当し、609は図1の
グローバルランキュー(GRQ)112に相当する。6
07は移動対象プロセスである。
FIG. 6 shows the operation of the second embodiment.
In FIG. 6, reference numerals 601, 602 and 603 denote the processors (PM0, PM1, PM2) 101, 10 of FIG.
2 and 103, and 604, 605, and 606 are shown in FIG.
Local run queue (LRQ0, LRQ1, LRQ
2) 106, 107, and 108, and 609 corresponds to the global run queue (GRQ) 112 in FIG. 6
Reference numeral 07 is a process to be moved.

【0046】ここでは、プロセッサ(PM0)601で
実行されたプロセスが、実行を終えた直後の[CT]の
値がZ秒以上となり、グローバルランキュー(GRQ)
609へ移される条件を満たしたので、そのプロセスは
グローバルランキュー(GRQ)609へ渡され、一
方、グローバルランキュー(GRQ)609からは1つ
のプロセスがローカルランキュー(LRQ0)604に
フェッチされる。
In this case, the value of [CT] immediately after the process executed by the processor (PM0) 601 is finished is Z seconds or more, and the global run queue (GRQ) is reached.
The process is passed to the global run queue (GRQ) 609 because the condition to be moved to 609 is satisfied, while one process is fetched from the global run queue (GRQ) 609 to the local run queue (LRQ0) 604.

【0047】このように、ローカルランキューにつなが
っているプロセスは、しばらくの間(この例の場合CT
>Z秒となるまで)は唯一のプロセッサ上でのみ実行さ
れることになるので、キャッシング効果が向上する。
As described above, the process connected to the local run queue is for a while (CT in this example).
> Z seconds) will be executed on only one processor, so the caching effect is improved.

【0048】また、図7は、ローカルランキュー内のプ
ロセス数をローカルランキューカウンタ(LC0)70
4により調べ、MXPより少ないので、グローバルラン
キュー(GRQ)709から補充する例である。尚、図
7に於いて、701,702,703は、図1のプロセ
ッサ(PM0,PM1,PM2)101,102,10
3に相当し、704,705,706は、図1のローカ
ルランキュー(LRQ0,LRQ1,LRQ2)10
6,107,108に相当し、709は図1のグローバ
ルランキュー(GRQ)112に相当する。707は移
動対象プロセス、708は補充プロセスである。
Further, FIG. 7 shows the number of processes in the local run queue as a local run queue counter (LC0) 70.
In this example, the global run queue (GRQ) 709 is replenished because it is less than MXP. In FIG. 7, reference numerals 701, 702, 703 denote processors (PM0, PM1, PM2) 101, 102, 10 of FIG.
3 corresponds to the local run queues (LRQ0, LRQ1, LRQ2) 10 in FIG.
6, 107 and 108, and 709 corresponds to the global run queue (GRQ) 112 in FIG. Reference numeral 707 is a movement target process, and 708 is a supplement process.

【0049】このように、ローカルランキュー内のプロ
セス数をローカルランキューカウンタにより調べて、M
XPより少ないとき、グローバルランキュー(GRQ)
709から補充するすることにより、プロセッサ間のプ
ロセス数がある程度、均等に保たれ、負荷バランスが良
くなる。
In this way, the number of processes in the local run queue is checked by the local run queue counter, and M
Global run queue (GRQ) when less than XP
By replenishing from 709, the number of processes among the processors is maintained to some extent evenly, and the load balance is improved.

【0050】[0050]

【発明の効果】以上詳記したように本発明によれば、実
行可能なプロセスを保持するための、全プロセッサから
アクセス可能なグローバルランキューと、複数のプロセ
ッサ各々に固有のローカルランキューとをもつ、各プロ
セッサにキャッシュメモリを備えたマルチプロセッサシ
ステムに於いて、プロセスまたはプロセス群を、ある一
定時間だけローカルランキュー内に保持し、そのローカ
ルランキューに対応する一つのプロセッサ上でタイムス
ライスに基づき実行を繰り返し行なうことにより、プロ
セッサのアクセスにおけるキャッシュのヒット率を向上
できる。また、これと同時に、あるタイミングで全プロ
セッサからアクセス可能なグローバルランキューと各ロ
ーカルランキューとの間でプロセスまたはプロセス群の
移動を行なうことによって、プロセッサ間の負荷バラン
スが大きく乱れるのを防ぐことができる。これにより、
システムのスループットを向上させることができる。
As described in detail above, according to the present invention, a global run queue accessible from all processors for holding an executable process and a local run queue unique to each of a plurality of processors are provided. In a multiprocessor system in which each processor has a cache memory, hold a process or processes in the local run queue for a certain period of time, and repeat the execution based on the time slice on one processor corresponding to the local run queue. By doing so, the cache hit rate in processor access can be improved. At the same time, by moving a process or a group of processes between a global run queue accessible from all processors and each local run queue at a certain timing, it is possible to prevent the load balance between processors from being significantly disturbed. .. This allows
The throughput of the system can be improved.

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

【図1】本発明の実施例の構成を示すブロック図。FIG. 1 is a block diagram showing a configuration of an exemplary embodiment of the present invention.

【図2】図1に示す実施例のディスパッチ方式のアルゴ
リズムを示すフローチャート。
FIG. 2 is a flowchart showing an algorithm of the dispatch method of the embodiment shown in FIG.

【図3】図1に示す実施例のシステムにおいて、第1実
施例のディスパッチ方式を用いたときのグローバルラン
キューと各ローカルランキューの状態を示す図。
FIG. 3 is a diagram showing the states of a global run queue and local run queues when the dispatch system of the first embodiment is used in the system of the embodiment shown in FIG.

【図4】図1に示す実施例のシステムにおいて、図3の
状態から数秒経過後のグローバルランキューと各ローカ
ルランキューの状態を示す図。
4 is a diagram showing the states of the global run queue and each local run queue after a few seconds have elapsed from the state of FIG. 3 in the system of the embodiment shown in FIG.

【図5】本発明の第2実施例によるディスパッチ方式の
アルゴリズムを示すフローチャート。
FIG. 5 is a flowchart showing an algorithm of the dispatch method according to the second embodiment of the present invention.

【図6】図1に示す構成のシステムにおいて、第2実施
例のディスパッチ方式を用いたときのグローバルランキ
ューとローカルランキューとの間でのプロセス移動を示
す図。
FIG. 6 is a diagram showing process movement between a global run queue and a local run queue when the dispatch system of the second embodiment is used in the system having the configuration shown in FIG.

【図7】第2実施例のディスパッチ方式において、プロ
セッサ間での負荷バランスを保つためにグローバルラン
キューからローカルランキューへのプロセス補充を示す
図。
FIG. 7 is a diagram showing process replenishment from a global run queue to a local run queue in order to maintain a load balance between processors in the dispatch system of the second embodiment.

【符号の説明】[Explanation of symbols]

101,102,103、301,302,303、4
01,402,403、601,602,603、70
1,702,703…プロセッサ(キャッシュ付きのプ
ロセッサモジュール;PM0,PM1,PM2)。 104…メモリバス(BUS)。 105…共有メモリ(CM)。 106,107,108、304,305,306、4
04,405,406、604,605,606、70
4,705,706…ローカルランキュー(LRQ0,
LRQ1,LRQ2)。 109,110,111…ローカルランキューカウンタ
(LC0,LC1,LC2)。 112,308,408,609,709…グローバル
ランキュー(GRQ)。 113…グローバルランキューカウンタ(GC)。 114,307,407,608,…実行待ちプロセス
(P)。 607,707…移動対象プロセス。 708…補充プロセス。
101, 102, 103, 301, 302, 303, 4
01, 402, 403, 601, 602, 603, 70
1, 702, 703 ... Processor (processor module with cache; PM0, PM1, PM2). 104 ... Memory bus (BUS). 105 ... Shared memory (CM). 106, 107, 108, 304, 305, 306, 4
04,405,406,604,605,606,70
4, 705, 706 ... Local run queue (LRQ0,
LRQ1, LRQ2). 109, 110, 111 ... Local run queue counters (LC0, LC1, LC2). 112, 308, 408, 609, 709 ... Global run queue (GRQ). 113 ... Global run queue counter (GC). 114, 307, 407, 608, ... Waiting process (P). 607, 707 ... Process to be moved. 708 ... Replenishment process.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 実行可能なプロセスを保持するための、
全プロセッサからアクセス可能なグローバルランキュー
と、複数のプロセッサ各々に固有のローカルランキュー
とをもち、かつ各プロセッサにキャッシュメモリをもつ
マルチプロセッサシステムに於いて、 上記グローバルランキュー内にあるプロセス中から優先
度順にプロセスを上記ローカルランキューにフェッチし
てくる手段と、 上記ローカルランキューにフェッチしてきたプロセス群
をタイムスライスに基づき順次実行する手段と、 上記ローカルランキューにフェッチしてきたプロセス群
を一定時間実行した後に上記プロセス群を優先度に基づ
き再び上記グローバルランキューに戻す手段とを具備し
てなることを特徴とするマルチプロセッサに於けるプロ
セスディスパッチ方式。
1. For holding a runnable process,
In a multiprocessor system that has a global run queue accessible from all processors and a local run queue unique to each of the multiple processors, and each processor has a cache memory, the processes in the global run queue are listed in order of priority. Means for fetching a process into the local run queue, means for sequentially executing the process group fetched in the local run queue based on a time slice, and the process after the process group fetched in the local run queue is executed for a certain time A process dispatch system in a multiprocessor, comprising means for returning a group to the global run queue again based on priority.
【請求項2】 グローバルランキュー内にあるプロセス
中から同一アドレス空間を共有する複数のプロセスをロ
ーカルランキューにフェッチしてくる手段をもつ請求項
1記載のマルチプロセッサに於けるプロセスディスパッ
チ方式。
2. The process dispatch method in a multiprocessor according to claim 1, further comprising means for fetching a plurality of processes sharing the same address space from among the processes in the global run queue to a local run queue.
JP3476092A 1992-02-21 1992-02-21 Process dispatch system for multiprocessor Pending JPH05233572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3476092A JPH05233572A (en) 1992-02-21 1992-02-21 Process dispatch system for multiprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3476092A JPH05233572A (en) 1992-02-21 1992-02-21 Process dispatch system for multiprocessor

Publications (1)

Publication Number Publication Date
JPH05233572A true JPH05233572A (en) 1993-09-10

Family

ID=12423277

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3476092A Pending JPH05233572A (en) 1992-02-21 1992-02-21 Process dispatch system for multiprocessor

Country Status (1)

Country Link
JP (1) JPH05233572A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005235228A (en) * 2004-02-20 2005-09-02 Sony Computer Entertainment Inc Method and apparatus for task management in multiprocessor system
JP2012089154A (en) * 2005-09-30 2012-05-10 Coware Inc Scheduling in multi-core architecture
JP2013149108A (en) * 2012-01-19 2013-08-01 Canon Inc Information processing apparatus, control method therefor, and program
US8782639B2 (en) 2011-03-15 2014-07-15 Fujitsu, Limited Computer scheduling product and apparatus therefor

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005235228A (en) * 2004-02-20 2005-09-02 Sony Computer Entertainment Inc Method and apparatus for task management in multiprocessor system
JP4526412B2 (en) * 2004-02-20 2010-08-18 株式会社ソニー・コンピュータエンタテインメント Task management method and apparatus in multiprocessor system
JP2012089154A (en) * 2005-09-30 2012-05-10 Coware Inc Scheduling in multi-core architecture
US8732439B2 (en) 2005-09-30 2014-05-20 Synopsys, Inc. Scheduling in a multicore processor
US8751773B2 (en) 2005-09-30 2014-06-10 Synopsys, Inc. Scheduling in a multicore architecture
US9164953B2 (en) 2005-09-30 2015-10-20 Synopsys, Inc. Scheduling in a multicore architecture
US9286262B2 (en) 2005-09-30 2016-03-15 Synopsys, Inc. Scheduling in a multicore architecture
US9442886B2 (en) 2005-09-30 2016-09-13 Synopsys, Inc. Scheduling in a multicore architecture
US8782639B2 (en) 2011-03-15 2014-07-15 Fujitsu, Limited Computer scheduling product and apparatus therefor
JP2013149108A (en) * 2012-01-19 2013-08-01 Canon Inc Information processing apparatus, control method therefor, and program

Similar Documents

Publication Publication Date Title
EP2323035B1 (en) Scheduling system
CN103999051B (en) Strategy for tinter resource allocation in the minds of shader core
CN105579959B (en) Hardware accelerator virtualization
EP3435231B1 (en) Dynamic virtual machine sizing
KR102432380B1 (en) Method for performing WARP CLUSTERING
JP3008896B2 (en) Interrupt Load Balancing System for Shared Bus Multiprocessor System
KR101786767B1 (en) Graphics processing dispatch from user mode
US20060037017A1 (en) System, apparatus and method of reducing adverse performance impact due to migration of processes from one CPU to another
JP2002532801A (en) Prioritized instruction scheduling for multi-streaming processors
CN103608776A (en) Dynamic work partitioning on heterogeneous processing device
WO2009101563A1 (en) Multiprocessing implementing a plurality of virtual processors
US7590990B2 (en) Computer system
US10599477B1 (en) Methods and apparatus for command list processing in performing parallel IO operations
US20050132380A1 (en) Method for hiding latency in a task-based library framework for a multiprocessor environment
CN113312323B (en) IO (input/output) request scheduling method and system for reducing access delay in parallel file system
US10409640B1 (en) Methods and apparatus for data request scheduling in performing parallel IO operations
US20090133029A1 (en) Methods and systems for transparent stateful preemption of software system
Tan et al. A virtual multi-channel GPU fair scheduling method for virtual machines
Wu et al. Transparent {GPU} sharing in container clouds for deep learning workloads
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
KR20010080208A (en) Processing system scheduling
US8539491B1 (en) Thread scheduling in chip multithreading processors
Manner Hardware task/processor scheduling in a polyprocessor environment
JPH05233572A (en) Process dispatch system for multiprocessor
KR101465657B1 (en) Method for Coordinated Scheduling For virtual machine