JP5621896B2 - Multiprocessor system, control program, and control method - Google Patents

Multiprocessor system, control program, and control method Download PDF

Info

Publication number
JP5621896B2
JP5621896B2 JP2013221663A JP2013221663A JP5621896B2 JP 5621896 B2 JP5621896 B2 JP 5621896B2 JP 2013221663 A JP2013221663 A JP 2013221663A JP 2013221663 A JP2013221663 A JP 2013221663A JP 5621896 B2 JP5621896 B2 JP 5621896B2
Authority
JP
Japan
Prior art keywords
access
cpu
task
core
shared memory
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
Application number
JP2013221663A
Other languages
Japanese (ja)
Other versions
JP2014038656A (en
Inventor
康志 栗原
康志 栗原
浩一郎 山下
浩一郎 山下
宏真 山内
宏真 山内
鈴木 貴久
貴久 鈴木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2013221663A priority Critical patent/JP5621896B2/en
Publication of JP2014038656A publication Critical patent/JP2014038656A/en
Application granted granted Critical
Publication of JP5621896B2 publication Critical patent/JP5621896B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements

Description

本発明は、共有資源へのアクセスを制御するマルチプロセッサシステム、制御プログラム、および制御方法に関する。   The present invention relates to a multiprocessor system, a control program, and a control method for controlling access to a shared resource.

従来該実行終了時に大量のメモリアクセスを行うタスクが知られている。たとえば、レンダリングの処理に関するタスクが挙げられる(たとえば、下記特許文献1を参照。)。レンダリング処理とは、たとえば、3次元物体に対してカメラや光源の位置や方向を指定し、光の物理的な性質に基づいて描画を行うことである。   Conventionally, a task for accessing a large amount of memory at the end of execution is known. For example, a task related to rendering processing can be given (for example, see Patent Document 1 below). Rendering is, for example, designating the position and direction of a camera or light source for a three-dimensional object and drawing based on the physical properties of light.

マルチコアプロセッサで共有する共有メモリを有するマルチコアプロセッサシステムにおいては、たとえば、レンダリング処理を複数のタスクに分割して分散処理を行う。また、該マルチコアプロセッサシステムでは、該各タスクの処理終了時に各CPU(Central Processing Unit)のキャッシュに格納している演算結果を共有メモリに書き戻す処理が必要になる。   In a multi-core processor system having a shared memory shared by multi-core processors, for example, a rendering process is divided into a plurality of tasks and distributed processing is performed. In the multi-core processor system, it is necessary to write back the operation result stored in the cache of each CPU (Central Processing Unit) to the shared memory at the end of the processing of each task.

特開2008−130091号公報JP 2008-130091 A

しかしながら、マルチコアプロセッサシステムでは、上述したレンダリング処理の複数のタスクが負荷分散を考慮してタスク量が平均化されるように各CPUに割り当てられる。そのため、各CPUの処理が同時に終了することになるため、該タスクの処理終了時に共有メモリへのアクセスが複数のCPUで競合する。   However, in the multi-core processor system, a plurality of tasks of the rendering process described above are assigned to each CPU so that task amounts are averaged in consideration of load distribution. For this reason, the processing of each CPU ends at the same time. Therefore, when the task processing ends, access to the shared memory competes among a plurality of CPUs.

共有メモリへのアクセスが複数のCPUで同時に発生した場合、どのCPUからのアクセスを許可するかを調停回路が調停する。調停回路は、たとえば、各CPUに順番にアクセス権を与えるラウンドロビン方式を用いて調停している。調停回路が共有メモリへのアクセスを調停することにより、該共有メモリのアクセスが競合した際のメモリアクセス性能はピーク時の30[%]になることもあるため、各CPUの実行性能が低下する問題点があった。メモリアクセス性能とは、各CPUが共有メモリへのアクセスにかかるアクセス時間である。   When access to the shared memory occurs simultaneously in a plurality of CPUs, the arbitration circuit arbitrates which CPU is permitted to access. The arbitration circuit arbitrates, for example, using a round robin method that gives access rights to the CPUs in order. Since the arbitration circuit arbitrates access to the shared memory, the memory access performance when the access to the shared memory competes may be 30 [%] at the peak time, so the execution performance of each CPU is reduced. There was a problem. The memory access performance is an access time required for each CPU to access the shared memory.

本発明は、上述した従来技術による問題点を解消するため、共有メモリへのアクセス時間を減少させることで、CPUの実行性能を向上させることができるマルチプロセッサシステム、制御プログラム、および制御方法を提供することを目的とする。   The present invention provides a multiprocessor system, a control program, and a control method capable of improving the execution performance of the CPU by reducing the access time to the shared memory in order to solve the above-described problems caused by the prior art. The purpose is to do.

本発明の一の観点によれば、複数のコアと、前記複数のコアから共通にアクセスされる共有メモリを有するマルチプロセッサシステムであって、前記複数のコアのうちの第1のコアは、前記第1のコアを除く第2のコアから前記共有メモリへのアクセス量が所定量以上であり、かつ前記第1のコアから前記共有メモリへのアクセスの前処理をしている場合に、前記第1のコアで実行中のタスクを他のタスクに切り替えるマルチプロセッサシステム、制御プログラム、および制御方法が提供される。   According to an aspect of the present invention, there is provided a multiprocessor system having a plurality of cores and a shared memory that is commonly accessed from the plurality of cores, wherein a first core of the plurality of cores includes the first core The access amount from the second core excluding the first core to the shared memory is a predetermined amount or more, and when the preprocessing for accessing the shared memory from the first core is performed, the first Provided are a multiprocessor system, a control program, and a control method for switching a task being executed in one core to another task.

本マルチプロセッサシステム、制御プログラム、および制御方法によれば、共有メモリへのアクセス時間を減少させることで、CPUの実行性能を向上させることができるという効果を奏する。   According to the multiprocessor system, the control program, and the control method, it is possible to improve the execution performance of the CPU by reducing the access time to the shared memory.

本発明の一の例を示す説明図である。It is explanatory drawing which shows one example of this invention. 本発明の他の一例を示す説明図である。It is explanatory drawing which shows another example of this invention. マルチコアプロセッサシステムのハードウェア例を示すブロック図である。It is a block diagram which shows the hardware example of a multi-core processor system. 属性テーブル400の一例を示す説明図である。It is explanatory drawing which shows an example of the attribute table. 大量アクセス開始情報500の一例を示す説明図である。It is explanatory drawing which shows an example of the mass access start information. マルチコアプロセッサシステム300の機能ブロック図である。2 is a functional block diagram of a multi-core processor system 300. FIG. タスク2がCPU#0にディスパッチされる例を示す説明図である。It is explanatory drawing which shows the example in which the task 2 is dispatched to CPU # 0. タスク5がCPU#1にディスパッチされる例を示す説明図である。It is explanatory drawing which shows the example in which the task 5 is dispatched to CPU # 1. タスク7がCPU#2にディスパッチされる例を示す説明図である。It is explanatory drawing which shows the example in which the task 7 is dispatched to CPU # 2. CPU#0が大量アクセスを開始する例を示す説明図である。It is explanatory drawing which shows the example which CPU # 0 starts mass access. CPU#1での大量アクセスの検出例を示す説明図である。It is explanatory drawing which shows the example of a detection of mass access in CPU # 1. CPU#1でタスクディスパッチを行う例を示す説明図である。It is explanatory drawing which shows the example which performs task dispatch by CPU # 1. スケジューラ351による制御処理手順の一例を示すフローチャート(その1)である。7 is a flowchart (part 1) illustrating an example of a control processing procedure by a scheduler 351. スケジューラ351による制御処理手順の一例を示すフローチャート(その2)である。12 is a flowchart (part 2) illustrating an example of a control processing procedure by the scheduler 351. 属性チェンジャー371による制御処理手順の一例を示すフローチャートである。It is a flowchart which shows an example of the control processing procedure by the attribute changer 371.

以下に添付図面を参照して、本発明にかかるマルチプロセッサシステム、制御プログラム、および制御方法の好適な実施の形態を詳細に説明する。   Exemplary embodiments of a multiprocessor system, a control program, and a control method according to the present invention will be explained below in detail with reference to the accompanying drawings.

図1は、本発明の一の例を示す説明図である。一のCPUではタスクAが実行中であり、他のCPUではタスクBが実行中である。他のCPUのレディーキュー121にはタスクCが積まれている。レディーキュー121は、周知のように他のCPUに割り当てられたタスクのうち、実行可能状態であるタスクを管理するために該タスクのコンテキスト情報を保持する。他のCPUは、レディーキュー121に登録されているタスクのコンテキスト情報を取り出すことで、該取り出したタスクを実行することができる。コンテキスト情報はプログラムの内部状態やプログラムがメモリ上のどこに配置されたかを示す情報である。   FIG. 1 is an explanatory diagram showing an example of the present invention. Task A is being executed in one CPU, and task B is being executed in the other CPU. Task C is loaded on the ready queue 121 of another CPU. As is well known, the ready queue 121 holds context information of a task in order to manage a task in an executable state among tasks assigned to other CPUs. Another CPU can execute the extracted task by extracting the context information of the task registered in the ready queue 121. The context information is information indicating the internal state of the program and where the program is arranged on the memory.

テーブル101はタスクIDの項目102と命令アドレスの項目103とを有している。テーブル101では、タスクごとに一のCPUと他のCPUとで共有する共有メモリへのアクセスを行う命令アドレスが保持されている。ここでは、一のCPUと他のCPUとのマルチコアプロセッサで共有する共有資源の一例として、共有メモリを挙げる。   The table 101 has a task ID item 102 and an instruction address item 103. The table 101 holds an instruction address for accessing a shared memory shared by one CPU and another CPU for each task. Here, a shared memory is taken as an example of a shared resource shared by a multi-core processor between one CPU and another CPU.

また、アクセスフラグはいずれのCPUが共有メモリへ先にアクセスしたかを示す情報である。たとえば、アクセスフラグの値が0の場合、一のCPUが共有メモリへアクセスしていることを示す。アクセスフラグの値が0であることを、アクセスフラグの値が一のCPUを示す値と称する。たとえば、アクセスフラグの値が1の場合、他のCPUが共有メモリへアクセスしていることを示す。アクセスフラグの値が1であることを、アクセスフラグの値が他のCPUを示す値と称する。たとえば、アクセスフラグの値が−の場合、一のCPUと他のCPUとのいずれのCPUも共有メモリへアクセスしていないことを示す。   The access flag is information indicating which CPU accessed the shared memory first. For example, when the value of the access flag is 0, it indicates that one CPU is accessing the shared memory. An access flag value of 0 is referred to as a value indicating a CPU having an access flag value of one. For example, when the value of the access flag is 1, it indicates that another CPU is accessing the shared memory. When the value of the access flag is 1, the value of the access flag is referred to as a value indicating another CPU. For example, when the value of the access flag is −, it indicates that neither one CPU nor another CPU is accessing the shared memory.

まず、一のCPUが、たとえば、テーブル101に保持されているタスクAが共有メモリへのアクセスを行う命令アドレスと一のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、一のCPUがアクセスフラグを確認することにより、アクセスフラグの値が−であるか否かを判断する。アクセスフラグの値は−であるため、一のCPUがアクセスフラグを0に設定する。   First, one CPU detects, for example, a match between an instruction address by which task A held in the table 101 accesses the shared memory and the program counter of the one CPU as preprocessing for the access. Then, one CPU checks the access flag to determine whether or not the value of the access flag is −. Since the value of the access flag is-, one CPU sets the access flag to 0.

つぎに、他のCPUが、たとえば、テーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスと他のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が−であるか否かを判断する。アクセスフラグの値は0であるため、他のCPUが共有メモリへ一のCPUがアクセス中であると判断し、他のCPUがタスクBからレディーキュー121内のタスクCへ切り替える。   Next, the other CPU detects, for example, a match between the instruction address at which the task B held in the table 101 accesses the shared memory and the program counter of the other CPU as a preprocess for the access. Then, another CPU checks the access flag to determine whether or not the value of the access flag is −. Since the value of the access flag is 0, another CPU determines that one CPU is accessing the shared memory, and the other CPU switches from task B to task C in the ready queue 121.

そして、タスクAの実行が終了すると、一のCPUがアクセスフラグの値を−に設定する。つぎに、タスクCの実行が終了すると、他のCPUがレディーキュー121からタスクBを取り出して実行する。そして、他のCPUが、タスクBのプログラムカウンタとテーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスとの一致を該アクセスの前処理として検出する。   When the execution of task A ends, one CPU sets the value of the access flag to-. Next, when the execution of the task C is completed, another CPU takes out the task B from the ready queue 121 and executes it. Then, the other CPU detects the coincidence between the program counter of task B and the instruction address at which task B held in the table 101 accesses the shared memory, as preprocessing for the access.

そして、前処理が検出されると、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が−であるか否かを判断する。さらに、アクセスフラグの値が−であるため、他のCPUがアクセスフラグを1に設定し、タスクBに共有メモリへのアクセスを開始させる。   When preprocessing is detected, the other CPU checks the access flag to determine whether the value of the access flag is −. Further, since the value of the access flag is −, another CPU sets the access flag to 1, and causes the task B to start accessing the shared memory.

図2は、本発明の他の一例を示す説明図である。まず、一のCPUが、テーブル101に保持されているタスクAが共有メモリへのアクセスを行う命令アドレスと一のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、一のCPUがアクセスフラグを確認し、アクセスフラグの値が−であるか否かを判断する。アクセスフラグの値が−であるため、一のCPUが、アクセスフラグを0に設定する。   FIG. 2 is an explanatory view showing another example of the present invention. First, one CPU detects, as pre-processing for the access, that the task A held in the table 101 matches the instruction address for accessing the shared memory and the program counter of the one CPU. Then, one CPU checks the access flag and determines whether or not the value of the access flag is −. Since the value of the access flag is −, one CPU sets the access flag to 0.

つぎに、他のCPUが、テーブル101に保持されているタスクBが共有メモリへのアクセスを行う命令アドレスと他のCPUのプログラムカウンタとの一致を該アクセスの前処理として検出する。そして、他のCPUがアクセスフラグを確認することにより、アクセスフラグの値が−であるか否かを判断する。アクセスフラグの値は0であるため、他のCPUが共有メモリへ一のCPUがアクセス中であると判断し、タスクBをストールさせる。   Next, the other CPU detects, as pre-processing for the access, that the task B held in the table 101 matches the instruction address for accessing the shared memory and the program counter of the other CPU. Then, another CPU checks the access flag to determine whether or not the value of the access flag is −. Since the value of the access flag is 0, another CPU determines that one CPU is accessing the shared memory, and causes task B to stall.

そして、タスクAの実行が終了すると、一のCPUがアクセスフラグの値を−に設定する。図示しないが、たとえば、他のCPUが、該タスクAの実行の終了を検出し、タスクBを復帰させてもよい。または、たとえば、他のCPUが、あらたに他のタスクが割り当てられた場合に、タスクBを復帰させて、レディーキューに登録させてもよい。   When the execution of task A ends, one CPU sets the value of the access flag to-. Although not shown, for example, another CPU may detect the end of execution of task A and return task B. Alternatively, for example, when another task is newly assigned, another CPU may return task B and register it in the ready queue.

また、図1および図2で示したテーブル101ではタスクごとに1つの命令アドレスのみを保持しているため、該命令アドレスからタスクが終了するまでの区間のみに着目している。すなわち、ここでは、該命令アドレスで実行される処理からタスクが終了するまでを1つのアクセスとしている。これに限らず、たとえば、タスクAの共有メモリへの各アクセスの開始命令アドレスから該アクセスの終了命令アドレスまでをテーブル101に登録してもよい。すなわち、該開始命令アドレスで実行される処理から該終了命令アドレスで実行される処理までが1つのアクセスとする。そして、一のCPUで実行するタスクAの共有メモリへのアクセスごとに他のCPUで実行するタスクBの共有メモリへのアクセスが競合しないように、一のCPUがアクセスフラグを立ててもよい。   Further, since the table 101 shown in FIGS. 1 and 2 holds only one instruction address for each task, attention is paid only to the section from the instruction address to the end of the task. That is, here, one access is from the process executed at the instruction address to the end of the task. However, the present invention is not limited to this, and for example, the start instruction address of each access to the shared memory of task A to the end instruction address of the access may be registered in the table 101. That is, one access is from the process executed at the start instruction address to the process executed at the end instruction address. Then, each time the task A executed by one CPU accesses the shared memory, one CPU may set an access flag so that the access to the shared memory of task B executed by another CPU does not compete.

本実施の形態では、アクセス量が所定量以上であるアクセスが複数のCPUで競合しない例を示す。アクセス量が所定量以上であるアクセスとは、アクセス密度(単位時間あたりのメモリアクセス回数)が一定の閾値を超えるアクセスを示している。アプリケーションの設計者が、アクセス密度を変化させて、アクセスが競合する場合のアクセス時間とアクセスが競合しない場合のアクセス時間とを測定する。   In the present embodiment, an example in which an access whose access amount is a predetermined amount or more does not compete with a plurality of CPUs. An access whose access amount is a predetermined amount or more indicates an access in which the access density (the number of memory accesses per unit time) exceeds a certain threshold. The application designer changes the access density and measures the access time when the access conflicts and the access time when the access does not conflict.

そして、アクセスが競合しない場合(タスクが順次メモリへアクセス)のアクセス時間が、アクセスが競合する場合のアクセス時間よりも小さくなるアクセス量を所定アクセス量(閾値)とする。また、各タスクの所定アクセス量以上となるアクセスについては測定済であるとして説明する。ここで、タスク処理中でメモリへのアクセス密度が所定アクセス量を超えるアクセスを大量アクセスと称する。   Then, the access amount when the access time does not conflict (the task sequentially accesses the memory) becomes smaller than the access time when the access contention conflicts is defined as a predetermined access amount (threshold). Further, the description will be made assuming that the access exceeding the predetermined access amount of each task has been measured. Here, an access in which the memory access density exceeds a predetermined access amount during task processing is referred to as a mass access.

ここで、アクセス競合がある場合とアクセス競合が無い場合とでアクセス時間を比較する。アクセス競合時のメモリアクセス性能はアクセス競合が無い場合と比較して約30[%]に低下すると言われている。上述のようにアクセスが複数のCPUで競合すると、調停回路がアクセス権を調停する。よって、アクセス競合がある場合、調停時間やアクセス権の切り替えなどによって、アクセス時間が長くなる。   Here, the access time is compared between when there is an access conflict and when there is no access conflict. It is said that the memory access performance at the time of access contention is reduced to about 30 [%] compared to the case where there is no access contention. As described above, when access conflicts among a plurality of CPUs, the arbitration circuit arbitrates the access right. Therefore, when there is an access conflict, the access time becomes longer due to arbitration time, access right switching, and the like.

アクセス競合が無い場合の単位時間当たりのアクセスデータサイズをXとする。アクセス競合時のメモリアクセス性能はアクセス競合がない場合と比較して約30%に低下すると言われていることを考慮すると、アクセス競合時の単位時間当たりのアクセスデータサイズは0.3Xとなる。一のCPUと他のCPUとのそれぞれのCPUがYサイズのデータアクセスに要する時間は下記となる。
・アクセス競合が無い場合(順次メモリアクセスを行う場合):時間S=Y/X+Y/X=2Y/X
・アクセス競合がある場合(同時にメモリアクセスを行う場合):時間P=Y/0.3X=3.3Y/X
Let X be the access data size per unit time when there is no access conflict. Considering that the memory access performance at the time of access contention is said to be reduced to about 30% compared to the case without access contention, the access data size per unit time at the time of access contention is 0.3X. The time required for each CPU of one CPU and another CPU to access Y-size data is as follows.
When there is no access conflict (when performing sequential memory access): time S = Y / X + Y / X = 2Y / X
When there is access contention (when accessing memory simultaneously): Time P = Y / 0.3X = 3.3Y / X

すなわち、アクセス競合がある場合のアクセス時間はアクセス競合が無い場合のアクセス時間と比較して1.65倍(P/S)である。   That is, the access time when there is an access conflict is 1.65 times (P / S) compared to the access time when there is no access conflict.

(マルチコアプロセッサシステムのハードウェア)
図3は、マルチコアプロセッサシステムのハードウェア例を示すブロック図である。マルチコアプロセッサシステム300は、CPU#0〜CPU#2と、共有メモリ303と、スヌープコントローラ301と、を有している。
(Multi-core processor system hardware)
FIG. 3 is a block diagram illustrating a hardware example of the multi-core processor system. The multi-core processor system 300 includes CPU # 0 to CPU # 2, a shared memory 303, and a snoop controller 301.

ここで、CPU#0〜CPU#2では、たとえば、それぞれコアとレジスタとキャッシュとを有している。CPU#0のレジスタ311はPC(Program Counter)331を有し、CPU#1のレジスタ312はPC332を有し、CPU#2のレジスタ313はPC333を有している。   Here, CPU # 0 to CPU # 2 have, for example, a core, a register, and a cache, respectively. The register 311 of CPU # 0 has a PC (Program Counter) 331, the register 312 of CPU # 1 has a PC 332, and the register 313 of CPU # 2 has a PC 333.

CPU#0はマスタOSであるOS341を実行し、マルチコアプロセッサシステム300の全体の制御を司る。OS341は、ソフトウェアの各プロセスをどのCPUに割り当てるかを制御し、かつCPU#0でのタスクの切り替えを制御する制御プログラムであるスケジューラ351を有している。レディーキュー361は、CPU#0に割り当てられタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。   The CPU # 0 executes the OS 341 that is the master OS and controls the entire multi-core processor system 300. The OS 341 includes a scheduler 351 which is a control program that controls which CPU each software process is assigned to and controls task switching in the CPU # 0. The ready queue 361 holds context information of tasks assigned to the CPU # 0 and waiting for execution.

CPU#1とCPU#2とは、それぞれスレーブOSであるOS342とOS343とを実行している。OS342は、CPU#1に割り当てられたタスクの切り替えを制御する制御プログラムであるスケジューラ352を有している。レディーキュー362は、CPU#1に割り当てられたタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。OS343は、CPU#2に割り当てられたタスクの切り替えを制御する制御プログラムであるスケジューラ353を有している。レディーキュー363は、CPU#2に割り当てられタスクのうち、実行待ち状態であるタスクのコンテキスト情報を保持する。   CPU # 1 and CPU # 2 execute OS 342 and OS 343, which are slave OSs, respectively. The OS 342 includes a scheduler 352 that is a control program that controls switching of tasks assigned to the CPU # 1. The ready queue 362 holds context information of tasks that are waiting to be executed among the tasks assigned to the CPU # 1. The OS 343 includes a scheduler 353 that is a control program that controls switching of tasks assigned to the CPU # 2. The ready queue 363 holds context information of tasks assigned to CPU # 2 and waiting for execution.

また、CPU#0はキャッシュ321を有し、CPU#1はキャッシュ322を有し、CPU#2はキャッシュ323を有している。各キャッシュはスヌープコントローラ301を介して接続されている。各CPUのキャッシュが該キャッシュ自身および他のコアのキャッシュのラインの状態を監視し、他のコアのキャッシュと更新状態の情報を交換することにより、アクセスフラグのような共有データの更新を検出する。各キャッシュは更新を検出すると、スヌープコントローラ301を介して、未更新のデータをパージし、更新されたデータをキャッシュする。   The CPU # 0 has a cache 321, the CPU # 1 has a cache 322, and the CPU # 2 has a cache 323. Each cache is connected via the snoop controller 301. Each CPU cache monitors the state of the cache itself and the caches of the other cores, and detects update of shared data such as an access flag by exchanging update state information with the caches of other cores. . When each cache detects an update, it purges the unupdated data via the snoop controller 301 and caches the updated data.

各キャッシュが有しているアクセスフラグは各キャッシュで共有の共有データであり、アクセスフラグはいずれのCPUが共有メモリ303へ先にアクセスしたかを示す情報である。たとえば、アクセスフラグが0の場合、CPU#0が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が0であることを、アクセスフラグの値がCPU#0を示す値と称する。たとえば、アクセスフラグが1の場合、CPU#1が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が1であることを、アクセスフラグの値がCPU#1を示す値と称する。アクセスフラグが2の場合、CPU#2が共有メモリ303へ大量アクセスしていることを示す。アクセスフラグの値が2であることを、アクセスフラグの値がCPU#2を示す値と称する。アクセスフラグの値が−の場合、いずれのCPUも共有メモリ303へアクセスしていないことを示す。   The access flag possessed by each cache is shared data shared by each cache, and the access flag is information indicating which CPU accessed the shared memory 303 first. For example, when the access flag is 0, it indicates that CPU # 0 is accessing the shared memory 303 in large quantities. That the value of the access flag is 0 is referred to as a value indicating the CPU # 0. For example, when the access flag is 1, it indicates that CPU # 1 is accessing the shared memory 303 in large quantities. An access flag value of 1 is referred to as a value indicating an access flag value of CPU # 1. When the access flag is 2, it indicates that CPU # 2 is accessing the shared memory 303 in large quantities. An access flag value of 2 is referred to as a value indicating the CPU # 2 of the access flag value. When the value of the access flag is −, it indicates that no CPU is accessing the shared memory 303.

また、各CPUと共有メモリ303とは、バス302を介して接続されている。共有メモリ303は、たとえば、マルチコアプロセッサに共有されるメモリである。共有メモリ303は、たとえば、属性テーブル400と、タスクテーブル381と、大量アクセス開始情報500と、ブートプログラムと、アプリケーションソフトウェアと、OS341〜OS343と、を有している。   Each CPU and the shared memory 303 are connected via a bus 302. The shared memory 303 is, for example, a memory shared by multicore processors. The shared memory 303 has, for example, an attribute table 400, a task table 381, mass access start information 500, a boot program, application software, and OS 341 to OS 343.

共有メモリ303は、具体的には、たとえば、ROM(Read Only Memory)と、RAM(Random Access Memory)と、フラッシュROMなどを有している。たとえば、フラッシュROMがブートプログラムを記憶し、ROMがアプリケーションソフトウェアを記憶し、RAMがCPU#0〜CPU#2のワークエリアとして使用される。共有メモリ303に記憶されているプログラムは、各CPUにロードされることで、コーディングされている処理を該各CPUに実行させることとなる。   Specifically, the shared memory 303 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a flash ROM, and the like. For example, a flash ROM stores a boot program, a ROM stores application software, and a RAM is used as a work area for CPU # 0 to CPU # 2. The program stored in the shared memory 303 is loaded on each CPU, thereby causing each CPU to execute a coded process.

タスクテーブル381とは、ソフトウェアのプロセスや関数がどのCPUに割り当てられているか、各CPUがどのソフトウェアのプロセスや関数を実行中であるかを示す情報である。   The task table 381 is information indicating to which CPU a software process or function is assigned and which software process or function is being executed by each CPU.

図4は、属性テーブル400の一例を示す説明図である。属性テーブル400では、各タスクの属性について記述されている。属性テーブル400では、タスクIDの項目401と、属性の項目402と、を有している。タスクIDの項目401にはタスクの名称が保持され、属性の項目402には各タスクの属性が保持されている。ここで、属性の項目402には、アクセスか通常のいずれかが保持される。アクセスとは、タスクが共有メモリ303へ大量にアクセスしている状態を示し、通常とは、タスクが共有メモリ303へ大量にアクセスしていない状態を示す。   FIG. 4 is an explanatory diagram showing an example of the attribute table 400. The attribute table 400 describes the attributes of each task. The attribute table 400 includes a task ID item 401 and an attribute item 402. The task ID item 401 holds the name of the task, and the attribute item 402 holds the attribute of each task. Here, the attribute item 402 holds either access or normal. “Access” indicates a state in which a task is accessing a large amount of the shared memory 303, and “normal” indicates a state in which the task is not accessing a large amount of the shared memory 303.

また、タスクIDの項目401にタスクの名称が保持されていないタスクは属性が未付加なタスクとする。本実施の形態では、タスクはタスク1〜タスク9までとすると、タスク1〜6およびタスク9は属性が付加されているタスクであり、タスク7およびタスク8は属性が未付加なタスクである。   A task whose task name is not held in the task ID item 401 is a task to which no attribute is added. In the present embodiment, assuming that tasks are tasks 1 to 9, tasks 1 to 6 and task 9 are tasks to which attributes are added, and tasks 7 and 8 are tasks to which no attributes are added.

図5は、大量アクセス開始情報500の一例を示す説明図である。大量アクセス開始情報500は、大量アクセス状態に遷移する命令アドレスをタスクのタスクIDごとに保持するテーブルである。   FIG. 5 is an explanatory diagram showing an example of the mass access start information 500. The mass access start information 500 is a table that holds an instruction address for transition to the mass access state for each task ID.

大量アクセス開始情報500は、タスクIDの項目501と、開始アドレスの項目502とを有している。タスクIDの項目501にはタスクの名称が保持される。開始アドレスの項目502には大量アクセス状態に遷移する命令アドレスが保持される。   The mass access start information 500 includes a task ID item 501 and a start address item 502. The task ID field 501 holds the name of the task. The start address field 502 holds an instruction address for transition to the mass access state.

(マルチコアプロセッサシステム300の機能ブロック図)
図6は、マルチコアプロセッサシステム300の機能ブロック図である。マルチコアプロセッサシステム300は、検出部601と、検出部602と、検出部603と、制御部611と、制御部612と、制御部613と、を有している。
(Functional block diagram of multi-core processor system 300)
FIG. 6 is a functional block diagram of the multi-core processor system 300. The multi-core processor system 300 includes a detection unit 601, a detection unit 602, a detection unit 603, a control unit 611, a control unit 612, and a control unit 613.

検出部601と検出部602と検出部603とは後述する属性チェンジャーと称するプログラムとして記憶装置内に記憶されている。該各CPUが該属性チェンジャーを記憶装置からロードし、該属性チェンジャー内にコーディングされている処理を実行する。   The detection unit 601, the detection unit 602, and the detection unit 603 are stored in the storage device as a program called an attribute changer described later. Each CPU loads the attribute changer from the storage device and executes the process coded in the attribute changer.

制御部611と制御部612と制御部613とは、それぞれスケジューラ351と、スケジューラ352と、スケジューラ353として記憶装置内に記憶されている。該各CPUが各スケジューラを記憶装置からロードし、スケジューラ内にコーディングされている処理を実行する。ここでは、CPU#0上で動作する検出部601と制御部611を例に挙げて説明する。   The control unit 611, the control unit 612, and the control unit 613 are stored in the storage device as a scheduler 351, a scheduler 352, and a scheduler 353, respectively. Each CPU loads each scheduler from the storage device, and executes the process coded in the scheduler. Here, the detection unit 601 and the control unit 611 operating on the CPU # 0 will be described as an example.

検出部601は、マルチコアプロセッサのうちの該検出部601を実行するCPU#0を除く他のコアがマルチコアプロセッサで共有する共有資源へアクセスしているときに、CPU#0から共有資源へのアクセスの前処理を検出する。   The detecting unit 601 accesses the shared resource from the CPU # 0 when other cores of the multi-core processor except the CPU # 0 executing the detecting unit 601 are accessing the shared resource shared by the multi-core processor. Detect pre-processing.

制御部611は、検出部601により前処理が検出された場合、CPU#0で実行中のタスクを他のタスクに切り替える。   When the preprocessing is detected by the detection unit 601, the control unit 611 switches the task being executed by the CPU # 0 to another task.

また、制御部611は、検出部601により前処理が検出された場合、CPU#0で実行中のタスクをストールさせる。   In addition, when the preprocessing is detected by the detection unit 601, the control unit 611 stalls the task being executed by the CPU # 0.

また、検出部601は、該他のコアから共有資源へのアクセス量が所定量以上のときに、CPU#0から共有資源へのアクセスの前処理を検出する。ここでは、所定量とは上述した所定アクセス量である。   The detecting unit 601 detects pre-processing for access from the CPU # 0 to the shared resource when the access amount from the other core to the shared resource is equal to or greater than a predetermined amount. Here, the predetermined amount is the above-described predetermined access amount.

また、検出部601は、該他のコアから共有資源へアクセスしているときに、CPU#0から共有資源へのアクセス量が所定量以上であるアクセスの前処理を検出する。   Further, the detecting unit 601 detects pre-processing of access in which the access amount from the CPU # 0 to the shared resource is a predetermined amount or more when accessing the shared resource from the other core.

CPU#1上で動作する検出部602および制御部612と、CPU#2上で動作する検出部603および制御部613とは、それぞれCPU#0上で動作する検出部601および制御部611と同一の処理であるため、説明を省略する。   Detection unit 602 and control unit 612 operating on CPU # 1 and detection unit 603 and control unit 613 operating on CPU # 2 are the same as detection unit 601 and control unit 611 operating on CPU # 0, respectively. Since this is the process, the description is omitted.

以上を踏まえ、図を用いて詳細に説明する。   Based on the above, it demonstrates in detail using figures.

図7は、タスク2がCPU#0にディスパッチされる例を示す説明図である。まず、スケジューラ351が、(1)タスク2をCPU#0にディスパッチすることにより、CPU#0へのタスクのディスパッチを検出することとする。そして、スケジューラ351が、(2)ディスパッチされたタスク2の属性を属性テーブル400から取得することにより、タスク2の属性をチェックする。   FIG. 7 is an explanatory diagram showing an example in which task 2 is dispatched to CPU # 0. First, the scheduler 351 detects the dispatch of a task to CPU # 0 by (1) dispatching task 2 to CPU # 0. Then, the scheduler 351 (2) acquires the attribute of the dispatched task 2 from the attribute table 400, thereby checking the attribute of the task 2.

タスク2の属性は通常であるため、スケジューラ351が、(3)アクセスフラグの値がCPU#0を示す値であるか否かを判断する。ここでは、アクセスフラグの値が−であるため、いずれのCPUも示していないので、スケジューラ351は、属性チェンジャー371が起動済か否かを判断する。属性チェンジャー371は起動されていないため、スケジューラ351が、(4)属性チェンジャー371を起動する。   Since the attribute of task 2 is normal, the scheduler 351 determines whether (3) the value of the access flag is a value indicating CPU # 0. Here, since the value of the access flag is −, no CPU is shown, so the scheduler 351 determines whether or not the attribute changer 371 has been activated. Since the attribute changer 371 is not activated, the scheduler 351 activates (4) the attribute changer 371.

属性チェンジャー371は、スケジューラ351により起動されると、大量アクセス開始情報500から、実行中のタスク2が大量アクセス状態に遷移する命令アドレスを取得する。そして、属性チェンジャー371は、取得した命令アドレスとCPU#0のPC331の値とを比較することにより、タスク2の大量アクセス開始を監視する。   When the attribute changer 371 is activated by the scheduler 351, the attribute changer 371 acquires from the mass access start information 500 an instruction address at which the task 2 being executed transitions to the mass access state. The attribute changer 371 monitors the start of mass access of the task 2 by comparing the acquired instruction address with the value of the PC 331 of the CPU # 0.

図8は、タスク5がCPU#1にディスパッチされる例を示す説明図である。ここで、CPU#0のレディーキュー361にはタスク1とタスク3とが積まれている。そして、スケジューラ351が(1)タスク5をCPU#1にディスパッチすると、スケジューラ352が(2)該ディスパッチを検出する。   FIG. 8 is an explanatory diagram showing an example in which the task 5 is dispatched to the CPU # 1. Here, task 1 and task 3 are stacked in the ready queue 361 of CPU # 0. When the scheduler 351 (1) dispatches the task 5 to the CPU # 1, the scheduler 352 (2) detects the dispatch.

そして、スケジューラ352が、(3)ディスパッチされたタスク5の属性を属性テーブル400から取得することにより、タスク5の属性をチェックする。タスク5の属性は通常状態であるため、スケジューラ352が、(4)アクセスフラグの値がCPU#1を示す値であるか否かを判断する。ここでは、アクセスフラグの値が−であり、いずれのCPUも示していないので、スケジューラ352は、属性チェンジャー372が起動済か否かを判断する。属性チェンジャー372は起動されていないため、スケジューラ352が、(5)属性チェンジャー372を起動する。   Then, the scheduler 352 (3) acquires the attribute of the dispatched task 5 from the attribute table 400, thereby checking the attribute of the task 5. Since the attribute of task 5 is the normal state, scheduler 352 determines whether (4) the value of the access flag is a value indicating CPU # 1. Here, since the value of the access flag is-and no CPU is shown, the scheduler 352 determines whether or not the attribute changer 372 has been activated. Since the attribute changer 372 is not activated, the scheduler 352 activates (5) the attribute changer 372.

属性チェンジャー372は、スケジューラ352により起動されると、大量アクセス開始情報500から、実行中のタスク5が大量アクセス状態に遷移する命令アドレスを取得する。そして、属性チェンジャー372は、取得した命令アドレスとCPU#1のPC332の値とを比較することにより、タスク5の大量アクセス開始を監視する。   When the attribute changer 372 is activated by the scheduler 352, the attribute changer 372 acquires from the mass access start information 500 an instruction address at which the task 5 being executed transitions to the mass access state. The attribute changer 372 monitors the start of mass access of the task 5 by comparing the acquired instruction address with the value of the PC 332 of the CPU # 1.

図9は、タスク7がCPU#2にディスパッチされる例を示す説明図である。ここで、CPU#1のレディーキュー362にはタスク4とタスク6とが積まれている。そして、スケジューラ351が(1)タスク7をCPU#2にディスパッチすると、スケジューラ353が(2)該ディスパッチを検出する。   FIG. 9 is an explanatory diagram showing an example in which the task 7 is dispatched to the CPU # 2. Here, task 4 and task 6 are stacked in the ready queue 362 of CPU # 1. When the scheduler 351 (1) dispatches the task 7 to the CPU # 2, the scheduler 353 (2) detects the dispatch.

そして、スケジューラ353が、(3)ディスパッチされたタスク7の属性を属性テーブル400から取得することにより、タスク7の属性をチェックする。タスク7の属性は属性テーブル400に登録されていないため、属性未付加である。そして、スケジューラ353が、(4)アクセスフラグの値がCPU#2を示す値であるか否かを判断する。ここでは、アクセスフラグの値が−であり、いずれのCPUも示していない。つぎに、スケジューラ353は、属性チェンジャーが起動済か否かを判断する。属性チェンジャーは起動されておらず、スケジューラ353は、属性チェンジャーを起動しない。   Then, the scheduler 353 checks the attribute of the task 7 by acquiring (3) the attribute of the dispatched task 7 from the attribute table 400. Since the attribute of task 7 is not registered in the attribute table 400, no attribute is added. Then, the scheduler 353 determines whether (4) the value of the access flag is a value indicating the CPU # 2. Here, the value of the access flag is-, and any CPU is not shown. Next, the scheduler 353 determines whether or not the attribute changer has been activated. The attribute changer is not activated, and the scheduler 353 does not activate the attribute changer.

図10は、CPU#0が大量アクセスを開始する例を示す説明図である。上述のように属性チェンジャー371は、取得した命令アドレスとCPU#0のPC331の値とを比較することにより、タスク2の大量アクセス開始を監視する。そして、属性チェンジャー371は、(1)取得した命令アドレスとCPU#0のPC331の値との一致を検出することにより、共有メモリ303へのアクセス量が所定量以上であるアクセスの前処理を検出することとする。   FIG. 10 is an explanatory diagram showing an example in which CPU # 0 starts mass access. As described above, the attribute changer 371 monitors the start of mass access of the task 2 by comparing the acquired instruction address with the value of the PC 331 of the CPU # 0. Then, the attribute changer 371 detects (1) pre-processing of access in which the access amount to the shared memory 303 is equal to or greater than a predetermined amount by detecting a match between the acquired instruction address and the value of the PC 331 of the CPU # 0. I decided to.

属性チェンジャー371は、(2)アクセスフラグを、CPU#0を示す値に設定する。属性チェンジャー371は、(3)属性テーブル400内のタスクIDの項目401がタスク2を保持する属性の項目402を通常からアクセスに変更する。そして、属性チェンジャー371は(4)属性チェンジャー371を停止する。   The attribute changer 371 sets (2) the access flag to a value indicating the CPU # 0. The attribute changer 371 changes (3) the attribute item 402 in which the task ID item 401 in the attribute table 400 holds the task 2 from normal to access. Then, the attribute changer 371 stops (4) the attribute changer 371.

また、スヌープコントローラ301は、<1>CPU#0のキャッシュ321内のアクセスフラグの変更を検出すると、<2>スヌープによりCPU#1のキャッシュ322およびCPU#2のキャッシュ323内のアクセスフラグを更新する。アクセスフラグのアドレス空間は常に全CPUのキャッシュ上に配置される。たとえば、全CPUのキャッシュ上にロック領域が設けられ、該ロック領域にアクセスフラグのアドレス空間が配置される。   When the snoop controller 301 detects a change in the access flag in the cache 321 of <1> CPU # 0, <2> updates the access flag in the cache 322 of the CPU # 1 and the cache 323 of the CPU # 2 by the snoop. To do. The address space of the access flag is always placed on the cache of all CPUs. For example, a lock area is provided on the cache of all CPUs, and an address space for an access flag is arranged in the lock area.

図11は、CPU#1での大量アクセスの検出例を示す説明図である。上述のように属性チェンジャー372は、取得した命令アドレスとCPU#1のPC332の値とを比較することにより、タスク5の大量アクセス開始を監視する。そして、属性チェンジャー372は、検出部602により、(1)取得した命令アドレスとCPU#1のPC332の値との一致を検出することにより、共有メモリ303へのアクセス量が所定量以上であるアクセスの前処理を検出することとする。   FIG. 11 is an explanatory diagram showing an example of mass access detection in CPU # 1. As described above, the attribute changer 372 monitors the start of mass access of the task 5 by comparing the acquired instruction address with the value of the PC 332 of the CPU # 1. Then, the attribute changer 372 detects (1) the coincidence between the acquired instruction address and the value of the PC 332 of the CPU # 1 by the detection unit 602, whereby the access amount to the shared memory 303 is a predetermined amount or more. This pre-processing is detected.

属性チェンジャー372は、(2)アクセスフラグが−であるか否かを判断する。アクセスフラグが0であるため、属性チェンジャー372は(3)スケジューラ352に他のタスクへのディスパッチ要求を通知する。   The attribute changer 372 determines whether (2) the access flag is −. Since the access flag is 0, the attribute changer 372 (3) notifies the scheduler 352 of a dispatch request to another task.

図12は、CPU#1でタスクディスパッチを行う例を示す説明図である。そして、スケジューラ352が、制御部612により、ディスパッチ要求を受け付けると、(1)タスク5からタスク6にディスパッチする。また、属性チェンジャー372は停止する。   FIG. 12 is an explanatory diagram illustrating an example in which task dispatch is performed by the CPU # 1. When the scheduler 352 receives a dispatch request from the control unit 612, (1) the task 5 is dispatched from the task 5 to the task 6. Further, the attribute changer 372 stops.

そして、スケジューラ352がタスク6をディスパッチすることにより、タスク6のディスパッチを検出することとして、図8で示したようにタスク5がディスパッチされた場合と同様の処理をスケジューラ352が実施する。   Then, the scheduler 352 dispatches the task 6 to detect the dispatch of the task 6, and the scheduler 352 performs the same processing as when the task 5 is dispatched as shown in FIG.

また、本実施の形態では、上述のようにアクセス量が所定量以上であるアクセスが複数のCPUで競合しない例を示した。これに限らず、たとえば、大量アクセスであるか否かに関係なく1つのCPUが共有メモリ303へアクセスしているときに、他のCPUから共有メモリ303へアクセス量が所定量以上であるアクセスの前処理を検出し、アクセスが競合しないようにしてもよい。また、たとえば、1つのCPUが共有メモリ303へアクセス量が所定量以上であるアクセスを実行しているときに、大量アクセスであるか否かに関係なく他のCPUから共有メモリ303へのアクセスの前処理を検出して、アクセスが競合しないようにしてもよい。   Further, in the present embodiment, as described above, an example in which an access whose access amount is a predetermined amount or more does not compete with a plurality of CPUs has been described. Not limited to this, for example, when one CPU is accessing the shared memory 303 regardless of whether it is mass access or not, the access amount from the other CPU to the shared memory 303 is an access amount that is a predetermined amount or more. Pre-processing may be detected so that access does not compete. Also, for example, when one CPU is executing an access with an access amount greater than or equal to a predetermined amount, access from other CPUs to the shared memory 303 is performed regardless of whether the access is a large amount. Pre-processing may be detected so that access does not compete.

(マルチコアプロセッサシステム300による制御処理手順)
つぎに、マルチコアプロセッサシステム300による制御処理手順について説明する。ここでは、CPU#0で動作するスケジューラ351と属性チェンジャー371を例に挙げて説明するが、他のCPUで動作するスケジューラと属性チェンジャーも同一処理である。
(Control processing procedure by multi-core processor system 300)
Next, a control processing procedure by the multi-core processor system 300 will be described. Here, the scheduler 351 and the attribute changer 371 operating on the CPU # 0 will be described as an example, but the schedulers and attribute changers operating on other CPUs are the same process.

図13および図14は、スケジューラ351による制御処理手順の一例を示すフローチャートである。まず、スケジューラ351が、タスクのディスパッチを検出、または他のタスクへのディパッチ要求を検出したか否かを判断する(ステップS1301)。スケジューラ351が、タスクのディスパッチを検出および他のタスクへのディパッチ要求を検出していないと判断した場合(ステップS1301:No)、ステップS1301へ戻る。   13 and 14 are flowcharts showing an example of a control processing procedure by the scheduler 351. First, the scheduler 351 determines whether or not a task dispatch has been detected or a dispatch request to another task has been detected (step S1301). When the scheduler 351 determines that the dispatch of the task is not detected and the dispatch request to another task is not detected (step S1301: No), the process returns to step S1301.

スケジューラ351が、タスクのディスパッチを検出したと判断した場合(ステップS1301:ディスパッチ)、ディスパッチされたタスクの属性をチェックする(ステップS1302)。スケジューラ351が、ディスパッチされたタスクの属性が属性未付加であると判断した場合(ステップS1302:属性未付加)、アクセスフラグの値が自CPUを示す値であるか否かを判断する(ステップS1303)。   When the scheduler 351 determines that task dispatch has been detected (step S1301: dispatch), the attribute of the dispatched task is checked (step S1302). When the scheduler 351 determines that the attribute of the dispatched task is not attributed (step S1302: attribute not added), the scheduler 351 determines whether the value of the access flag is a value indicating the own CPU (step S1303). ).

