JP5408330B2 - Multi-core processor system, thread control method, and thread control program - Google Patents
Multi-core processor system, thread control method, and thread control program Download PDFInfo
- Publication number
- JP5408330B2 JP5408330B2 JP2012501562A JP2012501562A JP5408330B2 JP 5408330 B2 JP5408330 B2 JP 5408330B2 JP 2012501562 A JP2012501562 A JP 2012501562A JP 2012501562 A JP2012501562 A JP 2012501562A JP 5408330 B2 JP5408330 B2 JP 5408330B2
- Authority
- JP
- Japan
- Prior art keywords
- core
- cpu
- access
- cores
- contention
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0629—Configuration or reconfiguration of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1605—Handling requests for interconnection or transfer for access to memory bus based on arbitration
- G06F13/1652—Handling requests for interconnection or transfer for access to memory bus based on arbitration in a multiprocessor architecture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/18—Handling requests for interconnection or transfer for access to memory bus based on priority control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
- G06F13/26—Handling requests for interconnection or transfer for access to input/output bus using interrupt with priority control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44552—Conflict resolution, i.e. enabling coexistence of conflicting executables
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Multi Processors (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Description
本発明は、スレッドを制御するマルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラムに関する。 The present invention relates to a multi-core processor system that controls threads, a thread control method, and a thread control program.
従来から、1つのCPUに対して、複数のプログラムを動作させるマルチプログラミング技術が存在する。具体的には、OS(Operating System)は、CPU(Central Processing Unit)の処理時間を分割する機能を有し、分割された時間にプロセスやスレッドを割り当てることにより、CPUが同時に複数のプロセスやスレッドを動作する。ここで、プロセスはプログラムの実行単位である。 Conventionally, there exists a multiprogramming technique for operating a plurality of programs for one CPU. Specifically, an OS (Operating System) has a function of dividing the processing time of a CPU (Central Processing Unit), and by assigning a process or thread to the divided time, the CPU can simultaneously process a plurality of processes or threads. Work. Here, a process is a program execution unit.
また、一定時間内に処理を終える必要があるプロセスに対して、OSがCPUに対するスレッドの割り当て時間を他のプロセスより多くすることで、優先的に処理を行い、一定時間内に処理を行う、という技術も開示されている。また、プロセスを効果的に切り替える技術として、OSがプロセスごとに実行命令数を取得し、実行命令数の多いプロセスを先に実行する技術が開示されている(たとえば、下記特許文献1を参照。)。前述の技術では、キャッシュメモリに一番多く保持されているプロセスが実行されることにより、全体のスループットを向上させることができる。
In addition, for a process that needs to finish processing within a certain period of time, the OS performs processing preferentially by increasing the thread allocation time for the CPU over other processes, and performs processing within a certain period of time. This technique is also disclosed. Further, as a technique for effectively switching processes, a technique is disclosed in which the OS acquires the number of execution instructions for each process and executes a process having a large number of execution instructions first (for example, see
また、コンピュータシステムに複数のCPUを搭載するマルチコアプロセッサシステムの技術も開示されている。これにより、前述のマルチプログラミング技術において、OSは複数のプログラムを複数のプロセスに対して割り当てることができる。また、マルチコアプロセッサシステムの構成として、各CPUが専用のメモリを保持し、それ以外のデータが必要の場合には、共有メモリにアクセスを行うことを特徴とする、分散システムの構造を持ったマルチコアプロセッサシステムが開示されている。また、各CPUがキャッシュメモリのみを保持し、必要なデータは共有メモリに格納することを特徴とする、集中共用システムの構造を持ったマルチコアプロセッサシステムも開示されている。 A technique of a multi-core processor system in which a plurality of CPUs are mounted on a computer system is also disclosed. Thereby, in the above-mentioned multiprogramming technique, the OS can allocate a plurality of programs to a plurality of processes. In addition, as a multi-core processor system configuration, a multi-core having a distributed system structure is characterized in that each CPU holds a dedicated memory, and when other data is required, the shared memory is accessed. A processor system is disclosed. Also disclosed is a multi-core processor system having a centralized shared system structure in which each CPU holds only a cache memory and necessary data is stored in a shared memory.
しかしながら、マルチコアプロセッサシステムでは、複数のCPUが共有メモリに同時にアクセスすることによってコンテンションが発生する。コンテンションが発生すると、CPUは、通常の処理時間以内に処理を終了できなくなり、一定時間内に処理を終わらせる必要があるリアルタイム処理を行えないという問題があった。リアルタイム処理とは、設計上あらかじめ決められた時刻に処理を終了しなければならない処理、および割り込み動作における、割り込みイベント発生から割り込み処理本体の開始時間までの許容されるインターバル時間が定められた処理をさす。 However, in a multi-core processor system, contention occurs when a plurality of CPUs simultaneously access a shared memory. When contention occurs, there is a problem in that the CPU cannot finish the process within a normal processing time, and cannot perform a real-time process that needs to finish the process within a certain time. Real-time processing refers to processing that must be completed at a predetermined time in design, and processing that determines the allowable interval time from the occurrence of an interrupt event to the start time of the interrupt processing body in interrupt operation. Sure.
また、コンテンションはハードウェアを原因として引き起こされる。したがって、上述した従来技術において、マルチコアプロセッサシステムに特許文献1を適用しても、CPUはキャッシュメモリに一番多く保持されているプロセスによってコンテンションを起こす可能性もあり、コンテンションの解決に至らないという問題があった。
Also, contention is caused by hardware. Therefore, in the above-described conventional technology, even if
また、前述した分散システムを適用した場合、コンテンションが発生する頻度は少ないが、CPUごとにメモリを配置する必要があるため、コストと消費電力が大きくなるという問題があった。したがって、コストと消費電力に制限のある組み込み環境では、集中共用システムを適用したマルチコアプロセッサシステムがよく適用される。しかし、集中共用システムを適用したマルチコアプロセッサシステムは、複数のCPUが共有メモリに同時にアクセスする機会が多く、コンテンションが発生する頻度が多いという問題があった。 Further, when the above-described distributed system is applied, contention occurs less frequently, but there is a problem in that cost and power consumption increase because it is necessary to arrange a memory for each CPU. Therefore, in an embedded environment where cost and power consumption are limited, a multi-core processor system to which a centralized shared system is applied is often applied. However, the multi-core processor system to which the centralized shared system is applied has a problem that a plurality of CPUs frequently access the shared memory at the same time, and contention occurs frequently.
本発明は、上述した従来技術による問題点を解消するため、マルチコアプロセッサシステムにてリアルタイム処理を保証できるマルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラムを提供することを目的とする。 An object of the present invention is to provide a multi-core processor system, a thread control method, and a thread control program that can guarantee real-time processing in a multi-core processor system in order to solve the above-described problems caused by the prior art.
上述した課題を解決し、目的を達成するため、開示のマルチコアプロセッサシステムは複数のコアのうち、実行優先度が最も高い第1のコアを検出し、検出された第1のコアのうち、メモリに対してアクセス競合を発生させた第2のコアを特定し、複数のコアのうち、第1のコアと第2のコアとを除いたすべてのコアに対し、メモリにアクセスしないスレッドを、アクセス競合の期間のうち少なくとも一部の期間中に実行させるように制御することを備えることを要件とする。 In order to solve the above-described problems and achieve the object, the disclosed multi-core processor system detects a first core having the highest execution priority among a plurality of cores, and detects a memory among the detected first cores. The second core that caused the access contention is identified, and the threads that do not access the memory are accessed for all the cores except the first core and the second core among the plurality of cores. It is a requirement to provide control to be executed during at least some of the periods of contention.
本マルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラムによれば、リアルタイム処理を行っており、コンテンション発生中のコアのリアルタイム処理を保証することができるという効果を奏する。 According to the present multi-core processor system, thread control method, and thread control program, real-time processing is performed, and there is an effect that real-time processing of the core during contention generation can be guaranteed.
以下に添付図面を参照して、本発明にかかるマルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラムの好適な実施の形態を詳細に説明する。 Exemplary embodiments of a multi-core processor system, a thread control method, and a thread control program according to the present invention will be explained below in detail with reference to the accompanying drawings.
(マルチコアプロセッサシステムのハードウェア構成)
図1は、実施の形態にかかるマルチコアプロセッサシステムのハードウェア構成を示すブロック図である。マルチコアプロセッサシステムとは、コアが複数搭載されたプロセッサを含むコンピュータのシステムである。コアが複数搭載されていれば、複数のコアが搭載された単一のプロセッサでもよく、シングルコアのプロセッサが並列されているプロセッサ群でもよい。なお、本実施の形態では、説明を単純化するため、シングルコアのプロセッサであるCPUが並列されているプロセッサ群を例にあげて説明する。(Hardware configuration of multi-core processor system)
FIG. 1 is a block diagram of a hardware configuration of the multi-core processor system according to the embodiment. A multi-core processor system is a computer system including a processor having a plurality of cores. If a plurality of cores are mounted, a single processor having a plurality of cores may be used, or a processor group in which single core processors are arranged in parallel may be used. In this embodiment, in order to simplify the description, a processor group in which CPUs that are single-core processors are arranged in parallel will be described as an example.
マルチコアプロセッサシステム100は、CPUを複数搭載するCPUs101と、ROM(Read‐Only Memory)102と、RAM(Random Access Memory)103と、フラッシュROM104と、を備えている。また、マルチコアプロセッサシステム100は、ユーザやその他の機器との入出力装置として、ディスプレイ105と、I/F(Interface)106と、を備えている。また、各構成部はバス108によってそれぞれ接続されている。本実施の形態にかかるハードウェアの構成は、集中共用システムを適用した構成となっている。
The
ここで、CPUs101は、マルチコアプロセッサシステムの全体の制御を司る。また、CPUs101は、シングルコアのプロセッサを並列して接続したすべてのCPUを指している。詳細は、図2にて後述する。ROM102は、ブートプログラムなどのプログラムを記憶している。RAM103は、CPUs101のワークエリアとして使用される。
Here, the
フラッシュROM104は、書き換えが可能であり、電源を切ってもデータが消えないという特徴を持つ不揮発性の半導体メモリである。フラッシュROM104は、ソフトウェアプログラムや、データを記憶している。フラッシュROM104の代わりに、磁気ディスクであるHDD(ハードディスクドライブ)にて記憶してもよいが、フラッシュROM104を使用することにより、機械的に動作するHDDに比べて振動に強くすることができる。たとえば、マルチコアプロセッサシステム100で構成する装置に対し、強い振動があった場合でも、フラッシュROM104であればデータが消える可能性を低くすることができる。
The
ディスプレイ105は、カーソル、アイコンあるいはツールボックスをはじめ、文書、画像、機能情報などのデータを表示する。ディスプレイ105は、たとえば、TFT液晶ディスプレイなどを採用することができる。また、ディスプレイ105は、タッチパネル式で入力する形態でもよい。
The
I/F106は、通信回線を通じてLAN(Local Area Network)、WAN(Wide Area Network)、インターネットなどのネットワーク107に接続され、このネットワーク107を介して他の装置に接続される。そして、I/F106は、ネットワーク107と内部のインターフェースを司り、外部装置からのデータの入出力を制御する。I/F106には、たとえばモデムやLANアダプタなどを採用することができる。
The I / F 106 is connected to a
図2は、マルチコアプロセッサシステム100の各CPUのハードウェアの一部の構成とソフトウェア構成を示すブロック図である。マルチコアプロセッサシステム100のハードウェア構成は、CPUs101と、共有メモリ203で構成される。CPUs101は、複数のCPUとしてCPU201−1、CPU201−2、・・・、CPU201−nで構成される。
FIG. 2 is a block diagram illustrating a partial hardware configuration and software configuration of each CPU of the
CPU201−1、CPU201−2、・・・、CPU201−nは、それぞれ、キャッシュメモリ202−1、キャッシュメモリ202−2、・・・、キャッシュメモリ202−nを保持している。各CPUと共有メモリ203は、バス108によってそれぞれ接続されている。以下の記述では、CPU201−1、CPU201−2について記述する。
The CPU 201-1, CPU 201-2,..., And CPU 201-n respectively hold a cache memory 202-1, a cache memory 202-2,. Each CPU and the shared
また、マルチコアプロセッサシステム100のソフトウェア構成として、CPU201−1は、ハイパーバイザ204−1、OS205−1を実行する。CPU201−1は、ハイパーバイザ204−1の制御により、監視ライブラリ206−1を実行する。同様に、CPU201−1は、OS205−1の制御により、リアルタイムソフトウェア207を実行する。同様にCPU201−2も、ハイパーバイザ204−2、OS205−2を実行する。CPU201−2は、ハイパーバイザ204−2の制御により、監視ライブラリ206−2を実行する。同様に、CPU201−2は、OS205−2の制御により、ソフトウェア208を実行する。
Further, as a software configuration of the
CPU201−1がリアルタイムソフトウェア207を実行する際には、データへのアクセス先が2通りあり、アクセス経路209とアクセス経路210である。同様に、CPU201−2がソフトウェア208を実行する際にも、データへのアクセス先が2通りあり、アクセス経路211とアクセス経路212である。また、ハイパーバイザ204−1とハイパーバイザ204−2と、他のCPU上で動作しているハイパーバイザは、ハイパーバイザ間通信213を行う。
When the CPU 201-1 executes the real-
CPU201−1、CPU201−2、・・・、CPU201−nは、マルチコアプロセッサシステム100の制御を司る。CPU201−1、CPU201−2、・・・、CPU201−nは、対称的、均一的に処理が割り付けられたSMP(Symmetric
Multi−processing)でもよい。また、CPU201−1、CPU201−2、・・・、CPU201−nは、処理内容によって分担するCPUを決めておくASMP(Asymmetric Multi−Processing)でもよい。ASMPの例として、マルチコアプロセッサシステム100は、CPU201−1にて優先して処理すべきであるリアルタイム処理を割り当ててもよい。The CPU 201-1, the CPU 201-2,..., The CPU 201-n control the
Multi-processing) may be used. Further, the CPU 201-1, CPU 201-2,..., CPU 201-n may be ASMP (Asymmetric Multi-Processing) that determines the CPU to be shared according to the processing content. As an example of ASMP, the
共有メモリ203は、CPU201−1、CPU201−2、・・・、CPU201−nからアクセス可能な記憶領域である。記憶領域とは、具体的には、たとえば、ROM102、RAM103、フラッシュROM104である。また、たとえば、CPU201−1が、ディスプレイ105に画像データの表示を要求する場合、RAM103に含まれるVRAM(Video RAM)にアクセスし、画像データをVRAMに書き込むことになる。したがって、CPU201−1が、ディスプレイ105へアクセスする場合も、共有メモリ203にアクセスすることに含める。
The shared
また、たとえば、CPU201−1が、I/F106にアクセスする場合も同様である。たとえば、I/F106の具体例がLANアダプタとして、LANアダプタにあるバッファにアクセスする形式か、RAM103にアクセスし、その後LANアダプタに転送する形式かのどちらかになる。どちらの場合であっても、CPU201−1、CPU201−2からみると共有メモリにアクセスしていることとなるため、CPU201−1、CPU201−2が、I/F106へアクセスする場合も、共有メモリ203にアクセスすることに含める。同様に、CPU201−1が、I/F106にアクセスする場合も、I/F106を制御するデバイスドライバが用意する共有の記憶領域にアクセスすることになるため、結果、共有メモリ203にアクセスすることになる。
Further, for example, the same applies when the CPU 201-1 accesses the I /
ハイパーバイザ204−1、ハイパーバイザ204−2は、それぞれCPU201−1、CPU201−2にて動作するプログラムである。ハイパーバイザの機能は、OSとCPUの間にて位置し、OSの監視を行い、OSがハングアップした際にリセットをする他、OSが何もスレッドを実行していない場合に、省電力設定にする。また、CPU201−1、CPU201−2は、それぞれのハイパーバイザによって、本実施の形態での特徴である、コンテンションの監視をする監視ライブラリ206−1、監視ライブラリ206−2を実行する。 The hypervisor 204-1 and the hypervisor 204-2 are programs that operate on the CPU 201-1 and the CPU 201-2, respectively. The hypervisor function is located between the OS and CPU, monitors the OS, resets when the OS hangs, and sets the power saving when the OS is not executing any threads. To. In addition, the CPU 201-1 and the CPU 201-2 execute the monitoring library 206-1 and the monitoring library 206-2 that monitor contention, which is a feature of the present embodiment, by the respective hypervisors.
OS205−1、OS205−2は、それぞれ、CPU201−1、CPU201−2にて動作するプログラムであり、ハイパーバイザ204−1、ハイパーバイザ204−2上で動作する。たとえば、OS205−1は、リアルタイムソフトウェア207をCPU201−1に割り当てて実行させるスレッドのスケジューラを持つ。
The OS 205-1 and OS 205-2 are programs that operate on the CPU 201-1 and CPU 201-2, respectively, and operate on the hypervisor 204-1 and the hypervisor 204-2. For example, the OS 205-1 has a thread scheduler that allocates and executes the real-
監視ライブラリ206−1、監視ライブラリ206−2は、それぞれ、ハイパーバイザ204−1、ハイパーバイザ204−2上で動作するプログラムであり、共有メモリ203に対してアクセス競合によるコンテンションが発生していないかを監視する。監視の結果、コンテンションが発生している場合、監視ライブラリは、ハイパーバイザ間で情報を送信し、コンテンションを起こしたことを、他のハイパーバイザに送信する。
The monitoring library 206-1 and the monitoring library 206-2 are programs that operate on the hypervisor 204-1 and the hypervisor 204-2, respectively, and no contention due to access contention occurs in the shared
リアルタイムソフトウェア207は、OS205−1によってCPU201−1に割り当てられたプログラムである。リアルタイムソフトウェアの具体例としては、通信パケット処理がある。通信パケット処理は、プロトコルの決められた時間以内に処理を行う必要があり、リアルタイム処理を要求される。ソフトウェア208は、OS205−2によってCPU201−2に割り当てられたプログラムである。ソフトウェア208は、リアルタイム処理を要求されていない。前述のように、本実施の形態では、CPU201−1にてリアルタイム処理の保証を必要とするソフトウェアを実行している状態を想定する。
The real-
アクセス経路209は、CPU201−1がキャッシュメモリ202−1にアクセスする経路である。アクセス経路210は、CPU201−1が共有メモリ203にアクセスする経路である。アクセス経路209とアクセス経路210の違いとして、リアルタイムソフトウェア207がアクセスしたいデータがキャッシュメモリ202−1にあればアクセス経路209、なければアクセス経路210となる。アクセス経路211、アクセス経路212も同様で、アクセス経路211は、CPU201−2がキャッシュメモリ202−2にアクセスする経路である。アクセス経路212は、CPU201−2が共有メモリ203にアクセスする経路である。
The
ハイパーバイザ間通信213は、ハイパーバイザ間でメッセージの送受信をする通信である。具体的には、たとえば、CPU201−1にて、リアルタイムソフトウェア207を実行中にコンテンション状態になった場合に、ハイパーバイザ204−1からハイパーバイザ204−2を含むすべてのハイパーバイザにメッセージをブロードキャスト送信する。
The
(マルチコアプロセッサシステムの機能的構成)
次に、マルチコアプロセッサシステム100の機能的構成について説明する。図3は、マルチコアプロセッサシステム100の機能的構成を示すブロック図である。マルチコアプロセッサシステム100は、優先度検出部305と、発行命令効率算出部306と、コンテンション検出部307と、特定部308と、制御部311と、を含む構成である。この制御部となる機能(優先度検出部305〜制御部311)は、具体的には、たとえば、図1に示したROM102、RAM103、フラッシュROM104などの記憶装置に記憶されたプログラムをCPUs101が実行することにより、その機能を実現する。(Functional configuration of multi-core processor system)
Next, a functional configuration of the
また、CPU201−1、CPU201−2、・・・、CPU201−nは、ハイパーバイザとOS/ソフトウェアを実行する。さらに、一点破線で分割された領域のうち、領域301−1に図示している優先度検出部305〜ハイパーバイザ間メッセージ送信部309は、CPU201−1がハイパーバイザ204−1の機能の一部として実行することにより実現する。同様に、領域301−2内に図示しているハイパーバイザ間メッセージ受信部310、制御部311は、CPU201−2が、ハイパーバイザ204−2の機能の一部として実行することにより実現する。
Further, the CPU 201-1, CPU 201-2,..., CPU 201-n execute a hypervisor and OS / software. Furthermore, the
また、図示していないが、CPU201−1以外のコアが実行しているハイパーバイザにも、優先度検出部305〜ハイパーバイザ間メッセージ送信部309の機能を有している。同様に、CPU201−2以外のコアが実行しているハイパーバイザにも、ハイパーバイザ間メッセージ受信部310、制御部311の機能を有している。また、優先度検出部305〜ハイパーバイザ間メッセージ送信部309は、監視ライブラリ206−1に相当する。同様に、ハイパーバイザ間メッセージ受信部310、制御部311は、監視ライブラリ206−2に相当する。
Although not shown, the hypervisor executed by the core other than the CPU 201-1 also has the functions of the
また、領域302−1に図示しているOSスケジューラ監視部304−1、リアルタイムソフトウェア207、ソフトウェア312は、CPU201−1がOS205−1の機能の一部として実行することにより実現する。優先度テーブル303−1は、ハイパーバイザ204−1またはOS205−1からアクセスできるテーブルである。
In addition, the OS scheduler monitoring unit 304-1, the real-
また、領域302−2に図示しているOSスケジューラ監視部304−2、ソフトウェア208、ソフトウェア313、nice値設定部314、ダミースレッド起動部315は、CPU201−2がOS205−2の機能の一部として実行することにより実現する。優先度テーブル303−2は、ハイパーバイザ204−2またはOS205−2からアクセスできるテーブルである。
The OS scheduler monitoring unit 304-2,
優先度テーブル303−1、優先度テーブル303−2は、マルチコアプロセッサシステム100で実行される処理と処理の優先度を関連付けて管理するテーブルである。優先度テーブル303−1の内容の詳細は、図7にて後述する。
The priority table 303-1 and the priority table 303-2 are tables for managing the processing executed in the
OSスケジューラ監視部304−1、OSスケジューラ監視部304−2は、CPU201−1、CPU201−2に割り当てるソフトウェアを監視する機能を有する。具体的には、たとえば、リアルタイムソフトウェア207がCPU201−1に割り当てられており、リアルタイムソフトウェア207がRAM103やフラッシュROM104上にある共有資源にアクセス要求する場合を想定する。
The OS scheduler monitoring unit 304-1 and the OS scheduler monitoring unit 304-2 have a function of monitoring software allocated to the CPU 201-1 and the CPU 201-2. Specifically, for example, it is assumed that the real-
この時、既に他のソフトウェアが共有資源を使用すると宣言中であった場合に、OSスケジューラ監視部304−1は、リアルタイムソフトウェア207の実行状態を待ち状態にする。続けて、OSスケジューラ監視部304−1は、実行可能状態となっていた別のソフトウェア、たとえばソフトウェア312を実行状態にして、CPU201−1に割り当てる。
At this time, if another software has already been declared to use the shared resource, the OS scheduler monitoring unit 304-1 sets the execution state of the real-
また、別の具体例として、たとえば、リアルタイムソフトウェア207が所定期間以上CPU201−1に割り当てられていた場合にも、OSスケジューラ監視部304−1は、別のソフトウェアをCPU201−1に割り当てる。また、前述のように、CPUに割り当てられたソフトウェアを切り替えることを、ディスパッチという。
As another specific example, for example, even when the real-
また、OSスケジューラ監視部304−1は、新しくソフトウェアを起動する際に、ソフトウェアの実行単位となるスレッドとして起動する。各スレッドは、スタック領域、プログラムカウンタを含むレジスタ情報等を持つ。OSスケジューラ監視部304−1は、ディスパッチを行うたびに、現在実行中のレジスタ情報等を共有メモリ203に退避し、次のソフトウェアのレジスタ情報等を共有メモリ203から取得し、CPUのレジスタ情報に設定する。
Further, the OS scheduler monitoring unit 304-1 is activated as a thread that becomes a unit of software execution when the software is newly activated. Each thread has a stack area, register information including a program counter, and the like. Each time dispatch is performed, the OS scheduler monitoring unit 304-1 saves the currently executed register information and the like to the shared
また、マルチコアプロセッサシステム100は、スレッドの集合から、1つのプロセスを構成してもよい。スレッド間ではメモリ空間が共通であるが、プロセス間ではメモリ空間が独立しており、お互いのメモリ空間に直接アクセスできない。本実施の形態では、スレッドを用いて説明しているが、プロセスに置き換えてもよい。
The
別のソフトウェアをCPU201−1に割り当てる際に、複数の割り当て候補となるソフトウェアが存在する場合、OSスケジューラ監視部304−1は、優先度テーブル303−1に基づいて割り当てを行ってもよい。また、OSスケジューラ監視部304−1は、それぞれのソフトウェアの割り当て時刻に基づいて、割り当て時刻が一番古いソフトウェアを割り当ててもよい。 When assigning another software to the CPU 201-1, when there are a plurality of assignment candidate softwares, the OS scheduler monitoring unit 304-1 may perform assignment based on the priority table 303-1. Further, the OS scheduler monitoring unit 304-1 may allocate the software with the oldest allocation time based on the allocation time of each software.
優先度検出部305は、複数のコアのうち、実行優先度が最も高い第1のコアを検出する機能を有する。ここでのコアは、CPUs101を構成しているCPU201−1、CPU201−2、・・・、CPU201−nに相当する。また、マルチコアプロセッサシステム100がASMPであり、リアルタイム処理が割り当てられたCPUが存在するならば、CPUによって第1のコアを検出してもよい。
The
具体的には、たとえば、CPU201−1は、現在割り当てられているソフトウェアの優先度を、優先度テーブル303−1から取得し、優先度が“リアルタイム”の場合に、実行優先度が最も高い第1のコアとする。なお、検出した第1のコアの情報は、キャッシュメモリ202−1、CPU201−1の汎用レジスタなどの記憶領域に記憶される。 Specifically, for example, the CPU 201-1 obtains the priority of the currently assigned software from the priority table 303-1, and when the priority is “real time”, the CPU 20-1 has the highest execution priority. 1 core. The detected first core information is stored in a storage area such as the cache memory 202-1, the general-purpose register of the CPU 201-1.
発行命令効率算出部306は、コアごとに、コアが命令を発行した発行命令数とコアのサイクル数に基づいて、発行命令効率を算出する機能を有する。発行命令数は、所定時間内にCPUが命令を行った数である。発行命令数はCPUの特殊なレジスタである発行命令カウンタIに格納されており、ハイパーバイザは、スーパバイザモードに移行することにより、発行命令カウンタIの値を取得する。サイクル数は、所定時間内にCPUが入力されたクロックの数である。サイクル数はCPUのレジスタであるクロックカウンタCに格納されている。発行命令効率は、1命令にかかったクロック数であり、C/Iにて算出される。発行命令効率算出部306は、発行命令効率をI/Cとして算出し、後述する閾値τも逆数にして比較してもよい。
The issued instruction
具体的には、たとえば、ハイパーバイザ204−1が起動するたびに、CPU201−1は、C/Iを算出する。ハイパーバイザは、数十マイクロ秒〜数ミリ秒に1回の間隔で実行されるため、その時間での発行命令カウンタIとクロックカウンタCを取得し、C/Iを算出する。なお、算出された発行命令効率は、キャッシュメモリ202−1、CPU201−1の汎用レジスタなどの記憶領域に記憶される。 Specifically, for example, every time the hypervisor 204-1 is activated, the CPU 201-1 calculates C / I. Since the hypervisor is executed at intervals of once every several tens of microseconds to several milliseconds, the hypervisor acquires the issued instruction counter I and the clock counter C at that time, and calculates C / I. The calculated issued instruction efficiency is stored in a storage area such as the cache memory 202-1, the general-purpose register of the CPU 201-1.
コンテンション検出部307は、発行命令効率算出部306によって算出された発行命令効率と所定の閾値とに基づいて、アクセス競合を検出する機能を有する。所定の閾値とは、仕様から設定できる値であり、τで表す。閾値τの具体的な設定方法は、図4にて後述する。具体的には、たとえば、発行命令数が閾値τより大きい場合、CPU201−1は、共有メモリ203に対するアクセス競合によるコンテンションが発生していることを検出する。なお、検出された結果は、キャッシュメモリ202−1、CPU201−1の汎用レジスタなどの記憶領域に記憶される。
The
特定部308は、複数のコアのうち、優先度検出部305によって検出された第1のコアのうち、共有メモリ203に対してアクセス競合を発生させた第2のコアを特定する機能を有する。また、特定部308は、共有メモリ203に対してアクセス競合を発生させており第2のコアと競合する第3のコアを特定してもよい。アクセス競合によるコンテンション発生を検出する際にCPU201−1は、コンテンション検出部307によって検出してもよい。
The specifying
具体的には、たとえば、CPU201−1は、優先度検出部305によって“リアルタイム”であるCPUから、コンテンションを発生しているCPUを検出して、第2のコアとして特定する。また、CPU201−1は、複数のCPUからコンテンションを発生しているCPUを検出して、第3のコアとして特定してもよい。なお、特定された第2のコア、または第3のコアの情報は、キャッシュメモリ202−1、CPU201−1の汎用レジスタなどの記憶領域に記憶される。
Specifically, for example, the CPU 201-1 detects the CPU generating contention from the CPUs that are “real time” by the
ハイパーバイザ間メッセージ送信部309は、他のハイパーバイザにメッセージをブロードキャスト送信する機能を有する。具体的には、たとえば、リアルタイム処理を行っており、コンテンション発生を検出したハイパーバイザ204−1は、バス108を通じてハイパーバイザ204−2や、その他のハイパーバイザに対して、メッセージをブロードキャスト送信する。なお、送信したメッセージの内容は、キャッシュメモリ202−1、CPU201−1の汎用レジスタなどの記憶領域に記憶されてもよい。
The hypervisor
ハイパーバイザ間メッセージ受信部310は、他のハイパーバイザが送信したメッセージを受信する機能を有する。具体的には、たとえば、ハイパーバイザ204−2は、リアルタイム処理を行っておりコンテンション発生を検出したハイパーバイザ204−1からメッセージを受信する。なお、受信したメッセージの内容は、キャッシュメモリ202−2、CPU201−2の汎用レジスタなどの記憶領域に記憶される。
The
制御部311は、複数のコアのうち、第1のコアと特定部308によって特定された第2のコアを除いた第3のコアに対し、共有メモリ203にアクセスしないスレッドを実行するように制御する機能を有する。また、制御部311は、第2のコアを除いた第3のコアに対し、共有メモリ203にアクセスしないスレッドを実行するように制御してもよい。また、特定部308によって第3のコアが特定されている場合、制御部311は、特定された第3のコアに対し、共有メモリ203にアクセスしないスレッドを実行するように制御してもよい。
The
また、共有メモリ203にアクセスしないスレッドを実行する期間は、アクセス競合が発生した期間のうち、所定の期間である。所定の期間とは、OS205−2が保持しているタイムスライスの値となる。また、所定の期間は、アクセス競合が発生した期間のうち、第3のコアに割り当てられていたスレッドと、共有メモリ203にアクセスしないスレッドとで、時分割した期間としてもよい。
Further, the period during which a thread that does not access the shared
具体的には、たとえば、特定された第2のコアは、ハイパーバイザ間通信を行うため、メッセージを受信したCPUが第3のコアとなり、共有メモリ203にアクセスしないスレッドを実行するようにOSスケジューラ監視部304−2を制御する。制御内容としては、制御部311は、nice値設定部314か、または、ダミースレッド起動部315を実行するようにOSスケジューラ監視部304−2を制御する。
Specifically, for example, since the specified second core performs inter-hypervisor communication, the CPU that receives the message becomes the third core, and the OS scheduler executes a thread that does not access the shared
nice値設定部314は、現在実行されているソフトウェアのnice値を設定する機能を有する。nice値とは、POSIX(Portable Operating System Interface for UNIX(登録商標))にて定義されているniceコマンドで設定する値である。niceコマンドによって設定値を変更することにより、OS205−2はソフトウェアの実行優先度を制御する。
The nice
具体的には、たとえば、リアルタイム処理を要求されないソフトウェアに対して、nice値を上昇させると、優先度が低くなる。niceコマンドの実装の一例としては、OS205−2は、ソフトウェアの割り当て終了時刻にnice値を加算した値を算出する。次に、OSスケジューラ監視部304−2は、加算した値に基づいて、一番小さい値を持つソフトウェアをディスパッチ対象に決める、という方法をとってもよい。 Specifically, for example, when the nice value is increased for software that does not require real-time processing, the priority is lowered. As an example of implementation of the nice command, the OS 205-2 calculates a value obtained by adding the nice value to the software assignment end time. Next, the OS scheduler monitoring unit 304-2 may take a method of determining the software having the smallest value as a dispatch target based on the added value.
結果、対象のソフトウェアのnice値が大きいほど対象のソフトウェアの優先度が低くなる。したがって、もしOS205−2がPOSIX仕様に準拠していなく、niceコマンドが存在しない場合でも、前述の処理を加えることでnice値設定部314を実現してもよい。なお、設定された値は、RAM103、フラッシュROM104などの記憶領域に記憶される。
As a result, the priority of the target software decreases as the nice value of the target software increases. Therefore, even if the OS 205-2 is not compliant with the POSIX specification and there is no nice command, the nice
ダミースレッド起動部315は、共有メモリ203にアクセスしないスレッドを生成する機能を有する。具体的には、たとえば、CPU201−2は、CPUに対して何も動作しないコードであるnopを一定時間行うスレッドを起動する。また、nice値設定部314とダミースレッド起動部315は、OSスケジューラ監視部304−2によってアクセス競合によるコンテンション発生の期間のうち少なくとも一部の期間中に実行する。
The dummy
図4は、コンテンション状態を示す説明図である。初めに、CPU201−1は、ハイパーバイザ204−1とリアルタイムソフトウェア207を実行しており、CPU201−2は、ハイパーバイザ204−2とソフトウェア208を実行している。それぞれのCPUは、実行中のソフトウェアによってキャッシュメモリにアクセスするか、または、共有メモリ203にアクセスする。
FIG. 4 is an explanatory diagram showing a contention state. First, the CPU 201-1 executes the hypervisor 204-1 and the real-
ハイパーバイザは周期的に起動しており、起動間隔は、数十マイクロ秒から、数ミリ秒である。図4では、どちらのメモリにアクセスしたかという動作に従って、示した時間を、時間401、時間402、時間403に分割して示している。時間401と時間403にて、CPU201−1とCPU201−2は、リアルタイムソフトウェア207と、ソフトウェア208によって同時に共有メモリ203にアクセスしていないため、コンテンション状態とはならない。
The hypervisor is periodically activated, and the activation interval is several tens of microseconds to several milliseconds. In FIG. 4, the time shown is divided into a
しかし、時間402にて、CPU201−1とCPU201−2は、同時に共有メモリ203にアクセスしているため、共有メモリ203に対してアクセス競合によるコンテンション状態となっている。コンテンション状態になると、CPU201−1は、メモリアクセスにかかる時間が数百サイクルとなり、リアルタイムソフトウェア207の処理遅延を発生させてしまう。結果、CPU201−1は、リアルタイムソフトウェア207に求められている時刻までに処理を終了することができない可能性があり、リアルタイム処理の保証を行えない状態となる。
However, since the CPU 201-1 and the CPU 201-2 are accessing the shared
次に、リアルタイム処理の保証について説明する。リアルタイム処理は、決められた時間以内に応答を返す必要があり、その時間を、Δ[秒]とする。ここで、リアルタイム処理を行うCPU201−1のクロックサイクルをclk[1/秒]とする。したがって、時間Δを消費する間に許されるCPU201−1のクロックのカウント数はΔ・clk[個]となる。もしコンテンション状態になっており、CPU201−1がΔ・clk[個]のカウント数で1命令を実行できない場合に、リアルタイム処理の保証を行えないことになる。 Next, guarantee of real-time processing will be described. In real-time processing, it is necessary to return a response within a predetermined time, and this time is set to Δ [seconds]. Here, the clock cycle of the CPU 201-1 that performs real-time processing is defined as clk [1 / second]. Therefore, the clock count of the CPU 201-1 allowed while consuming the time Δ is Δ · clk [pieces]. If the CPU 201-1 is in a contention state and cannot execute one instruction with a count of Δ · clk [pieces], real-time processing cannot be guaranteed.
1命令あたりのクロック数は、一定時間内での発行命令カウンタIと、クロックカウンタCに基づいて、C/Iを算出することで求められる。ここで、閾値τを、τ=Δ・clkで示す。C/Iが閾値τ以下の場合、CPU201−1は、リアルタイム処理の保証を行える状態であり、C/Iが閾値τより大きい場合、CPU201−1は、リアルタイム処理の保証を行えない状態である。 The number of clocks per instruction can be obtained by calculating C / I based on the issued instruction counter I and the clock counter C within a certain time. Here, the threshold τ is represented by τ = Δ · clk. When C / I is less than or equal to the threshold τ, the CPU 201-1 is in a state where real-time processing can be guaranteed, and when C / I is greater than the threshold τ, the CPU 201-1 is in a state where real-time processing cannot be guaranteed. .
Δやclkは、仕様策定時に決定可能な値であるため、閾値τも仕様策定時に決定可能である。具体的には、たとえば、Δ=2[マイクロ秒]、clk=500[MHz]である場合、τ=1000となる。通常、CPU201−1は、共有メモリ203へのアクセスは数十カウント消費する。しかし、共有メモリ203へのアクセス競合によるコンテンション発生時には、数十〜数百カウント消費し、CPU201−1の動作効率は最大でピーク時の30%にまで低減することがある。
Since Δ and clk are values that can be determined at the time of specification formulation, the threshold τ can also be determined at the time of specification formulation. Specifically, for example, when Δ = 2 [microseconds] and clk = 500 [MHz], τ = 1000. Normally, the CPU 201-1 consumes several tens of counts to access the shared
図5は、コンテンションが解消された状態を示す説明図である。図5も図4と同様に、CPU201−1は、ハイパーバイザ204−1とリアルタイムソフトウェア207を実行しており、CPU201−2は、ハイパーバイザ204−2とソフトウェア208を実行している。図4では、時間402にて、CPU201−1とCPU201−2が同時に共有メモリ203にアクセスし、アクセス競合によるコンテンションが発生していた。
FIG. 5 is an explanatory diagram showing a state in which contention is eliminated. In FIG. 5, as in FIG. 4, the CPU 201-1 executes the hypervisor 204-1 and the real-
しかし、図5での時間402でのCPU201−2は、ソフトウェア208とダミースレッドを交互に実行することにより、アクセス競合によるコンテンションを解消している。結果、CPU201−1は、リアルタイムソフトウェア207に求められている時刻までに処理を終了することができ、リアルタイム処理を保証できる。
However, the CPU 201-2 at
図6は、本実施の形態を適用したマルチコアプロセッサシステム100の性能比を示す説明図である。図6の横軸は、バス108に設定したバッファ段数であり、縦軸は従来例のバッファ段数1を基準とした性能比である。従来例のバッファ段数1と等しい性能の場合、縦軸が1.00にプロットされることになる。本実施の形態にかかるマルチコアプロセッサシステム100に関して、バッファ段数ごとに、従来例との性能比をプロットして曲線で結んだ結果が曲線601である。また、Δ=1[ミリ秒]、clk=600[MHz]である。同様に、従来例にかかるマルチコアプロセッサシステムに関して、バッファ段数ごとに、従来例との性能比をプロットして曲線で結んだ結果が曲線602である。
FIG. 6 is an explanatory diagram showing the performance ratio of the
また、曲線601、曲線602は、従来例のバッファ段数1を基準として、それより性能比がよい場合には領域603に位置し、悪い場合には領域604に位置する。領域603に位置する場合、マルチコアプロセッサシステム100はリアルタイム処理を保証でき、領域604に位置する場合、リアルタイム処理を保証できないことになる。マルチコアプロセッサシステムは、バスのバッファ段数が増えるとバス利用の効率をあげることができるが、リアルタイム処理を保証することが難しくなる。
The
従来例にかかる曲線602は、バッファ段数が5段以上では領域604に位置している。したがって、従来例にかかるマルチコアプロセッサシステムは、バッファ段数が5段以上になると、リアルタイム処理保証を行えない。本実施の形態にかかる曲線601では、バッファ段数が13段となるまで領域603に位置している。したがって、本実施の形態にかかるマルチコアプロセッサシステム100は、バッファ段数が13段まで、リアルタイム処理を保証することができる。
A
図7は、優先度テーブル303−1の記憶内容の一例を示す説明図である。優先度テーブル303−1は、処理名称フィールドと、実行優先度フィールドで構成する。なお、優先度テーブル303−2も同様のデータが設定されている。処理名称フィールドは、具体的な処理の内容を記述している。実際には、処理内容を記述したプログラムがROM102、RAM103、フラッシュROM104のいずれかに存在し、CPU201−1は、プログラムをロードし、スレッドとして実行する。実行優先度フィールドは、対応する処理名称の実行する際の優先度を設定している。
FIG. 7 is an explanatory diagram showing an example of the stored contents of the priority table 303-1. The priority table 303-1 includes a process name field and an execution priority field. Similar data is set in the priority table 303-2. The process name field describes specific processing contents. Actually, a program describing the processing contents exists in any of the
たとえば、“通信パケット受信”処理は、一定時間内にパケット処理を行わないと、タイムアウトになるため、リアルタイム処理を保証する必要がある。したがって、実行優先度フィールドは、“リアルタイム”となる。続けて、“描画レンダリング”処理は、通常の処理であって、リアルタイム処理を保証する必要がない。したがって、実行優先度フィールドは、“通常”となる。同様に、“UI入力”処理は、仕様によりユーザに対する応答時間を決められている場合、リアルタイム処理を保証する必要がある。“辞書の先読み検索”処理は、リアルタイム処理を保証する必要がない。 For example, the “communication packet reception” process times out if packet processing is not performed within a certain period of time, so real-time processing must be guaranteed. Therefore, the execution priority field is “real time”. Subsequently, the “drawing rendering” process is a normal process, and it is not necessary to guarantee real-time processing. Therefore, the execution priority field is “normal”. Similarly, the “UI input” process needs to guarantee real-time processing when the response time for the user is determined by the specification. “Dictionary look-ahead search” processing does not require real-time processing.
コンテンションが起こる状態として、たとえば、マルチコアプロセッサシステム100が、Webブラウジング処理を行っている状態を想定する。前述の状態でCPU201−1は、通信パケット受信処理を実行しており、CPU201−2は、描画レンダリング処理を実行している。描画レンダリング処理は、メモリアクセスが多く、通信パケット受信処理と共有メモリ203に対するアクセス競合を起こす可能性が高い。
As a state in which contention occurs, for example, a state in which the
本実施の形態を適用した状態では、前述の状態のようにアクセス競合によるコンテンションが発生した際に、CPU201−2が、OS205−2によって描画レンダリング処理のnice値を上昇させる。OS205−2は、nice値を上昇させた描画レンダリング処理をよりまばらになるようにCPU201−2に割り当てる。結果、マルチコアプロセッサシステム100は、アクセス競合によるコンテンションを回避でき、描画レンダリング処理のリアルタイム処理を保証できる。
In the state where the present embodiment is applied, when contention due to access competition occurs as in the above-described state, the CPU 201-2 increases the nice value of the rendering rendering process by the OS 205-2. The OS 205-2 assigns the rendering rendering process in which the nice value is increased to the CPU 201-2 so as to be more sparse. As a result, the
また別のコンテンション状態として、たとえば、マルチコアプロセッサシステム100が、ユーザからの文字入力を受け付けている状態を想定する。前述の状態で、CPU201−1は、UI入力処理を実行しており、CPU201−2は、辞書の先読み検索処理を実行している。辞書の先読み検索処理は、I/Oアクセスが多く、通信パケット受信処理と共有メモリ203に対するアクセス競合を起こす可能性が高い。
As another contention state, for example, a state is assumed in which the
本実施の形態を適用した状態では、前述の状態のようにアクセス競合によるコンテンションが発生した際に、CPU201−2が、OS205−2によって辞書の先読み検索処理のnice値を上昇させる。OS205−2は、nice値を上昇させた辞書の先読み検索処理をよりまばらになるようにCPU201−2に割り当てる。結果、マルチコアプロセッサシステム100は、アクセス競合によるコンテンションを回避でき、UI入力処理のリアルタイム処理を保証できる。
In a state where the present embodiment is applied, when contention due to access competition occurs as in the above-described state, the CPU 201-2 increases the nice value of the dictionary prefetch search processing by the OS 205-2. The OS 205-2 assigns the look-ahead search processing of the dictionary with the nice value increased to the CPU 201-2 so as to be more sparse. As a result, the
図8は、ハイパーバイザによるメッセージ送信処理を示すフローチャートである。メッセージ送信処理は、ハイパーバイザが起動するたびに行われる。CPU201−1は、リアルタイムソフトウェアが実行中かを確認する(ステップS801)。リアルタイムソフトウェアが実行中の場合(ステップS801:Yes)、CPU201−1は、発行命令カウンタIを取得する(ステップS802)。続けて、CPU201−1は、クロックカウンタCを取得する(ステップS803)。取得後、CPU201−1は、コンテンション中かの判断値となるC/I値を算出する(ステップS804)。算出後、CPU201−1は、C/I値と閾値τを比較する(ステップS805)。 FIG. 8 is a flowchart showing message transmission processing by the hypervisor. The message transmission process is performed every time the hypervisor is activated. The CPU 201-1 confirms whether the real-time software is being executed (step S801). When the real-time software is being executed (step S801: Yes), the CPU 201-1 acquires the issue instruction counter I (step S802). Subsequently, the CPU 201-1 acquires the clock counter C (step S803). After the acquisition, the CPU 201-1 calculates a C / I value that is a determination value indicating whether contention is in progress (step S804). After the calculation, the CPU 201-1 compares the C / I value with the threshold value τ (step S805).
C/I値が閾値τより大きい場合(ステップS805:Yes)、コンテンション中となり、CPU201−1は、nice値上昇メッセージを生成する(ステップS806)。このメッセージを受信したCPUは、現在動作中のソフトウェアのnice値を上昇させ、nice値が上昇したソフトウェアは優先度が下がるため、現在動作中のソフトウェアの実行をまばらにすることになる。 When the C / I value is larger than the threshold τ (step S805: Yes), the contention is in progress, and the CPU 201-1 generates a nice value increase message (step S806). The CPU that has received this message increases the nice value of the currently operating software, and the software with the increased nice value has a lower priority, so the execution of the currently operating software is sparse.
生成後、CPU201−1は、ハイパーバイザ間にメッセージをブロードキャスト送信する(ステップS807)。送信後、CPU201−1は、通常のハイパーバイザ処理を実行し(ステップS810)、処理を終了する。C/I値が閾値τ以下の場合(ステップS805:No)、コンテンション中ではないことになり、CPU201−1は、ステップS810の処理を行い、処理を終了する。 After the generation, the CPU 201-1 broadcasts a message between the hypervisors (step S807). After the transmission, the CPU 201-1 executes a normal hypervisor process (step S810) and ends the process. If the C / I value is less than or equal to the threshold value τ (step S805: No), the contention is not in progress, and the CPU 201-1 performs the process of step S810 and ends the process.
リアルタイムソフトウェアが実行中でない場合(ステップS801:No)、CPU201−1は、続けて、実行中のソフトウェアのnice値が初期値かを確認する(ステップS808)。初期値でない場合(ステップS808:No)、CPU201−1は、実行中のソフトウェアのnice値を初期値に設定し(ステップS809)、ステップS810の処理に移行する。nice値が初期値の場合(ステップS808:Yes)、CPU201−1は、ステップS810の処理に移行する。 When the real-time software is not being executed (step S801: No), the CPU 201-1 subsequently checks whether the nice value of the software being executed is an initial value (step S808). If it is not the initial value (step S808: No), the CPU 201-1 sets the nice value of the software being executed to the initial value (step S809), and proceeds to the process of step S810. When the nice value is the initial value (step S808: Yes), the CPU 201-1 proceeds to the process of step S810.
nice値が初期値でない場合、CPU201−1で実行していた処理がコンテンションの原因だったことを示しており、CPU201−1は、ステップS809の処理にて、コンテンション回避のために低下していた処理を元に戻すことができる。コンテンションを解決する場合、コンテンションの原因となっている処理を、OSのスケジューラが切り替え可能とする最小単位の時間で休止することで、コンテンションの解決を得られるケースが多い。もし、最小単位の時間で解決しないことが多い場合、CPU201−1は、ステップS808:Noの後にC/I値を算出し、閾値τと比較してコンテンションが解決したことを確認した後にステップS809の処理を実行してもよい。 If the nice value is not the initial value, it indicates that the process executed by the CPU 201-1 was the cause of contention, and the CPU 201-1 decreased in order to avoid contention in the process of step S809. The processing that had been performed can be restored. When resolving contention, it is often possible to obtain contention resolution by suspending the process that causes contention for the minimum unit time that can be switched by the scheduler of the OS. If there is often no resolution in the minimum unit time, the CPU 201-1 calculates the C / I value after step S808: No, and compares it with the threshold τ to confirm that the contention has been resolved. The process of S809 may be executed.
図9は、ハイパーバイザによるメッセージ受信処理を示すフローチャートである。CPU201−2は、ハイパーバイザ間のメッセージを受信する(ステップS901)。本実施の形態では、CPU201−1が送信したメッセージを受信する。次に、CPU201−2は、自身のCPUがメッセージをブロードキャストしたかを確認する(ステップS902)。 FIG. 9 is a flowchart showing message reception processing by the hypervisor. The CPU 201-2 receives a message between hypervisors (step S901). In the present embodiment, the message transmitted by CPU 201-1 is received. Next, the CPU 201-2 confirms whether its own CPU broadcasts a message (step S902).
ブロードキャストしている場合(ステップS902:Yes)、リアルタイム処理中でコンテンション中であり、スレッドの制御を行わないため、CPU201−2は、処理を終了する。ブロードキャストしていない場合(ステップS902:No)、コンテンションの原因となるので、CPU201−2は、共有メモリ203にアクセスしない処理を実行する。
When broadcasting (step S902: Yes), the CPU 201-2 ends the processing because the real-time processing is in contention and the thread is not controlled. When not broadcasting (step S902: No), it causes contention, so the CPU 201-2 executes a process of not accessing the shared
たとえば、CPU201−2は、現在動作中のソフトウェアのnice値を上昇させるようにOS205−2に指示する(ステップS903)。もし、nice値の機能を持っていないOSの場合、CPU201−2は、OS205−2に対してダミースレッドを起動させるよう指示してもよい。 For example, the CPU 201-2 instructs the OS 205-2 to increase the nice value of the currently operating software (step S903). If the OS does not have a nice value function, the CPU 201-2 may instruct the OS 205-2 to activate a dummy thread.
また、CPU201−2は、ステップS902:Noにて、リアルタイムソフトが動作していない場合、C/I値を算出し、C/I値と閾値τを比較しコンテンション中であった場合に、スレッドの制御を行ってもよい。この場合、C/I値の比較の分だけ処理が増加するが、コンテンションが発生しているCPUだけを対象にすることができる。 Further, when the real-time software is not operating in step S902: No, the CPU 201-2 calculates the C / I value, compares the C / I value with the threshold value τ, and is in contention. You may control the thread. In this case, the processing increases by the comparison of the C / I values, but only the CPU in which contention occurs can be targeted.
また、本実施の形態では、CPU201−1は、メッセージ送信処理にて優先度をリアルタイム実行か否かという2段階で分けたうえでコンテンションのチェックをしたが、優先度を3段階以上に分けてコンテンションのチェックをしてもよい。 In the present embodiment, the CPU 201-1 checks the contention after dividing the priority in two stages of whether or not the real-time execution is performed in the message transmission process. However, the priority is divided into three or more stages. You may check contention.
その場合の処理を行う例として、CPU201−1は、優先度テーブル303−1の実行優先度フィールドの取りうる値を3段階以上にする。たとえば、“UI入力”処理の実行優先度が“リアルタイム”と“通常”の間である“高優先”であり、“辞書の先読み検索”処理の実行優先度が“通常”の下である“低優先”とする。さらに、メッセージ送信処理では、ステップS801の処理にて、「リアルタイムソフトウェアが実行中か?」を「低優先以外の優先度を持つソフトウェアが実行中か?」に置き換える。さらに、ステップS806の処理にて、メッセージの内容に、現在動作中のソフトウェアの優先度を付与する。 As an example of performing the processing in that case, the CPU 201-1 sets the possible values of the execution priority field of the priority table 303-1 to three or more levels. For example, the execution priority of the “UI input” process is “high priority” between “real time” and “normal”, and the execution priority of the “dictionary look-ahead search” process is below “normal”. “Low priority”. Further, in the message transmission process, “Is real-time software being executed?” Is replaced with “Is software having a priority other than low priority being executed?” In step S801. Further, in the process of step S806, the priority of the currently operating software is given to the message content.
続けて、メッセージ受信処理では、ステップS902:Noの処理の後とステップS903の処理の間に新たな条件として、「受信したメッセージの優先度が現在動作中のソフトウェアの優先度より高いか?」を付け加える。条件がYesの場合、実行主体となるCPUは、ステップS903の処理を行い、Noの場合には、ステップS903の処理を行わず処理を終了する。 Subsequently, in the message reception process, a new condition between the process after step S902: No and the process at step S903 is "Are the received message priority higher than the priority of the currently operating software?" Add. If the condition is Yes, the CPU that is the execution subject performs the process of Step S903, and if No, the process ends without performing the process of Step S903.
前述した処理の状態にて、たとえば、図7にて前述した高優先であるUI入力処理を実行しているCPUは、ステップS801にてYesとなり、ステップS807の処理にて他のコアにメッセージをブロードキャスト送信する。前述のメッセージを通常の優先度である描画レンダリングを実行しているCPUが受信した場合、「受信したメッセージの優先度が現在動作中のソフトウェアの優先度より高いか?」が、Yesとなり、ステップS903の処理を行い、nice値の制御を行う。 In the processing state described above, for example, the CPU executing the high-priority UI input processing described above with reference to FIG. 7 becomes Yes in step S801, and sends a message to other cores in the processing in step S807. Broadcast transmission. If the CPU executing the rendering rendering, which is the normal priority, receives the above message, “Yes, is the priority of the received message higher than the priority of the currently operating software?”, Step The process of S903 is performed to control the nice value.
もし、前述のメッセージをリアルタイム処理が要求される通信パケットを実行しているCPUが受信した場合、「受信したメッセージの優先度が現在動作中のソフトウェアの優先度より高いか?」が、Noとなるため、nice値の制御を行わない。このように、メッセージ送信処理を行うCPUは、優先度を3段階以上に分けてコンテンションのチェックを行い、メッセージ受信処理を行うCPUは、優先度の判断を加えることで、優先度の低い処理を行っているCPUの処理をまばらにする。これにより、マルチコアプロセッサシステム100は、優先度の高い処理を先に処理することができる。
If the CPU executing the communication packet for which real-time processing is required is received for the above-described message, “No. Is the priority of the received message higher than the priority of the currently operating software?” Therefore, the nice value is not controlled. In this way, the CPU that performs message transmission processing divides the priority into three or more stages and checks the contention, and the CPU that performs message reception processing adds priority determination, thereby lowering the priority processing. Sparse CPU processing. Thereby, the
また、前述の実行優先度が3段階以上の処理の場合でステップS903を実行する際に、受信したメッセージの優先度と現在動作中のソフトウェアの優先度に基づいて、nice値の上昇させる値を設定してもよい。たとえば、受信したメッセージの優先度がリアルタイムであり、現在動作中のソフトウェアの優先度が通常であった場合、優先度が2段階離れているため、nice値を2上昇させる、という処理を行ってもよい。このように、ハイパーバイザ204−2によってnice値を段階的に制御することで、OS205−2は、優先度の低い処理ほど、よりまばらに実行することになり、CPU201−1に割り当てられているリアルタイム処理を先に処理することができる。 Further, when executing step S903 in the case of the above-described processing with three or more execution priorities, a value for increasing the nice value is set based on the priority of the received message and the priority of the currently operating software. It may be set. For example, if the priority of the received message is real-time and the priority of the currently operating software is normal, the priority is two steps away, so that the nice value is increased by two. Also good. In this way, by controlling the nice value in stages by the hypervisor 204-2, the OS 205-2 executes the processing with lower priority more sparsely and is assigned to the CPU 201-1. Real-time processing can be processed first.
また、実行優先度が2段階の状態においても、nice値の上昇させる値を2段階以上あげる処理を追加してもよい。具体的には、たとえば、CPU201−2が、メッセージ受信処理を受けてnice値を1上昇させた後に、nice値を初期値に戻す前に、メッセージ受信した場合である。この場合、nice値を上昇させたにもかかわらず、まだコンテンション状態であることを意味しているため、CPU201−2はさらにnice値を1上昇させるように設定することで、コンテンション状態がより解消しやすくなる。 Further, even when the execution priority is in a two-stage state, a process for increasing the value of the nice value by two or more stages may be added. Specifically, for example, the CPU 201-2 has received a message after receiving the message reception process and increasing the nice value by 1, but before returning the nice value to the initial value. In this case, since it means that the nice value is still increased even though the nice value is increased, the CPU 201-2 sets the nice value to be increased by 1 so that the contention state is increased. It becomes easier to eliminate.
以上説明したように、マルチコアプロセッサシステム、スレッド制御方法、およびスレッド制御プログラムによれば、リアルタイム処理でコンテンション中のCPUを特定する。そして、リアルタイム処理中のCPUと特定されたCPUを除いたすべてのCPUが、共有メモリにアクセスしないスレッドを実行するよう制御する。これにより、マルチコアプロセッサシステムは、リアルタイム処理を保証できる。 As described above, according to the multi-core processor system, the thread control method, and the thread control program, the CPU in contention is specified by real-time processing. Then, control is performed so that all CPUs except for the CPU identified as the CPU in real-time processing execute a thread that does not access the shared memory. Thereby, the multi-core processor system can guarantee real-time processing.
また、マルチコアプロセッサシステムは、特定されたCPUを除いたすべてのCPUに対し、共有メモリにアクセスしないスレッドを実行してもよい。これにより、特定されたCPUから、特定されたCPUを除いたすべてのCPUに対して制御依頼をする際に、競合している相手を探さず、自身のCPU以外のすべてのCPUに制御依頼を行うことで検索処理を行わないため、処理を簡略化できる。 Further, the multi-core processor system may execute a thread that does not access the shared memory for all the CPUs except the specified CPU. As a result, when a control request is made from the specified CPU to all CPUs except the specified CPU, the control request is sent to all CPUs other than the own CPU without searching for a competing partner. Since the search process is not performed, the process can be simplified.
また、マルチコアプロセッサシステムは、複数のCPUのうち、コンテンション中のCPUを特定し、特定されたCPUが、共有メモリにアクセスしないスレッドを実行するよう制御してもよい。これにより、マルチコアプロセッサシステムは、コンテンションを起こしたCPUのみスレッドを制御させ、コンテンションを起こしていないCPUに対しては、通常処理を続けさせることができる。 In addition, the multi-core processor system may specify a CPU in contention among a plurality of CPUs, and control the specified CPU to execute a thread that does not access the shared memory. As a result, the multi-core processor system can control the thread only for the CPU that has caused contention, and can continue normal processing for the CPU that has not caused contention.
また、マルチコアプロセッサシステムは、コンテンションが発生した期間のうち、スレッドを制御するCPUに対して、制御するCPUに割り当てられていたスレッドの実行時間と、メモリにアクセスしないスレッドの時間を、時分割で分割して割り当ててもよい。これにより、マルチコアプロセッサシステムは、コンテンションを解消し、また、制御するCPUに割り当てられていたスレッドの処理も行うことができる。 Also, the multi-core processor system time-divides the execution time of the thread assigned to the controlling CPU and the time of the thread not accessing the memory with respect to the CPU controlling the thread during the contention generation period. You may divide and allocate by. As a result, the multi-core processor system can eliminate contention and can also perform processing of threads assigned to the controlling CPU.
また、マルチコアプロセッサシステムは、CPUごとに、CPUの命令を発行した発行命令数とCPUのサイクル数とに基づいて、発行命令効率を算出し、算出された発行命令効率と所定の閾値τに基づいて、コンテンションを検出してもよい。これにより、マルチコアプロセッサシステムは、アクセス競合によるコンテンションを検出することができ、リアルタイム処理を保証できる。 In addition, the multi-core processor system calculates, for each CPU, the issued instruction efficiency based on the number of issued instructions issued by the CPU and the number of cycles of the CPU, and based on the calculated issued instruction efficiency and a predetermined threshold τ. Contention may be detected. As a result, the multi-core processor system can detect contention due to access contention and guarantee real-time processing.
また、マルチコアプロセッサシステムは、CPUに割り当てられたスレッドの実行優先度が最も高いコアを検出してもよい。これにより、マルチコアプロセッサシステムは、リアルタイム処理の保証を必要とするスレッドを決めておくことで、そのスレッドがどのCPUに割り当てられていても、コンテンションを解消しリアルタイム処理の保証を行うことができる。 Further, the multi-core processor system may detect the core having the highest execution priority of the thread assigned to the CPU. As a result, the multi-core processor system can determine the thread that needs to guarantee real-time processing, and can eliminate contention and guarantee real-time processing regardless of which CPU the thread is assigned to. .
なお、本実施の形態で説明したスレッド制御方法は、予め用意されたプログラムをコンピュータで実行することにより実現することができる。本スレッド制御プログラムは、ハードディスク、フレキシブルディスク、CD−ROM、MO、DVD等のコンピュータで読み取り可能な記録媒体に記録され、コンピュータによって記録媒体から読み出されることによって実行される。また本スレッド制御プログラムは、インターネット等のネットワークを介して配布してもよい。 The thread control method described in the present embodiment can be realized by executing a program prepared in advance on a computer. The thread control 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 thread control program may be distributed via a network such as the Internet.
201−1 CPU
201−2 CPU
301−1 領域
301−2 領域
302−1 領域
302−2 領域
303−1 優先度テーブル
303−2 優先度テーブル
304−1 OSスケジューラ監視部
304−2 OSスケジューラ監視部
305 優先度検出部
306 発行命令効率算出部
307 コンテンション検出部
308 特定部
309 ハイパーバイザ間メッセージ送信部
310 ハイパーバイザ間メッセージ受信部
311 制御部
312 ソフトウェア
313 ソフトウェア
314 nice値設定部
315 ダミースレッド起動部201-1 CPU
201-2 CPU
301-1 Area 301-2 Area 302-1 Area 302-2 Area 303-1 Priority Table 303-2 Priority Table 304-1 OS Scheduler Monitoring Unit 304-2 OS
Claims (8)
前記複数のコアのうち、実行優先度が最も高い第1のコアを検出する検出手段と、
前記コアごとに、当該コアのサイクル数を当該コアが命令を発行した発行命令数で除することにより、1命令にかかったサイクル数を表す発行命令効率を算出する算出手段と、
前記コアごとに、前記算出手段によって算出された発行命令効率と所定の閾値との比較結果に基づいて、前記メモリに対するアクセス競合を検出する競合検出手段と、
前記検出手段によって検出された第1のコアのうち、前記競合検出手段によって前記アクセス競合が検出された第2のコアを特定する特定手段と、
前記複数のコアのうち、前記第1のコアと前記特定手段によって特定された第2のコアとを除いた第3のコアに対し、前記メモリにアクセスしないスレッドを、前記アクセス競合が発生した期間のうち、所定の期間実行するように制御する制御手段と、
を備えることを特徴とするマルチコアプロセッサシステム。 A multi-core processor system comprising a plurality of cores and a memory accessible from the plurality of cores,
Detecting means for detecting a first core having the highest execution priority among the plurality of cores;
For each core, a calculation means for calculating the issue instruction efficiency representing the number of cycles taken for one instruction by dividing the number of cycles of the core by the number of issue instructions issued by the core;
For each of the cores, contention detection means for detecting access contention to the memory based on a comparison result between the issued instruction efficiency calculated by the calculation means and a predetermined threshold value;
Among the first cores detected by the detection means, a specifying means for specifying the second core in which the access conflict is detected by the conflict detection means ;
A period in which the access contention occurs for a thread that does not access the memory with respect to a third core of the plurality of cores excluding the first core and the second core specified by the specifying unit. Control means for performing control for a predetermined period of time,
A multi-core processor system comprising:
前記複数のコアのうち、前記特定手段によって特定された第2のコアを除いた第3のコアに対し、前記メモリにアクセスしないスレッドを、前記アクセス競合が発生した期間のうち、所定の期間実行するように制御することを特徴とする請求項1に記載のマルチコアプロセッサシステム。 The control means includes
A thread that does not access the memory is executed for a predetermined period of a period in which the access contention occurs with respect to a third core of the plurality of cores excluding the second core specified by the specifying unit. The multi-core processor system according to claim 1, wherein control is performed to
前記複数のコアのうち、前記メモリに対してアクセス競合を発生させており前記第2のコアと競合する第3のコアを特定し、
前記制御手段は、
前記特定手段によって特定された第3のコアに対し、前記メモリにアクセスしないスレッドを、前記アクセス競合が発生した期間のうち、所定の期間実行するように制御することを特徴とする請求項1に記載のマルチコアプロセッサシステム。 The specifying means is:
A third core that generates an access conflict with the memory and competes with the second core among the plurality of cores;
The control means includes
The control unit according to claim 1, wherein a thread that does not access the memory is controlled to be executed for a predetermined period of a period in which the access contention occurs with respect to the third core specified by the specifying unit. The described multi-core processor system.
前記複数のコアのうち、当該コアに割り当てられたスレッドの実行優先度が最も高い第1のコアを検出することを特徴とする請求項1〜4のいずれか一つに記載のマルチコアプロセッサシステム。The multi-core processor system according to any one of claims 1 to 4, wherein a first core having the highest execution priority of a thread assigned to the core is detected from the plurality of cores.
前記コアごとに、前記算出手段によって算出された発行命令効率と、リアルタイム保証が行える時間間隔およびコアの単位時間当たりのクロックサイクル数の積により求められた所定の閾値と、の比較結果に基づいて、前記メモリに対するアクセス競合を検出することを特徴とする請求項1〜5のいずれか一つに記載のマルチコアプロセッサシステム。For each core, based on a comparison result between the issued instruction efficiency calculated by the calculating means and a predetermined threshold obtained by the product of the time interval at which real-time guarantee can be performed and the number of clock cycles per unit time of the core 6. The multi-core processor system according to claim 1, wherein an access contention with respect to the memory is detected.
前記検出手段により、前記複数のコアのうち、実行優先度が最も高い第1のコアを検出する検出工程と、
前記算出手段により、前記コアごとに、当該コアのサイクル数を当該コアが命令を発行した発行命令数で除することにより、1命令にかかったサイクル数を表す発行命令効率を算出する算出工程と、
前記競合検出手段により、前記コアごとに、前記算出工程によって算出された発行命令効率と所定の閾値との比較結果に基づいて、前記メモリに対するアクセス競合を検出する競合検出工程と、
前記特定手段により、前記検出工程によって検出された第1のコアのうち、前記競合検出工程によって前記アクセス競合が検出された第2のコアを特定する特定工程と、
前記制御手段により、前記複数のコアのうち、前記第1のコアと前記特定工程によって特定された第2のコアとを除いた第3のコアに対し、前記メモリにアクセスしないスレッドを、前記アクセス競合が発生した期間のうち、所定の期間実行するように制御指示する制御指示工程と、
を実行することを特徴とするスレッド制御方法。 The core of the multi-core processor system comprising a plurality of cores, a memory accessible from the plurality of cores , a detection unit, a calculation unit, a conflict detection unit, a specifying unit, and a control unit,
A detecting step of detecting a first core having the highest execution priority among the plurality of cores by the detecting means;
A calculating step of calculating, for each core, the issued instruction efficiency representing the number of cycles taken by one instruction by dividing the number of cycles of the core by the number of issued instructions issued by the core; ,
A contention detection step of detecting access contention to the memory based on a comparison result between the issued instruction efficiency calculated by the calculation step and a predetermined threshold for each core by the contention detection unit;
A specifying step of specifying the second core in which the access conflict is detected by the conflict detection step among the first cores detected by the detection step by the specifying unit ;
A thread that does not access the memory is accessed by the control means with respect to a third core of the plurality of cores excluding the first core and the second core specified by the specifying step. A control instruction step for instructing control to be executed for a predetermined period of time during which competition has occurred;
A thread control method characterized by executing
前記複数のコアのうち、実行優先度が最も高い第1のコアを検出する検出手段、
前記コアごとに、当該コアのサイクル数を当該コアが命令を発行した発行命令数で除することにより、1命令にかかったサイクル数を表す発行命令効率を算出する算出手段、
前記コアごとに、前記算出手段によって算出された発行命令効率と所定の閾値との比較結果に基づいて、前記メモリに対するアクセス競合を検出する競合検出手段、
前記検出手段によって検出された第1のコアのうち、前記競合検出手段によって前記アクセス競合が検出された第2のコアを特定する特定手段、
前記複数のコアのうち、前記第1のコアと前記特定手段によって特定された第2のコアとを除いた第3のコアに対し、前記メモリにアクセスしないスレッドを、前記アクセス競合が発生した期間のうち、所定の期間実行するように制御指示する制御指示手段、
として機能させることを特徴とするスレッド制御プログラム。 The core of a multi-core processor system comprising a plurality of cores and a memory accessible from the plurality of cores,
Detecting means for detecting a first core having the highest execution priority among the plurality of cores;
For each core, a calculating means for calculating the issue instruction efficiency representing the number of cycles taken for one instruction by dividing the number of cycles of the core by the number of issued instructions issued by the core.
Conflict detection means for detecting access contention to the memory based on a comparison result between the issued instruction efficiency calculated by the calculation means and a predetermined threshold for each core.
A specifying unit for specifying a second core in which the access conflict is detected by the conflict detection unit among the first cores detected by the detection unit;
A period in which the access contention occurs for a thread that does not access the memory with respect to a third core of the plurality of cores excluding the first core and the second core specified by the specifying unit. Control instruction means for instructing control to be executed for a predetermined period of time,
Thread control program characterized by functioning as
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2010/052792 WO2011104823A1 (en) | 2010-02-23 | 2010-02-23 | Multi-core processor system, thread control method, and thread control program |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2013231580A Division JP5601414B2 (en) | 2013-11-07 | 2013-11-07 | Multi-core processor system, control method, and control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2011104823A1 JPWO2011104823A1 (en) | 2013-06-17 |
JP5408330B2 true JP5408330B2 (en) | 2014-02-05 |
Family
ID=44506270
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012501562A Expired - Fee Related JP5408330B2 (en) | 2010-02-23 | 2010-02-23 | Multi-core processor system, thread control method, and thread control program |
Country Status (3)
Country | Link |
---|---|
US (2) | US9311142B2 (en) |
JP (1) | JP5408330B2 (en) |
WO (1) | WO2011104823A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9667747B2 (en) | 2012-12-21 | 2017-05-30 | Akamai Technologies, Inc. | Scalable content delivery network request handling mechanism with support for dynamically-obtained content policies |
US9654579B2 (en) | 2012-12-21 | 2017-05-16 | Akamai Technologies, Inc. | Scalable content delivery network request handling mechanism |
JP6428557B2 (en) * | 2015-10-09 | 2018-11-28 | 株式会社デンソー | Parallelization method, parallelization tool |
US10585800B2 (en) | 2017-06-16 | 2020-03-10 | International Business Machines Corporation | Reducing cache transfer overhead in a system |
FR3075412B1 (en) * | 2017-12-20 | 2020-01-10 | Thales | METHOD AND SYSTEM FOR SOFTWARE TASK SCHEDULING CONTROL |
US10831492B2 (en) | 2018-07-05 | 2020-11-10 | International Business Machines Corporation | Most favored branch issue |
US11263114B2 (en) * | 2019-09-24 | 2022-03-01 | International Business Machines Corporation | Method and technique to find timing window problems |
US11321123B2 (en) * | 2019-11-21 | 2022-05-03 | International Business Machines Corporation | Determining an optimum number of threads to make available per core in a multi-core processor complex to executive tasks |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05225149A (en) * | 1992-02-13 | 1993-09-03 | Toshiba Corp | Lock system |
JPH1115793A (en) * | 1997-05-28 | 1999-01-22 | Internatl Business Mach Corp <Ibm> | Protection method for resource maintainability |
JP2001084235A (en) * | 1999-09-10 | 2001-03-30 | Nec Corp | Exclusive control method using lock particle size satistical information and computer-readable recording medium with program recorded therein |
JP2003030042A (en) * | 2001-07-11 | 2003-01-31 | Fujitsu Ten Ltd | Microcomputer with cores |
JP2008269578A (en) * | 2007-03-27 | 2008-11-06 | Nec Corp | Conflict partial processing detecting method, device and computer program |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5202991A (en) * | 1988-04-14 | 1993-04-13 | Digital Equipment Corporation | Reducing the effect processor blocking |
JPH09330237A (en) | 1996-06-07 | 1997-12-22 | Toshiba Corp | Device and method for switching process |
US7093109B1 (en) * | 2000-04-04 | 2006-08-15 | International Business Machines Corporation | Network processor which makes thread execution control decisions based on latency event lengths |
JP4394298B2 (en) * | 2001-02-20 | 2010-01-06 | 日本電気株式会社 | Multiprocessor system, shared memory control method thereof, and shared memory control program |
US7441242B2 (en) * | 2004-04-22 | 2008-10-21 | International Business Machines Corporation | Monitoring performance of a logically-partitioned computer |
US7401206B2 (en) * | 2004-06-30 | 2008-07-15 | Sun Microsystems, Inc. | Apparatus and method for fine-grained multithreading in a multipipelined processor core |
US20060036810A1 (en) * | 2004-08-12 | 2006-02-16 | International Business Machines Corporation | System, application and method of reducing cache thrashing in a multi-processor with a shared cache on which a disruptive process is executing |
US20060112208A1 (en) * | 2004-11-22 | 2006-05-25 | International Business Machines Corporation | Interrupt thresholding for SMT and multi processor systems |
JP2007241918A (en) * | 2006-03-13 | 2007-09-20 | Fujitsu Ltd | Processor device |
US8345053B2 (en) * | 2006-09-21 | 2013-01-01 | Qualcomm Incorporated | Graphics processors with parallel scheduling and execution of threads |
US9081605B2 (en) | 2007-03-27 | 2015-07-14 | Nec Corporation | Conflicting sub-process identification method, apparatus and computer program |
US8886918B2 (en) * | 2007-11-28 | 2014-11-11 | International Business Machines Corporation | Dynamic instruction execution based on transaction priority tagging |
US8544006B2 (en) * | 2007-12-19 | 2013-09-24 | International Business Machines Corporation | Resolving conflicts by restarting execution of failed discretely executable subcomponent using register and memory values generated by main component after the occurrence of a conflict |
GB2458487B (en) * | 2008-03-19 | 2011-01-19 | Imagination Tech Ltd | Pipeline processors |
US9244732B2 (en) * | 2009-08-28 | 2016-01-26 | Vmware, Inc. | Compensating threads for microarchitectural resource contentions by prioritizing scheduling and execution |
US8190930B2 (en) * | 2009-03-30 | 2012-05-29 | Intel Corporation | Methods and apparatuses for controlling thread contention |
-
2010
- 2010-02-23 JP JP2012501562A patent/JP5408330B2/en not_active Expired - Fee Related
- 2010-02-23 WO PCT/JP2010/052792 patent/WO2011104823A1/en active Application Filing
-
2012
- 2012-08-08 US US13/569,725 patent/US9311142B2/en not_active Expired - Fee Related
-
2016
- 2016-03-01 US US15/057,383 patent/US20160179429A1/en not_active Abandoned
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05225149A (en) * | 1992-02-13 | 1993-09-03 | Toshiba Corp | Lock system |
JPH1115793A (en) * | 1997-05-28 | 1999-01-22 | Internatl Business Mach Corp <Ibm> | Protection method for resource maintainability |
JP2001084235A (en) * | 1999-09-10 | 2001-03-30 | Nec Corp | Exclusive control method using lock particle size satistical information and computer-readable recording medium with program recorded therein |
JP2003030042A (en) * | 2001-07-11 | 2003-01-31 | Fujitsu Ten Ltd | Microcomputer with cores |
JP2008269578A (en) * | 2007-03-27 | 2008-11-06 | Nec Corp | Conflict partial processing detecting method, device and computer program |
Non-Patent Citations (2)
Title |
---|
CSNG200800760006; 佐々木広ほか: 'CMPの統計的モデリングによる実行時最適化手法' 情報処理学会研究報告 Vol.2008 No.75, 20080805, 31-36頁, 社団法人情報処理学会 * |
JPN6013028822; 佐々木広ほか: 'CMPの統計的モデリングによる実行時最適化手法' 情報処理学会研究報告 Vol.2008 No.75, 20080805, 31-36頁, 社団法人情報処理学会 * |
Also Published As
Publication number | Publication date |
---|---|
US20120304183A1 (en) | 2012-11-29 |
US9311142B2 (en) | 2016-04-12 |
WO2011104823A1 (en) | 2011-09-01 |
US20160179429A1 (en) | 2016-06-23 |
JPWO2011104823A1 (en) | 2013-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5408330B2 (en) | Multi-core processor system, thread control method, and thread control program | |
JP6437579B2 (en) | Intelligent GPU scheduling in virtualized environment | |
JP4702127B2 (en) | Virtual computer system, physical resource reconfiguration method and program thereof | |
US9063783B2 (en) | Coordinating parallel execution of processes using agents | |
US8589939B2 (en) | Composite contention aware task scheduling | |
WO2014015725A1 (en) | Resource scheduling system and method in graphics card virtualization and based on instant feedback of application effect | |
US9189293B2 (en) | Computer, virtualization mechanism, and scheduling method | |
JP5660149B2 (en) | Information processing apparatus, job scheduling method, and job scheduling program | |
US20130125131A1 (en) | Multi-core processor system, thread control method, and computer product | |
JP2009223842A (en) | Virtual machine control program and virtual machine system | |
JP2017534970A (en) | Method, system, and computer program product for executing a plurality of threads, and method, system, and computer program for realizing a waiting state of a plurality of threads | |
WO2010089808A1 (en) | Virtual computer allocation method, allocation program, and information processing device having a virtual computer environment | |
KR101271211B1 (en) | Apparatus and method for input/output processing of multi thread | |
WO2010137092A1 (en) | Multi-operating system control method and processor system | |
JP5601414B2 (en) | Multi-core processor system, control method, and control program | |
US20140053162A1 (en) | Thread processing method and thread processing system | |
JP2011221634A (en) | Computer system, logic section management method and logic division processing program | |
JP5376042B2 (en) | Multi-core processor system, thread switching control method, and thread switching control program | |
JPWO2012101759A1 (en) | Processor processing method and processor system | |
WO2020086265A1 (en) | Timer-based i/o completion polling for low latency storage device | |
JP2008165318A (en) | Computer system | |
US20140089930A1 (en) | Host system | |
JP4878050B2 (en) | Computer and control method | |
JP5582241B2 (en) | Multi-core processor system, multi-core processor system control method, and multi-core processor system control program | |
WO2023225991A1 (en) | Dynamic establishment of polling periods for virtual machine switching operations |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130618 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130819 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20131008 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20131021 |
|
LAPS | Cancellation because of no payment of annual fees |