JP4650504B2 - Process control device, process control method, and process control program - Google Patents
Process control device, process control method, and process control program Download PDFInfo
- Publication number
- JP4650504B2 JP4650504B2 JP2008053474A JP2008053474A JP4650504B2 JP 4650504 B2 JP4650504 B2 JP 4650504B2 JP 2008053474 A JP2008053474 A JP 2008053474A JP 2008053474 A JP2008053474 A JP 2008053474A JP 4650504 B2 JP4650504 B2 JP 4650504B2
- Authority
- JP
- Japan
- Prior art keywords
- resource
- cpu
- execution
- release
- waiting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Multi Processors (AREA)
- Advance Control (AREA)
Description
本発明は、プロセス制御装置、プロセス制御方法およびプロセス制御プログラムに関する。 The present invention relates to a process control device, a process control method, and a process control program.
本発明に関連する技術として、システム共有資源をロックした状態で、ワークロードクラスが、そのワークロードクラスに与えられたCPU時間を使い切った場合に、プロセスの実行を打ち切らず、無条件にシステム共有資源が解放されるまで、割り当て時間をオーバーしてCPU資源を与えるCPU配分装置があった。ワークロードクラスは、CPUの配分単位である。 As a technology related to the present invention, when a workload class uses up the CPU time given to the workload class while the system shared resource is locked, the system is unconditionally shared without stopping the execution of the process. There has been a CPU distribution device that gives CPU resources over the allotted time until resources are released. The workload class is a CPU allocation unit.
図24は、本発明に関連するCPU配分装置の例を示すブロック図である。図24に例示するCPU配分装置は、CPU配分テーブル202と、目標時間格納テーブル203と、プロセス対応テーブル204と、使用時間格納テーブル205と、インターバル初期化手段250と、目標時間計算手段210と、プロセス選択手段220と、プロセス実行手段240と、プロセス管理テーブル207と、実行可能プロセスキュー記憶手段206と、資源管理テーブル208とを備える。
FIG. 24 is a block diagram showing an example of a CPU distribution device related to the present invention. The CPU distribution device illustrated in FIG. 24 includes a CPU distribution table 202, a target time storage table 203, a process correspondence table 204, a usage time storage table 205, an
CPU配分テーブル202は、各ワークロードクラスに対するCPU配分比率を記憶する。目標時間格納テーブル203は、ワークロードクラス毎の目標時間を記憶する。プロセス対応テーブル204は、各プロセスのワークロードクラス番号を記憶する。使用時間格納テーブル205は、ワークロードクラス毎のCPU使用時間を記憶する。インターバル初期化手段250は、一定時間毎に使用時間格納テーブル205に記憶されるCPU使用時間を初期化する。資源管理テーブル208には、資源の解放を待つプロセスのキューが格納される。
The CPU distribution table 202 stores a CPU distribution ratio for each workload class. The target time storage table 203 stores a target time for each workload class. The process correspondence table 204 stores the workload class number of each process. The usage time storage table 205 stores the CPU usage time for each workload class. The
目標時間計算手段210は、CPU配分比率に応じて目標時間を設定する。プロセス決定手段240は、実行可能プロセスキュー記憶手段206に格納された実行可能プロセスを実行し、プロセス管理テーブル207にプロセスの状態を記録する。
The target
プロセス選択手段220は、以下に示すように動作する。図25および図26は、図24に示すCPU配分装置のプロセス選択手段220の動作を示すフローチャートである。プロセス選択手段220は、実行可能プロセスキュー記憶手段206の先頭にキューイングされているプロセスのプロセス番号および実行優先順位を取得し、それぞれ変数n,wにセットする(ステップS201)。そして、実行優先順位wが、ユーザが設定可能な優先順位より高いか否かを判定する(ステップS202)
The
実行優先順位wが、ユーザが設定可能な優先順位より高い場合には、プロセス実行手段240に制御を渡す。また、実行優先順位wが、ユーザが設定可能な優先順位の範囲な範囲内である場合には、ステップS203に移行する。 If the execution priority w is higher than the priority that can be set by the user, control is passed to the process execution means 240. On the other hand, if the execution priority w is within the range of the priority order that can be set by the user, the process proceeds to step S203.
ステップS203では、プロセス番号nのワークロードクラス番号をプロセス対応テーブル204から取得する。そして、そのワークロードクラスのCPU目標時間を、目標時間格納テーブル203から取得し(ステップS204)、そのワークロードクラスのCPU使用時間を、使用時間格納テーブル205から取得する(ステップS205)。 In step S203, the workload class number of process number n is acquired from the process correspondence table 204. Then, the CPU target time of the workload class is acquired from the target time storage table 203 (step S204), and the CPU usage time of the workload class is acquired from the usage time storage table 205 (step S205).
ステップS205の後、プロセス選択手段220は、CPU使用時間がCPU目標時間未満であるか否かを判定する(ステップS206)。CPU使用時間がCPU目標時間未満である場合に、プロセス実行手段240に制御を渡す。また、CPU使用時間がCPU目標時間以上である場合、ステップS207に移行する。
After step S205, the
ステップS207において、プロセス選択手段220は、実行可能プロセスキュー記憶手段206に格納された次のプロセスがキューイングされているか否かを判定する。次のプロセスがキューイングされている場合には、ステップS208に移行する。また、次のプロセスがキューイングされていない場合には、プロセス選択手段220に制御を渡す(換言すれば、ステップS201から処理を開始する)。
In step S207, the
ステップS208では、実行可能プロセスキュー記憶手段206に格納されたの次のプロセスのプロセス番号、および実行優先順位を取得し、それぞれ変数n,wにセットする。その後、ステップS202以降の処理を繰り返す。
In step S208, the process number and execution priority of the next process stored in the executable process
以上のような動作により、システム共有資源をロックした状態で、ワークロードクラスが、そのワークロードクラスに与えられたCPU時間を使い切った場合に、プロセスの実行を打ち切らず、無条件にシステム共有資源が解放されるまで、割り当て時間をオーバーしてCPU資源を与える。このような動作によって、他のワークロードクラスのプロセスが配分されたCPU資源をまだ使用していないにもかかわらず、CPU時間を使い切った他のワークロードクラスが取得しているシステム共有資源を待ったまま実行できない状態に陥ることを防止していた。なお、システム共有資源をロックする場合には、必ず、ユーザが設定可能な優先順位の範囲よりも高い実行優先順位に設定する。そして、実行優先順位をもとに、システム共有資源取得中か否かの判断を行っていた。 With the above operation, if the workload class uses up the CPU time given to the workload class while the system shared resource is locked, the process execution is not aborted and the system shared resource is unconditionally CPU resources are allocated over the allotted time until is released. Due to such an operation, the process of another workload class waits for the system shared resource acquired by another workload class that has used up the CPU time even though the CPU resource is not yet used. It was prevented from falling into a state where it could not be executed. When the system shared resource is locked, the execution priority is always set to be higher than the priority range that can be set by the user. Then, based on the execution priority, it is determined whether or not system shared resources are being acquired.
また、他の方式として、システムが使用したCPU時間はワークロードクラスへの配分対象としない方式がある。この方式では、CPU時間全体からシステムが使用したCPU時間を除いた残りの時間について、ワークロードクラス毎に配分比率を指定する。そして、ワークロードクラス毎にCPU使用時間を累積していき、各ワークロードクラスに配分されたCPU時間を越えた場合には、そのワークロードクラスで実行しているプロセスの優先順位を低くする。このように制御することにより、配分されたCPU資源をまだ使用していないワークロードクラスのプロセスに優先的にCPU資源が割り当てられるようにしている。 As another method, there is a method in which the CPU time used by the system is not subject to allocation to the workload class. In this method, an allocation ratio is designated for each workload class for the remaining time excluding the CPU time used by the system from the entire CPU time. Then, the CPU usage time is accumulated for each workload class, and when the CPU time allocated to each workload class is exceeded, the priority order of processes executed in the workload class is lowered. By controlling in this way, CPU resources are preferentially allocated to workload class processes that have not yet used the allocated CPU resources.
また、特許文献1には、ジョブの性質に従って予め分類された各ジョブグループに対するCPU資源の配分比率を指定できるようにし、そのCPU資源の配分比率と、実際に各ジョブに割り当てられた配分実績とに基づいてジョブスケジュールが行われるようにするジョブスケジュール処理方式が記載されている。 Japanese Patent Laid-Open No. 2004-26883 allows designation of a CPU resource distribution ratio for each job group classified in advance according to the nature of the job, and shows the CPU resource distribution ratio and the actual distribution allocated to each job. Describes a job schedule processing method that allows a job schedule to be performed based on the above.
また、特許文献2には、共有資源解放要求処理において、ジョブが共有資源を解放すると、そのジョブが一時的なCPU割り当て保証ジョブであるか否かを判定し、一時的なCPU割り当て保証ジョブである場合、一時的なCPUの割り当てを解除するジョブのスケジュール方法が記載されている。
Further, in
また、特許文献3には、リアルタイム処理トランザクションが、ディレード処理型トランザクションが処理を完了するまで資源待ちとなる場合、そのディレード処理型トランザクションが動作するタスクの実行優先度を上げるタスク優先度変更方式が記載されている。
Further,
図24に示すCPU配分装置では、ワークロードクラスを大きな類似機能のまとまりで設定した場合(例えば、バッチ業務、オンライン業務、開発業務でワークロードクラスを分ける等の場合)には、システム共有資源の取得区間をオーバーしてCPU資源を与えても、オーバーしたCPU時間が配分の設定値から大きくずれることはなかった。 In the CPU distribution device shown in FIG. 24, when a workload class is set as a group of large similar functions (for example, when a workload class is divided into batch work, online work, development work, etc.), the system shared resource Even if CPU resources were given over the acquisition interval, the over-CPU time did not deviate significantly from the distribution setting value.
ところが、CPU単体性能向上に伴い、1つのOSで多くの業務を行うようになり、類似機能をさらにいくつかのワークロードクラスに分割してきめ細かく設定する必要性が増えてきた。例えば、バッチ業務、オンライン業務1、オンライン業務2、オンライン業務3、開発業務等のようにワークロードクラスを分ける必要が生じる場合があった。CPU配分の設定値が小さくなると、システム共有資源のロック区間をオーバーしてCPU資源を与えた場合に、CPU配分の設定値からずれる割合が大きくなり、これにより全体のCPU配分を崩すようになってきた。また、類似機能をさらにいくつかのワークロードクラスに分割することにより、システムが共有資源をロックする場合の他に、ワークロードクラス間で資源(例えば、オンライン業務共有資源)を共有する場合も生じるようになった。共有資源がシステムでなく特定業務に限定される場合には、その特定業務が実行される優先順位の範囲内で高い優先順位となっていればよく、全ての業務よりも高い実行優先順位(すなわち、ユーザが設定可能な優先順位の範囲よりも高い実行優先順位)には設定しない。このため、あるワークロードクラスでワークロードクラス間共有資源を取得したままCPU配分時間を使い切ったために、他のワークロードクラスがCPU配分時間を使い切っていないにもかかわらず、ワークロードクラス間共有資源待ちのままCPU資源を使用することができない状態に陥る場合が生じるようになった。
However, as the performance of a single CPU has been improved, a lot of work has been performed with one OS, and the need to finely divide similar functions into several workload classes has increased. For example, it may be necessary to divide workload classes such as batch business,
また、システムが使用したCPU時間はワークロードクラスへの配分対象としない方式では、システム資源の取得によるCPU配分バランスの崩れは発生しない。しかし、ワークロードクラスで実行しているプロセスから依頼されて動作したシステム部分は、配分対象ではないため、結果的にコンピュータが各ワークロードクラスのために使用したCPU資源は、配分比率とは異なるものになるという問題がある。また、システム部分以外で、ワークロードクラス間の共有資源を取得するような場合には、あるワークロードクラスでワークロードクラス間共有資源を取得したままCPU配分時間を使い切ったために、他のワークロードクラスがCPU配分時間を使い切っていないにもかかわらず、ワークロードクラス間共有資源待ちのままCPU資源を使用することができない状態に陥るという問題も発生する。 Further, in a method in which the CPU time used by the system is not targeted for allocation to the workload class, the CPU distribution balance is not disrupted due to acquisition of system resources. However, since the system part requested and operated by the process executing in the workload class is not the allocation target, the CPU resource used by the computer for each workload class as a result is different from the allocation ratio. There is a problem of becoming something. In addition, when acquiring shared resources between workload classes outside of the system part, the CPU allocation time has been used while acquiring shared resources between workload classes in a certain workload class, and other workloads have been used. There is also a problem that the CPU resource cannot be used while waiting for the shared resource between workload classes even though the class does not use up the CPU allocation time.
そこで、本発明は、ワークロードクラスの定め方によらず、CPU配分時間を使い切っていないにもかかわらず共有資源待ちのままCPU資源を使用することができない状態に陥ることを防止することができ、プロセスの強制的実行によるCPU配分比率からのずれを抑えることができるプロセス制御装置、プロセス制御方法およびプロセス制御プログラムを提供することを目的とする。 Therefore, the present invention can prevent the CPU resource from being used while waiting for the shared resource even though the CPU allocation time is not used up, regardless of how the workload class is defined. An object of the present invention is to provide a process control device, a process control method, and a process control program that can suppress a deviation from a CPU distribution ratio due to forced execution of a process.
本発明のプロセス制御装置は、実行可能なプロセスのキューである実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在していない場合に、CPU目標時間までCPUを使い切っていないワークロードクラスで動作するプロセスであって資源の解放を待つ解放待ちプロセスと、当該資源を確保している資源確保プロセスとを特定する強制実行対象特定手段と、前記資源確保プロセスを強制的に実行させる強制実行手段と、強制実行手段からプロセスの実行に伴い資源の解放を要求されると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する資源解放手段とを備えることを特徴とする。 The process control apparatus of the present invention does not use up the CPU until the CPU target time when there is no process in the executable process queue that is a queue of executable processes that does not use up the CPU until the CPU target time. A process that operates in the workload class and waits for a resource to be released, a forcible execution target specifying means for specifying a resource securing process that secures the resource, and forcibly executing the resource securing process And a forced execution means that, when requested to release a resource in accordance with the execution of a process by the forced execution means, releases the resource, interrupts the process, and waits for the release of the resource. Resource release means for adding to the queue.
また、本発明のプロセス制御方法は、実行可能なプロセスのキューである実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在していない場合に、CPU目標時間までCPUを使い切っていないワークロードクラスで動作するプロセスであって資源の解放を待つ解放待ちプロセスと、当該資源を確保している資源確保プロセスとを特定し、前記資源確保プロセスを強制的に実行させ、プロセスの実行に伴い資源の解放を要求されると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加することを特徴とする。 The process control method of the present invention uses up the CPU until the CPU target time when there is no process in the executable process queue that is a queue of executable processes that does not use up the CPU until the CPU target time. A process that operates in a non-workload class that is waiting for a resource to be released and a resource securing process that secures the resource, forcibly execute the resource securing process, and When a resource release is requested in accordance with execution, the resource is released, the process is suspended, and a release waiting process waiting for the resource release is added to the executable process queue.
また、本発明のプロセス制御プログラムは、コンピュータに、実行可能なプロセスのキューである実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在していない場合に、CPU目標時間までCPUを使い切っていないワークロードクラスで動作するプロセスであって資源の解放を待つ解放待ちプロセスと、当該資源を確保している資源確保プロセスとを特定する強制実行対象特定処理、前記資源確保プロセスを強制的に実行させる強制実行処理、および、強制実行処理でのプロセスの実行に伴い資源の解放要求が生じると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する資源解放処理を実行させることを特徴とする。 Also, the process control program of the present invention can achieve up to the CPU target time when there is no process in the executable process queue that is a queue of executable processes that has not used up the CPU until the CPU target time. A process that operates in a workload class that does not use up the CPU and that waits for a resource to be released, a forcible execution target specifying process that specifies a resource securing process that secures the resource, and the resource securing process Forcible execution processing to be forcibly executed, and when a resource release request is generated in accordance with execution of a process in the forcible execution processing, the resource is released, the process is interrupted, and the release wait waiting for the resource to be released It is characterized by executing a resource release process that adds a process to the executable process queue. .
本発明によれば、ワークロードクラスの定め方によらず、CPU配分時間を使い切っていないにもかかわらず共有資源待ちのままCPU資源を使用することができない状態に陥ることを防止することができ、プロセスの強制的実行によるCPU配分比率からのずれを抑えることができる。 According to the present invention, it is possible to prevent the CPU resource from being in a state where the CPU resource cannot be used while waiting for the shared resource even though the CPU allocation time is not used up, regardless of how the workload class is determined. The deviation from the CPU distribution ratio due to the forced execution of the process can be suppressed.
以下、本発明の実施形態を図面を参照して説明する。
図1は、本発明のプロセス制御装置の例を示すブロック図である。プロセス制御装置は、コンピュータ10によって実現される。プロセス制御装置10は、プロセス対応テーブル101と、CPU配分テーブル102と、目標時間格納テーブル103と、使用時間格納テーブル104と、プロセス管理テーブル105と、実行可能プロセスキュー記憶手段106と、資源管理テーブル107と、強制実行情報格納テーブル108と、目標時間計算手段110と、プロセス選択手段120と、強制実行プロセス選択手段130と、プロセス実行手段140と、インターバル初期化手段150と、資源取得手段160と、資源解放手段170とを備える。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a block diagram showing an example of a process control apparatus of the present invention. The process control device is realized by the computer 10. The process control apparatus 10 includes a process correspondence table 101, a CPU distribution table 102, a target time storage table 103, a usage time storage table 104, a process management table 105, an executable process queue storage means 106, and a resource management table. 107, forced execution information storage table 108, target time calculation means 110, process selection means 120, forced execution process selection means 130, process execution means 140, interval initialization means 150, resource acquisition means 160, Resource release means 170.
プロセス対応テーブル101は、各プロセスのワークロードクラス番号を記憶する記憶手段である。図2は、プロセス対応テーブル101を示す説明図である。図2に示すように、プロセス対応テーブル101には、プロセス番号順に各プロセスのワークロードクラス番号が格納される。なお、ワークロードクラスはCPUの配分単位であり、ワークロードクラス番号は、各ワークロードクラスの識別情報である。また、プロセス番号は、各プロセスの識別情報である。 The process correspondence table 101 is a storage unit that stores the workload class number of each process. FIG. 2 is an explanatory diagram showing the process correspondence table 101. As shown in FIG. 2, the process correspondence table 101 stores the workload class number of each process in the order of the process number. The workload class is a CPU allocation unit, and the workload class number is identification information of each workload class. The process number is identification information of each process.
CPU配分テーブル102は、各ワークロードクラスのCPU配分比率を記憶する記憶手段である。図3は、CPU配分テーブル102を示す説明図である。図3に示すように、CPU配分テーブル102には、ワークロードクラス番号順にCPU配分比率が格納される。CPU配分比率は、例えば、百分率で表された値であるが、百分率以外で表されていてもよい。 The CPU distribution table 102 is a storage unit that stores the CPU distribution ratio of each workload class. FIG. 3 is an explanatory diagram showing the CPU distribution table 102. As shown in FIG. 3, the CPU distribution table 102 stores CPU distribution ratios in the order of workload class numbers. The CPU distribution ratio is, for example, a value expressed as a percentage, but may be expressed as a percentage other than a percentage.
目標時間格納テーブル103は、各ワークロードクラスのCPU目標時間を記憶する記憶手段である。CPU目標時間は、CPU配分比率に応じて各ワークロードクラスに割り当てられた時間である。図4は、目標時間格納テーブル103を示す説明図である。図4に示すように、目標時間格納テーブル103には、ワークロードクラス番号順にCPU目標時間が格納される。 The target time storage table 103 is storage means for storing the CPU target time of each workload class. The CPU target time is a time allocated to each workload class according to the CPU distribution ratio. FIG. 4 is an explanatory diagram showing the target time storage table 103. As shown in FIG. 4, the target time storage table 103 stores CPU target times in the order of workload class numbers.
使用時間格納テーブル104は、各ワークロードクラスのCPU使用時間を記憶する記憶手段である。CPU使用時間は、CPUにより実際に処理を実行したワークロードクラス毎の時間である。図5は、使用時間格納テーブル104を示す説明図である。図5に示すように、使用時間格納テーブル104には、ワークロードクラス番号順にCPU使用時間が格納される。 The usage time storage table 104 is storage means for storing the CPU usage time of each workload class. The CPU usage time is the time for each workload class that is actually executed by the CPU. FIG. 5 is an explanatory diagram showing the usage time storage table 104. As shown in FIG. 5, the CPU usage time is stored in the usage time storage table 104 in the order of the workload class number.
プロセス管理テーブル105は、各プロセスの状態を示す情報を記憶する記憶手段である。図6は、プロセス管理テーブル105を示す説明図である。図6に示すように、プロセス管理テーブル105には、実行可フラグ、資源待ちフラグ、実行中断フラグ、実行優先順位、資源待ちしている資源番号の組が、プロセス番号順に格納される。実行可フラグは、実行可能か否かを示すフラグであり、セットされている状態(オン)で実行可能であることを表す。資源待ちフラグは、資源(共有資源)を待っている状態であるか否かを示すフラグであり、セットされている状態で資源待ち状態であることを表す。実行中断フラグは、実行を中断する要求があるか否かを示すフラグであり、セットされている状態で実行を中断する要求があることを表す。また、各種フラグがセットされていない状態をオフと記す。 The process management table 105 is a storage unit that stores information indicating the state of each process. FIG. 6 is an explanatory diagram showing the process management table 105. As shown in FIG. 6, the process management table 105 stores a set of an executable flag, a resource waiting flag, an execution interruption flag, an execution priority, and a resource number waiting for resources in the order of process numbers. The executable flag is a flag indicating whether or not execution is possible, and represents that execution is possible in a set state (ON). The resource waiting flag is a flag indicating whether or not the resource (shared resource) is waiting, and indicates that the resource waiting state is set. The execution interruption flag is a flag indicating whether or not there is a request to interrupt the execution, and represents that there is a request to interrupt the execution in the set state. A state where various flags are not set is described as OFF.
プロセスが解放を待つ資源には、システム資源だけでなく、ワークロードクラス間で共有される資源も含まれる。 The resources for which a process waits for release include not only system resources but also resources shared among workload classes.
また、資源番号は、各資源を識別するための識別情報である。 The resource number is identification information for identifying each resource.
図7は、実行可能プロセスキュー記憶手段106を示す説明図である。実行可能プロセスキュー記憶手段106は、実行可能プロセスが実行優先順位順にキューイングされる記憶手段である。具体的には、実行可能プロセスキュー記憶手段106は、実行優先順位順にキューイングされたプロセス番号および実行優先順位の情報を記憶する。
FIG. 7 is an explanatory diagram showing the executable process
図8は、資源管理テーブル107を示す説明図である。資源管理テーブル107は、資源番号順に、資源を確保しているテナントプロセスのプロセス番号を記憶するとともに、資源待ちのプロセスが実行優先順位順にキューイングされる記憶手段である。図8に示すように、“0”,“1”等の資源番号順に、テナントプロセスのプロセス番号および資源待ちのプロセス番号が記憶される。 FIG. 8 is an explanatory diagram showing the resource management table 107. The resource management table 107 is a storage unit that stores process numbers of tenant processes that have secured resources in the order of resource numbers and queues processes waiting for resources in the order of execution priority. As shown in FIG. 8, the process number of the tenant process and the process number waiting for the resource are stored in the order of resource numbers such as “0” and “1”.
図9は、強制実行情報格納テーブル108を示す説明図である。強制実行情報格納テーブル108は、資源番号と、資源解放時に優先的に資源を渡すプロセスのプロセス番号が格納される記憶手段である。 FIG. 9 is an explanatory diagram showing the forced execution information storage table 108. The forced execution information storage table 108 is a storage unit that stores a resource number and a process number of a process that preferentially delivers a resource when releasing the resource.
目標時間計算手段110は、CPU配分テーブル102に格納されているワークロードクラス毎のCPU配分比率をもとに、一定のインターバル時間で各ワークロードクラスが使用可能なCPU時間を計算し、目標時間格納テーブル103に記憶させる。 The target time calculation means 110 calculates the CPU time that can be used by each workload class at a fixed interval time based on the CPU distribution ratio for each workload class stored in the CPU distribution table 102, and the target time Store in the storage table 103.
プロセス選択手段120は、実行可能プロセスキュー記憶手段106にキューイングされているプロセスを先頭から順番にサーチし、目標時間格納テーブル103に格納されているCPU目標時間までCPUを使い切っていないプロセスを特定する。そのようなプロセスを特定したならば、そのプロセスを選択して、プロセス実行手段140に制御を渡す。また、CPU目標時間までCPUを使い切っていないプロセスが、キューイングされた最後のプロセスまで存在しなかった場合には、強制実行プロセス選択手段130に制御を渡す。プロセス選択手段120は、プロセスがCPU目標時間までCPUを使い切っているか否かを以下のように判定する。すなわち、実行可能プロセスキュー記憶手段106にキューイングされているプロセスのワークロードクラス番号をプロセス対応テーブル101から取得し、そのワークロードクラス番号のCPU使用時間およびCPU目標時間を、使用時間格納テーブル104、目標時間格納テーブル103で参照し、両者を比較することによって、プロセスがCPU目標時間までCPUを使い切っているか否かを判定すればよい。
The
強制実行プロセス選択手段130は、CPU目標時間までCPUを使い切っていないプロセスが、実行可能プロセスキュー記憶手段106にキューイングされたプロセス中に存在しなかった場合、以下の処理を行う。強制実行プロセス選択手段130は、目標時間格納テーブル103と使用時間格納テーブル104とを参照し、CPU目標時間までCPUを使い切っていないワークロードクラスをサーチする。さらに、強制実行プロセス選択手段130は、プロセス対応テーブル101を参照し、そのワークロードクラスで動作するプロセスをサーチする。そして、強制実行プロセス選択手段130は、プロセス管理テーブル105に格納されているそのプロセスの状態が資源待ちである場合、対象となる資源番号と資源解放時に優先的に資源を渡すプロセスの番号とを強制実行情報格納テーブル108に格納し、対象となる資源を確保しているプロセスのプロセス番号を資源管理テーブル107から取得して、プロセス実行手段140に制御を渡す。
The forcible execution
プロセス実行手段140は、CPU目標時間までCPUを使い切っていないプロセスとしてプロセス選択手段120に選択されたプロセスや、資源を確保しているプロセスとして資源管理テーブル107から強制実行プロセス選択手段130によって取得されたプロセスに対して以下の処理を行う。プロセス実行手段140は、それらのプロセスを実行可能プロセスキュー記憶手段106からデキューする。そして、プロセス実行手段140は、そのプロセスのワークロードクラスのCPU使用時間がCPU目標時間に到達するか、あるいは、プロセス管理テーブル105中の実行中断フラグがセットされるまで、そのプロセスを実行するとともに、そのプロセスのワークロードクラスの使用時間格納テーブル104中のCPU使用時間に実行時間を加算する。プロセス実行手段140は、プロセスの実行終了後に、強制実行情報格納テーブル108中に登録されている資源番号を削除する。
The process execution means 140 is acquired by the forced execution process selection means 130 from the resource management table 107 as a process selected by the process selection means 120 as a process that does not use up the CPU until the CPU target time, or as a process that secures resources. The following processing is performed on the processed process. The
インターバル初期化手段150は、一定のインターバル時間毎に動作し、使用時間格納テーブル104中の各ワークロードクラスが使用したCPU使用時間を0にセットする。
The
資源取得手段160は、資源の取得(確保)がプロセスから要求されると、資源管理テーブル107を参照し、その資源が既に取得されているか否かを判定する。その資源が未だ取得されていない場合、資源取得手段160は、資源の取得を要求したプロセス(資源取得要求プロセス)のプロセス番号を、テナントプロセスのプロセス番号として資源管理テーブル107に格納する。また、資源が既に取得されている場合には、資源取得要求プロセスを資源管理テーブル107中の資源待ちプロセスキューにつなぎ、プロセス管理テーブル105中の資源待ちフラグをセットし、プロセス管理テーブル105中の資源待ちしている資源番号として、その既に取得されている資源の番号をセットする。なお、プロセスをキューにつなぐとは、プロセスをキューに追加することである。
When resource acquisition (reservation) is requested from a process, the
資源解放手段170は、資源を解放するとともに、解放した資源の番号が強制実行情報格納テーブル108の資源番号と一致している場合には、強制実行情報格納テーブル108に格納されているプロセスを資源管理テーブル107の資源待ちプロセスキューからデキューし、資源番号が一致していない場合には、資源管理テーブル107の資源待ちプロセスキューの先頭のプロセスをデキューする。そして、資源解放手段170は、デキューしたプロセスの番号を資源管理テーブル107のテナントプロセスのプロセス番号にセットする。さらに、デキューしたプロセスのプロセス管理テーブル105の実行可フラグをセットし、資源待ちフラグをリセットし、そのプロセスを実行可能プロセスキュー106につなぐ。資源解放手段170は、解放資源が強制実行情報格納テーブル108の資源番号と一致している場合には、最後に資源解放要求プロセスのプロセス管理テーブル105の実行中断フラグと実行可フラグをセットし、資源解放要求プロセスを実行可能プロセスキュー106にキューイングし、プロセス実行手段140に制御を戻す。
The resource release means 170 releases the resources, and if the number of the released resources matches the resource number of the forced execution information storage table 108, the resource release means 170 executes the process stored in the forced execution information storage table 108 as a resource. Dequeue from the resource waiting process queue in the management table 107. If the resource numbers do not match, the process at the head of the resource waiting process queue in the resource management table 107 is dequeued. Then, the
プロセス対応テーブル101、CPU配分テーブル102、目標時間格納テーブル103、使用時間格納テーブル104、プロセス管理テーブル105、実行可能プロセスキュー記憶手段106、資源管理テーブル107、および強制実行情報格納テーブル108は、例えば、コンピュータ10が備える記憶装置によって実現される。また、目標時間計算手段110、プロセス選択手段120、強制実行プロセス選択手段130、プロセス実行手段140、インターバル初期化手段150、資源取得手段160、および資源解放手段170は、例えば、プログラム(プロセス制御プログラム)に従って動作するコンピュータ10のCPUによって実現される。例えば、コンピュータ10のCPUが、プロセス制御プログラムを読み込み、そのプログラムに従って、目標時間計算手段110、プロセス選択手段120、強制実行プロセス選択手段130、プロセス実行手段140、インターバル初期化手段150、資源取得手段160、および資源解放手段170として動作する。
The process correspondence table 101, CPU distribution table 102, target time storage table 103, usage time storage table 104, process management table 105, executable process queue storage means 106, resource management table 107, and forced execution information storage table 108 are, for example, This is realized by a storage device included in the computer 10. The target
次に、本発明の動作について説明する。
まず、各ワークロードクラスのCPU目標時間を算出して目標時間格納テーブル103に記憶させる動作について説明する。なお、CPU配分テーブル102には、予め定められたワークロードクラス毎のCPU配分比率が設定されている。図10は、CPU目標時間を目標時間格納テーブル103に記憶させる動作の例を示すフローチャートである。
Next, the operation of the present invention will be described.
First, the operation of calculating the CPU target time for each workload class and storing it in the target time storage table 103 will be described. In the CPU distribution table 102, a CPU distribution ratio for each predetermined workload class is set. FIG. 10 is a flowchart illustrating an example of an operation for storing the CPU target time in the target time storage table 103.
まず、目標時間計算手段110は、CPU配分テーブル102に記憶されているワークロードクラス毎のCPU配分比率を読み込み(ステップS111)、全ワークロードクラスのCPU配分比率の合計値を計算する(ステップS112)。既に説明したように、CPU配分比率は、例えば、百分率で表された値であるが、百分率以外で表されていてもよい。
First, the target
次に、目標時間計算手段110は、各ワークロードクラスのCPU目標時間をそれぞれ計算する(ステップS113)。目標時間計算手段110は、ワークロードクラス毎に、「一定のインターバル時間」に、ステップS112で求めた合計値に対するCPU配分比率の割合を乗じることで、個々のワークロードクラスのCPU目標時間を計算する。「一定のインターバル時間」とは、インターバル初期化手段150が、使用時間格納テーブル104に格納されたCPU使用時間を0に初期化する周期である。この一定のインターバル時間をIとし、ステップS112で計算した全ワークロードクラスのCPU配分比率の合計値をSとし、CPU目標時間の計算対象としているワークロードクラスのCPU配分比率をRとすると、目標時間計算手段110は、個々のワークロードクラス毎に、I×R/Sを計算することにより、各ワークロードクラスのCPU目標時間を計算する。このように、目標時間計算手段110は、一定のインターバル時間をCPU配分比率に応じて配分することで、各ワークロードクラスのCPU目標時間を計算する。
Next, the target time calculation means 110 calculates the CPU target time for each workload class (step S113). The target time calculation means 110 calculates the CPU target time for each workload class by multiplying the “certain interval time” by the ratio of the CPU distribution ratio to the total value obtained in step S112 for each workload class. To do. The “fixed interval time” is a cycle in which the
次に、目標時間計算手段110は、計算した各ワークロードクラスのCPU目標時間を目標時間格納テーブル103に記憶させる(ステップS114)。このとき、図4に示すように、ワークロードクラス番号順にCPU目標時間を記憶させる。
Next, the target
次に、プロセス選択からプロセス実行までの制御の流れを説明する。図11は、プロセス選択からプロセス実行までの制御の流れを示す説明図である。 Next, the flow of control from process selection to process execution will be described. FIG. 11 is an explanatory diagram showing the flow of control from process selection to process execution.
プロセス選択手段120は、実行可能なプロセスを選択する。そして、プロセス選択手段120は、実行可能なプロセスを選択できた場合には、プロセス実行手段140に制御を渡し、実行可能なプロセスを選択できなかった場合には、強制実行プロセス選択手段130に制御を渡す。このプロセス選択手段120の動作については、図12を用いて後述する。
The
強制実行プロセス選択手段130は、強制的に実行するプロセスを選択する。強制実行プロセス選択手段130は、強制的に実行するプロセスを選択できた場合には、プロセス実行手段140に制御を渡し、強制的に実行するプロセスを選択できなかった場合には、プロセス選択手段120に制御を渡す。この強制実行プロセス選択手段130の動作については、図13、図14および図15を用いて後述する。
The forced execution
プロセス実行手段140は、プロセス選択手段120、または、強制実行プロセス選択手段130で選択されたプロセスを実行し、プロセス選択手段120に制御を渡す。このプロセス実行手段140の動作については、図16および図17を用いて後述する。
The
次に、プロセス選択手段120の動作について説明する。図12は、プロセス選択手段120の動作の例を示すフローチャートである。プロセス選択手段120は、実行可能プロセスキュー記憶手段106において先頭にキューイングされているプロセスのプロセス番号を取得する(ステップS121)。すなわち、実行可能プロセスキュー記憶手段106に記憶されているプロセス番号のうち、優先順位が最も高いプロセス番号を取得する。プロセス選択手段120が取得したプロセス番号を、ここではnとする。
Next, the operation of the
次に、プロセス選択手段120は、取得したプロセス番号nに対応するワークロードクラス番号(すなわち、プロセス番号nのプロセスのワークロードクラス番号)をプロセス対応テーブル101から取得する(ステップS122)。ステップS121からステップS122に移行した場合、プロセス選択手段120は、ステップS121で取得したプロセス番号に対応するワークロードクラス番号をプロセス対応テーブル101から取得する。また、後述のステップS127からステップS122に移行した場合、プロセス選択手段120は、ステップS127で取得したプロセス番号に対応するワークロードクラス番号をプロセス対応テーブル101から取得する。
Next, the
ステップS122の次に、プロセス選択手段120は、ステップS122で取得したワークロードクラス番号に対応するCPU目標時間を、目標時間格納テーブル103から取得する(ステップS123)。すなわち、そのワークロードクラス番号が示すワークロードクラスのCPU目標時間を取得する。
After step S122, the
次に、プロセス選択手段120は、ステップS122で取得したワークロードクラス番号に対応するCPU使用時間を、使用時間格納テーブル104から取得する(ステップS124)。すなわち、ステップS122で取得したワークロードクラス番号が示すワークロードクラスのCPU使用時間を取得する。
Next, the
プロセス選択手段120は、CPU使用時間がCPU目標時間よりも小さいか否かを判定する(ステップS125)。CPU使用時間がCPU目標時間よりも小さければ(ステップS125のY)、プロセス実行手段140に制御を渡す。CPU使用時間がCPU目標時間と等しいか、または、大きい場合には(ステップS125のN)、プロセス選択手段120は、実行可能プロセスキュー記憶手段106に次のプロセスがキューイングされているか否かを判定する(ステップS126)。
The
実行可能プロセスキュー記憶手段106に次のプロセスがキューイングされている場合(ステップS126のY)、プロセス選択手段120は、実行可能プロセスキュー記憶手段106にキューイングされている次のプロセスのプロセス番号を取得し(ステップS127)、ステップS122に移行する。そして、ステップS127で取得したプロセス番号について、ステップS122以降の処理を行う。
When the next process is queued in the executable process queue storage unit 106 (Y in step S126), the
実行可能プロセスキュー記憶手段106に次のプロセスがキューイングされていない場合(ステップS126のN)というのは、キューイングされている最後のプロセスまで、CPU使用時間がCPU目標時間未満のプロセスが存在しない場合である。換言すれば、CPU目標時間までCPU使用時間を使い切っていないプロセスが実行可能プロセスキュー記憶手段106にキューイングされていない場合である。この場合、プロセス選択手段120は、強制実行プロセス選択手段130に制御を渡す。
When the next process is not queued in the executable process queue storage means 106 (N in step S126), there is a process whose CPU usage time is less than the CPU target time until the last queued process. This is the case. In other words, a process that has not used up the CPU usage time until the CPU target time is not queued in the executable process
次に、強制実行プロセス選択手段130の動作について説明する。図13、図14および図15は、強制実行プロセス選択手段130の動作の例を示すフローチャートである。以下の説明で、例えば、ワークロードクラス番号がiであるワークロードクラスを、単にワークロードクラスiと記す。また、プロセス番号xに対応するワークロードクラス番号とは、プロセス番号がxであるプロセスのワークロードクラス番号である。
Next, the operation of the forced execution
強制実行プロセス選択手段130は、変数iに0をセットする(ステップS231)。次に、強制実行プロセス選択手段130は、ワークロードクラスiのCPU目標時間を目標時間格納テーブル103から取得し(ステップS232)、ワークロードクラスiのCPU使用時間を使用時間格納テーブル104から取得する(ステップS233)。そして、CPU使用時間がCPU目標時間未満であるか否かを判定する(ステップS234)。CPU使用時間がCPU目標時間以上であれば(ステップS234のN)、ステップS246(図15参照)に移行し、CPU使用時間がCPU目標時間未満であれば(ステップS234のY)、ステップS235に移行する。
The forced execution
ステップS235では、強制実行プロセス選択手段130は、変数jに0をセットする。
In step S235, the forced execution
次に、強制実行プロセス選択手段130は、プロセス対応テーブル101を参照し、プロセス番号jに対応するワークロードクラス番号を取得し(ステップS236)、そのワークロードクラス番号が変数iと等しいか否かを判定する(ステップS237)。すなわち、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラス番号iと等しいか否かを判定する。プロセス番号jに対応するワークロードクラス番号が変数iと等しくなければ(ステップS237のN)、ステップS244(図14参照)に移行する。プロセス番号jに対応するワークロードクラス番号が変数iと等しい場合(ステップS237のY)、そのjは、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスのプロセス番号である。この場合(ステップS237のY)、ステップS238に移行する。
Next, the forcible execution
ステップS238では、強制実行プロセス選択手段130は、変数kにjの値をセットする。
In step S238, the forced execution
次に、強制実行プロセス選択手段130は、プロセス管理テーブル105において、プロセス番号kの資源待ちフラグがオンであるか否かを判定する(ステップS239)。すなわち、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスが資源待ち状態であるか否かを判定する。プロセス管理テーブル105に記憶されているプロセス番号kの資源待ちフラグがオフであるならば(ステップS239のN)、ステップS244に移行し、オンであれば(ステップS239のY)、ステップS240に移行する。
Next, the forced execution
ステップS240において、強制実行プロセス選択手段130は、プロセス管理テーブル105に格納されているプロセス番号kの資源番号(資源待ちしている資源番号。図6参照。)を、変数mにセットする。すなわち、プロセス番号kのプロセスが待っている資源の資源番号をmにセットする。
In step S240, the forced execution
次に、強制実行プロセス選択手段130は、資源管理テーブル107に格納されている資源番号mのテナントプロセスのプロセス番号を、変数nにセットする(ステップS241)。すなわち、着目している資源番号mの資源を確保しているプロセスのプロセス番号をnにセットする(ステップS241)。以上のようにして、CPU使用時間がCPU目標時間未満となっている着目中のワークロードクラスで動作するプロセスが待っている資源を確保中のプロセスのプロセス番号をnとしている。 Next, the forced execution process selection means 130 sets the process number of the tenant process of the resource number m stored in the resource management table 107 to the variable n (step S241). That is, the process number of the process that secures the resource of the target resource number m is set to n (step S241). As described above, the process number of the process that secures the resources waiting for the process operating in the workload class of interest whose CPU usage time is less than the CPU target time is n.
次に、強制実行プロセス選択手段130は、プロセス管理テーブル105を参照して、プロセス番号nの実行可能フラグ(資源番号mの資源を確保しているプロセスの実行可能フラグ)がオンであるか否かを判定する(ステップS242)。その実行可能フラグがオンであれば(ステップS242のY)、ステップS248に移行する。オフであれば(ステップS242のN)、強制実行プロセス選択手段130は、変数kにnの値をセットし(ステップS243)、ステップS239以降の処理を繰り返す。
Next, the forced execution
ステップS242で実行可能フラグがオンと判定された場合、その時点のnは、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスが待っている資源を確保中のプロセスであって、実行可能フラグがオンとなっているプロセスのプロセス番号を意味する。 If it is determined in step S242 that the executable flag is on, n at that time secures resources waiting for processes operating in the target workload class whose CPU usage time is less than the CPU target time. This means the process number of a process in which the executable flag is on.
また、ステップS244において、強制実行プロセス選択手段130は、プロセス番号jが最終エントリであるか否かを判定する(ステップS244)。すなわち、jが最大のプロセス番号に達したか否かを判定する。プロセス番号jが最終エントリであれば(ステップS244のY)、ステップS246(図15参照)に移行する。また、プロセス番号jが最終エントリでなければ(ステップS244のN)、強制実行プロセス選択手段130は、jの値を1増加させ(ステップS245)、そのjに関して、ステップS236以降の処理を行う。
In step S244, the forced execution
また、ステップS246において、強制実行プロセス選択手段130は、ワークロードクラス番号iが目標時間格納テーブル103における最終エントリであるか否かを判定する(ステップS246)。ワークロードクラス番号iが最終エントリであれば(ステップS246のY)、プロセス選択手段120に制御を渡す。ワークロードクラス番号iが最終エントリでなければ(ステップS246のN)、iの値を1増加させ(ステップS247)、そのiに関して、ステップS232(図13参照)以降の処理を行う。
In step S246, the forced execution
また、ステップS242からステップ248に移行した時点で、CPU使用時間がCPU目標時間未満の着目中のワークロードクラスで動作するプロセスが待っている資源を確保中のプロセスであって、実行可能フラグがオンとなっているプロセスのプロセス番号(n)が特定されることになる。強制実行プロセス選択手段130は、強制実行情報格納テーブル108の資源番号として、その資源番号mを格納する(ステップS248)。さらに、強制実行プロセス選択手段130は、資源解放時に優先的に資源を渡すプロセスのプロセス番号(図9参照)として、kの値を、強制実行情報格納テーブル108に格納する(ステップS249)。そして、プロセス実行手段140に制御を渡す。
In addition, when the process proceeds from step S242 to step 248, a resource that is waiting for a process that operates in a focused workload class whose CPU usage time is less than the CPU target time is being secured, and an executable flag is set. The process number (n) of the process that is turned on is specified. The forced execution process selection means 130 stores the resource number m as the resource number of the forced execution information storage table 108 (step S248). Further, the forced execution
上記の動作において、ステップS239の処理は、資源待ちフラグがオフであるということは、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスが、資源を待っていないということを意味する。この場合には、ステップS240,S241,S242,S248,S249を行ってプロセス実行手段140に制御を渡すのではなく、ステップS244に移行し、jが最終エントリでなければ、jを1インクリメントし(ステップS245)、ステップS236からの処理を繰り返す。jが最終エントリであれば、iが最終エントリであるか否かを判定し、iを1インクリメントしてステップS232からの処理を繰り返す。このように、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスが資源を待っていない場合には、プロセス実行手段140にそのプロセスを強制的に実行させることはしない。
In the above operation, the processing in step S239 indicates that the resource wait flag is off means that the process operating in the target workload class whose CPU usage time is less than the CPU target time waits for resources. It means not. In this case, steps S240, S241, S242, S248, and S249 are not performed to transfer control to the process execution means 140, but the process proceeds to step S244. If j is not the final entry, j is incremented by 1 ( Steps S245) and S236 are repeated. If j is the final entry, it is determined whether i is the final entry, i is incremented by 1, and the processing from step S232 is repeated. As described above, when the process operating in the target workload class whose CPU usage time is less than the CPU target time is not waiting for the resource, the
次に、プロセス実行手段140の動作について説明する。図16および図17は、プロセス実行手段140の動作の例を示すフローチャートである。プロセス実行手段140は、プロセス選択手段120または強制実行プロセス選択手段130で選択されたプロセス、すなわちプロセス番号nのプロセスのワークロードクラス番号を、プロセス対応テーブル101から取得し、そのワークロードクラス番号を変数pにセットする(ステップS341)。
Next, the operation of the
すなわち、プロセス選択手段120が実行するステップS125(図12参照)において、CPU使用時間がCPU目標時間未満であると判定され、プロセス選択手段120から制御を渡された場合には、その時点でプロセス選択手段120が取得していたプロセス番号nに対応するワークロードクラス番号を変数pにセットする。
That is, in step S125 (see FIG. 12) executed by the
また、強制実行プロセス選択手段130が実行するステップS242(図15参照)において、資源番号mの資源を確保しているプロセス番号nのプロセスの実行可能フラグがオンであり、ステップS248,S249(図16参照)の処理後に強制実行プロセス選択手段130から制御を渡された場合には、その時点で強制実行プロセス選択手段130が特定していたプロセス番号nに対応するワークロードクラス番号を変数pにセットする。
Further, in step S242 (see FIG. 15) executed by the forced execution
ステップS341の後、プロセス実行手段140は、ワークロードクラスpのCPU目標時間を目標時間格納テーブル103から取得し、変数qにセットし(ステップS342)、ワークロードクラスpのCPU使用時間を使用時間格納テーブル104から取得し、変数rにセットする(ステップS343)。 After step S341, the process execution means 140 acquires the CPU target time of the workload class p from the target time storage table 103, sets it to the variable q (step S342), and sets the CPU usage time of the workload class p as the usage time. Obtained from the storage table 104 and set to the variable r (step S343).
そして、プロセス実行手段140は、実行可能プロセスキュー記憶手段106にキューイングされているプロセス番号から、nをデキューし(ステップS344)、プロセス管理テーブル105に格納されているプロセス番号nの実行可フラグをオフにする(ステップS345)。さらに、プロセス実行手段140は、プロセス管理テーブル105に格納されているプロセス番号nの実行中断フラグをオフにする(ステップS346)。次に述べるステップS347は、プロセスを実行するステップであり、ステップS344〜S346では、これから実行しようとするプロセスのプロセス番号nを実行可能プロセスキュー記憶手段106からデキューし、その実行可フラグおよび実行中断フラグをいずれもオフとしている。
Then, the
ステップS346の後、プロセス実行手段140は、プロセス番号nのプロセスを最小単位分だけ実行する(ステップS347)。
After step S346, the
強制実行プロセス選択手段130がステップS242,S248,S249の処理を行い、強制実行プロセス選択手段130から制御を渡された場合、このようにステップS347を実行することで、資源番号mの資源を確保しているプロセス番号nのプロセスを強制的に実行させている。
When the forced execution
ただし、ステップS347は、資源番号mの資源を確保しているプロセス番号nのプロセスを強制的に実行させるためだけのステップではない。プロセス選択手段120から制御を渡されてステップS347に移行した場合には、CPU目標時間までCPUを使用していないプロセス(プロセス選択手段120が選択したプロセス)を最小単位分、実行する。
However, step S347 is not only a step for forcibly executing the process of the process number n that secures the resource of the resource number m. When control is passed from the
ステップS347の後、プロセス実行手段140は、使用時間格納テーブル104に格納されているワークロードクラスpのCPU使用時間に対し、ステップS347で実行した時間分を加算して、ワークロードクラスpのCPU使用時間を更新する(ステップS348)。 After step S347, the process execution means 140 adds the time executed in step S347 to the CPU usage time of the workload class p stored in the usage time storage table 104, and the CPU of the workload class p. The usage time is updated (step S348).
次に、プロセス実行手段140は、プロセス管理テーブル105に格納されているプロセス番号nの実行中断フラグがオンになっているか否かを確認する(ステップS349)。プロセス番号nの実行中断フラグがオンであれば(ステップS349のY)、ステップS354に移行し、オフであれば(ステップS349のN)、ステップS350に移行する。
Next, the
ステップS350では、プロセス実行手段140は、変数rの値が変数qの値以上であるか否かを判定する(ステップS350)。変数rの値が変数qの値以上であれば(ステップS350のY)、ステップS347以降の処理を繰り返す。すなわち、ステップS343で変数rにセットしたCPU使用時間が既にCPU目標時間を超えている場合、実行中断フラグがオンになるまで、プロセス番号nのプロセスを実行させる。
In step S350, the
また、変数rの値が変数qの値未満である場合(ステップS350のN)、プロセス実行手段140は、使用時間格納テーブル104に格納されているワークロードクラスpのCPU使用時間(ステップS347で実行した時間分が加算されたCPU使用時間)がCPU目標時間未満であるか否かを判定する(ステップS351)。CPU使用時間がCPU目標時間未満であれば、ステップS347以降の処理を繰り返し、CPU使用時間がCPU目標時間以上になったならばステップS352に移行する。
If the value of the variable r is less than the value of the variable q (N in step S350), the
ステップS352では、プロセス実行手段140は、プロセス管理テーブル105に格納されているプロセス番号の実行可フラグをオンにする(ステップS352)。次に、プロセス実行手段140は、実行可能プロセスキュー記憶手段106に、プロセス番号nを実行順位順になるようにエンキューする(ステップS353)。そして、プロセス実行手段140は、強制実行情報格納テーブル108に登録されている資源番号を削除する(ステップS354)。
In step S352, the
なお、上記のステップS347で、プロセス実行手段140がプロセス番号nのプロセスを実行するときに、資源解放手段170に資源の解放を要求する場合、資源解放手段170によって、そのプロセスの実行中断フラグがオンにされ、そのプロセスは中断される。資源を解放した資源解放手段170から制御を戻されると、プロセス実行手段140はステップS348を行い、その後のステップS349で実行中断フラグがオンとなっているので、ステップS347に戻らない。よって、プロセス番号nのプロセスは中断されていることになる。
When the
次に、インターバル初期化手段150の動作について説明する。図18は、インターバル初期化手段150の動作の例を示すフローチャートである。インターバル初期化手段150は、使用時間格納テーブル104中の全てのワークロードクラスのCPU使用時間に0をセットすると(ステップS151)、一定のインターバル時間が経過するのを待つ(ステップS152)。その一定のインターバル時間が経過すると、ステップS151以降の処理を繰り返す。
Next, the operation of the
次に、資源取得手段160および資源解放手段170の動作について説明する。資源取得手段160および資源解放手段170は、プロセス実行手段140がステップS347でプロセスを実行している最中に、プロセス実行手段140によって起動される。プロセス実行手段140がステップS347で資源の取得を要求する場合には、資源取得手段160を起動して、取得する資源の資源番号を指定して、その資源を取得させる。このときプロセス実行手段140が実行しているプロセスを資源取得要求プロセスと記す。また、プロセス実行手段140がステップS347で資源の解放を要求する場合には、資源解放手段170を起動して、解放する資源の資源番号を指定して、その資源を解放させる。このときプロセス実行手段140が実行しているプロセスを資源解放プロセスと記す。
Next, operations of the
図19は、資源取得手段160の動作の例を示すフローチャートである。資源取得手段160は、取得する資源を資源番号によって指定されると、その資源番号を変数sにセットする(ステップS161)。
FIG. 19 is a flowchart illustrating an example of the operation of the
次に、資源取得手段160は、資源管理テーブル107において、資源番号sのテナントプロセスのプロセス番号格納領域にプロセス番号が格納されているか否かを確認する(ステップS162)。テナントプロセスのプロセス番号格納領域にプロセス番号が未格納であれば(ステップS162のN)、ステップS163に移行し、プロセス番号が格納済みであれば(ステップS162のY)、ステップS164に移行する。
Next, the
ステップS163では、資源取得手段160は、資源管理テーブル107中の資源番号sのテナントプロセスのプロセス番号格納領域に、資源取得要求プロセスの番号を格納し(ステップS163)、資源取得手段160を終了する。
In step S163, the
また、ステップS164に移行した場合、資源取得手段160は、資源管理テーブル107における資源番号sの資源待ちプロセスキューに、資源取得要求プロセスを実行優先順位順となるようにキューイングする(ステップS164)。すなわち、資源取得要求プロセスのプロセス番号を実行優先順位順となるように格納する。次に、資源取得手段160は、プロセス管理テーブル105中の資源取得要求プロセスの実行中断フラグをオンにセットし(ステップS165)、プロセス管理テーブル105中の資源取得要求プロセスの資源待ちフラグをオンにセットする(ステップS166)。さらに、プロセス管理テーブル105中の資源取得要求プロセスの資源番号(資源待ちしている資源番号。図6参照)として、変数sをセットし、プロセス実行手段140に制御を戻す(ステップS167)。
When the process proceeds to step S164, the
図20および図21は、資源解放手段170の動作の例を示すフローチャートである。資源解放手段170は、解放する資源を資源番号によって指定されると、その資源番号を変数tにセットする(ステップS171)。次に、資源解放手段170は、資源管理テーブル107において資源番号tのテナントプロセスのプロセス番号格納領域に格納されているプロセス番号を削除する(ステップS172)。このように、テナントプロセスのプロセス番号格納領域に格納されているプロセス番号を削除することによって、プロセス実行手段140が実行しているプロセスで確保していた資源(解放を要求された資源)を解放する。
20 and 21 are flowcharts showing an example of the operation of the
次に、資源解放手段170は、強制実行情報格納テーブル108に格納されている資源番号と変数tとが一致しているか否かを判定する(ステップS173)。一致していない場合、ステップS175に移行し、一致している場合、ステップS174に移行する。
Next, the
ステップS174において、資源解放手段170は、強制実行情報格納テーブル108中の「源解放時に優先的に資源を渡すプロセスのプロセス番号(図9参照)」を変数uにセットする(ステップS174)。
In step S174, the
また、ステップS175では、資源解放手段170は、資源管理テーブル107中の、資源番号tの資源待ちプロセスキューにプロセスが存在するか否かを確認する(ステップS175)。存在していなければ(ステップS175のN)、資源解放手段170を終了する。存在している場合(ステップS175のY)、資源解放手段170は、資源管理テーブル107中の、資源番号tの資源待ちプロセスキューの先頭のプロセスのプロセス番号を変数uにセットする(ステップS176)。
In step S175, the
ステップS174の後、および、ステップS176の後、資源解放手段170は、資源管理テーブル107中の資源番号tの資源待ちプロセスキューから、プロセス番号uをデキューする(ステップS177)。すなわち、ステップS174の後では、「源解放時に優先的に資源を渡すプロセスのプロセス番号」をデキューし、ステップS176の後では、資源番号tの資源待ちプロセスキューの先頭のプロセスのプロセス番号をデキューする。
After step S174 and after step S176, the
次に、資源解放手段170は、資源管理テーブル107中の、資源番号tのテナントプロセスのプロセス番号格納領域に変数uを設定する(ステップS178)。
Next, the
続いて、資源解放手段170は、プロセス管理テーブル105中のプロセス番号uの資源待ちフラグをオフにし(ステップS179)、さらに、プロセス管理テーブル105中のプロセス番号uの実行可フラグをオンにする(ステップS180)。次に、資源解放手段170は、実行可能プロセスキュー記憶手段106の実行可能プロセスキューに、プロセス番号uを実行優先順位順となるようにキューイングする(ステップS181)。
Subsequently, the
次に、資源解放手段170は、強制実行情報格納テーブル108中の資源番号と変数tが一致しているか否かを判定し(ステップS182)、一致していなければ、資源解放手段170を終了する。
Next, the
一致していれば、資源解放手段170は、プロセス管理テーブル105中の資源解放プロセスの実行中断フラグをオンにセットし(ステップS183)、さらに、プロセス管理テーブル105中の資源解放プロセスの実行可フラグをオンにセットし(ステップS184)、実行可能プロセスキュー記憶手段106に資源解放プロセスを実行優先順位順となるようにキューイングし、プロセス実行手段140に制御を渡す(ステップS185)。 If they match, the resource release means 170 sets the execution flag of the resource release process in the process management table 105 to ON (step S183), and further executes the resource release process executable flag in the process management table 105. Is set to ON (step S184), the resource release processes are queued in the executable process queue storage means 106 in order of execution priority, and control is passed to the process execution means 140 (step S185).
ステップS171〜S185の処理において、資源解放手段170は、ステップS172でテナントプロセスのプロセス番号格納領域に格納されているプロセス番号を削除することによって、解放要求された資源を解放している。また、ステップS177でプロセス番号uをデキューすることで、その資源の解放の待ち状態であったプロセスを、資源待ちプロセスキューからデキューしている。さらに、ステップS181で、そのプロセス番号uを実行可能プロセスキューにキューイングすることで、待っていた資源が解放されたプロセスを実行可能プロセスキューにキューイングしている。
In the processing of steps S171 to S185, the
また、ステップS183,S184,S185で、資源解放プロセスの実行中断フラグおよび実行可フラグをオンとし、資源解放プロセスを実行可能プロセスキューにキューイングすることにより、資源解放プロセスを中断させている。ステップS185の後、資源解放プロセスを実行していたプロセス実行手段140は、資源解放手段170から制御を戻されると、ステップS348,S349(図16および図17参照)を行い、ステップS349で、資源解放プロセスの実行中断フラグがオンになっていることを確認して、ステップS347〜S351のループ処理を抜け、ステップS347には戻らないので、中断したプロセスをさらに実行し続けることはない。
In steps S183, S184, and S185, the resource release process is suspended by turning on the execution suspension flag and the executable flag of the resource release process and queuing the resource release process in the executable process queue. After step S185, when the
次に、本発明の動作の具体例を説明する。図22は、各テーブルの状態の具体例を示す説明図である。以下の説明では、プロセス対応テーブル101に、プロセス番号0に対応するワークロードクラス番号として“0”が格納され、プロセス番号1に対応するワークロードクラス番号として“1”が格納されている場合を例にする。また、CPU配分テーブル102において、ワークロードクラス0に対応するCPU配分比率が80%であり、ワークロードクラス1に対応するCPU配分比率が70%であると定められている場合を例にする。また、以下に示す例では、CPUの配分を行うインターバル時間(インターバル初期化手段150が全ワークロードクラスのCPU使用時間を0に初期化する周期)が100ミリ秒であるとする。
Next, a specific example of the operation of the present invention will be described. FIG. 22 is an explanatory diagram showing a specific example of the state of each table. In the following description, “0” is stored as the workload class number corresponding to process
図10を参照して、目標時間計算手段110の動作の具体例を説明する。目標時間計算手段110は、CPU配分テーブル102から、ワークロードクラス0のCPU配分比率“80”、およびワークロードクラス1のCPU配分比率“20”を読み込み(ステップS111)、各ワークロードクラスのCPU配分比率の合計値を計算する(ステップS112)。ワークロードクラス0,1のCPU配分比率は、それぞれ、80,20であるので、本例では、80と20とを加算して、その計算結果である100を算出する。次に、インターバル時間が100ミリ秒であるので、ワークロードクラス0,1のCPU目標時間をそれぞれ、100×80/100=80ミリ秒、100×20/100=20ミリ秒と計算する(ステップS113)。そして、目標時間計算手段110は、各ワークロードクラス0,1のCPU目標時間をそれぞれ80ミリ秒、20ミリ秒として目標時間格納テーブル103にセットする(ステップS114)。
A specific example of the operation of the target
図19を参照して、資源取得手段160の動作の具体例を説明する。プロセス番号1のプロセスから資源番号0の資源の取得を要求されているとする。すなわち、資源要求プロセスのプロセス番号が1であるとする。資源取得手段160は、取得する資源番号0を変数sにセットする(ステップS161)。図22に示すように、資源管理テーブル107において、資源番号0のテナントプロセスのプロセス番号格納領域にプロセス番号0が格納されているとする。すると、資源取得手段160は、テナントプロセスのプロセス番号が格納済みであるので(ステップS162のY)、資源管理テーブル107中の資源番号0の資源待ちプロセスキューに、プロセス1を実行優先順位順となるようにキューイングする(ステップS164)。次に、資源取得手段160は、プロセス管理テーブル105中のプロセス番号1の実行中断フラグおよび資源待ちフラグをオンにセットし(ステップS165,S166)、プロセス管理テーブル105中のプロセス番号1の資源番号(資源待ちしている資源番号)に、資源番号0をセットする(ステップS167)。そして、プロセス実行手段140に制御を戻す。
A specific example of the operation of the
次に、図12を参照して、プロセス選択手段120の動作の具体例を説明する。本例では、実行可能プロセスキュー記憶手段106には、プロセス番号0のプロセスが実行可能プロセスとしてキューイングされ、他にキューイングされている実行可能プロセスはないものとする。また、ワークロードクラス番号0のCPU使用時間は80ミリ秒になっていて、ワークロードクラス番号1のCPU使用時間は10ミリ秒になっているとする。
Next, a specific example of the operation of the
プロセス選択手段120は、ステップ121で、実行可能プロセスキューにキューイングされているプロセスのプロセス番号0を取得する。次に、プロセス番号0のワークロードクラス番号(本例では、ワークロードクラス番号は0)をプロセス対応テーブル101から取得する(ステップS122)。そして、プロセス選択手段120は、そのワークロードクラス番号0のCPU目標時間80ミリ秒を、目標時間格納テーブル103から取得し(ステップS123)、そのワークロードクラス番号0のCPU使用時間80ミリ秒を、使用時間格納テーブル104から取得する(ステップS124)。すると、取得したCPU使用時間およびCPU目標時間は等しいので(ステップS125のN)、ステップS126に移行し、実行可能プロセスキュー記憶手段106に他にキューイングされている実行可能プロセスがないため、強制実行プロセス選択手段130に制御を渡す。
In step 121, the
次に、図13、図14および図15を参照して、強制実行プロセス選択手段130の動作の具体例を説明する。強制実行プロセス選択手段130は、変数iに0をセットする(ステップS231)。そして、目標時間格納テーブル103からワークロードクラス0のCPU目標時間80ミリ秒を取得し(ステップS232)、使用時間格納テーブル104からワークロードクラス0のCPU使用時間80ミリ秒を取得する(ステップS233)。CPU使用時間がCPU目標時間以上であるため(ステップS234のN)、ステップS246に移行し、強制実行プロセス選択手段130は、ワークロードクラス番号0が最終エントリであるか否かを判定する(ステップS246)。ワークロードクラス番号として1があり、ワークロードクラス番号0は最終エントリではないので(ステップS246のN)、ステップS247に移行し、強制実行プロセス選択手段130は、iの値を1増加させ、i=1としてステップS232に移行する(ステップS247)。
Next, a specific example of the operation of the forced execution
続いて、強制実行プロセス選択手段130は、目標時間格納テーブル103からワークロードクラス1のCPU目標時間20ミリ秒を取得し(ステップS232)、使用時間格納テーブル104からワークロードクラス1のCPU使用時間10ミリ秒を取得する(ステップS233)。すると、CPU使用時間がCPU目標時間未満であるため(ステップS234のY)、強制実行プロセス選択手段130は、変数jを0にセットする(ステップS235)。
Subsequently, the forced execution
続いて、強制実行プロセス選択手段130は、プロセス対応テーブル101を参照し、プロセス番号j(ここでは0)のワークロードクラス番号0を取得する(ステップS236)。取得したワークロードクラス番号0が変数iの値(ここでは1)でないため(ステップS237のN)、ステップS244に移行する。ステップS244では、プロセス番号j(=0)が、プロセス対応テーブル101において最終エントリであるか否かを判定する。ここでは、プロセス番号0は最終エントリではないため(ステップS244のN)、強制実行プロセス選択手段130は、jの値を1増加させ、j=1としてステップS236に移行する。
Subsequently, the forced execution
強制実行プロセス選択手段130は、プロセス対応テーブル101を参照し、プロセス番号j(ここでは1)のワークロードクラス番号1を取得する(ステップS236)。取得したワークロードクラス番号1が変数iの値である1と等しいので(ステップS237のY)、強制実行プロセス選択手段130は、変数kにjの値1をセットする(ステップS238)。
The forced execution
次に、プロセス管理テーブル105に格納されているプロセス番号1の資源待ちフラグがオンであるか否かを判定する(ステップS239)。プロセス番号1の資源待ちフラグがオンであるので(ステップS239のY)、強制実行プロセス選択手段130は、プロセス管理テーブル105に格納されているプロセス番号1に対応する、資源待ちしている資源番号0を、変数mにセットする(ステップS240)。さらに、資源管理テーブル107に格納されている資源番号0のテナントプロセスのプロセス番号0を、変数nにセットする(ステップS241)。
Next, it is determined whether or not the resource wait flag of
次に、強制実行プロセス選択手段130は、プロセス管理テーブル105においてプロセス番号n(=0)の実行可フラグがオンになっているか否かを確認する(ステップS242)。本例では、プロセス管理テーブル105においてプロセス番号0の実行可フラグはオンであるとする(ステップS242のY)。よって、この時点でのn=0が、ワークロードクラス1で動作するプロセス1が待っている資源を確保中のプロセスのプロセス番号である。続いて、ステップS248に移行し、強制実行情報格納テーブル108の資源番号にm(=0)を格納する(ステップS248)。さらに、強制実行プロセス選択手段130は、資源解放時に優先的に資源を渡すプロセスのプロセス番号(図9参照)として、kの値(ここでは1)を、強制実行情報格納テーブル108に格納し(ステップS249)、プロセス実行手段140に制御を渡す。
Next, the forced execution
次に、図16および図17を参照して、プロセス実行手段140の動作の具体例を説明する。プロセス実行手段140は、強制実行プロセス選択手段130で選択されたプロセス番号n(ここではn=0)のワークロードクラス番号(ここでは0)をプロセス対応テーブル101から取得し、変数pにセットする(ステップS341)。強制実行プロセス選択手段130で選択されたプロセス番号nとは、強制実行プロセス選択手段130から制御が渡された時点のnであり、上記のように、ワークロードクラス1で動作するプロセス1が待っている資源を確保中のプロセスのプロセス番号を意味している。
Next, a specific example of the operation of the
ステップS341の後、プロセス実行手段140は、目標時間格納テーブル103からワークロードクラス番号p(=0)のCPU目標時間(ここでは80ミリ秒)を取得して変数qにセットし(ステップS342)、使用時間格納テーブル104からワークロードクラス番号p(=0)のCPU使用時間(ここでは80ミリ秒)を取得して変数rにセットする(ステップS343)。そして、n=0であるので、実行可能プロセスキュー106から、プロセス番号0をデキューする(ステップS344)。さらに、プロセス管理テーブル105に格納されているプロセス番号0の実行可フラグおよび実行中断フラグをオフとする(ステップS345,S346)。
After step S341, the
そして、プロセス実行手段140は、プロセス番号0を最小実行単位分、実行し(ステップS347)、使用時間格納テーブル104のワークロードクラスp(=0)のCPU使用時間を、ステップS347で実行した時間分加算する(ステップS348)。
Then, the process execution means 140 executes the
次に、プロセス管理テーブル105に格納されているプロセス番号0の実行中断フラグがオンになったか否かを判定する(ステップS349)。ここでは、プロセス番号0の実行中断フラグがオフのままであるとする(ステップS349のN)。次に、プロセス実行手段140は、変数rの値(80ミリ秒)と、変数qの値(80ミリ秒)とを比較し、r=qであるので(ステップS350のY)、ステップS347に移行する。その後、プロセス番号0の実行中断フラグがオンになるまで、ステップS347〜S350の処理を繰り返す。
Next, it is determined whether or not the execution interruption flag of
次に、図20および図21を参照して、資源解放手段170の動作の具体例を説明する。上記のステップS347(図16参照)でプロセス実行手段140がプロセス番号0のプロセスを実行中に、そのプロセスから資源番号0の解放要求を行ったとする。すなわち、プロセス番号0のプロセスが資源解放プロセスであるとする。すると、資源解放手段170は、解放する資源番号0を変数tにセットする(ステップS171)。そして、資源管理テーブル107中の、資源番号t(ここでは0)のテナントプロセスのプロセス番号格納領域に格納されているプロセス番号0を削除し(ステップS172)、変数tが強制実行情報格納テーブル108中の資源番号0と一致しているか否かを判定する(ステップS173)。ここでは、変数tの値は0であり、両者は一致しているので(ステップS173のY)、資源解放手段170は、強制実行情報格納テーブル108中の「源解放時に優先的に資源を渡すプロセスのプロセス番号(図9参照)」を変数uにセットする。本例では、源解放時に優先的に資源を渡すプロセスのプロセス番号は1となっているので、u=1とする(ステップS174)。
Next, a specific example of the operation of the
ここではt=0,u=1であるので、資源解放手段170は、資源管理テーブル107において資源番号0の資源待ちプロセスキューから、プロセス番号1をデキューする(ステップS177)。さらに、資源管理テーブル107中の資源番号0のテナントプロセスのプロセス番号格納領域にプロセス番号1を格納する(ステップS178)。
Here, since t = 0 and u = 1, the
また、資源解放手段170は、プロセス管理テーブル105中のプロセス番号1の資源待ちフラグをオフとし(ステップS179)、そのプロセス番号1の実行可フラグをオンとする(ステップS180)。さらに、実行可能プロセスキュー記憶手段106にプロセス番号1を実行優先順位順となるようにキューイングする(ステップS181)。
Further, the
そして、強制実行情報格納テーブル108中の資源番号と変数tが一致しているので(ステップS182のY)、資源解放手段170は、プロセス管理テーブル105において、資源解放プロセス(本例では、プロセス0)の実行中断フラグおよび実行可フラグをオンにセットする(ステップS183,S184)。実行可能プロセスキュー記憶手段106に、資源解放プロセスを実行優先順位順となるようにキューイングする(ステップS185)。すなわち、プロセス番号0を実行優先順位順となるようにキューイングする。その後、プロセス実行手段140に制御を戻す。
Since the resource number in the forced execution information storage table 108 matches the variable t (Y in step S182), the
プロセス実行手段140は、ステップS347(図16参照)でのプロセス実行中に資源番号0の解放要求を行った後、資源解放手段170から制御を戻されると、ステップS348以降の処理を行う。使用時間格納テーブル104のワークロードクラス0のCPU使用時間を、ステップS347で実行した時間分加算し(ステップS348、図16参照)。続くステップS349では、プロセス管理テーブル105に格納されているプロセス番号0の実行中断フラグがオンになっているので、ステップS354に移行し、強制実行情報格納テーブル108に登録されている資源番号0を削除し、プロセス選択手段120に制御を渡す。
The
次に、図18を参照して、インターバル初期化手段150の動作の具体例を説明する。インターバル初期化手段150は、使用時間格納テーブル104中の全てのワークロードクラスのCPU使用時間に0をセットし(ステップS151)、100ミリ秒が経過するのを待つ(ステップS152)。100ミリ秒経過すると、ステップS151以降の処理を再度行う。
Next, a specific example of the operation of the
次に、本発明の効果について説明する。
本発明によれば、CPU使用時間がCPU目標時間未満となっているワークロードクラスで動作するプロセスが待っている資源を確保中のプロセスを強制的に実行させる。従って、CPU配分時間を使い切っていないにもかかわらず、共有資源待ちのままCPU資源を使用することができない状態に陥ることを防止することができる。
Next, the effect of the present invention will be described.
According to the present invention, a process that is securing resources waiting for a process operating in a workload class whose CPU usage time is less than the CPU target time is forcibly executed. Accordingly, it is possible to prevent the CPU resource from being in a state where the CPU resource cannot be used while waiting for the shared resource even though the CPU allocation time is not used up.
本発明によれば、ステップS239における資源待ちフラグがオンかオフかの判定を行うことで、CPU使用時間がCPU目標時間未満となっている着目しているワークロードクラスで動作するプロセスが、資源待ち状態であるか否かを判定している。そして、そのプロセスが資源待ち状態でない場合(ステップS239のN)では、プロセス実行手段140に制御を渡さず、プロセス実行手段140がそのプロセスの強制的実行(ステップS347)を行うことはない。換言すれば、システム資源等の資源を取得(確保)している場合でも、他のワークロードクラスがその資源の解放を待っていない場合には、強制的な実行を行わない。そのため、ワークロードクラスをきめ細かく設定し、各ワークロードクラスのCPU配分比率が小さくなる場合でも、システム資源の取得区間の強制実行を行った結果のCPU配分と、元々定めていたCPU配分比率とのずれを削減することができる。
According to the present invention, by determining whether the resource waiting flag in step S239 is on or off, a process operating in the target workload class whose CPU usage time is less than the CPU target time is It is determined whether or not it is in a waiting state. If the process is not in a resource waiting state (N in step S239), control is not passed to the
また、資源を確保中のプロセスを強制的に実行させた場合でも、そのプロセスが資源の解放を要求すると、資源解放手段170は、そのプロセスを中断させる(ステップS183,S184,S185)。その結果、実行優先順位が、ユーザが設定可能な優先順位の範囲に戻るまでの余分な区間を実行しないので、システム資源の取得区間の強制実行を行った結果のCPU配分と、元々定めていたCPU配分比率とのずれを削減することができる。 Further, even when the process that has secured the resource is forcibly executed, when the process requests the release of the resource, the resource release means 170 interrupts the process (steps S183, S184, S185). As a result, since the execution priority does not execute an extra section until it returns to the priority order range that can be set by the user, the CPU allocation as a result of the forced execution of the system resource acquisition section was originally determined. Deviation from the CPU distribution ratio can be reduced.
また、プロセスが解放を待つ資源には、システム資源だけでなく、ワークロードクラス間で共有される資源も含まれ、システム資源だけでなく、ワークロードクラス間共有資源についても、他のワークロードクラスが資源の解放を待つ場合に、その資源を確保しているプロセスの強制的な実行(ステップS347)を行う。よって、類似機能をさらにいくつかのワークロードクラスに分割したことによりワークロードクラス間で共有する資源が存在するようになった場合でも、ワークロードクラス間共有資源のロックネックによるスループットの低下を防止することができる。 In addition, resources that a process waits for release include not only system resources, but also resources shared among workload classes. Other workload classes include not only system resources but also shared resources between workload classes. When waiting for the release of the resource, the process that secures the resource is forcibly executed (step S347). Therefore, even if similar functions are further divided into several workload classes, resources that are shared among the workload classes can be prevented, and a decrease in throughput due to a lock neck of shared resources between workload classes is prevented. can do.
次に、本発明の概要について説明する。図23は、本発明の概要を示すブロック図である。本発明のプロセス制御装置は、強制実行対象特定手段501(例えば、強制実行プロセス選択手段130)と、強制実行手段502(例えば、プロセス実行手段140)と、資源解放手段503(例えば、資源解放手段170)とを備える。 Next, the outline of the present invention will be described. FIG. 23 is a block diagram showing an outline of the present invention. The process control apparatus of the present invention includes a forced execution target identification unit 501 (for example, forced execution process selection unit 130), a forced execution unit 502 (for example, process execution unit 140), and a resource release unit 503 (for example, resource release unit). 170).
強制実行対象特定手段501は、実行可能なプロセスのキューである実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在していない場合に(例えば、プロセス選択手段120がステップS121〜S127の処理でCPU使用時間がCPU目標時間未満のプロセスを選択できなかった場合)、CPU目標時間までCPUを使い切っていないワークロードクラスで動作するプロセスであって資源の解放を待つ解放待ちプロセス(例えば、ステップS242でYとなるときのプロセス番号kのプロセス)と、その資源を確保している資源確保プロセス(例えば、ステップS242でYとなるときのプロセス番号nのプロセス)とを特定する。
The forced execution
強制実行手段502は、資源確保プロセスを強制的に実行させる(例えば、ステップS347を行う)。
The
資源解放手段503は、強制実行手段からプロセスの実行に伴い資源の解放を要求されると、その資源を解放する(例えば、ステップS172を行う)とともに、そのプロセスを中断し(例えば、ステップS183〜S185を行い)、その資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する(例えば、ステップS181を行う)。
When the
以上のような構成により、資源確保プロセスを強制的に実行させ、CPU目標時間を使い切っていないにもかかわらず、資源待ちのままとなってしまう状態に陥ることを防止することができる。また、資源解放手段503は、資源解放時に、資源解放を要求したプロセスを中断するので、ワークロードクラスをきめ細かく設定し、各ワークロードクラスのCPU配分比率が小さくなる場合でも、システム資源の取得区間の強制実行を行った結果のCPU配分と、元々定めていたCPU配分比率とのずれを削減することができる。
With the configuration as described above, it is possible to forcibly execute the resource securing process and prevent a situation in which a resource is kept waiting even though the CPU target time is not used up. Further, since the
また、上記の実施形態には、強制実行対象特定手段501が、資源の解放を待つ解放待ちプロセスが存在していることを条件に(ステップS239でYとなることを条件に)、資源確保プロセスを強制実行手段502に実行させる構成が開示されている。
Further, in the above embodiment, the forced execution
そのような構成により、ワークロードクラスをきめ細かく設定し、各ワークロードクラスのCPU配分比率が小さくなる場合でも、システム資源の取得区間の強制実行を行った結果のCPU配分と、元々定めていたCPU配分比率とのずれを削減することができる。 With such a configuration, even when the workload class is set finely and the CPU distribution ratio of each workload class is small, the CPU distribution as a result of forcibly executing the acquisition section of the system resources and the CPU that was originally determined Deviation from the distribution ratio can be reduced.
また、資源が、ワークロードクラス間で共有される資源を含むことが開示されている。 It is also disclosed that the resources include resources that are shared between workload classes.
また、確保されている資源の資源識別情報と、資源解放時にその資源を優先的に使用するプロセスのプロセス識別情報とを記憶する優先プロセス記憶手段(例えば、強制実行情報格納テーブル108)を備え、強制実行対象特定手段501が、資源確保プロセスが確保している資源の資源識別情報を優先プロセス記憶手段に記憶させ(例えばステップS248を行い)、解放待ちプロセスのプロセス識別情報を、その資源を優先的に使用するプロセスのプロセス識別情報として優先プロセス記憶手段に記憶させ(例えば、ステップS249を行い)、資源解放手段503が、解放した資源の資源識別情報と優先プロセス記憶手段が記憶している資源識別情報とが一致する場合に(例えば、ステップS173のY)、優先プロセス記憶手段に記憶されているプロセス識別情報が示すプロセスを実行可能プロセスキューにキューイングする(例えば、ステップS174で定めたuに関してステップS181を行う)構成が開示されている。
In addition, there is provided priority process storage means (for example, forced execution information storage table 108) for storing resource identification information of the secured resource and process identification information of a process that preferentially uses the resource when releasing the resource, The forced execution
また、強制実行手段502は、実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在する場合(例えば、プロセス選択手段120がステップS121〜S127の処理でCPU使用時間がCPU目標時間未満のプロセスを選択した場合)、そのプロセスを実行する構成が開示されている。
Further, the
本発明は、ワークロード毎に資源の割り当てを行うプロセス制御に好適に適用される。 The present invention is preferably applied to process control in which resources are allocated for each workload.
10 プロセス制御装置
101 プロセス対応テーブル
102 CPU配分テーブル
103 目標時間格納テーブル
104 使用時間格納テーブル
105 プロセス管理テーブル
106 実行可能プロセスキュー記憶手段
107 資源管理テーブル
108 強制実行情報格納テーブル
110 目標時間計算手段
120 プロセス選択手段
130 強制実行プロセス選択手段
140 プロセス実行手段
150 インターバル初期化手段
160 資源取得手段
170 資源解放手段
501 強制実行対象特定手段
502 強制実行手段
503 資源解放手段
DESCRIPTION OF SYMBOLS 10
Claims (9)
前記資源確保プロセスを強制的に実行させる強制実行手段と、
強制実行手段からプロセスの実行に伴い資源の解放を要求されると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する資源解放手段とを備える
ことを特徴とするプロセス制御装置。 A process that operates in a workload class that does not use up the CPU until the CPU target time when there is no process in the executable process queue that is the queue of executable processes that does not use up the CPU until the CPU target time. A forcible execution target specifying means for specifying a release waiting process waiting for the release of a resource and a resource securing process securing the resource;
Forcibly executing means for forcibly executing the resource securing process;
When the forcible execution means requests the release of a resource along with the execution of the process, the resource is released, and the process is suspended and a release waiting process waiting for the release of the resource is added to the executable process queue. A process control apparatus.
請求項1に記載のプロセス制御装置。 The process control device according to claim 1, wherein the forcible execution target specifying unit causes the forcible execution unit to execute the resource securing process on condition that there is a release waiting process waiting for the release of the resource.
請求項1または請求項2に記載のプロセス制御装置。 The process control apparatus according to claim 1, wherein the resource includes a resource shared between workload classes.
強制実行対象特定手段は、資源確保プロセスが確保している資源の資源識別情報を優先プロセス記憶手段に記憶させ、解放待ちプロセスのプロセス識別情報を、前記資源を優先的に使用するプロセスのプロセス識別情報として優先プロセス記憶手段に記憶させ、
資源解放手段は、解放した資源の資源識別情報と優先プロセス記憶手段が記憶している資源識別情報とが一致する場合に、優先プロセス記憶手段に記憶されているプロセス識別情報が示すプロセスを実行可能プロセスキューにキューイングする
請求項1から請求項3のうちのいずれか1項に記載のプロセス制御装置。 A priority process storage means for storing resource identification information of a secured resource and process identification information of a process that preferentially uses the resource when releasing the resource;
The forced execution target specifying means stores the resource identification information of the resource secured by the resource securing process in the priority process storage means, and the process identification information of the process waiting to be released is the process identification of the process that preferentially uses the resource. Information is stored in the priority process storage means,
The resource release means can execute the process indicated by the process identification information stored in the priority process storage means when the resource identification information of the released resource matches the resource identification information stored in the priority process storage means. The process control device according to any one of claims 1 to 3, wherein the process control device is queued in a process queue.
請求項1から請求項4のうちのいずれか1項に記載のプロセス制御装置。 The process according to any one of claims 1 to 4, wherein the forcible execution means executes the process when there is a process that does not use up the CPU until the CPU target time in the executable process queue. Control device.
前記資源確保プロセスを強制的に実行させ、
プロセスの実行に伴い資源の解放を要求されると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する
ことを特徴とするプロセス制御方法。 A process that operates in a workload class that does not use up the CPU until the CPU target time when there is no process in the executable process queue that is the queue of executable processes that does not use up the CPU until the CPU target time. Identify the release-waiting process that waits for the release of the resource and the resource reservation process that secures the resource,
Forcing the resource securing process to run;
When a resource is requested to be released in accordance with the execution of a process, the process releases the resource, interrupts the process, and adds a waiting process for waiting for the release of the resource to an executable process queue. Control method.
請求項6に記載のプロセス制御方法。 The process control method according to claim 6, wherein the resource securing process is executed on condition that there is a release waiting process waiting for the release of the resource.
実行可能なプロセスのキューである実行可能プロセスキューの中にCPU目標時間までCPUを使い切っていないプロセスが存在していない場合に、CPU目標時間までCPUを使い切っていないワークロードクラスで動作するプロセスであって資源の解放を待つ解放待ちプロセスと、当該資源を確保している資源確保プロセスとを特定する強制実行対象特定処理、
前記資源確保プロセスを強制的に実行させる強制実行処理、および、
強制実行処理でのプロセスの実行に伴い資源の解放要求が生じると、当該資源を解放するとともに、前記プロセスを中断し、前記資源の解放を待つ解放待ちプロセスを実行可能プロセスキューに追加する資源解放処理
を実行させるためのプロセス制御プログラム。 On the computer,
A process that operates in a workload class that does not use up the CPU until the CPU target time when there is no process in the executable process queue that is the queue of executable processes that does not use up the CPU until the CPU target time. A forced execution target identification process that identifies a release waiting process that waits for the release of a resource and a resource allocation process that secures the resource,
A forced execution process for forcibly executing the resource securing process; and
When a resource release request is generated during execution of a process in forced execution processing, the resource is released, and the process is suspended and a release waiting process waiting for the resource release is added to the executable process queue. Process control program to execute processing.
資源の解放を待つ解放待ちプロセスが存在していることを条件に、強制実行処理で資源確保プロセスを強制的に実行する
請求項8に記載のプロセス制御プログラム。 In the computer,
The process control program according to claim 8, wherein the resource securing process is forcibly executed by the forcible execution process on condition that there is a release waiting process waiting for the release of the resource.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008053474A JP4650504B2 (en) | 2008-03-04 | 2008-03-04 | Process control device, process control method, and process control program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008053474A JP4650504B2 (en) | 2008-03-04 | 2008-03-04 | Process control device, process control method, and process control program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2009211386A JP2009211386A (en) | 2009-09-17 |
| JP4650504B2 true JP4650504B2 (en) | 2011-03-16 |
Family
ID=41184463
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008053474A Expired - Fee Related JP4650504B2 (en) | 2008-03-04 | 2008-03-04 | Process control device, process control method, and process control program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4650504B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111026552B (en) * | 2019-12-09 | 2023-03-03 | 腾讯科技(深圳)有限公司 | Resource scheduling method and device, electronic equipment and computer readable storage medium |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH06214811A (en) * | 1993-01-20 | 1994-08-05 | Toshiba Corp | Scheduling system |
| JPH0877025A (en) * | 1994-09-01 | 1996-03-22 | Kokusai Electric Co Ltd | Task priority control method and task priority control device |
| JPH1124946A (en) * | 1997-07-04 | 1999-01-29 | Canon Inc | Task scheduling apparatus and method |
| JP2000148512A (en) * | 1998-11-06 | 2000-05-30 | Hitachi Ltd | How to schedule a job |
| JP2003122586A (en) * | 2001-08-09 | 2003-04-25 | Matsushita Electric Ind Co Ltd | Task scheduling device |
-
2008
- 2008-03-04 JP JP2008053474A patent/JP4650504B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2009211386A (en) | 2009-09-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7302686B2 (en) | Task management system | |
| CN107291548B (en) | Task resource scheduling method and device | |
| US8954975B2 (en) | Task scheduling method for real time operating system | |
| US20090083746A1 (en) | Method for job management of computer system | |
| KR101644800B1 (en) | Computing system and method | |
| JPH07141305A (en) | Execution control method for parallel computers | |
| KR101640848B1 (en) | Job Allocation Method on Multi-core System and Apparatus thereof | |
| JPH0659906A (en) | Execution control method for parallel computers | |
| FR3025907B1 (en) | MECHANISM AND METHOD FOR PROVIDING COMMUNICATION BETWEEN A CLIENT AND A SERVER BY ACCESSING SHARED MEMORY MESSAGE DATA. | |
| CN110781145B (en) | File system task scheduling method, device, equipment and readable storage medium | |
| US20210149726A1 (en) | Scheduling device, scheduling system, scheduling method, and non-transitory computer-readable medium | |
| JP5605131B2 (en) | Job scheduling program, method, and apparatus | |
| Biswas et al. | Determining proficient time quantum to improve the performance of round robin scheduling algorithm | |
| CN115766612B (en) | A scheduling method based on weight conversion probability and corresponding device | |
| US20170344266A1 (en) | Methods for dynamic resource reservation based on classified i/o requests and devices thereof | |
| CN114153578A (en) | Data access method, device, equipment and storage medium | |
| JP4650504B2 (en) | Process control device, process control method, and process control program | |
| CN113225269A (en) | Container-based workflow scheduling method, device and system and storage medium | |
| KR101335038B1 (en) | Periodic and aperiodic task scheduling algorithm based on topological sort and residual time | |
| Azmi et al. | Performance comparison of priority rule scheduling algorithms using different inter arrival time jobs in grid environment | |
| CN106775975A (en) | Process scheduling method and device | |
| CN112181661B (en) | Task scheduling method | |
| JP2001022601A (en) | Job execution control method and parallel computer system | |
| Patel | SJRR CPU scheduling algorithm | |
| JP6337684B2 (en) | Observation plan creation device and observation device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101105 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20101116 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20101129 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4650504 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131224 Year of fee payment: 3 |
|
| LAPS | Cancellation because of no payment of annual fees |