スケジューラ351が、アクセスフラグの値が自CPUを示す値であると判断した場合(ステップS1303:Yes)、アクセスフラグの値を解除値に設定する(ステップS1304)。ここでは、−を解除値と称する。スケジューラ351が、アクセスフラグの値が自CPUを示す値でないと判断した場合(ステップS1303:No)、またはステップS1304のつぎに、属性チェンジャー371が起動済か否かを判断する(ステップS1305)。   When the scheduler 351 determines that the value of the access flag is a value indicating its own CPU (step S1303: Yes), it sets the value of the access flag to a release value (step S1304). Here,-is referred to as a release value. When the scheduler 351 determines that the value of the access flag is not a value indicating the own CPU (step S1303: No), or after step S1304, determines whether the attribute changer 371 has been activated (step S1305).

スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1305:起動済)、属性チェンジャー371の停止要求を通知(図15のステップS1503へ)する(ステップS1306)。そして、ステップS1306のつぎに、ステップS1301へ戻る。一方、スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1305:停止中)、ステップS1301へ戻る。   When the scheduler 351 determines that the attribute changer 371 has been activated (step S1305: activated), the scheduler 351 notifies a request to stop the attribute changer 371 (to step S1503 in FIG. 15) (step S1306). Then, after step S1306, the process returns to step S1301. On the other hand, when the scheduler 351 determines that the attribute changer 371 has not been activated (step S1305: stopped), the process returns to step S1301.

