JP5708450B2 - Multi-core processor system, register utilization method, and register utilization program - Google Patents
Multi-core processor system, register utilization method, and register utilization program Download PDFInfo
- Publication number
- JP5708450B2 JP5708450B2 JP2011246959A JP2011246959A JP5708450B2 JP 5708450 B2 JP5708450 B2 JP 5708450B2 JP 2011246959 A JP2011246959 A JP 2011246959A JP 2011246959 A JP2011246959 A JP 2011246959A JP 5708450 B2 JP5708450 B2 JP 5708450B2
- Authority
- JP
- Japan
- Prior art keywords
- synchronization
- thread
- cores
- register
- cpu
- 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)
Description
本発明は、レジスタの利用方法に関するマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムに関する。 The present invention relates to a multi-core processor system, a register utilization method, and a register utilization program relating to a register utilization method.
近年、1つのシステム内に、複数のコアを有するマルチコアプロセッサシステムの形態を採用する機器が増加している。また、複数のコアを利用して、アプリケーションソフトウェア(以下、「アプリ」と称す)を複数のスレッドに分割し、スレッド単位での並列を行うことで、マルチコアプロセッサシステムは、単一のコアで処理を実行する場合より高速処理を可能にしている。なお、スレッドとはプログラムの実行単位である。 In recent years, an increasing number of devices adopt a form of a multi-core processor system having a plurality of cores in one system. In addition, by using multiple cores, application software (hereinafter referred to as “apps”) is divided into multiple threads and parallelized in units of threads. High-speed processing is possible than when executing. A thread is a unit of program execution.
また、スレッドの処理量を細かくし、細粒度並列性を用いることで、マルチコアプロセッサシステムは、スレッド単位の並列処理の性能を向上できる。このとき、細粒度スレッドは、各スレッド間でレジスタを共有しながら実行する。レジスタを共有する場合の処理コードとして、たとえば、レジスタから値を読み込むスレッドは、同期待ちを行い、レジスタの値を書き込むスレッドは、同期待ちスレッドに対して同期通知を行う。レジスタを共有する技術として、たとえば、コアが自身の内部レジスタを使用せずに他コアの内部レジスタを利用する方法を用いて、各スレッドを実行するものがある。また、各CPUが自身のレジスタに値を書き込むと、他のプロセッサのレジスタに値を書き込む技術が開示されている(たとえば、下記特許文献1、2を参照。)。
Further, by reducing the processing amount of threads and using fine-grain parallelism, the multi-core processor system can improve the performance of parallel processing in units of threads. At this time, the fine-grained thread is executed while sharing a register among the threads. As a processing code for sharing a register, for example, a thread that reads a value from a register waits for synchronization, and a thread that writes a register value sends a synchronization notification to the synchronization waiting thread. As a technique for sharing a register, for example, there is a technique in which a core executes each thread using a method of using an internal register of another core without using its own internal register. Further, a technique is disclosed in which each CPU writes a value to its own register, and the value is written to the register of another processor (see, for example,
しかしながら、上述した従来技術において、各スレッドは同期通知の回数と同期待ちの回数が偏っていたり、または均等であったりし、レジスタを共有する技術によって処理能力がコアごとで異なるため、コア全体の処理能力が低下してしまう問題がある。 However, in the above-described conventional technology, the number of synchronization notifications and the number of synchronization waits are uneven or equal for each thread, and the processing capability differs depending on the core depending on the technology sharing the register. There is a problem that the processing capacity is reduced.
本発明は、上述した従来技術による問題点を解消するため、処理能力が向上できるマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムを提供することを目的とする。 SUMMARY OF THE INVENTION An object of the present invention is to provide a multi-core processor system, a register use method, and a register use program capable of improving the processing capability in order to solve the above-described problems caused by the prior art.
上述した課題を解決し、目的を達成するため、本発明の一側面によれば、複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得し、情報が取得された場合、複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、複数のコアにより各スレッドを実行するマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムが提案される。 In order to solve the above-described problems and achieve the object, according to one aspect of the present invention, the difference between the number of synchronization notifications and the number of synchronization waits for at least one of the threads assigned to each of the plurality of cores By acquiring information indicating that the value based on the value is greater than a predetermined value, and when the information is acquired, by sharing the register of the core that performs synchronization notification among the plurality of cores with the other cores. Proposes a multi-core processor system for executing each thread, a register use method, and a register use program.
また、本発明の他の側面によれば、複数のコアのそれぞれに割り当てられるスレッドのいずれのスレッドについても同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得し、情報が取得された場合、複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、複数のコアによりスレッドを実行するマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムが提案される。 According to another aspect of the present invention, it is indicated that the value based on the difference between the number of synchronization notifications and the number of synchronization waits is less than or equal to a predetermined value for any of the threads allocated to each of the plurality of cores. Acquire information, and when the information is acquired, each time the value of the register of one of the multiple cores is updated, the thread is executed by multiple cores by copying to the register of the other core A multi-core processor system, a register utilization method, and a register utilization program are proposed.
また、本発明の他の側面によれば、複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断し、値が所定値より大きいと判断された場合、複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、複数のコアにより各スレッドを実行するマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムが提案される。 Further, according to another aspect of the present invention, is a value based on a difference between the number of synchronization notifications and the number of synchronization waits related to at least one of the threads allocated to each of the plurality of cores greater than a predetermined value? If it is determined that the value is greater than the predetermined value, each thread is executed by a plurality of cores by sharing the register of the core that performs synchronization notification among the plurality of cores with other cores. A multi-core processor system, a register utilization method, and a register utilization program are proposed.
本発明の一側面によれば、処理能力の向上を図ることができるという効果を奏する。 According to one aspect of the present invention, the processing capacity can be improved.
以下に添付図面を参照して、開示のマルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムの実施の形態を詳細に説明する。 Exemplary embodiments of a disclosed multi-core processor system, a register utilization method, and a register utilization program will be described below in detail with reference to the accompanying drawings.
図1は、同期通知数と同期待ち数に偏りがあるスレッドの割当例を示す説明図である。図1で示すマルチコアプロセッサシステム100は、複数のCPUとして、CPU#0〜CPU#2を含み、バス101で接続されている。また、CPU#0〜CPU#2は、レジスタR0〜レジスタR4を有し、レジスタI/F102#0〜レジスタI/F102#2の制御によってCPU#0〜CPU#2の各レジスタの値を共有する。
FIG. 1 is an explanatory diagram illustrating an example of thread allocation in which the number of synchronization notifications and the number of synchronization waits are biased. A
始めに、CPU#0は、CPU#0〜CPU#2に割り当てられるスレッドA_0〜スレッドA_2に関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得する。同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を、以下の記述では、同期命令に偏りがあることを示す情報と呼称する。このとき、スレッドA_0〜スレッドA_2は、細粒度並列処理を行うことを前提としており、CPU#0〜CPU#2のレジスタ値を共有することが要求される。
First,
同期通知数とは、同期命令のうちの同期通知を実行する回数であり、同期待ち数とは、同期命令のうちの同期待ちを実行する回数である。なお、同期命令の詳細については、図4にて説明する。また、所定値の具体的な値については、図9にて後述する。 The number of synchronization notifications is the number of times that the synchronization notification of the synchronization command is executed, and the number of synchronization waits is the number of times of waiting for the synchronization of the synchronization command. Details of the synchronization command will be described with reference to FIG. A specific value of the predetermined value will be described later with reference to FIG.
スレッドA_0に関して、スレッドA_0の同期通知数が6であり、同期待ち数が0となることから、差分が6となり、さらに、所定値が3であれば、差分が所定値より大きくなるため、CPU#0は、同期命令に偏りがあることを示す情報を取得する。続けて、CPU#0は、CPU#0のレジスタを共有元として、CPU#1、CPU#2がレジスタI/F102を通してCPU#0のレジスタにアクセスするようにレジスタI/F102#0〜レジスタI/F102#2に通知する。
Regarding the thread A_0, since the number of synchronization notifications of the thread A_0 is 6 and the number of synchronization waits is 0, the difference is 6, and if the predetermined value is 3, the difference becomes larger than the predetermined value. In # 0, information indicating that the synchronization command is biased is acquired. Subsequently, the
このように、マルチコアプロセッサシステム100は、CPU#0〜CPU#2のうち同期通知を実行するCPU#0のレジスタをCPU#1とCPU#2に共有させることにより、CPU#0〜CPU#2にてスレッドA_0〜スレッドA_2を実行する。以下、図1で示したレジスタの利用方法を、共有方法と呼称する。共有方法にて、共有元となるCPUの処理は、自身のレジスタにアクセスするため速くなり、他のCPUは、バス101を介して共有元となるCPUにアクセスするため遅くなる。
As described above, the
図1の状態では、同期通知を行うCPU#0の処理が高速となるため、同期待ちを行うCPU#1、CPU#2の待ち時間が減少し、CPU#0〜CPU#2全体の利用効率が向上する。
In the state of FIG. 1, since the processing of
図2は、同期通知数と同期待ち数に偏りがないスレッドの割当例を示す説明図である。図2で示すマルチコアプロセッサシステム100にて、CPU#0は、CPU#0〜CPU#2に割り当てられるスレッドB_0〜スレッドB_2に関する同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得する。同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を、以下の記述では、同期命令に偏りがないことを示す情報と呼称する。このとき、スレッドB_0〜スレッドB_2は、細粒度並列処理を行うことを前提としており、CPU#0〜CPU#2のレジスタ値を共有することが要求される。
FIG. 2 is an explanatory diagram showing an example of thread allocation in which the number of synchronization notifications and the number of synchronization waiting are not biased. In the
スレッドB_0の同期通知数が3であり、同期待ち数が3となることから、差分が0となり、さらに、所定値が3であれば、差分が所定値以下となるため、CPU#0は、同期命令に偏りがないことを示す情報を取得する。また、CPU#0は、スレッドB_1、スレッドB_2に関する同期命令に偏りがないことを示す情報を取得する。続けて、CPU#0は、各CPUが自身のレジスタの値が更新される都度、他のCPUのレジスタに複写するように、レジスタI/F102#0〜レジスタI/F102#2に通知する。
Since the number of synchronization notifications for thread B_0 is 3 and the number of synchronization waits is 3, the difference is 0, and if the predetermined value is 3, the difference is less than or equal to the predetermined value. Information indicating that there is no bias in the synchronization command is acquired. In addition, the
このように、マルチコアプロセッサシステム100は、CPU#0〜CPU#2のうちいずれかのCPUのレジスタの値が更新される都度、他のCPUのレジスタに複写することにより、CPU#0〜CPU#2にてスレッドB_0〜スレッドB_2を実行する。以下、図2で示したレジスタの利用方法を、複写方法と呼称する。複写方法では、レジスタの読込時には、複写が発生しないため、高速に処理が行え、レジスタ書き込み時には、複写が発生するため、処理は遅くなる。また、複写方法では、各CPUの処理能力は同一となる。
As described above, the
図2の状態では、同期命令に偏りがない状態で、各CPUの処理能力が同一であるため、同期待ち時間が減少し、結果、全体での利用効率を向上することができる。図1、図2で示したように、マルチコアプロセッサシステム100は、スレッドに同期命令の偏りがある場合、CPUの処理能力に偏りのある共有方法を用い、スレッドに同期命令の偏りがない場合、CPUの処理能力に偏りのない複写方法を用いる。このように、各スレッドの同期命令の偏りと、各CPUの処理能力の偏りを一致させることで、全体の処理能力を向上することができる。以下、図1、図2で示したように動作するマルチコアプロセッサシステム100について、図3〜図18を用いて説明する。
In the state of FIG. 2, since the processing capability of each CPU is the same in the state where there is no bias in the synchronization command, the synchronization waiting time is reduced, and as a result, the overall utilization efficiency can be improved. As shown in FIGS. 1 and 2, the
(マルチコアプロセッサシステム100のハードウェア)
図3は、マルチコアプロセッサシステムのハードウェア例を示すブロック図である。本実施の形態におけるマルチコアプロセッサシステム100は、携帯電話などの携帯端末を想定している。図3において、マルチコアプロセッサシステム100は、CPUs301と、ROM(Read‐Only Memory)302と、RAM(Random Access Memory)303と、を含む。また、マルチコアプロセッサシステム100は、フラッシュROM304と、フラッシュROMコントローラ305と、フラッシュROM306と、を含む。また、マルチコアプロセッサシステム100は、ユーザやその他の機器との入出力装置として、ディスプレイ307と、I/F(Interface)308と、キーボード309と、を含む。また、各部はバス101によってそれぞれ接続されている。
(Hardware of the multi-core processor system 100)
FIG. 3 is a block diagram illustrating a hardware example of the multi-core processor system.
ここで、CPUs301は、マルチコアプロセッサシステム100の全体の制御を司る。CPUs301は、CPU#0〜CPU#2を含む。また、マルチコアプロセッサシステム100に含まれるCPUは、2つ以上であればよい。また、CPUs301は、専用のキャッシュメモリを有してもよい。また、マルチコアプロセッサシステム100は、複数のコアを含むマルチコアプロセッサシステムであってもよい。なお、マルチコアプロセッサシステムとは、コアが複数搭載されたプロセッサを含むコンピュータのシステムである。コアが複数搭載されていれば、複数のコアが搭載された単一のプロセッサでもよく、シングルコアのプロセッサが並列されているプロセッサ群でもよい。なお、本実施の形態では、シングルコアのプロセッサであるCPUが並列されている形態を例にあげて説明する。
Here, the
ROM302は、ブートプログラムなどのプログラムを記憶している。RAM303は、CPUs301のワークエリアとして使用される。フラッシュROM304は、読出し速度が高速なフラッシュROMであり、たとえば、NOR型フラッシュメモリである。たとえば、フラッシュROM304は、OS(Operating System)などのシステムソフトウェアやアプリなどを記憶している。たとえば、OSを更新する場合、マルチコアプロセッサシステム100は、I/F308によって新しいOSを受信し、フラッシュROM304に格納されている古いOSを、受信した新しいOSに更新する。
The
フラッシュROMコントローラ305は、CPUs301の制御に従ってフラッシュROM306に対するデータのリード/ライトを制御する。フラッシュROM306は、データの保存、運搬を主に目的としたフラッシュROMであり、たとえば、NAND型フラッシュメモリである。フラッシュROM306は、フラッシュROMコントローラ305の制御で書き込まれたデータを記憶する。データの具体例としては、マルチコアプロセッサシステム100を使用するユーザがI/F308を通して取得した画像データ、映像データや、また本実施の形態にかかるレジスタ利用方法を実行するプログラムなどである。フラッシュROM306は、たとえば、メモリカード、SDカードなどを採用することができる。
The
ディスプレイ307は、カーソル、アイコンあるいはツールボックスを始め、文書、画像、機能情報などのデータを表示する。ディスプレイ307は、たとえば、TFT(Thin Film Transistor)液晶ディスプレイなどを採用することができる。 The display 307 displays data such as a document, an image, and function information including a cursor, an icon, or a tool box. As the display 307, for example, a TFT (Thin Film Transistor) liquid crystal display can be adopted.
I/F308は、通信回線を通じてLAN、WAN(Wide Area Network)、インターネットなどのネットワーク310に接続され、ネットワーク310を介して他の装置に接続される。そして、I/F308は、ネットワーク310と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F308には、たとえばモデムやLANアダプタなどを採用することができる。
The I /
キーボード309は、数字、各種指示などの入力のためのキーを有し、データの入力を行う。また、キーボード309は、タッチパネル式の入力パッドやテンキーなどであってもよい。
The
図4は、同期命令の種別の一例についての説明図である。符号401で示す図は、スレッドA_0とスレッドA_1の実行コードの一例を示しており、符号402で示す図は、スレッドA_0とスレッドA_1の実行結果を示しており、表403は、符号401、符号402から示される同期命令の特徴について示している。スレッドA_0とスレッドA_1にて、レジスタR1が共に使用されており、レジスタR1に対する書込と読込の順序が変更されないようにするため、同期命令が挿入されている。
FIG. 4 is an explanatory diagram of an example of the type of synchronization instruction. The diagram denoted by
なお、以下の説明において、実行コード内での同期命令の位置を同期ポイントと定義する。また、同期命令を実行可能な位置に到達した場合を、同期ポイントに到達したと呼称する。また、同期命令のうちバリア同期は、特定のグループに含まれるスレッドが全て同期ポイントに到着した際に、次の処理に進む機能を有する。この特定のグループのことを、同期グループと定義する。また、同期命令には、同期通知、同期待ち、バリア同期が存在する。 In the following description, the position of the synchronization instruction in the execution code is defined as a synchronization point. Further, when the position where the synchronization command can be executed is reached, it is called that the synchronization point has been reached. Also, the barrier synchronization of the synchronization commands has a function of proceeding to the next processing when all the threads included in the specific group arrive at the synchronization point. This specific group is defined as a synchronization group. The synchronization command includes synchronization notification, synchronization wait, and barrier synchronization.
初めに、スレッドA_0を実行するCPU#0は、時刻t0にて、先行命令として、レジスタR2とレジスタR3の和をレジスタR1に書き込み、時刻t2にて同期通知であるsyncs命令をCPU#1を通知先として実行する。また、スレッドA_1を実行する実行するCPU#1は、時刻t0にて、先行命令を実行し、時刻t2より早い時刻である時刻t1にて、同期待ちであるsyncr命令をCPU#0を通知元として実行する。時刻t1では、CPU#0が同期ポイントに到達していないため、CPU#1は、同期通知を受け付けるまで待機する。同期通知を完了した時刻t3にて、CPU#0は、後続命令を実行し、同時刻にて、CPU#1も、同期待ちを終了し、後続命令を実行する。
First, the
次に、CPU#0は、時刻t4にて、バリア同期であるsynca命令を実行する。時刻t4の時点では、CPU#1が同期ポイントに到達していないため、CPU#0は、CPU#1が同期ポイントに到達するまで待機する。時刻t5にて、CPU#1がsynca命令を実行する。
Next,
このように、符号401、符号402で示したように、同期通知を含む一連の処理として、CPUは、先行命令が終了した後、同期通知を実行し、同期通知が終了した後に、後続命令を実行する。したがって、表403で示すように、同期通知を実行するCPUは、同期待ち側を待たなくてよい。
As described above, as indicated by
同様に、同期待ちを含む一連の処理として、CPUは、先行命令が終了した後、同期待ちを実行し、同期通知を受け付けた後、後続命令を実行する。したがって、同期待ちを実行するCPUは、既に同期通知を受け付けていれば、待たなくてよい。 Similarly, as a series of processing including synchronization waiting, the CPU executes synchronization waiting after completion of the preceding instruction, and executes subsequent instructions after receiving the synchronization notification. Therefore, the CPU executing the waiting for synchronization does not have to wait if the synchronization notification has already been received.
同様に、バリア同期を含む一連の処理として、CPUは、先行命令が終了した後、同期グループに属するCPUが全て同期ポイントに到達した場合、後続命令を実行する。したがって、バリア同期を実行するCPUは、同一の同期グループに属する他のCPUが同時に同期ポイントに到達すれば、待たなくてよい。 Similarly, as a series of processes including barrier synchronization, the CPU executes the subsequent instruction when all the CPUs belonging to the synchronization group have reached the synchronization point after the preceding instruction is completed. Therefore, the CPU executing the barrier synchronization does not have to wait if other CPUs belonging to the same synchronization group reach the synchronization point at the same time.
(マルチコアプロセッサシステム100の機能)
次に、マルチコアプロセッサシステム100の機能について説明する。図5は、マルチコアプロセッサシステムの機能例を示すブロック図である。マルチコアプロセッサシステム100は、スケジューラ501と、レジスタ利用ライブラリ502と、ディスパッチャ503と、を有する。
(Functions of the multi-core processor system 100)
Next, functions of the
また、マルチコアプロセッサシステム100は、検出部511と、更新部512と、取得部513と、判断部514と、特定部515と、通知部516と、実行部517と、割当部518とを含む。制御部となる機能(検出部511〜割当部518)は、記憶装置に記憶されたプログラムをCPUs301のうちのいずれかのCPUが実行することにより、その機能を実現する。記憶装置とは、具体的には、たとえば、図3に示したROM302、RAM303、フラッシュROM304、フラッシュROM306などである。または、I/F308を経由して他のCPUが実行することにより、その機能を実現してもよい。
The
また、図5では各機能部が、CPU#0の機能であるように図示しているが、CPU#1、CPU#2の機能であってもよい。また、検出部511〜通知部516は、レジスタ利用ライブラリ502の機能であり、実行部517は、レジスタI/F102の機能であり、割当部518は、ディスパッチャ503の機能である。
Further, in FIG. 5, each functional unit is illustrated as being a function of
また、マルチコアプロセッサシステム100は、プロファイル情報521にアクセス可能である。プロファイル情報521の詳細については、図6にて後述する。プロファイル情報521は、RAM303、フラッシュROM304、フラッシュROM306等に存在する。
The
スケジューラ501は、マルチコアプロセッサシステム100内で実行されるスレッドを各CPUに割り当て、次に実行するスレッドを選択する機能を有する。たとえば、スケジューラ501は、スレッドA_0をCPU#0に割り当て、スレッドA_1をCPU#1に割り当てる。
The
レジスタ利用ライブラリ502は、スケジューラ501からのスレッド割当通知を受け付けると、レジスタ共有方法のうち共有方法か複写方法のいずれかを用いるか、またはレジスタ共有を行わないか、ということをレジスタI/F102に通知する。また、レジスタ利用ライブラリ502は、ディスパッチャ503に、スレッドの割当に変更がない場合、スケジューラ501から受けたスレッド割当通知をそのまま通知し、変更がある場合、変更されたスレッド割当通知を通知する。
Upon receipt of the thread allocation notification from the
ディスパッチャ503は、現在動作中のスレッドに対して、スケジューラ501およびレジスタ利用ライブラリ502によって決定した次のスレッドに切り替える機能を有する。たとえば、ディスパッチャ503は、CPU#0で実行していたスレッドA_0からスレッドB_0に切り替える場合、スレッドA_0のプログラムカウンタ等を含むレジスタ情報を退避する。退避後、ディスパッチャ503は退避されてあったスレッドB_0のレジスタ情報を復帰する。復帰後、ディスパッチャ503は、スレッドB_0の処理を前回の切り替えられた時点から継続することができる。
The
検出部511は、スレッドが複数のコアのいずれかのコアに割り当てられることを検出する機能を有する。たとえば、検出部511は、スレッドA_0がCPU#0に割り当てられることを検出する。
The
また、検出部511は、いずれかのスレッドにて同期待ちが完了したことを検出してもよい。たとえば、検出部511は、実行中のスレッドA_1にて、同期待ちが完了したことを検出する。また、検出対象は、同期通知、バリア同期が含まれてもよい。なお、検出結果は、RAM303、フラッシュROM304、フラッシュROM306などの記憶領域に記憶される。
Further, the
更新部512は、検出部511によっていずれかのスレッドにて同期待ちが完了したことを検出した場合、スレッドに関する同期通知数と同期待ち数とを更新する機能を有する。たとえば、スレッドA_0のプロファイル情報521が同期通知数:6、同期待ち数:0、スレッドA_1のプロファイル情報521が同期通知数:0、同期待ち数:6とする。この状態から、さらに、たとえば、スレッドA_0から発行された同期通知をスレッドA_1にて同期待ちが完了したことを検出部511が検出した場合とする。このとき、更新部512は、スレッドA_0のプロファイル情報521を、同期通知数:5、同期待ち数:0、スレッドA_1のプロファイル情報521を、同期通知数:0、同期待ち数:5に更新する。
The
取得部513は、複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得する機能を有する。同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報とは、同期命令に偏りがあることを示す情報のことであり、同期命令に偏りがあることを示す情報は、プロファイル情報521に記録されている。プロファイル情報521には、同期命令に偏りがあることを示す識別子が格納されていてもよいし、同期通知数と同期待ち数の各値が格納されていてもよい。また、同期命令に偏りがあることを示す識別子は、マルチコアプロセッサシステム100の設計者によって設定されていてもよい。
The
また、スレッドに関する同期命令に偏りがある情報とは、スレッド内のプログラムに記述された同期命令に偏りがあることを示す情報である。したがって、プロファイル情報521は、同期命令に偏りがあることを示す情報をスレッドごとに記憶する。たとえば、取得部513は、スレッドA_0に関する同期命令に偏りがある情報を取得する。
Further, information indicating that the synchronization instruction related to the thread is biased is information indicating that the synchronization instruction described in the program in the thread is biased. Therefore, the
また、取得部513は、複数のコアのそれぞれに割り当てられるスレッドのいずれのスレッドについても同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得してもよい。同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報とは、同期命令に偏りがないことを示す情報のことであり、同期命令に偏りがないことを示す情報は、プロファイル情報521に記録されている。たとえば、プロファイル情報521には、同期命令に偏りがないことを示す識別子が格納されている。たとえば、取得部513は、スレッドA_0〜スレッドA_2のプロファイル情報521として、全てスレッドにて同期命令に偏りがないことを示す情報を取得する。なお、取得されたプロファイル情報521、または、プロファイル情報521へのポインタは、RAM303、フラッシュROM304、フラッシュROM306などの記憶領域に記憶される。
In addition, the
判断部514は、複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する機能を有する。
The
具体的な判断方法として、たとえば、判断部514は、同期通知数と同期待ち数の差分の絶対値が所定値より大きいか否かを判断する。また、判断部514は、同期通知数と同期待ち数の差分の絶対値を、同期命令の総数で除した値が所定値より大きいか否かを判断してもよい。
As a specific determination method, for example, the
また、判断部514は、検出部511によってスレッドが割り当てられることが検出された場合、または更新部512によってスレッドに関する偏りを示す情報が更新された場合に、差分に基づいた値が所定値より大きいか否かを判断してもよい。なお、判断結果は、RAM303、フラッシュROM304、フラッシュROM306などの記憶領域に記憶される。
Further, the
特定部515は、実行部517がレジスタを共有させることによりスレッドを実行する場合、スレッドに関する同期通知数と同期待ち数との差の大きさに基づいて、スレッドを特定する機能を有する。具体的な特定方法として、たとえば、特定部515は、同期通知数と同期待ち数の差分が最大となるスレッドを特定してもよい。または、特定部515は、同期通知数と同期待ち数の差が所定値以上となるスレッドのうちいずれかのスレッドを特定してもよい。または、特定部515は、同期通知数と同期待ち数の差を同期命令の総数で除した値が最大となるスレッドを特定してもよい。なお、特定されたスレッドの情報は、RAM303、フラッシュROM304、フラッシュROM306などの記憶領域に記憶される。
The specifying
通知部516は、取得部513によって差分に基づいた値が所定値より大きいことを示す情報が取得された場合、複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させる共有方法を用いることをレジスタI/F102に通知する機能を有する。また、通知部516は、判断部514によって差分に基づいた値が所定値より大きいと判断された場合に、共有方法を用いることを通知してもよい。また、通知部516は、特定部515によって特定されたスレッドを、複数のコアのうちレジスタの共有元となるコアに割り当てるように割当部518に通知してもよい。
When the information indicating that the value based on the difference is larger than the predetermined value is acquired by the
また、通知部516は、取得部513によって同期命令に偏りがないというプロファイル情報521が取得された場合、複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写する複写方法を用いることを通知してもよい。また、通知部516は、判断部514によっていずれのスレッドについても同期命令に偏りがないと判断された場合に、複写方法を用いることを通知してもよい。
In addition, when the
実行部517は、通知部516から通知された共有方法を用いるか、または複写方法を用いるか、という指示に従って、複数のコアによりスレッドを実行する機能を有する。たとえば、実行部517は、共有方法として、複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、スレッドA_0〜スレッドA_2を実行する。また、実行部517は、複写方法として、複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、スレッドB_0〜スレッドB_2を実行する。
The
割当部518は、通知部516から通知された、特定されたスレッドをレジスタの共有元となるコアに割り当てる機能を有する。たとえば、割当部518は、スレッドA_0を、レジスタの共有元となるCPU#0に割り当てる。
The
図6は、プロファイル情報の記憶内容の一例を示す説明図である。図6で示すプロファイル情報521は、レコード521−1〜レコード521−9を登録している。プロファイル情報521は、スレッドID、同期命令の総数、同期通知数、同期待ち数、バリア同期数という5つのフィールドを含む。スレッドIDフィールドには、対象スレッドを一意に識別する情報が格納される。同期命令の総数フィールドには、対象スレッド内にある同期通知、同期待ち、バリア同期の総数が格納される。同期通知数フィールドには、対象スレッド内にある同期通知数が格納される。同期待ち数フィールドには、対象スレッド内にある同期待ち数が格納される。バリア同期数フィールドには、対象スレッド内にあるバリア同期数が格納される。
FIG. 6 is an explanatory diagram showing an example of the stored contents of profile information. In the
たとえば、レコード521−1は、同期命令の総数が6であり、同期通知数が6であり、同期待ち数とバリア同期数が0であることを示している。なお、プロファイル情報521は、開発者がプログラムを作成したときに生成してもよいし、スレッド実行前に、OSがスレッドのバイナリプログラムを解析して生成してもよい。
For example, the record 521-1 indicates that the total number of synchronization instructions is 6, the number of synchronization notifications is 6, and the number of synchronization waits and the number of barrier synchronizations are 0. The
図7は、同期命令に偏りがあるスレッドの実行結果の一例を示す説明図である。符号701で示す図は、共有方法を実行しているマルチコアプロセッサシステム100が、レジスタの共有元となるCPU#0に、同期待ちが多いスレッドA_1を割り当て、CPU#1に、同期通知が多いスレッドA_0を割り当てている。また、符号702で示す図は、共有方法を実行しているマルチコアプロセッサシステム100が、レジスタの共有元となるCPU#0に、スレッドA_0を割り当て、CPU#1に、スレッドA_1を割り当てている。
FIG. 7 is an explanatory diagram illustrating an example of the execution result of a thread having a biased synchronization instruction. In the diagram indicated by
初めに、符号701におけるCPU#0は、レジスタの共有元であるため、処理が早く完了し、スレッドA_0からの同期通知を待つことになる。たとえば、CPU#0は、スレッドA_1の処理番号{1}を終了した後、CPU#1によるスレッドA_0の処理番号2からの同期通知を待つことになる。処理番号{3}、処理番号{5}でも同様な現象が発生する。このように、レジスタの共有元となるCPUに、同期待ちが多いスレッドを割り当てると、待ち時間の粒度が小さくなる。
First, since the
次に、符号702におけるCPU#0は、レジスタの共有元であるため、処理が早く完了し、処理番号{2}、{4}、{6}にて、同期通知をCPU#1に通知し、待ちとなる。このように、レジスタの共有元となるCPUに、同期通知が多いスレッドを割り当てると、待ち時間の粒度が大きくなる。待ち時間の粒度が大きくなると、DVFS(Dynamic Voltage and Frequency Scaling)が利用しやすくなり、また、他のアプリの処理を実行しやすくなる。理由として、DVFSは、適用が可能な最小時間が存在するため、待ち時間の粒度が小さいと、DVFSの適用ができない場合が存在するためである。また、他プロセスの処理に関しては、待ち時間の粒度が小さいと、他プロセスに切り替えるオーバヘッドが増大するためである。
Next, since the
図8は、同期命令に偏りがないスレッドの実行結果の一例を示す説明図である。符号801で示す図は、共有方法を実行しているマルチコアプロセッサシステム100が、レジスタの共有元となるCPU#0に、同期命令に偏りがないスレッドB_1を割り当て、CPU#1に、同期命令に偏りがないスレッドB_0を割り当てている。また、符号802で示す図は、複写方法を実行しているマルチコアプロセッサシステム100が、CPU#0に、スレッドB_1を割り当て、CPU#1に、スレッドB_0を割り当てている。
FIG. 8 is an explanatory diagram illustrating an example of the execution result of a thread in which there is no bias in synchronization instructions. In the diagram indicated by
初めに、符号801におけるCPU#0は、レジスタの共有元であるため、処理が早く完了し、スレッドB_0からの同期通知を待つことになる。たとえば、CPU#0は、スレッドB_0の処理番号{1}を終了した後、CPU#1によるスレッドB_0の処理番号{2}からの同期通知を待つことになる。処理番号{5}でも同様な現象が発生する。
First, since the
次に、符号802におけるCPU#0とCPU#1は、複写方法であるため、処理速度が同一となるため、同期待ちを行う時間が符号801で示す図に比べて短くなる。このように、同期命令に偏りがない場合、複写方法を用いてスレッドを実行することで、CPUの性能差がなくなり、同期待ち時間が減少するため、マルチコアプロセッサシステム100は、プロセッサの利用効率を向上できる。
Next, since
図9は、レジスタ値共有方法の判断方法の一例を示す説明図である。図9では、レジスタ値共有方法として利用する方法の判断方法について、共有方法、複写方法のいずれを用いるかの判断方法について説明する。 FIG. 9 is an explanatory diagram illustrating an example of a determination method of the register value sharing method. FIG. 9 illustrates a method for determining which method to use as the register value sharing method, which method to use, the sharing method or the copying method.
マルチコアプロセッサシステム100は、スレッド群のうち、下記(1)式が満たすスレッドが一つ以上ある場合、共有方法を用いる。
The
|(同期通知数−同期待ち数)/同期命令の総数|>α …(1) | (Number of synchronization notifications−Number of synchronization waits) / Total number of synchronization instructions |> α (1)
ここで、|x|はxの絶対値を意味しており、αは定数である。図1、図2で示した所定値は、たとえばαとなる。たとえば、α=0.4である。また、マルチコアプロセッサシステム100は、下記(2)式が満たされる場合、複写方法を用いる。
Here, | x | means the absolute value of x, and α is a constant. The predetermined value shown in FIGS. 1 and 2 is, for example, α. For example, α = 0.4. The
バリア同期数/同期命令の総数>β …(2) Number of barrier synchronizations / total number of synchronization instructions> β (2)
ここで、βは定数である。たとえば、β=0.5である。また、マルチコアプロセッサシステム100は、共有方法を用いると判断された場合、スレッドごとに下記(3)式で示す評価式を実行し、最も大きい値となったスレッドを、レジスタの共有元になるCPUに割り当てる。
Here, β is a constant. For example, β = 0.5. Further, when it is determined that the sharing method is used, the
(同期通知数−同期待ち数)/同期命令の総数 …(3) (Number of synchronization notifications-number of synchronization waits) / total number of synchronization instructions (3)
また、マルチコアプロセッサシステム100は、(1)式が満たされた場合に共有方法を用い、(1)式が満たされない場合に複写方法を用いてもよい。また、あるスレッドが(1)式を満たし、他のスレッドが(2)式を満たした場合、マルチコアプロセッサシステム100は、共有方法を用いる。
Further, the
以下、図9で示したレジスタ値共有方法の判断方法を実行して、第1のスレッド群〜第3のスレッド群の実行結果を図10〜図15にて説明する。スレッド群は、たとえば、それぞれ異なるアプリに属しているとする。たとえば、第1のスレッド群がアプリ1に属し、第2のスレッド群がアプリ2に属し、第3のスレッド群がアプリ3に属している。
Hereinafter, the determination method of the register value sharing method shown in FIG. 9 is executed, and execution results of the first to third thread groups will be described with reference to FIGS. For example, it is assumed that the thread groups belong to different applications. For example, the first thread group belongs to the
また、第1のスレッド群は、同期命令に偏りがあるスレッド群を想定しており、たとえば、図6で示したスレッドA_0〜スレッドA_2である。第2のスレッド群は、同期命令に偏りがないスレッド群を想定しており、たとえば、図6で示したスレッドB_0〜スレッドB_2である。第3のスレッド群は、同期命令に偏りがあるスレッドと、同期命令に偏りがないスレッドが混在している場合を想定しており、たとえば、図6で示したスレッドC_0〜スレッドC_2である。 Further, the first thread group is assumed to be a thread group in which the synchronization instruction is biased, and is, for example, the thread A_0 to the thread A_2 illustrated in FIG. The second thread group is assumed to be a thread group in which there is no bias in the synchronization instruction, and is, for example, the thread B_0 to the thread B_2 illustrated in FIG. The third thread group assumes a case in which a thread having a biased synchronization instruction and a thread having a biased synchronization instruction are mixed, for example, the thread C_0 to the thread C_2 illustrated in FIG.
図10は、第1のスレッド群の前提条件の一例を示す説明図である。表1001には、共有方法でのCPUの処理能力と、複写方法でのCPUの処理能力を示しており、前提条件1002では、第1のスレッド群となるスレッドA_0〜スレッドA_2の処理量と、同期通知および同期待ちの詳細について示している。また、表1003は、スレッドA_0〜スレッドA_2に関する式(1)〜式(3)の算出結果を示している。なお、図10におけるスレッドA_0〜スレッドA_2のプロファイル情報521としては、図6で示した値と同一である。
FIG. 10 is an explanatory diagram illustrating an example of a precondition for the first thread group. A table 1001 shows the CPU processing capacity in the sharing method and the CPU processing capacity in the copying method. In the
表1001に示すように、たとえば、共有方法にて自身のレジスタにアクセスするCPUの処理能力を300[命令数/us]であるとし、共有方法にて他のCPUのレジスタにアクセスするCPUの処理能力を100[命令数/us]であるとする。また、複写方法のCPUの処理能力を150[命令数/us]であるとする。 As shown in Table 1001, for example, the processing capacity of a CPU that accesses its own register by the sharing method is 300 [number of instructions / us], and the processing of the CPU that accesses the register of another CPU by the sharing method Assume that the capability is 100 [number of instructions / us]. Further, it is assumed that the processing capability of the CPU of the copying method is 150 [number of instructions / us].
また、前提条件1002では、たとえば、スレッドA_0の処理番号{1}は、処理量が600[命令数]であり、処理番号{5}へ同期通知を送信する。続けて、スレッドA_0は、処理番号{4}、{7}、{10}、{13}、{14}の順で処理を行う。また、スレッドA_1の処理番号{2}は、処理量450[命令数]であり、同期命令は行わない。続けて、スレッドA_1は、処理番号{5}、{8}、{11}の順で処理を行う。また、スレッドA_2の処理番号{3}は、処理量600[命令数]であり、同期命令は行わない。続けて、スレッドA_2は、処理番号{6}、{9}、{12}の順で処理を行う。
Further, in the
また、表1003で示すように、マルチコアプロセッサシステム100は、スレッドA_0〜スレッドA_2に対して、(1)式、(2)式を実行する。たとえば、スレッドAに対する(1)式は、以下のように実行される。
As shown in Table 1003, the
|(6−0)/6|=1>0.4 | (6-0) / 6 | = 1> 0.4
このように、スレッドA_0は(1)式を満たしている。同様に、スレッドA_0に対する(2)式、スレッドA_1、スレッドA_2に対する(1)式、(2)式を算出する。(1)式の算出結果について、スレッドA_0〜スレッドA_2全てが(1)式を満たしたため、マルチコアプロセッサシステム100は、共有方法を用いる。また、マルチコアプロセッサシステム100は、(3)式を実行し、(3)式の算出結果より、スレッドA_0が最も大きい値となるため、スレッドA_0をCPU#0に割り当てる。
Thus, the thread A_0 satisfies the expression (1). Similarly, the formula (2) for the thread A_0, the formula (1) and the formula (2) for the thread A_1 and the thread A_2 are calculated. Regarding the calculation result of the expression (1), since all the threads A_0 to A_2 satisfy the expression (1), the
図11は、共有方法、または複写方法を用いて第1のスレッド群を実行した場合の結果の一例を示す説明図である。図11の例では、タイムチャート1101は、図10で判断したように、共有方法を用い、スレッドA_0をCPU#0に割り当てた場合の結果を示している。また、比較として、タイムチャート1102は、共有方法を用い、スレッドA_0をCPU#2に割り当てた場合の結果を示している。同様に、タイムチャート1103は、複写方法を用いた場合の結果を示している。なお、各処理にかかる時間は、前提条件1002にて示した処理量を、表1001で示した処理能力で除算した結果である。
FIG. 11 is an explanatory diagram illustrating an example of a result when the first thread group is executed using the sharing method or the copying method. In the example of FIG. 11, the
タイムチャート1101にて、スレッドA_0を実行するCPU#0は、処理番号{1}、{4}、{7}、{10}、{13}、{14}を実行し、11.5[us]に処理を終了する。また、スレッドA_1を実行するCPU#1は、処理番号{2}、{5}、{8}、{11}を実行し、19.5[us]に処理を終了する。同様に、スレッドA_2を実行するCPU#2は、処理番号{3}、{6}、{9}、{12}を実行し、19.5[us]に処理を終了する。
In the
タイムチャート1102にて、スレッドA_0を実行するCPU#2は、図示していないが、34.5[us]に処理を終了する。タイムチャート1101の結果と比較すると、タイムチャート1102ではスレッドA_0の処理に時間がかかり、結果、通知待ちを行うスレッドA_1、スレッドA_2の処理にも時間がかかるようになってしまっている。また、スレッドA_2を実行するCPU#0は、たとえば、2[us]から12[us]まで待ち時間が発生してしまっている。
In the
タイムチャート1103にて、スレッドA_0を実行するCPU#0は、23[us]に処理を終了する。スレッドA_1を実行するCPU#1は、22[us]に処理を終了し、スレッドA_2を実行するCPU#2は、26[us]に処理を終了する。タイムチャート1101の結果と比較すると、タイムチャート1103ではスレッドA_0の処理に時間がかかっている。また、CPU#1、CPU#2は、同期待ちの時間が細切れに発生してしまっている。たとえば、CPU#1では、3[us]〜4[us]、8[us]〜11[us]といった細かい時間で待ちが発生しており、CPU#2では、4[us]〜8[us]、11[us]〜15[us]といった時間で待ちが発生している。
In the
図12は、第2のスレッド群の前提条件の一例を示す説明図である。表1001には、共有方法でのCPUの処理能力と、複写方法でのCPUの処理能力を示しており、前提条件1201では、第2のスレッド群となるスレッドB_0〜スレッドB_2の処理量と、同期通知および同期待ちの詳細について示している。また、表1202は、スレッドB_0〜スレッドB_2に関する式(1)〜式(3)の算出結果を示している。なお、図12におけるスレッドB_0〜スレッドB_2のプロファイル情報521は、図6で示した値と同一である。なお、表1001は図10で説明した値と同一であるため、説明を省略する。
FIG. 12 is an explanatory diagram illustrating an example of a precondition for the second thread group. A table 1001 shows the CPU processing capacity in the sharing method and the CPU processing capacity in the copying method. In the
前提条件1201で示すように、たとえば、スレッドB_0の処理番号{1}は、処理量が600[命令数]であり、処理番号{5}へ同期通知を送信する。次に、スレッドB_0の処理番号{4}は、処理量が450[命令数]であり、処理番号{3}からの同期待ちを行い、処理番号{8}へ同期通知を送信する。続けて、スレッドB_0は、処理番号{7}、{10}の順で処理を行う。また、スレッドB_1の処理番号{2}は、処理量450[命令数]であり、処理番号{6}へ同期通知を送信する。続けて、スレッドB_1は、処理番号{5}、{8}、{11}の順で処理を行う。また、スレッドB_2の処理番号{3}は、処理量600[命令数]であり、処理番号{4}へ同期通知を送信する。続けて、スレッドB_2は、処理番号{6}、{9}、{12}の順で処理を行う。
As indicated by the
また、表1202で示すように、マルチコアプロセッサシステム100は、スレッドB_0〜スレッドB_2に対して、(1)式、(2)式を実行する。(1)式の算出結果について、スレッドB_0〜スレッドB_2全てが(1)式を満たさないため、マルチコアプロセッサシステム100は、複写方法を用いる。
As shown in Table 1202, the
図13は、共有方法、または複写方法を用いて第2のスレッド群を実行した場合の結果の一例を示す説明図である。図13の例では、タイムチャート1301は、図12で判断したように、複写方法を用いた場合の結果を示している。また、比較として、タイムチャート1302は、共有方法を用いた場合の結果を示している。
FIG. 13 is an explanatory diagram illustrating an example of a result when the second thread group is executed using the sharing method or the copying method. In the example of FIG. 13, the
タイムチャート1301にて、スレッドB_0を実行するCPU#0は、処理番号{1}、{4}、{7}、{10}を実行し、16[us]に処理を終了する。また、スレッドB_1を実行するCPU#1は、処理番号{2}、{5}、{8}、{11}を実行し、16[us]に処理を終了する。同様に、スレッドB_2を実行するCPU#2は、処理番号{3}、{6}、{9}、{12}を実行し、15[us]に処理を終了する。
In the
タイムチャート1302にて、スレッドB_0を実行するCPU#0は、20[us]に処理を終了する。また、スレッドB_1を実行するCPU#1は、21[us]に処理を終了する。また、スレッドB_2を実行するCPU#2は、22.5[us]に処理を終了する。タイムチャート1301の結果と比較すると、タイムチャート1302ではスレッドB_1、スレッドB_2の処理に時間がかかるようになってしまっている。
In the
図14は、第3のスレッド群の前提条件の一例を示す説明図である。表1001には、共有方法でのCPUの処理能力と、複写方法でのCPUの処理能力を示しており、前提条件1401には、第3のスレッド群となるスレッドC_0〜スレッドC_2の処理量と、同期通知および同期待ちの詳細について示している。また、表1402は、スレッドC_0〜スレッドC_2に関する式(1)〜式(3)の算出結果を示している。なお、図14におけるスレッドC_0〜スレッドC_2のプロファイル情報521は、図6で示した値と同一である。なお、表1001は図10で説明した値と同一であるため、説明を省略する。
FIG. 14 is an explanatory diagram illustrating an example of a precondition for the third thread group. A table 1001 shows the CPU processing capacity in the sharing method and the CPU processing capacity in the copying method. The
前提条件1401で示した図のように、たとえば、スレッドC_0の処理番号{1}は、処理量が600[命令数]であり、処理番号{5}へ同期通知を送信し、処理番号{4}は、処理量が600[命令数]であり、処理番号{6}へ同期通知を送信する。また、スレッドC_1の処理番号{2}は、処理量450[命令数]であり、同期処理は行わない。また、スレッドB_2の処理番号{3}は、処理量600[命令数]であり、処理番号{5}へ同期通知を送信する。
As shown in the diagram shown in the
また、表1402で示すように、マルチコアプロセッサシステム100は、スレッドC_0〜スレッドC_2に対して、(1)式、(2)式を実行する。(1)式の算出結果について、スレッドC_0、スレッドC_1が(1)式を満たしたため、マルチコアプロセッサシステム100は、共有方法を用いる。また、マルチコアプロセッサシステム100は、(3)式を実行し、(3)式の算出結果より、スレッドC_0が最も大きい値となるため、スレッドC_0をCPU#0に割り当てる。
As shown in Table 1402, the
図15は、共有方法、または複写方法を用いて第3のスレッド群を実行した場合の結果の一例を示す説明図である。図15の例では、タイムチャート1501は、図14で判断したように、共有方法を用い、スレッドC_0をCPU#0に割り当てた場合の結果を示している。また、比較として、タイムチャート1502は、共有方法を用い、スレッドC_0をCPU#2に割り当てた場合の結果を示している。同様に、タイムチャート1503は、複写方法を用いた場合の結果を示している。
FIG. 15 is an explanatory diagram illustrating an example of a result when the third thread group is executed using the sharing method or the copying method. In the example of FIG. 15, the
タイムチャート1501にて、スレッドC_0を実行するCPU#0は、処理番号{1}、{4}、{7}、{10}、{13}、{14}を実行し、11.5[us]に処理を終了する。また、スレッドC_1を実行するCPU#1は、処理番号{2}、{5}、{8}、{11}を実行し、21[us]に処理を終了する。同様に、スレッドA_2を実行するCPU#2は、処理番号{3}、{6}、{9}、{12}を実行し、19.5[us]に処理を終了する。
In the
タイムチャート1502にて、スレッドC_0を実行するCPU#2は、図示していないが、34.5[us]に処理を終了する。タイムチャート1501の結果と比較すると、タイムチャート1502ではスレッドC_0の処理に時間がかかり、結果、通知待ちを行うスレッドC_1、スレッドC_2の処理にも時間がかかるようになってしまっている。また、スレッドC_2を実行するCPU#0は、たとえば、2[us]から12[us]まで待ち時間が発生してしまっている。
In the
タイムチャート1503にて、スレッドC_0を実行するCPU#0は、23[us]に処理を終了する。スレッドC_1を実行するCPU#1は、22[us]に処理を終了し、スレッドC_2を実行するCPU#2は、26[us]に処理を終了する。タイムチャート1501の結果と比較すると、タイムチャート1503ではスレッドC_0の処理に時間がかかっている。また、CPU#1、CPU#2は、同期待ちの時間が細切れに発生してしまっている。たとえば、CPU#1では、3[us]〜4[us]、8[us]〜11[us]といった細かい時間で待ちが発生しており、CPU#2では、4[us]〜8[us]、11[us]〜15[us]といった時間で待ちが発生している。
In the
図15で示すように、複数のスレッドのうち1つでも同期命令に偏りがある場合、マルチコアプロセッサシステム100は、共有方法を用いることで、ボトルネックとなるスレッドを高速に処理することができ、CPU#0〜CPU#2の利用効率を向上できる。
As shown in FIG. 15, when even one of a plurality of threads has a biased synchronization instruction, the
続いて、図16、図17にて、図10〜図15で示したようなレジスタ利用処理のフローチャートを示す。マルチコアプロセッサシステム100が実行するレジスタ利用処理は、図16で示すレジスタ利用処理か、図17で示すレジスタ利用処理か、のいずれであってもよい。なお、レジスタ利用処理は、CPU#0〜CPU#2のいずれのCPUで行ってもよい。本実施の形態では、たとえば、CPU#0がレジスタ利用処理を実行する場合にて説明する。
Subsequently, FIGS. 16 and 17 show flowcharts of the register use processing as shown in FIGS. The register use process executed by the
図16は、レジスタ利用処理の一例を示すフローチャートである。図16で示すレジスタ利用処理は、スケジューラからスレッド割当の通知をトリガーとして実行される。CPU#0は、スケジューラ501により、スレッドがCPU#0〜CPU#2のいずれかに割り当てられることを検出する(ステップS1601)。以下、図16の説明では、割り当てられるスレッドを対象スレッドと呼称する。CPU#0は、対象スレッドが細粒度並列処理か否かを判断する(ステップS1602)。なお、対象スレッドが細粒度並列処理か否かの判断方法としては、プロファイル情報521に、対象スレッドに対応するレコードの有無によって、細粒度並列処理か否かを判断する。
FIG. 16 is a flowchart illustrating an example of register use processing. The register use process shown in FIG. 16 is executed with a thread allocation notification from the scheduler as a trigger. The
細粒度並列処理である場合(ステップS1602:Yes)、CPU#0は、割当対象のスレッドに対応するプロファイル情報を取得する(ステップS1603)。次に、CPU#0は、プロファイル情報から、(1)式、(2)式を実行する(ステップS1604)。また、1つのアプリを実行する際に、複数のスレッドを割り当てる場合、CPU#0は、複数のスレッドの各々のスレッドに対して、(1)式、(2)式を実行する。
In the case of the fine-grain parallel processing (step S1602: Yes), the
(1)式、(2)式の結果により、CPU#0は、同期命令に偏りがあるか否かを判断する(ステップS1605)。同期命令に偏りがある場合(ステップS1605:Yes)、CPU#0は、レジスタI/F102に、特定のCPUをレジスタの共有元として共有方法を用いることを通知する(ステップS1606)。続けて、CPU#0は、プロファイル情報から、(3)式を実行する(ステップS1607)。(3)式の結果により、CPU#0は、ディスパッチャ503に、(3)式の値が最も大きいスレッドを、特定のCPUに割り当てるように通知し(ステップS1608)、レジスタ利用処理を終了する。
Based on the results of the expressions (1) and (2), the
同期命令に偏りがない場合(ステップS1605:No)、CPU#0は、レジスタI/F102に、複写方法を用いることを通知する(ステップS1609)。次に、CPU#0は、ディスパッチャ503に、スケジューラ501の指示通りに対象スレッドを割り当てるように通知し(ステップS1610)、レジスタ利用処理を終了する。
If there is no bias in the synchronization command (step S1605: No), the
また、細粒度並列処理でない場合(ステップS1602:No)、CPU#0は、レジスタI/Fに、レジスタ値の共有を行わないことを通知し(ステップS1611)、ステップS1610の処理に移行する。
If it is not the fine-grain parallel processing (step S1602: No), the
図17は、レジスタ利用処理の他の例を示すフローチャートである。図17で示すレジスタ利用処理は、スレッド内で同期命令が完了したことをトリガーとして実行される。また、図17で示すステップS1701、ステップS1704、ステップS1705、ステップS1708以外の処理については、図16で示した処理と同一であるため、説明を省略する。 FIG. 17 is a flowchart illustrating another example of register use processing. The register use process shown in FIG. 17 is executed with the completion of the synchronization instruction in the thread as a trigger. In addition, since processes other than step S1701, step S1704, step S1705, and step S1708 shown in FIG. 17 are the same as those shown in FIG.
CPU#0は、実行中のスレッドにて、同期命令が完了したことを検出し(ステップS1701)、ステップS1702の処理に移行する。以下、図17の説明では、実行中のスレッドを対象スレッドと呼称する。なお、検出対象となる同期命令は、同期通知、同期待ち、バリア同期のうち、同期待ちのみであってもよい。理由として、同期通知の完了を検出した場合、同期待ちも近いうちに行われることが予想され、頻繁にレジスタ利用処理が実行されるのを防ぐためである。また、バリア同期についても、検出対象となる同期命令に含めなくともよい。
The
ステップS1703の処理を実行後、CPU#0は、プロファイル情報521を、発行した同期命令数分減少する(ステップS1704)。次に、CPU#0は、更新したプロファイル情報521から、(1)式、(2)式を実行し(ステップS1705)、ステップS1706の処理に移行する。
After executing the processing of step S1703,
また、ステップS1707の処理を実行後、CPU#0は、更新したプロファイル情報521から、(3)式を実行し(ステップS1708)、ステップS1709の処理に移行する。
Further, after executing the process of step S1707,
図18は、本実施の形態にかかるコンピュータを用いたシステムの適用例を示す説明図である。図18において、ネットワークNWは、サーバ1801とクライアント1811〜クライアント1814とが通信可能なネットワークであり、たとえば、LAN、WAN、インターネット、携帯電話網などを含む。
FIG. 18 is an explanatory diagram showing an application example of a system using a computer according to the present embodiment. In FIG. 18, a network NW is a network in which a
クライアント1811はノート型PC(Personal Computer)である。クライアント1812はデスクトップ型PC、クライアント1813は携帯電話機である。携帯電話機として、クライアント1813は、スマートフォンであってもよいし、PHS(Personal Handyphone System)であってもよい。クライアント1814はタブレット型端末である。
The
図18のサーバ1801、クライアント1811〜クライアント1814は、実施の形態で説明したマルチコアプロセッサシステムとして、本実施の形態にかかるレジスタ利用方法を実行する。たとえば、サーバ1801内の複数のCPUが、本実施の形態にかかるレジスタ利用方法を実行する。
The
以上説明したように、マルチコアプロセッサシステム、レジスタ利用方法、およびレジスタ利用プログラムによれば、スレッドが発行する同期命令に偏りがあることを取得し、同期通知を行うCPUのレジスタを他のCPUに共有させる共有方法を用いる。これにより、同期通知を行うCPUが速く実行し、通知を待つCPUの待ちが短くなるため、全体の処理性能が向上する。また、レジスタの共有元となるCPUに、同期通知が多いスレッドを割り当てると、待ち時間の粒度が大きくなるため、マルチコアプロセッサシステムは、DVFSの利用や、他のアプリを実行しやすくなる。 As described above, according to the multi-core processor system, the register utilization method, and the register utilization program, it is acquired that there is a bias in the synchronization instruction issued by the thread, and the CPU register that performs synchronization notification is shared with other CPUs Use a sharing method. As a result, the CPU that performs the synchronization notification executes faster and the waiting time of the CPU waiting for the notification is shortened, so that the overall processing performance is improved. In addition, if a thread with a lot of synchronization notification is assigned to a CPU that is a register sharing source, the granularity of the waiting time increases, so that the multi-core processor system can easily use DVFS and execute other applications.
また、マルチコアプロセッサシステムは、スレッドが発行する同期命令に偏りがないことを取得し、CPUが自身のレジスタの値を更新する都度、他のCPUのレジスタに値を複写する複写方法を用いてもよい。これにより、マルチコアプロセッサシステムは、CPU間の性能差がなくなるため、同期待ち時間が減少し、CPUの処理能力を向上させることができる。 In addition, the multi-core processor system may acquire a fact that there is no bias in the synchronous instruction issued by the thread, and use a copying method that copies the value to the register of another CPU each time the CPU updates the value of its own register. Good. As a result, the multi-core processor system eliminates the performance difference between the CPUs, thereby reducing the synchronization waiting time and improving the CPU processing capability.
また、マルチコアプロセッサシステムは、少なくとも一つのスレッドについて、差分に基づいた値が所定値より大きいか否かを判断し、大きければ、共有方法を用いてもよい。これにより、マルチコアプロセッサシステムは、同期命令の偏りがあるスレッド群と偏りがないスレッド群を順次実行する場合でも、偏りがあるスレッドを実行する場合、レジスタの利用方法を共有方法に切り替えて、全体の処理能力を向上させることができる。 Further, the multi-core processor system determines whether or not a value based on the difference is larger than a predetermined value for at least one thread, and if it is larger, a sharing method may be used. This allows the multi-core processor system to switch the register usage method to the shared method when executing a thread with a bias even if a thread group with a bias in the synchronous instruction and a thread group without a bias are sequentially executed. The processing capacity can be improved.
また、マルチコアプロセッサシステムは、少なくとも一つのスレッドについて、同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断し、差分値が所定値以下であれば、複写方法を用いてもよい。これにより、マルチコアプロセッサシステムは、同期命令の偏りがあるスレッド群と偏りがないスレッド群を順次実行する場合でも、偏りがないスレッドを実行する場合、レジスタの利用方法を複写方法に切り替えて、全体の処理能力を向上させることができる。 In addition, the multi-core processor system determines whether or not a value based on the difference between the number of synchronization notifications and the number of waiting for synchronization is greater than a predetermined value for at least one thread. A method may be used. This allows the multi-core processor system to switch the register usage method to the copy method when executing a non-biased thread group even when sequentially executing a thread group with a biased synchronous instruction and a non-biased thread group. The processing capacity can be improved.
また、マルチコアプロセッサシステムは、スレッドがCPUに割り当てられるときに、差分に基づいた値が所定値より大きいか否かを判断してもよい。これにより、マルチコアプロセッサシステムは、スレッドが実行される前のタイミングで、利用方法を切り替えることができる。 The multi-core processor system may determine whether a value based on the difference is larger than a predetermined value when a thread is assigned to the CPU. Thereby, the multi-core processor system can switch the usage method at the timing before the thread is executed.
また、マルチコアプロセッサシステムは、スレッドにて同期待ちが完了したことを検出した場合、同期通知数と同期待ち数を更新し、更新された同期通知数と同期待ち数の差分に基づいて、同期命令の偏りがあるか否かを判断してもよい。これにより、マルチコアプロセッサシステムは、スレッドの実行中であっても、より最適なレジスタ利用方法を用いることができる。 In addition, when the multi-core processor system detects that the synchronization wait has been completed in the thread, the multi-core processor system updates the synchronization notification count and the synchronization wait count, and based on the difference between the updated synchronization notification count and the synchronization wait count, It may be determined whether there is a bias. As a result, the multi-core processor system can use a more optimal register utilization method even during execution of a thread.
たとえば、スレッドの割当時には同期命令の偏りがあり、共有方法を用いて実行されていたスレッド群が、処理の前半部分にて、同期命令を全て発行し終えた場合、処理の後半部分は、複写方法を用いた方が処理能力を向上できる。マルチコアプロセッサシステムは、このようなスレッド群を実行する場合、同期待ちの完了を検出し、共有方法から複写方法に切り替えることで、常に共有方法にし続けた場合と比較して、より全体の処理能力を向上させることができる。 For example, there is a bias in synchronous instructions when assigning threads, and if the group of threads executed using the sharing method has issued all synchronous instructions in the first half of the process, the second half of the process is copied. The processing power can be improved by using the method. When executing such a group of threads, the multi-core processor system detects the completion of synchronization wait and switches from the sharing method to the copying method, so that the overall processing capacity is more than that when the sharing method is always kept. Can be improved.
また、マルチコアプロセッサシステムは、共有方法を用いる場合、スレッドに関する同期通知数と同期待ち数の差の大きさに基づいて、レジスタの共有元となるCPUに割り当てるCPUを特定してもよい。これにより、マルチコアプロセッサシステムは、他のスレッドを待たせる割合が多いスレッドを、処理の高速なCPUに割り当てることができるため、他のスレッドの待ち時間が減少し、処理能力を向上させることができる。 In the case of using the sharing method, the multi-core processor system may specify the CPU to be assigned to the CPU that is the register sharing source based on the difference between the number of synchronization notifications related to threads and the number of synchronization waits. As a result, the multi-core processor system can assign a thread with a high ratio of waiting for other threads to a high-speed CPU, so that the waiting time of other threads can be reduced and the processing capacity can be improved. .
なお、本実施の形態で説明したレジスタ利用方法は、予め用意されたプログラムをパーソナル・コンピュータやワークステーション等のコンピュータで実行することにより実現することができる。本レジスタ利用プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本レジスタ利用プログラムは、インターネット等のネットワークを介して配布してもよい。 Note that the register utilization method described in this embodiment can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. The register utilization program is recorded on a computer-readable recording medium such as a hard disk, a flexible disk, a CD-ROM, an MO, and a DVD, and is executed by being read from the recording medium by the computer. The register use program may be distributed through a network such as the Internet.
上述した実施の形態に関し、さらに以下の付記を開示する。 The following additional notes are disclosed with respect to the embodiment described above.
(付記1)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得する取得手段と、
前記取得手段によって前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。
(Supplementary Note 1) Acquisition means for acquiring information indicating that a value based on a difference between the number of synchronization notifications and the number of synchronization waits for at least one of threads assigned to each of a plurality of cores is greater than a predetermined value When,
When the information is acquired by the acquisition means, execution means for executing the thread by the plurality of cores by sharing a register of a core that performs synchronization notification among the plurality of cores,
A multi-core processor system comprising:
(付記2)複数のコアのそれぞれに割り当てられるスレッドのいずれのスレッドについても同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得する取得手段と、
前記取得手段によって前記情報が取得された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。
(Additional remark 2) The acquisition means which acquires the information which shows that the value based on the difference of the number of synchronous notifications and the number of waiting for synchronization is below a predetermined value about any thread of the thread allocated to each of a plurality of cores;
When the information is acquired by the acquisition unit, each time the value of the register of one of the plurality of cores is updated, the thread is copied by the plurality of cores to the thread of the other core. Execution means for executing
A multi-core processor system comprising:
(付記3)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する判断手段と、
前記判断手段によって前記値が前記所定値より大きいと判断された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。
(Supplementary Note 3) Judgment means for judging whether or not a value based on a difference between the number of synchronization notifications and the number of synchronization waits for at least one of the threads assigned to each of the plurality of cores is larger than a predetermined value; ,
When the determination unit determines that the value is larger than the predetermined value, by sharing a register of a core that performs synchronization notification among the plurality of cores with other cores, Execution means to execute;
A multi-core processor system comprising:
(付記4)前記実行手段は、
前記判断手段によっていずれのスレッドについても前記値が前記所定値以下であると判断された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアにより前記スレッドを実行する、
ことを特徴とする付記3に記載のマルチコアプロセッサシステム。
(Supplementary Note 4) The execution means includes:
When it is determined by the determination means that the value is less than or equal to the predetermined value for any thread, each time the value of the register of one of the plurality of cores is updated, the value is stored in the register of the other core. Executing the thread with the plurality of cores by copying;
The multi-core processor system according to
(付記5)前記スレッドが前記複数のコアのいずれかのコアに割り当てられることを検出する検出手段をさらに備え、
前記判断手段は、
前記検出手段によって前記スレッドが割り当てられることが検出された場合、前記複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する、
ことを特徴とする付記3または4に記載のマルチコアプロセッサシステム。
(Additional remark 5) It further has a detecting means for detecting that the thread is assigned to any one of the plurality of cores,
The determination means includes
When it is detected by the detection means that the thread is allocated, a value based on a difference between the synchronization notification count and the synchronization wait count regarding at least one of the threads allocated to each of the plurality of cores is obtained. Determine whether it is greater than a predetermined value,
The multi-core processor system according to
(付記6)前記スレッドのうちいずれかのスレッドにて同期待ちが完了したことを検出する検出手段と、
前記検出手段によって前記いずれかのスレッドにて同期待ちが完了したことを検出した場合、前記スレッドに関する前記同期通知数と前記同期待ち数とを更新する更新手段と、をさらに備え、
前記判断手段は、
前記更新手段によって前記スレッドに関する前記同期通知数と前記同期待ち数とが更新された場合、前記複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する、
ことを特徴とする付記3または4に記載のマルチコアプロセッサシステム。
(Supplementary Note 6) Detection means for detecting completion of synchronization waiting in any one of the threads,
An update means for updating the number of synchronization notifications and the number of synchronization waits related to the thread when the detection means detects that the waiting for synchronization is completed in any one of the threads;
The determination means includes
When the number of synchronization notifications and the number of synchronization waits related to the thread are updated by the updating means, the number of synchronization notifications and the number of synchronization waits for at least one of the threads assigned to each of the plurality of cores, To determine whether the value based on the difference between is greater than a predetermined value,
The multi-core processor system according to
(付記7)前記実行手段が前記共有させることによって前記スレッドを実行する場合、前記複数のスレッドのうち前記スレッドに関する同期通知数と同期待ち数との差分に基づいて、スレッドを特定する特定手段と、
前記特定手段によって特定されたスレッドを、前記複数のコアのうちレジスタの共有元となるコアに割り当てる割当手段と、
をさらに備えることを特徴とする付記3、5、6のうちいずれか一つに記載のマルチコアプロセッサシステム。
(Supplementary note 7) When the execution unit executes the thread by causing the sharing, the specifying unit that specifies the thread based on the difference between the synchronization notification number and the synchronization waiting number related to the thread among the plurality of threads ,
An allocating unit that allocates the thread identified by the identifying unit to a core that is a register sharing source among the plurality of cores;
The multi-core processor system according to any one of
(付記8)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得し、
前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する、
処理を前記複数のコアのうち特定のコアが実行するレジスタ利用方法。
(Appendix 8) Obtaining information indicating that a value based on a difference between the number of synchronization notifications and the number of waiting for synchronization regarding at least one of the threads assigned to each of the plurality of cores is greater than a predetermined value;
When the information is acquired, the thread is executed by the plurality of cores by causing other cores to share the register of the core that performs synchronization notification among the plurality of cores.
A register utilization method in which a specific core among the plurality of cores executes processing.
(付記9)複数のコアのそれぞれに割り当てられるスレッドのいずれのスレッドについても同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得し、
前記情報が取得された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアにより前記スレッドを実行する、
処理を前記複数のコアのうち特定のコアが実行するレジスタ利用方法。
(Supplementary Note 9) Acquire information indicating that the value based on the difference between the number of synchronization notifications and the number of synchronization waits for any of the threads assigned to each of the plurality of cores is equal to or less than a predetermined value,
When the information is acquired, each time the value of the register of any of the plurality of cores is updated, the thread is executed by the plurality of cores by copying to the register of another core.
A register utilization method in which a specific core among the plurality of cores executes processing.
(付記10)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断し、
前記値が前記所定値より大きいと判断された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する、
処理を前記複数のコアのうち特定のコアが実行するレジスタ利用方法。
(Additional remark 10) It is judged whether the value based on the difference of the synchronous notification number regarding the at least any one thread among the threads allocated to each of a plurality of cores and the synchronous waiting number is larger than a predetermined value,
When it is determined that the value is greater than the predetermined value, the thread is executed by the plurality of cores by causing another core to share a register of a core that performs synchronization notification among the plurality of cores.
A register utilization method in which a specific core among the plurality of cores executes processing.
(付記11)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいことを示す情報を取得し、
前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアに前記スレッドを実行させる、
処理を前記複数のコアのうち特定のコアに実行させるレジスタ利用プログラム。
(Supplementary Note 11) Obtaining information indicating that a value based on a difference between the number of synchronization notifications and the number of waiting for synchronization regarding at least one of the threads allocated to each of the plurality of cores is greater than a predetermined value;
When the information is acquired, by causing another core to share a register of a core that performs synchronization notification among the plurality of cores, the plurality of cores execute the thread.
A register use program that causes a specific core of the plurality of cores to execute processing.
(付記12)複数のコアのそれぞれに割り当てられるスレッドのいずれのスレッドについても同期通知数と同期待ち数との差分に基づいた値が所定値以下であることを示す情報を取得し、
前記情報が取得された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアに前記スレッドを実行させる、
処理を前記複数のコアのうち特定のコアに実行させるレジスタ利用プログラム。
(Supplementary Note 12) For any of the threads assigned to each of the plurality of cores, obtain information indicating that the value based on the difference between the synchronization notification count and the synchronization wait count is equal to or less than a predetermined value,
When the information is acquired, each time the value of the register of one of the plurality of cores is updated, the thread is copied to the register of another core, thereby causing the plurality of cores to execute the thread.
A register use program that causes a specific core of the plurality of cores to execute processing.
(付記13)複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断し、
前記値が前記所定値より大きいと判断された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアに前記スレッドを実行させる、
処理を前記複数のコアのうち特定のコアに実行させるレジスタ利用プログラム。
(Additional remark 13) It is judged whether the value based on the difference of the synchronous notification number regarding the at least any one thread among the threads allocated to each of a plurality of cores and the synchronous waiting number is larger than a predetermined value,
When it is determined that the value is larger than the predetermined value, by causing another core to share a register of a core that performs synchronization notification among the plurality of cores, the plurality of cores execute the thread.
A register use program that causes a specific core of the plurality of cores to execute processing.
#0〜#2 CPU
A_1〜A_2 スレッド
101 バス
501 スケジューラ
502 レジスタ利用ライブラリ
503 ディスパッチャ
511 検出部
512 更新部
513 取得部
514 判断部
515 特定部
516 通知部
517 実行部
518 割当部
521 プロファイル情報
# 0 to # 2 CPU
A_1 to
Claims (9)
前記取得手段によって前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。 An acquisition unit configured to acquire information indicating that a value based on a difference between the number of synchronization notifications and the number of synchronization waits regarding at least one of the threads allocated to each of the plurality of cores is greater than a predetermined value;
When the information is acquired by the acquisition means, execution means for executing the thread by the plurality of cores by sharing a register of a core that performs synchronization notification among the plurality of cores,
A multi-core processor system comprising:
前記取得手段によって前記情報が取得された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。 An acquisition means for acquiring information indicating that a value based on a difference between the number of synchronization notifications and the number of waiting for synchronization is less than or equal to a predetermined value for any of the threads assigned to each of the plurality of cores;
When the information is acquired by the acquisition unit, each time the value of the register of one of the plurality of cores is updated, the thread is copied by the plurality of cores to the thread of the other core. Execution means for executing
A multi-core processor system comprising:
前記判断手段によって前記値が前記所定値より大きいと判断された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する実行手段と、
を備えることを特徴とするマルチコアプロセッサシステム。 A determination unit that determines whether or not a value based on a difference between the number of synchronization notifications and the number of synchronization waits for at least one of the threads allocated to each of the plurality of cores is greater than a predetermined value;
When the determination unit determines that the value is larger than the predetermined value, by sharing a register of a core that performs synchronization notification among the plurality of cores with other cores, Execution means to execute;
A multi-core processor system comprising:
前記判断手段によっていずれのスレッドについても前記値が前記所定値以下であると判断された場合、前記複数のコアのうちいずれかのコアのレジスタの値が更新される都度、他のコアのレジスタに複写することにより、前記複数のコアにより前記スレッドを実行する、
ことを特徴とする請求項3に記載のマルチコアプロセッサシステム。 The execution means includes
When it is determined by the determination means that the value is less than or equal to the predetermined value for any thread, each time the value of the register of one of the plurality of cores is updated, the value is stored in the register of the other core. Executing the thread with the plurality of cores by copying;
The multi-core processor system according to claim 3.
前記判断手段は、
前記検出手段によって前記スレッドが割り当てられることが検出された場合、前記複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する、
ことを特徴とする請求項3または4に記載のマルチコアプロセッサシステム。 Detecting means for detecting that the thread is assigned to any one of the plurality of cores;
The determination means includes
When it is detected by the detection means that the thread is allocated, a value based on a difference between the synchronization notification count and the synchronization wait count regarding at least one of the threads allocated to each of the plurality of cores is obtained. Determine whether it is greater than a predetermined value,
The multi-core processor system according to claim 3 or 4, wherein
前記検出手段によって前記いずれかのスレッドにて同期待ちが完了したことを検出した場合、前記スレッドに関する前記同期通知数と前記同期待ち数とを更新する更新手段と、をさらに備え、
前記判断手段は、
前記更新手段によって前記スレッドに関する前記同期通知数と前記同期待ち数とが更新された場合、前記複数のコアのそれぞれに割り当てられるスレッドのうち少なくともいずれか一つのスレッドに関する同期通知数と同期待ち数との差分に基づいた値が所定値より大きいか否かを判断する、
ことを特徴とする請求項3または4に記載のマルチコアプロセッサシステム。 Detecting means for detecting completion of synchronization waiting in any one of the threads;
An update means for updating the number of synchronization notifications and the number of synchronization waits related to the thread when the detection means detects that the waiting for synchronization is completed in any one of the threads;
The determination means includes
When the number of synchronization notifications and the number of synchronization waits related to the thread are updated by the updating means, the number of synchronization notifications and the number of synchronization waits for at least one of the threads assigned to each of the plurality of cores, To determine whether the value based on the difference between is greater than a predetermined value,
The multi-core processor system according to claim 3 or 4, wherein
前記特定手段によって特定されたスレッドを、前記複数のコアのうちレジスタの共有元となるコアに割り当てる割当手段と、
をさらに備えることを特徴とする請求項3、5、6のうちいずれか一つに記載のマルチコアプロセッサシステム。 When the execution means executes the thread by causing the sharing, the specifying means for specifying the thread based on the difference between the number of synchronization notifications and the number of synchronization waits for the thread among the plurality of threads,
An allocating unit that allocates the thread identified by the identifying unit to a core that is a register sharing source among the plurality of cores;
The multi-core processor system according to claim 3, further comprising:
前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアにより前記スレッドを実行する、
処理を前記複数のコアのうち特定のコアが実行するレジスタ利用方法。 Obtaining information indicating that a value based on a difference between the number of synchronization notifications and the number of synchronization waits regarding at least one of the threads allocated to each of the plurality of cores is greater than a predetermined value;
When the information is acquired, the thread is executed by the plurality of cores by causing other cores to share the register of the core that performs synchronization notification among the plurality of cores.
A register utilization method in which a specific core among the plurality of cores executes processing.
前記情報が取得された場合、前記複数のコアのうち同期通知を実行するコアのレジスタを他のコアに共有させることにより、前記複数のコアに前記スレッドを実行させる、
処理を前記複数のコアのうち特定のコアに実行させるレジスタ利用プログラム。 Obtaining information indicating that a value based on a difference between the number of synchronization notifications and the number of synchronization waits regarding at least one of the threads allocated to each of the plurality of cores is greater than a predetermined value;
When the information is acquired, by causing another core to share a register of a core that performs synchronization notification among the plurality of cores, the plurality of cores execute the thread.
A register use program that causes a specific core of the plurality of cores to execute processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011246959A JP5708450B2 (en) | 2011-11-10 | 2011-11-10 | Multi-core processor system, register utilization method, and register utilization program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011246959A JP5708450B2 (en) | 2011-11-10 | 2011-11-10 | Multi-core processor system, register utilization method, and register utilization program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013105217A JP2013105217A (en) | 2013-05-30 |
JP5708450B2 true JP5708450B2 (en) | 2015-04-30 |
Family
ID=48624733
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011246959A Expired - Fee Related JP5708450B2 (en) | 2011-11-10 | 2011-11-10 | Multi-core processor system, register utilization method, and register utilization program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5708450B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017146791A (en) * | 2016-02-17 | 2017-08-24 | 日本電信電話株式会社 | In-cluster migration management system, in-cluster migration management method, management server and program |
US10162559B2 (en) * | 2016-09-09 | 2018-12-25 | Veritas Technologies Llc | Systems and methods for performing live migrations of software containers |
US10649771B2 (en) | 2017-03-31 | 2020-05-12 | Samsung Electronics Co., Ltd. | Semiconductor device |
KR102235803B1 (en) | 2017-03-31 | 2021-04-06 | 삼성전자주식회사 | Semiconductor device |
CN114866499B (en) * | 2022-04-27 | 2024-02-23 | 曙光信息产业(北京)有限公司 | Synchronous broadcast communication method, device and storage medium of multi-core system on chip |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3261766B2 (en) * | 1992-11-10 | 2002-03-04 | セイコーエプソン株式会社 | Multiprocessor system, shared variable updating device, processor unit, and shared variable updating method |
JPH0887473A (en) * | 1994-09-16 | 1996-04-02 | Toshiba Corp | Data processor |
US5860116A (en) * | 1996-12-11 | 1999-01-12 | Ncr Corporation | Memory page location control for multiple memory-multiple processor system |
US7430627B2 (en) * | 2000-12-19 | 2008-09-30 | International Business Machines Corporation | Adaptive reader-writer lock |
JP2009031871A (en) * | 2007-07-24 | 2009-02-12 | Sony Corp | Information processor, information processing method, and program |
-
2011
- 2011-11-10 JP JP2011246959A patent/JP5708450B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2013105217A (en) | 2013-05-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5780243B2 (en) | Scheduling method and multi-core processor system | |
JP5765423B2 (en) | Multi-core processor system and scheduling method | |
JP5773065B2 (en) | Scheduling program, multi-core processor system, and scheduling method | |
JP5708450B2 (en) | Multi-core processor system, register utilization method, and register utilization program | |
JPWO2012046302A1 (en) | Multi-core processor system, supervisory control method, and supervisory control program | |
US20160179429A1 (en) | Controlling memory access conflict of threads on multi-core processor with set of highest priority processor cores based on a threshold value of issued-instruction efficiency | |
JP2010257428A (en) | Information processing apparatus, parallel processing optimization method, and program | |
JPWO2012127589A1 (en) | Multi-core processor system and branch prediction method | |
WO2012120654A1 (en) | Task scheduling method and multi-core system | |
US9395803B2 (en) | Multi-core processor system implementing migration of a task from a group of cores to another group of cores | |
US10579419B2 (en) | Data analysis in storage system | |
JP5861715B2 (en) | Data processing apparatus, transmission apparatus, scheduling method, transmission control method, scheduling program, and transmission control program | |
US20140082624A1 (en) | Execution control method and multi-processor system | |
JP5780296B2 (en) | Thread processing method and thread processing system | |
JP6135392B2 (en) | Cache memory control program, processor incorporating cache memory, and cache memory control method | |
KR101271211B1 (en) | Apparatus and method for input/output processing of multi thread | |
JP2015022380A (en) | Information processor, shift method for virtual machine and shift program for virtual machine | |
US9405470B2 (en) | Data processing system and data processing method | |
JP5704176B2 (en) | Processor processing method and processor system | |
JP2013149108A (en) | Information processing apparatus, control method therefor, and program | |
JP5505522B2 (en) | Program execution method | |
CN112417053A (en) | Metadata management method and device for cloud storage, electronic equipment and storage medium | |
Lyerly et al. | An OpenMP runtime for transparent work sharing across cache-incoherent heterogeneous nodes | |
JP2014026679A (en) | Multi-core processor system, control method, and control program | |
JP2014182764A (en) | Information processing unit, information processing method and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140704 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150128 |
|
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: 20150203 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150216 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5708450 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |