JP4127354B2 - Multiprocessor control program and multiprocessor control method - Google Patents
Multiprocessor control program and multiprocessor control method Download PDFInfo
- Publication number
- JP4127354B2 JP4127354B2 JP2001384027A JP2001384027A JP4127354B2 JP 4127354 B2 JP4127354 B2 JP 4127354B2 JP 2001384027 A JP2001384027 A JP 2001384027A JP 2001384027 A JP2001384027 A JP 2001384027A JP 4127354 B2 JP4127354 B2 JP 4127354B2
- Authority
- JP
- Japan
- Prior art keywords
- execution
- attribute
- upper limit
- processor
- execution unit
- 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
Description
【0001】
【発明の属する技術分野】
本発明はマルチプロセッサ制御プログラム及びマルチプロセッサ制御方法に関し、特に属性が付与された複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御プログラム及びマルチプロセッサ制御方法に関する。
【0002】
【従来の技術】
現在、コンピュータのデータ処理能力を向上させるための様々な技術が存在する。その技術の中にデータ処理を複数のCPU(Central Processing Unit)で分担して並列処理させることによりデータ処理能力を向上させるマルチCPUシステムがある。
【0003】
マルチCPUシステムにデータの並列処理をさせる方法として次の2通りがある。その1は、プロセスやスレッドなどのプログラムの実行単位を複数のCPUに実行させ、実行が終了したCPUに次々と実行待ちをしている実行単位を実行させる方法である。その2は、実行単位に属性を持たせ、属性ごとに実行単位を実行する複数のCPUを決めて実行単位をCPUに実行させ、実行が終了したCPUから順に、そのCPUが実行できる属性をもつ実行待ちをしている実行単位を実行させる方法である。
【0004】
図12は従来のマルチCPUシステムの動作(その1)を説明する図である。図に示すマルチCPUシステムは、4つのCPU40〜43を有する。CPU40〜43はプログラムの実行単位であるプロセス40a〜43aを実行している。また、プロセス44,45はCPU40〜43の実行待ちをしている。
【0005】
CPU41がプロセス41aの実行を終了したとすると、実行待ちをしているプロセス44がCPU41よって実行される。また、CPU42がプロセス42aの実行を終了したとすると、実行待ちをしているプロセス45がCPU42によって実行される。このように、プロセスの実行を終了しプロセスを切り離したCPUは、実行待ちをしているプロセスを順に実行していく。
【0006】
図13は従来のマルチCPUシステムの動作(その2)を説明する図である。図に示すマルチCPUシステムは、属性‘#A’を持つプロセスを実行するCPU50,51と、属性‘#B’をもつプロセスを実行するCPU52,53とを有する。CPU50,CPU51は、属性‘#A’を持つプロセス50a,51bを実行し、CPU52,CPU53は、属性‘#B’を持つプロセス52a,53aを実行している。また、属性‘#A’を持つプロセス54,55は、CPU50,51の実行待ちをしており、属性‘#B’を持つプロセス56,57は、CPU52,53の実行待ちをしている。
【0007】
CPU50がプロセス50aの実行を終了したとすると、実行待ちをしている属性‘#A’を持つプロセス54がCPU50によって実行される。また、CPU52がプロセス52aの実行を終了したとすると、実行待ちをしている属性‘#B’を持つプロセス56がCPU52によって実行される。このように、プロセスに属性を持たせ、属性ごとにプロセスを実行するCPUを決め、プロセスの実行を終了しプロセスを切り離したCPUは、決められた属性の実行待ちをしているプロセスを順に実行していく。
【0008】
【発明が解決しようとする課題】
ここで、図12において、CPU40が実行しているプロセス40aが、排他資源を利用しているとする。また、CPU41,42が実行しているプロセス41a,42aも排他資源を利用しようとしたとする。このとき、CPU41,42は、プロセス40aの排他資源の利用が終了するまで、プロセス41a,42aの実行を進めることができない(排他資源の競合)。このため、CPU43のみが、プロセス43aの実行を終了し、実行待ちのプロセス44,45を実行できる状態にあり並列動作性が低下してしまう。
【0009】
このように、実行が終了したCPUに次々と実行待ちをしている実行単位を実行させる方法では、排他資源の競合機会が増加した場合、並列動作性が低下してしまうという問題点があった。
【0010】
また、図13において、属性‘#A’を持つプロセス50a,51aの排他資源の競合が起こったとする。属性‘#B’を持つプロセス52a,53aは、CPU52,53によって実行が確保される。しかし、属性‘#B’を持つプロセス52a,53a,56,57のCPU52,53による実行が終了しても、実行待ちをしている属性‘#A’をもつプロセス54,55がCPU52,53によって実行されることはなく、CPUの使用効率が悪い。
【0011】
このように、実効単位に属性を持たせ、属性ごとに実行単位をCPUに実行させる方法では、排他資源の競合機会を減らすことはできるが、CPUの使用効率を低下させるという問題点があった。
【0012】
本発明はこのような点に鑑みてなされたものであり、プロセッサの並列動作性の低下、及び、プロセッサの使用効率の低下を抑えるマルチプロセッサ制御プログラムを提供することを目的とする。
【0013】
【課題を解決するための手段】
上記課題を解決するために、複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御プログラムにおいて、コンピュータに、いずれかのプロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、前記上限数が前記実行数より多い場合、実行単位の属性ごとに実行できるプロセッサを決めることなく、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行させ、プロセッサによって実行されている実行単位の排他資源に対する競合回数を実行単位の属性ごとに取得し、前記属性ごとに取得した競合回数に応じて、前記テーブルの前記属性に対応するプロセッサを占有できる上限数を変更する、処理を実行させることを特徴とするマルチプロセッサ制御プログラムが提供される。
【0014】
このようなマルチプロセッサ制御プログラムによれば、実行単位の属性ごとに、実行単位がプロセッサを占有できる上限数を設け、実行単位の属性ごとに実行できるプロセッサを決めることなく、開放状態になったプロセッサに実行単位を実行させる。また、実行単位の排他資源に対する競合回数を実行単位の属性ごとに取得し、属性ごとに取得した競合回数に応じて、プロセッサを占有できる上限数を変更する。
【0015】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照して説明する。
図1は、本発明の原理を説明する原理図である。
【0016】
この図においてコンピュータ1は、属性取得手段10、上限数取得手段11、テーブル12、実行数取得手段13、実行手段14、属性を有する実行単位15a〜15h、及び、プロセッサ16a〜16fを有する。
【0017】
属性取得手段10は、プロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得する。
上限数取得手段11は、属性取得手段10によって取得された実行待ちをしている実行単位の属性に対応する、プロセッサを占有できる上限数をテーブル12から取得する。
【0018】
テーブル12には、実行単位の属性ごとにプロセッサを占有できる上限数が予め登録される。
実行数取得手段13は、属性取得手段10によって取得された実行待ちをしている実行単位の属性と、同じ属性を持つ実行単位を実行しているプロセッサの数である実行数を取得する。
【0019】
実行手段14は、上限数取得手段11によって取得されたプロセッサを占有できる上限数が、実行数取得手段13によって取得されたプロセッサの実行数より多い場合、処理機能が開放状態となっているプロセッサに実行待ちをしていた実行単位を実行させる。
【0020】
実行単位15a〜15hは、プロセッサによって実行されるプログラム実行単位である。実行単位15aは属性‘#1’を有する。実行単位15bは属性‘#1’を有する。実行単位15cは属性‘#2’を有する。実行単位15dは属性‘#1’を有する。実行単位15eは属性‘#2’を有する。実行単位15fは属性‘#1’を有する。実行単位15gは属性‘#1’を有する。実行単位15hは属性‘#2’を有する。
【0021】
プロセッサ16a〜16fは、実行手段14によって割り当てられる実行単位を実行する。
以下、図1の原理図の動作について説明する。
【0022】
図1に示すように、プロセッサ16aは実行単位15aを実行しているとする。プロセッサ16bは実行単位15bを実行しているとする。プロセッサ16cは実行単位15cを実行しているとする。プロセッサ16dは実行単位15dを実行しているとする。プロセッサ16eは実行単位15eを実行しているとする。プロセッサ16fは実行単位15fを実行しているとする。また、実行単位15g、15hはプロセッサ16a〜16fの実行待ちをしているとする。
【0023】
ここで、プロセッサ16bが、実行単位15bの実行を終了したとする。プロセッサ16bは、処理機能が開放状態となり、属性取得手段10は、実行待ちをしている実行単位15gの属性‘#1’を取得する。
【0024】
上限数取得手段11は、実行単位15gの属性#1に対応する、プロセッサを占有できる上限数をテーブル12から取得する。ここで、テーブル12には、属性‘#1’を有する実行単位がプロセッサを占有できる上限数は‘9999’、属性‘#2’を有する実行単位がプロセッサを占有できる上限数は‘2’と登録されているとする。これによって、上限数取得手段11は、属性‘#1’の実行単位がプロセッサを占有できる上限数‘9999’を取得する。
【0025】
ここで、上限数‘9999’は、プロセッサ16a〜16fを制限されることなく割り当てられることを示している。これは、コンピュータ1がプロセッサを6個しか搭載していないので、プロセッサを占有できる上限数は最高で‘6’であるためである。
【0026】
実行数取得手段13は、属性取得手段10によって取得された、実行待ちをしている実行単位15gの属性‘#1’と、同じ実行単位を実行しているプロセッサの実行数を取得する。プロセッサ16bは、開放状態であることを考慮して、属性‘#1’の実行単位を実行しているプロセッサは、プロセッサ16a,16d、16fの3個であり、実行数取得手段13は、実行数‘3’を取得する。
【0027】
実行手段14は、上限数取得手段11によって取得されたプロセッサを占有できる上限数‘9999’が、実行数取得手段13によって取得されたプロセッサの実行数‘3’より多いので、実行待ちをしていた実行単位15gをプロセッサ16bに実行させる。
【0028】
実行単位15gがプロセッサ16bに割り当てられたことにより、次に、図1において、実行単位15hが実行待ちの状態となる。
ここで、プロセッサ16dが、実行単位15dの実行を終了したとする。すると、プロセッサ16dは、処理機能が開放状態となり、属性取得手段10は、実行待ちをしている実行単位15hの属性‘#2’を取得する。
【0029】
上限数取得手段11は、実行単位15hの属性‘#2’に対応する、プロセッサを占有できる上限数をテーブル12から取得する。先述したように、テーブル12には、属性‘#1’を有する実行単位がプロセッサを占有できる上限数は‘9999’、属性‘#2’を有する実行単位がプロセッサを占有できる上限数は‘2’、と登録されている。これによって、上限数取得手段11は、属性‘#2’の実行単位がプロセッサを占有できる上限数‘2’を取得する。
【0030】
実行数取得手段13は、属性取得手段10によって取得された、実行待ちをしている実行単位15hの属性‘#2’と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得する。プロセッサ16dは、現在、開放状態であること、及び、先述の説明よりプロセッサ16bは、属性‘#1’の実行単位15gを実行していることを考慮して、属性‘#2’の実行単位を実行しているプロセッサは、プロセッサ16c,16eの2個であり、実行数取得手段13は、実行数‘2’を取得する。
【0031】
実行手段14は、上限数取得手段11によって取得されたプロセッサを占有できる上限数‘2’が、実行数取得手段13によって取得されたプロセッサの実行数‘2’と同数であるので、実行待ちをしていた実行単位15hをプロセッサ16dに実行させない。
【0032】
このように、実行単位の属性ごとに、プロセッサを占有できる上限数を設けて、実行単位の競合機会を抑え、実行単位の属性ごとに実行できるプロセッサを決めることなく、開放状態になったプロセッサに実行単位を実行させるようにしたので、プロセッサの並列動作性、及び、使用効率の低下を抑えることができる。
【0033】
次に、本発明の実施の形態を実現するためのハードウェア構成について説明する。
図2は、本発明の実施の形態を実現するためのコンピュータのハードウェア構成例である。
【0034】
図に示すように、コンピュータ2は、CPU20a〜20f、各CPU20a〜20fに接続されたRAM(Random Access Memory)20aa〜20af、ハードディスクドライブ(HDD:Hard Disk Drive)20g、入力インタフェース20h、キーボード20i、グラフィック処理装置20j、モニタ20k、通信インタフェース20l、及び、バス20mとから構成される。
【0035】
RAM20aa〜20afには、各CPU20a〜20fが実行するプログラムの少なくとも一部が一時的に格納される。また、RAM20aa〜20afには、各CPU20a〜20fによる処理に必要な各種データが保存される。
【0036】
HDD20gには、CPU20a〜20fの並列動作を制御するためのプログラムなどが格納される。CPU20a〜20fは、HDD20gの並列動作を制御するためのプログラムに従って、スレッドなどのプログラムの実行単位を実行する。
【0037】
入力インタフェース20hには、キーボード20iが接続されている。入力インタフェース20hは、キーボード20iから送られてくる信号を、バス20mを介してCPU20a〜20fに送信する。
【0038】
グラフィック処理装置20jには、モニタ20kが接続されている。グラフィック処理装置20jは、CPU20a〜20fからの命令に従って、画像をモニタ20kの表示画面に表示させる。
【0039】
通信インタフェース20lは、ネットワーク20nに接続されている。通信インタフェース20lは、ネットワーク20nを介して、コンピュータ2を他の装置と通信可能にする。
【0040】
バス20mは、CPU20a〜20f、HDD20g、入力インタフェース20h、グラフィック処理装置20j、及び、通信インタフェース20lを接続する。
【0041】
なお、上記説明では各CPUにRAMが接続されたハードウェア構成を示したが、CPU全体に対し1個のRAMを共有するハードウェア構成でもよく、また、CPUの数より少ない複数のRAMを用いたハードウェア構成でもよい。
【0042】
次に、本発明の実施の形態を実現するためのコンピュータの機能について説明する。
図3は、本発明の実施の形態を実現するためのコンピュータの機能ブロック図である。
【0043】
図に示すコンピュータ2は、CPU20a〜20f、属性取得部21、上限数取得部22、上限数テーブル23、実行数取得部24、CPU割り当て制御部25、カーネルA26a、カーネルB26b、競合計数部27、設定情報テーブル28、実行待ちキュー29、OS(Operating System)30a、OS30b、及び、属性を有するスレッド31a〜31jとを有する。
【0044】
属性取得部21は、CPU20a〜20fが開放状態のとき、実行待ちキュー29の先頭(詳細は後述)で実行待ちをしているスレッドの属性を取得する。
上限数取得部22は、属性取得部21によって取得された、実行待ちをしているスレッドの属性に対応する、CPUを占有できる数である上限数を上限数テーブル23から取得する。
【0045】
上限数テーブル23は、スレッドの属性ごとにCPUを占有できる上限数を登録する。
実行数取得部24は、属性取得部21によって取得された実行待ちのスレッドの属性と同じ属性をもつスレッドを実行しているCPUの数である実行数を取得する。
【0046】
CPU割り当て制御部25は、上限数取得部22によって取得された上限数が、実行数取得部24によって取得された実行数より多い場合、処理機能が開放状態となっているCPUに、実行待ちキュー29の先頭で実行待ちをしているスレッドを割り当てる。また、CPU割り当て制御部25は、上限数取得部22によって取得された上限数が、実行数取得部24によって取得された実行数以下である場合、実行待ちキュー29の先頭で実行待ちをしているスレッドを末尾で実行待ちをさせる。
【0047】
カーネルA26a、カーネルB26bは、スレッドが特定の処理を実現するときに利用するプログラムである。カーネルA26a、カーネルB26bは、排他資源であり、あるスレッドがカーネルA26a、又は、カーネルB26bを利用しているとき、他のスレッドは、カーネルA26a、カーネルB26bを利用することはできず、スレッドの競合が生じる場合がある。
【0048】
競合計数部27は、スレッドのカーネルA26a、カーネルB26bへの単位時間当たりの競合回数を属性ごとにカウントする。また、競合計数部27は、設定情報テーブル28を参照し、スレッドのカーネルA26a、カーネルB26bへの競合回数に応じた、CPUを占有できる上限数を取得して、上限数テーブル23のCPUを占有できる上限数を変更する。
【0049】
設定情報テーブル28は、スレッドの属性ごとに、カーネルA26a、カーネルB26bの競合する回数に対応した、CPUを占有できる上限数を登録する。実行待ちキュー29は、OS30a,30bから生成されたスレッドを、CPUの割り当てが必要となった順にCPU割り当て制御部25に処理されるようにスレッドを管理する。ここで、実行待ちキューの構造について説明する。図4は、実行待ちキューの構造を示した図である。図に示すように、実行待ちキュー29は、キュー管理部29aを有する。キュー管理部29aは、OS30a,30bから生成されたスレッドをCPUの割り当てが必要となった順に先頭方向へスレッドを順番に並べる。図4においては、スレッド31gが先にCPUの割り当てが必要となったスレッドであり、スレッド31hが後にCPUの割り当てが必要となったスレッドである。スレッド31gが実行待ちをしている先頭であり、スレッド31hが実行待ちをしている末尾である。
【0050】
OS30a,30bは、プログラムの実行単位であるスレッドを生成し、実行待ちキュー29に送り出す。このとき、OS30a、30bは、OS30a、30bの種別を示す‘OS#1’,‘OS#2’を、スレッドの属性として付与する。
【0051】
スレッド31a〜31jは、プログラムの実行単位である。スレッド31aは属性‘OS#2’を有する。スレッド31bは属性‘OS#1’を有する。スレッド31cは属性‘OS#1’を有する。スレッド31dは属性‘OS#2’を有する。スレッド31eは属性‘OS#1’を有する。スレッド31fは属性‘OS#1’を有する。スレッド31gは属性‘OS#2’を有する。スレッド31hは属性‘OS#1’を有する。スレッド31iは属性‘OS#2’を有する。スレッド31jは属性‘OS#1’を有する。
【0052】
ここで、スレッドの構造について説明する。図5は、スレッドの構造を示した図である。スレッド31aは、プログラム管理領域31aaとスレッド管理テーブル領域31abに分かれる。プログラム管理領域31aaは、さらにアプリケーションプログラムを格納するプログラム領域31aaaと、アプリケーションプログラムが使用するデータを格納するデータ領域31aabに分かれる。スレッド管理テーブル領域31abは、さらにスレッドの属性を格納する属性領域31abaとCPUのレジスタ値を格納するレジスタ退避域31abbとOSが使用するデータを格納するデータ領域31abcに分かれる。レジスタ退避域31abbには、例えば、スレッド31aの実行が中断されたときのCPUのレジスタ値(例えば、CPUのレジスタA・・・レジスタEの値)が格納される。そして、次回スレッド31aがCPUによって実行されるとき、レジスタ退避域31abbに格納されているレジスタ値がCPUのレジスタに展開されて実行される。
【0053】
以下に、図3に示すコンピュータの機能ブロック図の処理の流れについて説明する。
図3に示すように、CPU20aはスレッド31aを実行しているとする。CPU20bはスレッド31bを実行しているとする。CPU20cはスレッド31cを実行しているとする。CPU20dはスレッド31dを実行しているとする。CPU20eはスレッド31eを実行しているとする。CPU20fはスレッド31fを実行しているとする。また、スレッド31g、スレッド31hは、実行待ちキュー29で実行待ちをしているとする。
【0054】
ここで、CPU20bがスレッド31bの実行を終了し、切り離したとする。するとCPU20bは、処理機能が開放状態となる。図6は、CPUのスレッド処理の遷移状態を説明する図(その1)である。CPU20a,CPU20c〜20fは、スレッド31a,スレッド31c〜31fを実行し、CPU20bは、スレッドを実行していない状態(開放状態)を示す。
【0055】
CPU20bが開放状態になると、属性取得部21は、実行待ちキュー29の先頭で実行待ちをしているスレッド31gの属性‘OS#2’を取得する。
上限数取得部22は、上限数テーブル23から、実行待ちキュー29の先頭で実行待ちをしているスレッド31gの属性‘OS#2’に対応する、CPUを占有できる上限数を取得する。図7は、上限数テーブルに登録されている情報の一例を示した図である。図の上限数テーブル23には、属性‘OS#1’に対応するプロセッサを占有できる上限数として‘4’、属性‘OS#2’に対応するプロセッサを占有できる上限数として‘2’が登録されている。
【0056】
図7より、上限数取得部22は、属性‘OS#2’に対応する、CPUを占有できる上限数‘2’を取得する。
実行数取得部24は、属性取得部21によって取得された、実行待ちをしているスレッド31gの属性‘OS#2’と同じ属性をもつスレッドを実行しているCPUの数を取得する。図6において、CPU20a,20dが属性‘OS#2’を有するスレッド31a,31dを実行しているので、実行数取得部24は、実行数‘2’を取得する。
【0057】
上限数取得部22によって取得された上限数は‘2’であり、属性‘OS#2’を有するスレッドをCPUに割り当てることのできる数は最大‘2’である。実行数取得部24によって取得された実行数は‘2’であり、すでにCPUには属性‘OS#2’を有するスレッドが‘2’割り当てられている。これによって、CPU割り当て制御部25は、実行待ちをしていたスレッド31gを開放状態にあるCPU20bに実行させない。
【0058】
CPU割り当て制御部25は、実行待ちキュー29の先頭で実行待ちをしていたスレッド31gを、そのままの順番で実行待ちするように保持し、次の実行待ちをしているスレッド31hを見に行く。
【0059】
CPU20bは、まだ開放状態にあるので、属性取得部21は、実行待ちキュー29で実行待ちをしているスレッド31hの属性‘OS#1’を取得する。
上限数取得部22は、実行待ちキュー29で実行待ちをしているスレッド31hの属性‘OS#1’に対応する、CPUを占有できる上限数を上限数テーブル23から取得する。図7より、上限数取得部22は、属性‘OS#1’に対応するCPUを占有できる上限数‘4’を取得する。
【0060】
実行数取得部24は、属性取得部21によって取得された、実行待ちをしているスレッド31hの属性‘OS#1’と同じ属性をもつスレッドを実行しているCPUの数を取得する。図6において、CPU20c,20e,20fが属性‘OS#1’のスレッドを実行しているので、実行数取得部24は、実行数‘3’を取得する。
【0061】
上限数取得部22によって取得された上限数は‘4’であり、属性‘OS#1’のスレッドをCPUに割り当てることのできる数は最大‘4’である。実行数取得部24によって取得された実行数‘3’であり、スレッド31hを開放状態にあるCPU20bに割り当てることができる。図8は、CPUのスレッド処理の遷移状態を説明する図(その2)である。図に示すように、CPU20bに、スレッド31hが割り当てられる。
【0062】
次に、図3の機能ブロック図における上限数テーブル23の上限数の変更処理の流れについて説明する。
競合計数部27は、スレッド31a〜31fのカーネルA26a、カーネルB26bへの競合回数をカウントし、設定情報テーブル28を参照して、上限数テーブル23のCPUを占有できる上限数を変更する。
【0063】
図9は、設定情報テーブルに登録されている情報の一例を示した図である。図に示す設定情報テーブル28には、属性“OS#1”を有するスレッドのカーネルA26aに対する競合が1秒間に5000回以上であれば、CPUを占有できる上限数は‘2’という情報が登録されている。同様に、競合が1秒間に1000回以上5000回未満であれば上限数は‘3’、競合が1秒間に1000回未満であれば上限数は‘4’という情報が登録されている。また、属性“OS#2”を有するスレッドのカーネルB26bに対する競合が1秒間に7000回以上であれば、CPUを占有できる上限数は‘2’、競合が1秒間に5000回未満であれば上限数は‘3’という情報が登録されている。
【0064】
ここで、図3に示す属性‘OS#1’を有するスレッド31b,31c,31e,31fによるカーネルA26aへの競合が1秒間に5000回以上発生したとする。競合計数部27は、設定情報テーブル28より、属性‘OS#1’を有するスレッドの競合回数5000回以上に対応するCPU上限数‘2’を取得し、図7に示した上限数テーブル23の属性‘OS#1’に対応するCPUの上限数を‘2’に変更する。同様に、競合回数が1秒間に1000回以上5000回未満であれば、競合計数部27は、設定情報テーブル28からCPU上限数‘3’を取得し、上限数テーブル23の属性‘OS#1’に対応するCPUの上限数を‘3’に変更する。1000回未満であれば、競合計数部27は、設定情報テーブル28からCPU上限数‘4’を取得し、上限数テーブル23の属性‘OS#1’に対応するCPUの上限数を‘4’に変更する。
【0065】
同様に、競合計数部27は、カーネルB26bに対する属性‘OS#2’を有するスレッド31a,31dの競合回数をカウントし、上限数テーブル23のCPU上限数を変更する。カーネルB26bへの競合が1秒間に7000回以上であれば、競合計数部27は、設定情報テーブル28を参照して、属性‘OS#2’の競合回数7000回以上に対応するCPU上限数‘2’を取得し、上限数テーブル23の属性‘OS#2’に対応するCPU上限数を‘2’に変更する。4000回未満であれば、CPU上限数を‘3’に変更する。
【0066】
属性‘OS#2’のカーネルB26bに対する競合回数が4000回以上7000回未満であれば、競合計数部27は、上限数テーブル23のCPU上限数を変更しない。CPU上限数の変更に履歴を持たせ、CPUの上限数が頻繁に変更されることを防止する。
【0067】
次に、コンピュータ2の処理の流れについてフローチャートを用いて説明する。
図10は、コンピュータのスレッドの割り当て処理を示したフローチャートである。このフローチャートが開始されると以下の処理が行われる。
【0068】
[ステップS10]属性取得部21は、CPU20a〜20fのいずれかの処理機能が開放状態のとき、実行待ちキュー29の先頭で実行待ちをしているスレッド31gの属性を取得する。
【0069】
[ステップS11]上限数取得部22は、スレッドの属性ごとにCPU20a〜20fを占有できる上限数を登録した上限数テーブル23から、スレッド31gの属性に対応するCPU20a〜20fを占有できる上限数を取得する。
【0070】
[ステップS12]実行数取得部24は、スレッド31gと同じ属性を持つスレッドを実行しているCPU20a〜20fの実行数を取得する。
[ステップS13]CPU割り当て制御部25は、ステップS11で取得した上限数と、ステップS12で取得した実行数を比較し、上限数が、実行数より多い場合、ステップS14へ進む。上限数が、実行数以下である場合、ステップS15へ進む。
【0071】
[ステップS14]CPU割り当て制御部25は、実行待ちキュー29の先頭で実行待ちをしているスレッド31gを開放状態にあるCPU20a〜20fに実行させる。
【0072】
[ステップS15]CPU割り当て制御部25は、実行待ちキュー29の先頭で実行待ちをしているスレッド31gを実行待ちキュー29のそのままの位置で実行待ちをさせ、実行待ちキュー29の次の実行待ちをしているスレッド31hを見に行き、ステップS10に戻る。
【0073】
図11は、コンピュータのプロセッサ上限数の変更処理を示したフローチャートである。このフローチャートが開始されると以下の処理が行われる。
[ステップS20]競合計数部27は、スレッド31a〜31fのカーネルA26a、カーネルB26bへの競合回数をスレッド31a〜31fの属性ごとに取得する。
【0074】
[ステップS21]競合計数部27は、競合回数に応じてCPU20a〜20fの占有できる上限数を登録した設定情報テーブル28から、ステップS20で取得した競合回数に対応する、CPU20a〜20fを占有できる上限数を取得する。
【0075】
[ステップS22]競合計数部27は、上限数テーブル23のCPU20a〜20fを占有できる上限数を、ステップS21で取得したCPU20a〜20fを占有できる上限数に変更する。
【0076】
このように、スレッドの属性ごとに、CPUを占有できる上限を設けたので、排他資源の競合機会が増加することがなく、並列動作性の低下を抑制することができ、スレッドの属性ごとに実行できるCPUを決めることなく、開放状態になったCPUにスレッドを割り当てるようにしたのでプロセッサの使用効率の低下を抑えることができる。
【0077】
また、スレッドの排他資源であるカーネルへの競合をリアルタイムに監視し、競合回数が多い場合、スレッドのCPUを占有できる上限数を減らし、競合回数が少ない場合、スレッドのCPUを占有できる上限数を増加するようにしたので、CPUの並列動作性、使用効率を最適の状態にコントロールすることができる。また、スレッドの属性に対応したCPUの割り当て数のチューニングを不要とすることができる。
【0078】
なお、上記の説明において、CPUが実行する実行単位をスレッドとして説明したが、プロセスや、LWP(Light Weight Process)などのプログラム実行単位であってもよい。また、属性をOSの種別としたが、OS上で動作するアプリケーションの種別によって属性を付与してもよい。また、OS、アプリケーションの種別によらず、プログラムの実行単位の内容に応じたフラグや、特定の値、名前などの属性を付与してもよい。さらに、スレッドの排他資源への競合回数をカウントして、CPUを占有できる上限数を変更するようにしたが、スレッドが排他資源をロック(あるスレッドが排他資源を利用している状態)している時間を計測し、ロックした時間に応じてCPUを占有できる上限数を変更するようにしてもよい。また、競合回数のカウント、CPUを占有できる上限数の変更を一定の周期で行うようにしてもよい。
【0079】
また、上記の各コンピュータが有すべき機能の処理内容は、コンピュータで読み取り可能な記録媒体に記録されたプログラムに記述させておくことができる。このプログラムをコンピュータで実行することにより、上記処理がコンピュータで実現できる。コンピュータで読み取り可能な記録媒体としては、磁気記録装置や半導体メモリなどがある。市場に流通させる場合には、CD−ROMやフレキシブルディスクなどの可搬型記録媒体にプログラムを格納して流通させたり、ネットワークを介して接続されたコンピュータの記憶装置に格納しておき、ネットワークを通じて他のコンピュータに転送することもできる。コンピュータで実行する際には、コンピュータ内のハードディスク装置などにプログラムを格納しておき、メインメモリにロードして実行する。
【0080】
(付記1) 複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御プログラムにおいて、
コンピュータに、
プロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、
前記上限数が前記実行数より多い場合、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行させる、
処理を実行させることを特徴とするマルチプロセッサ制御プログラム。
【0081】
(付記2) プロセッサによって実行されている実行単位の排他資源に対する競合回数を前記実行単位の属性ごとに取得し、
前記属性ごとに取得した競合回数に応じて、前記テーブルの前記属性に対応するプロセッサを占有できる上限数を変更する、
処理をさらに実行させることを特徴とする付記1記載のマルチプロセッサ制御プログラム。
【0082】
(付記3) 前記実行待ちをしている実行単位はキュー構造により管理され、前記上限数が前記実行数以下の場合、前記実行待ちをしている実行単位を前記キュー構造のそのままの位置で実行待ちをさせ、前記実行待ちをしている実行単位の次に実行待ちをしている実行単位に前記処理を実行させることを特徴とする付記1記載のマルチプロセッサ制御プログラム。
【0083】
(付記4) 前記実行単位の属性はオペレーションシステムの種別であることを特徴とする付記1記載のマルチプロセッサ制御プログラム。
(付記5) 複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御方法において、
プロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、
前記上限数が前記実行数より多い場合、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行する、
ことを特徴とするマルチプロセッサ制御方法。
【0084】
(付記6) 複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御装置において、
プロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得する属性取得手段と、
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得する上限数取得手段と、
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得する実行数取得手段と、
前記上限数が前記実行数より多い場合、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行する実行手段と、
を有することを特徴とするマルチプロセッサ制御装置。
【0085】
(付記7) 複数の実行単位を実行する複数のプロセッサを制御するマルチプロセッサ制御プログラムを記録したコンピュータ読み取り可能な記録媒体において、
コンピュータに、
プロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、
前記上限数が前記実行数より多い場合、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行させる、
処理を実行させることを特徴とするマルチプロセッサ制御プログラムを記録したコンピュータ読み取り可能な記録媒体。
【0086】
【発明の効果】
以上説明したように本発明では、コンピュータに、実行単位の属性ごとに、実行単位がプロセッサを占有できる上限数を設け、実行単位の属性ごとに実行できるプロセッサを決めることなく、開放状態になったプロセッサに実行単位を実行させる。また、実行単位の排他資源に対する競合回数を実行単位の属性ごとに取得し、属性ごとに取得した競合回数に応じて、プロセッサを占有できる上限数を変更する。これにより、プロセッサの並列動作性の低下及び使用効率の低下を抑えることができ、また、並列動作性及び使用効率を最適の状態に制御することができる。
【図面の簡単な説明】
【図1】本発明の原理を説明する原理図である。
【図2】本発明の実施の形態を実現するためのコンピュータのハードウェア構成例である。
【図3】本発明の実施の形態を実現するためのコンピュータの機能ブロック図である。
【図4】実行待ちキューの構造を示した図である。
【図5】スレッドの構造を示した図である。
【図6】CPUのスレッド処理の遷移状態を説明する図(その1)である。
【図7】上限数テーブルに登録されている情報の一例を示した図である。
【図8】CPUのスレッド処理の遷移状態を説明する図(その2)である。
【図9】設定情報テーブルに登録されている情報の一例を示した図である。
【図10】コンピュータのスレッドの割り当て処理を示したフローチャートである。
【図11】コンピュータのプロセッサ上限数の変更処理を示したフローチャートである。
【図12】従来のマルチCPUシステムの動作(その1)を説明する図である。
【図13】従来のマルチCPUシステムの動作(その2)を説明する図である。
【符号の説明】
1,2 コンピュータ
10 属性取得手段
11 上限数取得手段
12 テーブル
13 実行数取得手段
14 実行手段
15a〜15h 実行単位
16a〜16f プロセッサ
20a〜20f CPU
21 属性取得部
22 上限数取得部
23 上限数テーブル
24 実行数取得部
25 CPU割り当て制御部
26a カーネルA
26b カーネルB
27 競合計数部
28 設定情報テーブル
29 実行待ちキュー
30a,30b OS
31a〜31j スレッド[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a multiprocessor control program and a multiprocessor control method, and more particularly, to a multiprocessor control program and a multiprocessor control method for controlling a plurality of processors that execute a plurality of execution units assigned attributes.
[0002]
[Prior art]
Currently, there are various techniques for improving the data processing capability of a computer. Among such technologies, there is a multi-CPU system that improves data processing capability by sharing data processing by a plurality of CPUs (Central Processing Units) and performing parallel processing.
[0003]
There are the following two methods for causing the multi-CPU system to process data in parallel. The first is a method in which execution units of programs such as processes and threads are executed by a plurality of CPUs, and execution units waiting for execution are successively executed by CPUs that have completed execution. The second is to assign an attribute to an execution unit, determine a plurality of CPUs that execute the execution unit for each attribute, cause the CPU to execute the execution unit, and have an attribute that the CPU can execute in order from the CPU that has finished executing. This is a method for executing execution units waiting for execution.
[0004]
FIG. 12 is a diagram for explaining the operation (part 1) of the conventional multi-CPU system. The multi-CPU system shown in the figure has four
[0005]
If the
[0006]
FIG. 13 is a diagram for explaining the operation (part 2) of the conventional multi-CPU system. The multi-CPU system shown in the figure includes
[0007]
If the
[0008]
[Problems to be solved by the invention]
Here, in FIG. 12, it is assumed that the process 40a executed by the
[0009]
As described above, in the method in which the execution units that are waiting for execution are executed one after another by the CPU that has finished executing, there is a problem in that parallel operability deteriorates when the opportunity for exclusive resource contention increases. .
[0010]
Further, in FIG. 13, it is assumed that a conflict of exclusive resources of the
[0011]
As described above, in the method in which the effective unit has an attribute and the execution unit is executed by the CPU for each attribute, the opportunity for exclusive resource contention can be reduced, but there is a problem in that the CPU usage efficiency is lowered. .
[0012]
The present invention has been made in view of these points, and an object of the present invention is to provide a multiprocessor control program that suppresses a decrease in parallel operability of processors and a decrease in use efficiency of processors.
[0013]
[Means for Solving the Problems]
To solve the above problem,In a multiprocessor control program that controls multiple processors that execute multiple execution units, when the processing functions of any processor are in the open state, the execution unit attributes that are waiting for execution are acquired and executed by the computer. Execution of a processor that executes the execution unit having the same attribute as the acquired attribute, by acquiring the upper limit number corresponding to the acquired attribute from a table in which the upper limit number that can occupy the processor for each unit attribute is registered. When the number is acquired and the upper limit number is larger than the execution number, the execution unit waiting for execution is executed by the processor in the open state without determining a processor that can be executed for each attribute of the execution unit, and the processor For each attribute of the execution unit, obtain the number of times of contention for the exclusive resource of the execution unit executed by According to the acquired competing number, it changes the upper limit number can occupy the processor corresponding to the attribute of the table,It is characterized by having processing executedA multiprocessor control program is provided.
[0014]
According to such a multiprocessor control program,For each attribute of the execution unit, an upper limit number that the execution unit can occupy the processor is provided, and the execution unit is executed by the processor in the open state without determining the processor that can be executed for each attribute of the execution unit. Further, the number of times of contention for the exclusive resource of the execution unit is acquired for each attribute of the execution unit, and the upper limit number that can occupy the processor is changed according to the number of times of contention acquired for each attribute.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a principle diagram illustrating the principle of the present invention.
[0016]
In this figure, the
[0017]
The
The upper limit
[0018]
In the table 12, the upper limit number that can occupy the processor is registered in advance for each attribute of the execution unit.
The execution
[0019]
If the upper limit number that can occupy the processor acquired by the upper limit
[0020]
The execution units 15a to 15h are program execution units executed by the processor. The execution unit 15a has the attribute “# 1”. The
[0021]
The
The operation of the principle diagram of FIG. 1 will be described below.
[0022]
As shown in FIG. 1, it is assumed that the
[0023]
Here, it is assumed that the
[0024]
The upper limit
[0025]
Here, the upper limit number '9999' indicates that the
[0026]
The execution
[0027]
The execution means 14 waits for execution because the upper limit number “9999” that can occupy the processor acquired by the upper limit number acquisition means 11 is larger than the execution number “3” of the processor acquired by the execution number acquisition means 13. The
[0028]
Since the
Here, it is assumed that the
[0029]
The upper limit
[0030]
The execution
[0031]
The
[0032]
In this way, for each attribute of the execution unit, an upper limit number that can occupy the processor is set, the competition opportunity of the execution unit is suppressed, and the processor that has been released can be determined without determining the processor that can be executed for each attribute of the execution unit. Since execution units are executed, it is possible to suppress a decrease in processor parallel operation and usage efficiency.
[0033]
Next, a hardware configuration for realizing the embodiment of the present invention will be described.
FIG. 2 is a hardware configuration example of a computer for realizing the embodiment of the present invention.
[0034]
As shown in the figure, the
[0035]
The RAMs 20aa to 20af temporarily store at least part of programs executed by the
[0036]
The
[0037]
A
[0038]
A
[0039]
The communication interface 20l is connected to the
[0040]
The
[0041]
In the above description, a hardware configuration in which a RAM is connected to each CPU is shown. However, a hardware configuration in which one RAM is shared for the entire CPU may be used, and a plurality of RAMs smaller than the number of CPUs are used. The hardware configuration may be the same.
[0042]
Next, functions of a computer for realizing the embodiment of the present invention will be described.
FIG. 3 is a functional block diagram of a computer for realizing the embodiment of the present invention.
[0043]
The
[0044]
When the
The upper limit
[0045]
The upper limit number table 23 registers the upper limit number that can occupy the CPU for each attribute of the thread.
The execution
[0046]
When the upper limit number acquired by the upper limit
[0047]
The
[0048]
The
[0049]
The setting information table 28 registers the upper limit number that can occupy the CPU corresponding to the number of times the
[0050]
The
[0051]
The
[0052]
Here, the structure of the thread will be described. FIG. 5 is a diagram showing a thread structure. The
[0053]
The processing flow of the functional block diagram of the computer shown in FIG. 3 will be described below.
As shown in FIG. 3, it is assumed that the
[0054]
Here, it is assumed that the
[0055]
When the
The upper limit
[0056]
From FIG. 7, the upper limit
The execution
[0057]
The upper limit number acquired by the upper limit
[0058]
The CPU
[0059]
Since the
The upper limit
[0060]
The number-of-
[0061]
The upper limit number acquired by the upper limit
[0062]
Next, the flow of processing for changing the upper limit number in the upper limit number table 23 in the functional block diagram of FIG. 3 will be described.
The
[0063]
FIG. 9 is a diagram illustrating an example of information registered in the setting information table. In the setting information table 28 shown in the figure, if the contention of the thread having the attribute “
[0064]
Here, it is assumed that the
[0065]
Similarly, the
[0066]
If the number of times that the attribute “
[0067]
Next, the processing flow of the
FIG. 10 is a flowchart showing the thread assignment process of the computer. When this flowchart is started, the following processing is performed.
[0068]
[Step S10] The
[0069]
[Step S11] The upper limit
[0070]
[Step S12] The execution
[Step S13] The CPU
[0071]
[Step S14] The CPU
[0072]
[Step S15] The CPU
[0073]
FIG. 11 is a flowchart showing processing for changing the upper limit number of processors of a computer. When this flowchart is started, the following processing is performed.
[Step S20] The
[0074]
[Step S21] The
[0075]
[Step S22] The
[0076]
In this way, because there is an upper limit that can occupy the CPU for each attribute of the thread, there is no increase in exclusive resource contention opportunities, and a reduction in parallel operability can be suppressed. Since a thread is assigned to a CPU that is in an open state without deciding which CPU can be used, it is possible to suppress a decrease in processor use efficiency.
[0077]
In addition, the contention to the kernel, which is an exclusive resource of the thread, is monitored in real time, and if the number of times of contention is high, the upper limit number that can occupy the CPU of the thread is reduced. Since the number is increased, it is possible to control the parallel operability and usage efficiency of the CPU to an optimum state. Further, it is possible to eliminate the need for tuning the number of CPU allocations corresponding to thread attributes.
[0078]
In the above description, the execution unit executed by the CPU is described as a thread. However, a process execution unit such as a process or LWP (Light Weight Process) may be used. Further, although the attribute is the OS type, the attribute may be given depending on the type of application running on the OS. Further, an attribute such as a flag corresponding to the contents of the program execution unit, a specific value, or a name may be added regardless of the type of OS or application. Furthermore, the number of times the thread competes with the exclusive resource is counted, and the upper limit number that can occupy the CPU is changed. However, the thread locks the exclusive resource (a state in which a thread uses the exclusive resource). The upper limit number that can occupy the CPU may be changed according to the locked time. Further, the count of the number of times of competition and the change of the upper limit number that can occupy the CPU may be performed at a constant cycle.
[0079]
Further, the processing contents of the functions that each computer should have can be described in a program recorded on a computer-readable recording medium. By executing this program on a computer, the above processing can be realized on the computer. Examples of the computer-readable recording medium include a magnetic recording device and a semiconductor memory. When distributing to the market, the program is stored and distributed on a portable recording medium such as a CD-ROM or flexible disk, or stored in a storage device of a computer connected via a network. Can also be transferred to other computers. When executed by a computer, the program is stored in a hard disk device or the like in the computer, loaded into the main memory, and executed.
[0080]
(Supplementary Note 1) In a multiprocessor control program for controlling a plurality of processors that execute a plurality of execution units,
On the computer,
When the processing function of the processor is open, get the attribute of the execution unit waiting for execution,
From the table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered, the upper limit number corresponding to the acquired attribute is acquired,
Obtain the number of executions of the processor that is executing the execution unit having the same attribute as the obtained attribute,
If the upper limit is greater than the number of executions, the released processor is caused to execute the execution unit waiting for execution;
A multiprocessor control program for executing a process.
[0081]
(Supplementary Note 2) Obtain the number of times of contention for the exclusive resource of the execution unit being executed by the processor for each attribute of the execution unit,
According to the number of conflicts acquired for each attribute, change the upper limit number that can occupy the processor corresponding to the attribute of the table,
The multiprocessor control program according to
[0082]
(Supplementary Note 3) The execution unit waiting for execution is managed by a queue structure, and when the upper limit number is equal to or less than the execution number, the execution unit waiting for execution is executed at the position of the queue structure as it is. The multiprocessor control program according to
[0083]
(Supplementary note 4) The multiprocessor control program according to
(Supplementary Note 5) In a multiprocessor control method for controlling a plurality of processors that execute a plurality of execution units,
When the processing function of the processor is open, get the attribute of the execution unit waiting for execution,
From the table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered, the upper limit number corresponding to the acquired attribute is acquired,
Obtain the number of executions of the processor that is executing the execution unit having the same attribute as the obtained attribute,
When the upper limit number is larger than the execution number, the execution unit waiting for the execution is executed to the open processor.
And a multiprocessor control method.
[0084]
(Supplementary Note 6) In a multiprocessor control device that controls a plurality of processors that execute a plurality of execution units,
Attribute acquisition means for acquiring an attribute of an execution unit waiting for execution when the processing function of the processor is in an open state;
An upper limit number acquisition unit that acquires the upper limit number corresponding to the acquired attribute from a table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered;
Execution number acquisition means for acquiring the execution number of a processor executing an execution unit having the same attribute as the acquired attribute;
When the upper limit number is larger than the execution number, execution means for executing the execution unit waiting for the execution in the open processor;
A multiprocessor control device comprising:
[0085]
(Supplementary note 7) In a computer-readable recording medium that records a multiprocessor control program for controlling a plurality of processors that execute a plurality of execution units,
On the computer,
When the processing function of the processor is open, get the attribute of the execution unit waiting for execution,
From the table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered, the upper limit number corresponding to the acquired attribute is acquired,
Obtain the number of executions of the processor that is executing the execution unit having the same attribute as the obtained attribute,
If the upper limit is greater than the number of executions, the released processor is caused to execute the execution unit waiting for execution;
A computer-readable recording medium on which a multiprocessor control program is recorded.
[0086]
【The invention's effect】
As described above, in the present invention, the computer is provided with an upper limit number of execution units that can occupy the processor for each execution unit attribute, and the computer is in an open state without determining the processor that can be executed for each execution unit attribute. Causes the processor to execute an execution unit. Further, the number of times of contention for the exclusive resource of the execution unit is acquired for each attribute of the execution unit, and the upper limit number that can occupy the processor is changed according to the number of times of contention acquired for each attribute. This, It is possible to suppress degradation of processor parallel operation and use efficiency.In addition, parallel operability and usage efficiency can be controlled to the optimum stateThe
[Brief description of the drawings]
FIG. 1 is a principle diagram illustrating the principle of the present invention.
FIG. 2 is a hardware configuration example of a computer for realizing an embodiment of the present invention.
FIG. 3 is a functional block diagram of a computer for realizing an embodiment of the present invention.
FIG. 4 is a diagram illustrating a structure of an execution queue.
FIG. 5 is a diagram showing the structure of a thread.
FIG. 6 is a diagram (part 1) illustrating a transition state of thread processing of a CPU.
FIG. 7 is a diagram illustrating an example of information registered in an upper limit number table.
FIG. 8 is a diagram (part 2) illustrating a transition state of thread processing of a CPU.
FIG. 9 is a diagram illustrating an example of information registered in a setting information table.
FIG. 10 is a flowchart showing computer thread assignment processing;
FIG. 11 is a flowchart showing processing for changing the upper limit number of processors of a computer.
FIG. 12 is a diagram for explaining an operation (part 1) of a conventional multi-CPU system.
FIG. 13 is a diagram for explaining the operation (part 2) of the conventional multi-CPU system.
[Explanation of symbols]
1,2 computer
10 Attribute acquisition means
11 Upper limit number acquisition means
12 tables
13 Execution number acquisition means
14 Execution means
15a-15h Execution unit
16a-16f processor
20a-20f CPU
21 Attribute acquisition part
22 Upper limit number acquisition part
23 Upper limit number table
24 execution number acquisition part
25 CPU allocation controller
26a Kernel A
26b Kernel B
27 Competition counter
28 Setting information table
29 Waiting queue
30a, 30b OS
31a-31j threads
Claims (4)
コンピュータに、
いずれかのプロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、
前記上限数が前記実行数より多い場合、実行単位の属性ごとに実行できるプロセッサを決めることなく、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行させ、
プロセッサによって実行されている実行単位の排他資源に対する競合回数を実行単位の属性ごとに取得し、
前記属性ごとに取得した競合回数に応じて、前記テーブルの前記属性に対応するプロセッサを占有できる上限数を変更する、
処理を実行させることを特徴とするマルチプロセッサ制御プログラム。In a multiprocessor control program for controlling a plurality of processors that execute a plurality of execution units,
On the computer,
When the processing function of any processor is in the open state, get the attribute of the execution unit waiting for execution,
From the table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered, the upper limit number corresponding to the acquired attribute is acquired,
Obtain the number of executions of the processor that is executing the execution unit having the same attribute as the obtained attribute,
When the upper limit is greater than the number of executions, without determining the processor that can be executed for each attribute of the execution unit, the processor in the open state executes the execution unit waiting for execution ,
Get the number of times of contention for the exclusive resource of the execution unit being executed by the processor for each attribute of the execution unit,
According to the number of conflicts acquired for each attribute, change the upper limit number that can occupy the processor corresponding to the attribute of the table,
A multiprocessor control program for executing a process.
いずれかのプロセッサの処理機能が開放状態のとき、実行待ちをしている実行単位の属性を取得し、 When the processing function of any processor is in the open state, get the attribute of the execution unit waiting for execution,
実行単位の属性ごとにプロセッサを占有できる上限数を登録したテーブルから、前記取得した属性に対応する前記上限数を取得し、 From the table in which the upper limit number that can occupy the processor for each attribute of the execution unit is registered, the upper limit number corresponding to the acquired attribute is acquired,
前記取得した属性と同じ属性を持つ実行単位を実行しているプロセッサの実行数を取得し、 Obtain the number of executions of the processor that is executing the execution unit having the same attribute as the obtained attribute,
前記上限数が前記実行数より多い場合、実行単位の属性ごとに実行できるプロセッサを決めることなく、前記開放状態のプロセッサに前記実行待ちをしている実行単位を実行させ、 When the upper limit is greater than the number of executions, without determining the processor that can be executed for each attribute of the execution unit, the processor in the open state executes the execution unit waiting for execution,
プロセッサによって実行されている実行単位の排他資源に対する競合回数を実行単位の属性ごとに取得し、 Get the number of times of contention for the exclusive resource of the execution unit being executed by the processor for each attribute of the execution unit,
前記属性ごとに取得した競合回数に応じて、前記テーブルの前記属性に対応するプロセッサを占有できる上限数を変更する、 According to the number of conflicts acquired for each attribute, change the upper limit number that can occupy the processor corresponding to the attribute of the table,
ことを特徴とするマルチプロセッサ制御方法。 And a multiprocessor control method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001384027A JP4127354B2 (en) | 2001-12-18 | 2001-12-18 | Multiprocessor control program and multiprocessor control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001384027A JP4127354B2 (en) | 2001-12-18 | 2001-12-18 | Multiprocessor control program and multiprocessor control method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003186856A JP2003186856A (en) | 2003-07-04 |
JP4127354B2 true JP4127354B2 (en) | 2008-07-30 |
Family
ID=27593866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001384027A Expired - Fee Related JP4127354B2 (en) | 2001-12-18 | 2001-12-18 | Multiprocessor control program and multiprocessor control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4127354B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9170844B2 (en) * | 2009-01-02 | 2015-10-27 | International Business Machines Corporation | Prioritization for conflict arbitration in transactional memory management |
-
2001
- 2001-12-18 JP JP2001384027A patent/JP4127354B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003186856A (en) | 2003-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10545789B2 (en) | Task scheduling for highly concurrent analytical and transaction workloads | |
US8122451B2 (en) | Method and apparatus for dispatching tasks in a non-uniform memory access (NUMA) computer system | |
CN105579961B (en) | Data processing system, operating method and hardware unit for data processing system | |
US5333319A (en) | Virtual storage data processor with enhanced dispatching priority allocation of CPU resources | |
US6871264B2 (en) | System and method for dynamic processor core and cache partitioning on large-scale multithreaded, multiprocessor integrated circuits | |
CN108549574B (en) | Thread scheduling management method and device, computer equipment and storage medium | |
US7428629B2 (en) | Memory request / grant daemons in virtual nodes for moving subdivided local memory space from VN to VN in nodes of a massively parallel computer system | |
US20050144332A1 (en) | Autonomic input/output scheduler selector | |
US20080148300A1 (en) | Providing Policy-Based Operating System Services in a Hypervisor on a Computing System | |
JPH0640324B2 (en) | Multiprocessor system and process synchronization method thereof | |
US9632842B2 (en) | Exclusive access control method prohibiting attempt to access a shared resource based on average number of attempts and predetermined threshold | |
JP2004252983A (en) | System and method for enhancing performance of coprocessor | |
JP2004272894A (en) | Multithread kernel of graphics processing unit | |
JP2007512632A (en) | Managing virtual machines using activity information | |
JP2015504541A (en) | Method, program, and computing system for dynamically optimizing memory access in a multiprocessor computing system | |
US7765548B2 (en) | System, method and medium for using and/or providing operating system information to acquire a hybrid user/operating system lock | |
CN115981833A (en) | Task processing method and device | |
Gifford et al. | Dna: Dynamic resource allocation for soft real-time multicore systems | |
CN116225686A (en) | CPU scheduling method and system for hybrid memory architecture | |
Wang et al. | Adaptive scheduling of multiprogrammed dynamic-multithreading applications | |
JP3546694B2 (en) | Multi-thread computer system and multi-thread execution control method | |
US20150212859A1 (en) | Graphics processing unit controller, host system, and methods | |
JP4127354B2 (en) | Multiprocessor control program and multiprocessor control method | |
JPH0612395A (en) | Task allocating method in multiprocessor system | |
JP5243822B2 (en) | Workload management in a virtualized data processing environment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20041209 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070403 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070410 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070608 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070904 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071026 |
|
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: 20080507 |
|
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: 20080507 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110523 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4127354 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: 20120523 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130523 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140523 Year of fee payment: 6 |
|
LAPS | Cancellation because of no payment of annual fees |