スケジューラ351が、ディスパッチされたタスクの属性が通常であると判断した場合(ステップS1302:通常)、アクセスフラグの値が自CPUを示す値か否かを判断する(ステップS1307)。スケジューラ351が、アクセスフラグの値が自CPUを示す値であると判断した場合(ステップS1307:Yes)、アクセスフラグの値を解除値に設定する(ステップS1308)。スケジューラ351が、アクセスフラグの値が自CPUを示す値でないと判断した場合(ステップS1307:No)、またはステップS1308のつぎに、属性チェンジャー371が起動済か否かを判断する(ステップS1309)。   If the scheduler 351 determines that the attribute of the dispatched task is normal (step S1302: normal), the scheduler 351 determines whether the value of the access flag is a value indicating the own CPU (step S1307). When the scheduler 351 determines that the value of the access flag is a value indicating its own CPU (step S1307: Yes), it sets the value of the access flag to a release value (step S1308). When the scheduler 351 determines that the value of the access flag is not a value indicating the own CPU (step S1307: No), or after step S1308, the scheduler 351 determines whether the attribute changer 371 has been activated (step S1309).

スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1309:停止中)、属性チェンジャー371の起動要求を通知(ステップS1501へ)する(ステップS1310)。スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1309:起動済)、大量アクセス開始情報500の再取得の要求を属性チェンジャー371に通知(図15のステップS1503へ)する(ステップS1311)。そして、ステップS1310またはステップS1311のつぎに、ステップS1301へ戻る。   When the scheduler 351 determines that the attribute changer 371 has not been activated (step S1309: stopped), the scheduler 351 notifies the activation request of the attribute changer 371 (to step S1501) (step S1310). When the scheduler 351 determines that the attribute changer 371 has been activated (step S1309: activated), the scheduler 351 notifies the attribute changer 371 of a request for reacquiring the mass access start information 500 (to step S1503 in FIG. 15) ( Step S1311). Then, after step S1310 or step S1311, the process returns to step S1301.

ステップS1301において、スケジューラ351が、他のタスクのディスパッチ要求を検出した場合(ステップS1301:ディスパッチ要求)、制御部611により、レディーキュー361内の他のタスクにディスパッチする(ステップS1316)。   In step S1301, when the scheduler 351 detects a dispatch request for another task (step S1301: dispatch request), the control unit 611 dispatches to another task in the ready queue 361 (step S1316).

また、ステップS1302において、スケジューラ351が、ディスパッチされたタスクの属性がアクセスであると判断した場合(ステップS1302:アクセス)、アクセスフラグをチェックする(ステップS1312)。そして、スケジューラ351が、アクセスフラグの値が解除値であると判断した場合(ステップS1312:解除値)、アクセスフラグの値を、自CPUを示す値に設定する(ステップS1313)。   If the scheduler 351 determines in step S1302 that the attribute of the dispatched task is access (step S1302: access), it checks the access flag (step S1312). If the scheduler 351 determines that the value of the access flag is a release value (step S1312: release value), it sets the value of the access flag to a value indicating its own CPU (step S1313).

スケジューラ351が、アクセスフラグが自CPUを示していると判断した場合(ステップS1312:自CPU)、またはステップS1313のつぎに、属性チェンジャー371が起動済であるか否かを判断する(ステップS1314)。スケジューラ351が、属性チェンジャー371が起動済であると判断した場合(ステップS1314:起動済)、属性チェンジャー371の停止要求を属性チェンジャー371に通知(図15のステップS1503へ)する(ステップS1315)。   When the scheduler 351 determines that the access flag indicates the own CPU (step S1312: own CPU) or after step S1313, the scheduler 351 determines whether the attribute changer 371 has been activated (step S1314). . When the scheduler 351 determines that the attribute changer 371 has been activated (step S1314: activated), the scheduler 351 notifies the attribute changer 371 of a request to stop the attribute changer 371 (to step S1503 in FIG. 15) (step S1315).

ステップS1312において、スケジューラ351が、アクセスフラグが他CPUを示していると判断した場合(ステップS1312:他CPU)、ステップS1316へ移行する。そして、ステップS1314において、スケジューラ351が、属性チェンジャー371が起動済でないと判断した場合(ステップS1314:停止中)、ステップS1315、またはステップS1316のつぎに、ステップS1301へ戻る。   In step S1312, when the scheduler 351 determines that the access flag indicates another CPU (step S1312: other CPU), the process proceeds to step S1316. In step S1314, when the scheduler 351 determines that the attribute changer 371 has not been activated (step S1314: stopped), the process returns to step S1301 after step S1315 or step S1316.

図15は、属性チェンジャー371による制御処理手順の一例を示すフローチャートである。まず、属性チェンジャー371が、スケジューラ351から起動要求ありか否かを判断し(ステップS1501)、起動要求がないと判断した場合(ステップS1501:No)、ステップS1501へ戻る。つぎに、属性チェンジャー371が、起動要求がありと判断した場合(ステップS1501:Yes)、大量アクセス開始情報500を取得する(ステップS1502)。   FIG. 15 is a flowchart illustrating an example of a control processing procedure by the attribute changer 371. First, the attribute changer 371 determines whether or not there is an activation request from the scheduler 351 (step S1501). If it is determined that there is no activation request (step S1501: No), the process returns to step S1501. Next, when the attribute changer 371 determines that there is an activation request (step S1501: Yes), the mass access start information 500 is acquired (step S1502).

そして、属性チェンジャー371が、大量アクセスの前処理を検出、停止要求を検出、または大量アクセス開始情報500の再取得要求を検出したか否かを判断する(ステップS1503)。属性チェンジャー371が、大量アクセスの前処理の検出と、停止要求の検出と、大量アクセス開始情報500の再取得要求の検出とのいずれも検出していないと判断した場合(ステップS1503:No)、ステップS1503に戻る。   Then, it is determined whether the attribute changer 371 detects pre-processing for mass access, detects a stop request, or detects a request for reacquisition of mass access start information 500 (step S1503). When the attribute changer 371 determines that none of the detection of pre-processing for mass access, the detection of a stop request, and the detection of a reacquisition request for the mass access start information 500 is detected (step S1503: No). The process returns to step S1503.

属性チェンジャー371が、大量アクセス開始情報500の再取得要求を検出したと判断した場合(ステップS1503:大量アクセス開始情報の再取得要求)、ステップS1502へ戻る。属性チェンジャー371が、検出部601により、大量アクセスの前処理を検出したと判断した場合(ステップS1503:大量アクセスの前処理)、検出部601により、アクセスフラグの値が自CPUを示す値または解除値であるか否かを判断する(ステップS1504)。   When the attribute changer 371 determines that a reacquisition request for the mass access start information 500 has been detected (step S1503: reacquisition request for mass access start information), the process returns to step S1502. If the attribute changer 371 determines that the detection unit 601 has detected preprocessing for mass access (step S1503: preprocessing for mass access), the detection unit 601 determines that the value of the access flag indicates a value indicating the own CPU. It is determined whether the value is a value (step S1504).

属性チェンジャー371が、アクセスフラグの値が自CPUを示す値または解除値であると判断した場合(ステップS1504:Yes)、実行中のタスクの属性をアクセスに変更する(ステップS1505)。そして、属性チェンジャー371が、アクセスフラグの値を、自CPUを示す値に設定し(ステップS1506)、属性チェンジャー371を停止し(ステップS1508)、ステップS1501へ戻る。属性チェンジャー371を停止するとは、具体的には、たとえば、属性チェンジャー371を実行待機状態にさせることを示している。   If the attribute changer 371 determines that the value of the access flag is a value indicating the own CPU or a release value (step S1504: Yes), the attribute of the task being executed is changed to access (step S1505). The attribute changer 371 sets the value of the access flag to a value indicating its own CPU (step S1506), stops the attribute changer 371 (step S1508), and returns to step S1501. Specifically, stopping the attribute changer 371 indicates, for example, putting the attribute changer 371 into an execution standby state.

属性チェンジャー371が、停止要求を検出したと判断した場合(ステップS1503:停止要求)、ステップS1508へ移行する。また、属性チェンジャー371が、アクセスフラグの値が自CPUを示す値および解除値でないと判断した場合(ステップS1504:No)、ディスパッチ要求をスケジューラ351へ通知(ステップS1301へ)し(ステップS1507)、ステップS1508へ移行する。アクセスフラグの値が自CPUを示す値および解除値でない場合とは、他のCPUが大量アクセスを行っていることを示している。   When the attribute changer 371 determines that a stop request has been detected (step S1503: stop request), the process proceeds to step S1508. If the attribute changer 371 determines that the value of the access flag is not the value indicating the own CPU and the release value (step S1504: No), the dispatch request is notified to the scheduler 351 (to step S1301) (step S1507). The process moves to step S1508. The case where the value of the access flag is not the value indicating the own CPU and the release value indicates that another CPU is performing mass access.

以上説明したように、マルチプロセッサシステム、制御プログラム、および制御方法によれば、一のCPUが共有資源へアクセスしているときに、他のCPUから共有資源へのアクセスの前処理を検出する。そして、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、複数のCPUで共有資源へのアクセスが競合しないので、調停回路によるアクセスの調停が不要となる。したがって、一のCPUのアクセスを高速化させることができ、一のCPUの実効性能を向上させることができる。   As described above, according to the multiprocessor system, the control program, and the control method, when one CPU is accessing a shared resource, preprocessing for access to the shared resource from another CPU is detected. Then, the task being executed in another CPU is switched to another task. As a result, access to the shared resource does not compete among a plurality of CPUs, so access arbitration by the arbitration circuit becomes unnecessary. Therefore, the access speed of one CPU can be increased, and the effective performance of one CPU can be improved.

また、一のCPUが共有資源へアクセス量が所定量以上であるアクセスを実行しているときに、他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、大量アクセスが発生しているときに、他のCPUからのアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。   In addition, when one CPU is executing an access with an access amount equal to or greater than a predetermined amount, if a preprocessing for access to the shared resource from another CPU is detected, a task being executed by the other CPU is detected. Switch to another task. This improves the execution performance of the multi-core processor system because accesses from other CPUs do not compete when a large number of accesses occur.

また、一のCPUが共有資源へアクセスしているときに、アクセス量が所定アクセス量以上である他のCPUから共有資源へのアクセスの前処理を検出し、他のCPUで実行中のタスクを他のタスクに切り替える。これにより、複数のCPUで共有資源への大量のアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。   In addition, when one CPU is accessing a shared resource, it detects a pre-process for accessing the shared resource from another CPU whose access amount is equal to or greater than the predetermined access amount, and executes a task being executed by the other CPU. Switch to another task. As a result, a large number of accesses to the shared resource do not compete among a plurality of CPUs, thereby improving the execution performance of the multi-core processor system.

また、以上説明したように、マルチプロセッサシステム、制御プログラム、および制御方法によれば、一のCPUが共有資源へアクセスしているときに、他のCPUから共有資源へのアクセスの前処理を検出する。そして、他のCPUで実行中のタスクをストールさせる。これにより、複数のCPUで共有資源へのアクセスが競合しないので、調停回路によるアクセスの調停が不要となる。したがって、一のCPUのアクセスを高速化させることができ、一のCPUの実効性能を向上させることができる。   In addition, as described above, according to the multiprocessor system, the control program, and the control method, when one CPU is accessing the shared resource, the preprocessing of access to the shared resource from another CPU is detected. To do. Then, the task being executed by another CPU is stalled. As a result, access to the shared resource does not compete among a plurality of CPUs, so access arbitration by the arbitration circuit becomes unnecessary. Therefore, the access speed of one CPU can be increased, and the effective performance of one CPU can be improved.

また、一のCPUが共有資源へアクセス量が所定量以上であるアクセス実行しているときに、他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクをストールさせる。これにより、大量アクセスが発生しているときに、他のCPUからのアクセスが競合しないため、マルチコアプロセッサシステムの実行性能が向上する。   In addition, when one CPU is executing an access with an amount of access to a shared resource equal to or greater than a predetermined amount, if a pre-process for accessing the shared resource from another CPU is detected, a task being executed by the other CPU is Stall. This improves the execution performance of the multi-core processor system because accesses from other CPUs do not compete when a large number of accesses occur.

また、一のCPUが共有資源へアクセスしているときに、アクセス量が所定アクセス量以上である他のCPUから共有資源へのアクセスの前処理を検出すると、他のCPUで実行中のタスクをストールさせる。これにより、複数のCPUで共有資源への大量のアクセスが競合しないため、マルチコアプロセッサの実行性能が向上する。   In addition, when one CPU is accessing a shared resource, if a pre-process for accessing the shared resource from another CPU whose access amount is equal to or greater than the predetermined access amount is detected, the task being executed by the other CPU is Stall. As a result, a large number of accesses to the shared resource do not compete among a plurality of CPUs, so that the execution performance of the multi-core processor is improved.

300 マルチコアプロセッサシステム
303 共有メモリ
601,602,603 検出部
611,612,613 制御部
300 multi-core processor system 303 shared memory 601 602 603 detection unit 611 612 613 control unit

Claims (5)

複数のコアと、
前記複数のコアから共通にアクセスされる共有メモリを有するマルチプロセッサシステムであって、前記複数のコアのうちの第1のコアは、
前記第1のコアを除く第2のコアから前記共有メモリへのアクセス量が所定量以上であることを前記第1のコアが検出し、かつ前記第1のコアから前記共有メモリへのアクセスの前処理を前記第1のコアが検出した場合に、前記第1のコアで実行中のタスクを他のタスクに切り替える
マルチプロセッサシステム。
With multiple cores,
A multiprocessor system having a shared memory that is commonly accessed from the plurality of cores, wherein a first core of the plurality of cores is:
Detected by the first core that access amount from the second core excluding the first core to the shared memory is equal to or greater than a predetermined amount, and from the first core access to the shared memory A multiprocessor system that switches a task being executed in the first core to another task when the first core detects preprocessing.
前記第1のコアは、前記第2のコアから前記共有メモリへの単位時間あたりのアクセス回数に基づいて前記アクセス量が所定量以上であることを検出する、請求項1に記載のマルチプロセッサシステム。2. The multiprocessor system according to claim 1, wherein the first core detects that the access amount is a predetermined amount or more based on the number of accesses per unit time from the second core to the shared memory. . 前記共有メモリは、前記複数のコアで実行されるタスクと、前記タスクが共有メモリへアクセスする命令アドレスとの対応関係を示すタスク情報を保持し、The shared memory holds task information indicating a correspondence relationship between a task executed by the plurality of cores and an instruction address at which the task accesses the shared memory;
前記第1のコアは、前記タスク情報に基づいて前記前処理を検出する、請求項1に記載のマルチプロセッサシステム。  The multiprocessor system according to claim 1, wherein the first core detects the preprocessing based on the task information.
複数のコアと前記複数のコアから共通にアクセスされる共有メモリを有するマルチプロセッサシステムの制御方法であって、前記複数のコアのうちの第1のコアが、A control method for a multiprocessor system having a plurality of cores and a shared memory that is commonly accessed from the plurality of cores, wherein a first core of the plurality of cores includes:
前記第1のコアから前記共有メモリへのアクセスの前処理をしている場合に、前記第1のコアを除く第2のコアから前記共有メモリへのアクセス量が所定量以上となったことを検出する処理と、The amount of access from the second core excluding the first core to the shared memory when the preprocessing for accessing the shared memory from the first core is greater than or equal to a predetermined amount Processing to detect,
前記アクセス量が所定量以上となったことを検出した場合に、前記第1のコアで実行中のタスクを他のタスクに切り替える処理とA process of switching a task being executed in the first core to another task when it is detected that the access amount is a predetermined amount or more.
を実行するマルチプロセッサシステムの制御方法。Of controlling a multiprocessor system for executing
複数のコアと前記複数のコアから共通にアクセスされる共有メモリを有するマルチプロセッサシステムの制御プログラムであって、前記複数のコアのうちの第1のコアに、A control program for a multiprocessor system having a plurality of cores and a shared memory that is commonly accessed from the plurality of cores, the first core of the plurality of cores,
前記第1のコアから前記共有メモリへのアクセスの前処理をしている場合に、前記第1のコアを除く第2のコアから前記共有メモリへのアクセス量が所定量以上となったことを検出する処理と、The amount of access from the second core excluding the first core to the shared memory when the preprocessing for accessing the shared memory from the first core is greater than or equal to a predetermined amount Processing to detect,
前記アクセス量が所定量以上となったことを検出した場合に、前記第1のコアで実行中のタスクを他のタスクに切り替える処理とA process of switching a task being executed in the first core to another task when it is detected that the access amount is a predetermined amount or more.
を実行させるマルチプロセッサシステムの制御プログラム。A control program for a multiprocessor system that executes
JP2013221663A 2013-10-24 2013-10-24 Multiprocessor system, control program, and control method Expired - Fee Related JP5621896B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013221663A JP5621896B2 (en) 2013-10-24 2013-10-24 Multiprocessor system, control program, and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013221663A JP5621896B2 (en) 2013-10-24 2013-10-24 Multiprocessor system, control program, and control method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2012526236A Division JP5397546B2 (en) 2010-07-27 2010-07-27 Multi-core processor system, control program, and control method

Publications (2)

Publication Number Publication Date
JP2014038656A JP2014038656A (en) 2014-02-27
JP5621896B2 true JP5621896B2 (en) 2014-11-12

Family

ID=50286675

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013221663A Expired - Fee Related JP5621896B2 (en) 2013-10-24 2013-10-24 Multiprocessor system, control program, and control method

Country Status (1)

Country Link
JP (1) JP5621896B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021181454A1 (en) * 2020-03-09 2021-09-16 株式会社A.L.I. Technologies Image processing system, program, and image processing method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA1321033C (en) * 1988-04-14 1993-08-03 Rodney N. Gamache Reducing the effect of processor blocking
JP2952896B2 (en) * 1989-07-25 1999-09-27 日本電気株式会社 Shared memory access method in multitask multiprocessor system
JPH0381859A (en) * 1989-08-25 1991-04-08 Nec Corp Multiprocessor system
JPH11306076A (en) * 1998-04-27 1999-11-05 Oki Tsushin System Kk Common memory control device
JP2003067204A (en) * 2001-08-24 2003-03-07 Mitsubishi Electric Corp Computer system
JP4122968B2 (en) * 2002-12-25 2008-07-23 日本電気株式会社 Common resource access method, common resource access method, and program
JP5349072B2 (en) * 2009-02-17 2013-11-20 パナソニック株式会社 Resource exclusion control method and resource exclusion control device

Also Published As

Publication number Publication date
JP2014038656A (en) 2014-02-27

Similar Documents

Publication Publication Date Title
US9753779B2 (en) Task processing device implementing task switching using multiple state registers storing processor id and task state
TWI537831B (en) Multi-core processor,method to perform process switching,method to secure a memory block, apparatus to enable transactional processing using a multi core device and method to perform memory transactional processing
JP6434791B2 (en) Arithmetic unit for supporting multithreading, processor including the same, and operating method of processor
US20100293341A1 (en) Wake-and-Go Mechanism with Exclusive System Bus Response
US20140282564A1 (en) Thread-suspending execution barrier
JP5397546B2 (en) Multi-core processor system, control program, and control method
JP5673672B2 (en) Multi-core processor system, control program, and control method
KR20130104853A (en) System and method for balancing load on multi-core architecture
US20150254113A1 (en) Lock Spin Wait Operation for Multi-Threaded Applications in a Multi-Core Computing Environment
KR101686082B1 (en) Apparatus and method for thread scheduling and lock acquisition order control based on deterministic progress index
US8892819B2 (en) Multi-core system and external input/output bus control method
WO2012120654A1 (en) Task scheduling method and multi-core system
JP2012150583A5 (en)
US9367349B2 (en) Multi-core system and scheduling method
JP5621896B2 (en) Multiprocessor system, control program, and control method
WO2011104812A1 (en) Multi-core processor system, interrupt program, and interrupt method
KR101892273B1 (en) Apparatus and method for thread progress tracking
US20160320984A1 (en) Information processing device, parallel processing program and method for accessing shared memory
US10489218B2 (en) Suppression of speculative accesses to shared memory locations at a processor
US20080281999A1 (en) Electronic system with direct memory access and method thereof
US9043507B2 (en) Information processing system
US10740150B2 (en) Programmable state machine controller in a parallel processing system
JP2017201486A (en) Information processing apparatus, information processing program and information processing method
US20130191839A1 (en) Information processing apparatus, control method therefor, and computer-readable storage medium
JP5867630B2 (en) Multi-core processor system, multi-core processor system control method, and multi-core processor system control program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131125

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140603

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140804

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: 20140826

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140908

R150 Certificate of patent or registration of utility model

Ref document number: 5621896

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees