JP2021039666A - Core allocation device and core allocation method - Google Patents
Core allocation device and core allocation method Download PDFInfo
- Publication number
- JP2021039666A JP2021039666A JP2019162073A JP2019162073A JP2021039666A JP 2021039666 A JP2021039666 A JP 2021039666A JP 2019162073 A JP2019162073 A JP 2019162073A JP 2019162073 A JP2019162073 A JP 2019162073A JP 2021039666 A JP2021039666 A JP 2021039666A
- Authority
- JP
- Japan
- Prior art keywords
- task
- core
- allocation
- unit
- execution
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000013461 design Methods 0.000 claims abstract description 28
- 238000012545 processing Methods 0.000 claims description 62
- 239000000284 extract Substances 0.000 claims description 7
- 230000006870 function Effects 0.000 description 20
- 238000005259 measurement Methods 0.000 description 12
- 230000003252 repetitive effect Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000004044 response Effects 0.000 description 4
- 230000000737 periodic effect Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 1
- 230000000116 mitigating effect Effects 0.000 description 1
Images
Classifications
-
- 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/50—Allocation of resources, e.g. of the central processing unit [CPU]
Abstract
Description
本開示は、コア割当装置及びコア割当方法に関する。 The present disclosure relates to a core allocation device and a core allocation method.
近年、電子制御装置(Electronic Control Unit:ECU)を備える組み込みシステムでは、制御性能の向上、厳格化する環境規制などへの対応、及び、装置の自律化に伴う新たな演算処理の追加などが要求されており、それに伴い、高負荷化が進んでいる。このため、電子制御装置においても、性能向上などを目的として、ヘテロジニアスなマルチコアを備えたプロセッサ(複数種別のコアを備えたプロセッサ)が使用されている。 In recent years, embedded systems equipped with electronic control units (ECUs) have been required to improve control performance, respond to stricter environmental regulations, and add new arithmetic processing due to device autonomy. Along with this, the load is increasing. For this reason, even in electronic control devices, a processor having a heterogeneous multi-core (a processor having a plurality of types of cores) is used for the purpose of improving performance and the like.
また、組み込みシステムにおいては、電子制御装置による演算結果をアクチュエータに対して規定のタイミングで伝達するリアルタイム性が求められる。これに対応するため、ヘテロジニアスなマルチコアを備えた電子制御装置では、タスク全体がより短い時間で完了するように、各コアに対して、そのコアが実行するタスクを適切に割り当てる必要が生じている。 Further, in an embedded system, real-time performance is required in which the calculation result by the electronic control device is transmitted to the actuator at a predetermined timing. To accommodate this, electronic controllers with heterogeneous multi-cores need to properly assign each core the task it performs so that the entire task can be completed in a shorter amount of time. There is.
特許文献1には、性能にばらつきのある複数のコアを備えるプロセッサにおいて、アプリケーションに含まれるタスク群をコアにの割り当てるタスク群割当装置が開示されている。このタスク群割当装置は、コアの配置とコアの性能を抽出し、その抽出したコアの配置及び性能と、アプリケーションが実行可能であるか否かとを対応付ける制約条件を生成し、その制約条件を参照して、予め複数のコアに割り当てられていたタスク群のコアへの割り当てを再度行う。
特許文献1に記載の技術では、タスク群のコアへの割り当てを繰り返すことで、タスク群の適切な割り当てを行うものである。また、タスク群をコアに割り当てる際には、アプリケーションが実行可能であるか否かを、タスクを実際に実行した実行ログから取得する。このため、タスク群のコアへの割り当てを適切に行うためには、アプリケーションの実行と、アプリケーションが実行可能であるか否かの計測とを繰り返し行う必要があり、適切な割り当てを決定するまでに多大な時間を要するという問題がある。
In the technique described in
本発明は、上記課題を鑑みて為されたものであり、適切なタスクの割り当てを容易に行うことが可能なコア割当装置及びコア割当方法を提供することを目的とする。 The present invention has been made in view of the above problems, and an object of the present invention is to provide a core allocation device and a core allocation method capable of easily assigning appropriate tasks.
本開示の一態様に従うコア割当装置は、プロセッサが備える複数種別のコアに対して、当該コアに実行させるタスクを割り当てるコア割当装置であって、前記タスクを定義する設計情報から、前記タスクの特徴を示す特徴情報を取得する特徴取得部と、前記特徴情報と、前記プロセッサにおける前記コアの構成とに基づいて、前記タスクを前記コアに割り当てる割当部と、を有する。 The core allocating device according to one aspect of the present disclosure is a core allocating device that assigns a task to be executed by the core to a plurality of types of cores provided in the processor, and is characterized by the task from the design information that defines the task. It has a feature acquisition unit for acquiring the feature information indicating the above, and an allocation unit for allocating the task to the core based on the feature information and the configuration of the core in the processor.
本発明によれば、適切なタスクの割り当てを容易に行うことが可能になる。 According to the present invention, it becomes possible to easily assign an appropriate task.
以下、本開示の実施例について図面を参照して説明する。 Hereinafter, examples of the present disclosure will be described with reference to the drawings.
図1は、本開示の実施例1に係るコンピュータシステムを示す図である。図1に示すコンピュータシステム100は、コア割当装置101と、電子制御装置(ECU)102とを有する。コア割当装置101は、プロセッサが備える複数のコア(プロセッサ・コア)に対して、そのコアに実行させるタスクを割り当てる。電子制御装置102は、コア割当装置101からタスクの割り当てが行われるプロセッサを有する装置である。電子制御装置102は、本実施例では、車両を制御する車両システム(図示せず)の一部として車両に搭載されているものとするが、他の機器に搭載されてもよいし、単体で用いられてもよい。なお、車両システムによる車両の制御としては、例えば、車両の自動運転の制御などが挙げられる。
FIG. 1 is a diagram showing a computer system according to a first embodiment of the present disclosure. The
電子制御装置102は、プロセッサ103と、メモリ104と、スケジューリング部105と、周辺装置106とを有する。
The
プロセッサ103は、複数のコア107を有する。コア107は、タスクの実行命令に応じてタスクを実行し、その実行結果を出力する。コア107は、図の例では、N個ある。N個のコア107を区別する必要がある場合、各コア107をコア107_1〜107_Nと呼ぶ。また、コア107には、性能が異なる複数の種別がある。コアの種別としては、例えば、処理速度の速い第1の種別であるコア種別1と、コア種別1よりも処理速度が遅い第2の種別であるコア種別2などがある。
The
メモリ104は、コア107に対する実行命令及びコア107から出力される実行結果などの種々の情報を記憶する。スケジューリング部105は、各コア107と各コア107で実行するタスクとの対応関係を示す割当情報に基づいて、各コア107で実行するタスクを切り替えながら、各コア107に必要なタスクを実行させる。周辺装置106は、外部装置との通信などを行う。
The
図2は、コア割当装置101のハードウェア構成を示す図である。図2に示すようにコア割当装置101は、CPU(Central Processing Unit)111と、メモリ112と、補助記憶部113と、入力部114と、通信部115とを有する。
FIG. 2 is a diagram showing a hardware configuration of the
CPU111は、メモリ112に記録されているプログラムを読み取り、その読み取ったプログラムを実行することで種々の機能を実現する。メモリ112は、CPU11の動作を規定するプログラムと、CPU111にて使用される種々のデータを記録する。補助記憶部113は、プログラム及びデータを記憶する。補助記憶部113に記憶されたプログラム及びデータは、必要に応じてメモリ12にロードされる。入力部114は、コア割当装置101のユーザから種々の情報を受け付ける。通信部115は、電子制御装置102と通信可能に接続する。
The
図3は、コア割当装置101の機能的な構成を示す図である。図3に示すようにコア割当装置101は、特徴取得部201と、タスク分類部202と、コア種別決定部203と、コア割当決定部204とを有する。
FIG. 3 is a diagram showing a functional configuration of the
特徴取得部201は、電子制御装置102の各コア107に実行させるアプリケーションプログラムのタスク群に含まれる各タスクを定義する設計情報211から、タスクの特徴(性質)を示す特徴情報をタスクごとに取得する。設計情報211は、例えば、タスク又はアプリケーションプログラムのソースコードなどである。特徴情報は、複数の特徴を示してもよい。
The
タスク分類部202、コア種別決定部203及びコア割当決定部204は、特徴取得部201が取得した特徴情報と、電子制御装置102のプロセッサ103におけるコア107の構成とに基づいて、タスク群内の各タスクをコア107に割り当てる割当部210を構成する。コア107の構成は、例えば、コアの種別ごとのコアの数である。
The
タスク分類部202は、特徴取得部201にて取得された特徴情報と、タスク群に含まれる各タスクを示すタスクリスト212とに基づいて、各タスクを複数の区分のいずれかに分類し、その分類結果をタスク分類結果として生成する。例えば、タスクの特徴が複数ある場合、タスク分類部202は、特徴ごとに、タスクを複数のサブ区分のいずれかに分類し、各サブ区分の組み合わせに応じて、タスクを複数の区分のいずれかに分類する。
The
コア種別決定部203は、タスク分類部202にて生成されたタスク分類結果に基づいて、タスクリスト212が示すタスクごとに、そのタスクを実行するコアの種別であるコア種別と、そのタスクを実行するコアの数の上限値であるコア数とを決定し、各タスクと各タスクのコア種別及びコア数との対応関係を示す種別割当情報を生成する。
Based on the task classification result generated by the
コア割当決定部204は、コア種別決定部203にて生成された種別割当情報に基づいて、電子制御装置102に備わった複数のコア107のそれぞれに対して、そのコア107にて実行するタスクを割り当て、その割当結果として、各タスクとそれらを割り当てるコア107との対応関係を示す割当情報を生成する。
Based on the type allocation information generated by the core
コア割当決定部204は、生成した割当情報を電子制御装置102に出力して、電子制御装置102のスケジューリング部105に設定することで、割当情報に応じて電子制御装置102の各コア107にタスクを実行させてもよい。
The core
なお、図3に示したコア割当装置101の機能的な構成は、図2に示したコア割当装置101のハードウェア構成にて実現することができる。また、設計情報211及びタスクリスト212は、コア割当装置101のメモリ112又は補助記憶部113などに記憶されてもよい。
The functional configuration of the
次に、特徴取得部201にて取得される特徴情報について説明する。特徴情報は、本実施例では、タスクの特徴として、時間制約条件、安全性レベル、駆動形態、実行間隔、処理負荷及び並列性を示す。なお、これらの特徴は、単なる一例であり、他の特徴が追加されてもよいし、一部の特徴が除外されてもよい。例えば、特徴情報は、タスクの特徴として、時間制約条件、安全性レベル、駆動形態、実行間隔、処理負荷及び並列性の少なくとも1つを含むものでもよい。
Next, the feature information acquired by the
時間制約条件は、タスクに時間制約(タスクが開始されてから終了するまでの時間制限)があるか否かを示す。時間制約のないタスクは、明示的な時間制約がないが、できるだけ早く終了させるベストエフォート(Best Effort)型のタスクである。 The time constraint condition indicates whether or not the task has a time constraint (time limit from the start to the end of the task). A task without time constraints is a best effort type task that has no explicit time constraints but is completed as soon as possible.
安全性レベルは、タスクに割り当てられた安全性の程度を示す。本実施例では、安全性レベルとして、ASIL(Automotive Safety Integrity Level:安全性要求レベル)を用いる。ASILでは、安全性は、5段階で評価され、安全性の程度が高い方から順に、ASIL−D、ASIL−C、ASIL−B、ASIL−A、QM(Quality Management)と呼ばれる。 The safety level indicates the degree of safety assigned to the task. In this embodiment, ASIL (Automotive Safety Integrity Level) is used as the safety level. In ASIL, safety is evaluated on a five-point scale, and is called ASIL-D, ASIL-C, ASIL-B, ASIL-A, and QM (Quality Management) in order from the highest degree of safety.
駆動形態は、タスクが駆動する形態の種類を示す。本実施例では、駆動形態は、タスクが周期的に駆動する周期駆動か、又は、所定のイベントの発生に応じて駆動する割込み駆動かを示す。 The drive mode indicates the type of mode in which the task is driven. In the present embodiment, the drive mode indicates whether the task is a periodic drive that is driven periodically or an interrupt drive that is driven in response to the occurrence of a predetermined event.
実行間隔は、タスクが実行される時間間隔を示す。実行間隔は、タスクが時間駆動の場合、タスクが駆動される周期であり、タスクが割込み駆動の場合、イベントが発生する時間間隔(タスクが実行される時間間隔)の統計値である。統計値は、例えば、平均値、最大値及び最小値などである。なお、タスクが割込み駆動の場合、タスクが実行される実行間隔は後述するプロファイラ205にて取得されてもよい。
The execution interval indicates the time interval in which the task is executed. The execution interval is a cycle in which the task is driven when the task is time-driven, and is a statistical value of the time interval in which the event occurs (time interval in which the task is executed) when the task is interrupt-driven. The statistical values are, for example, an average value, a maximum value, a minimum value, and the like. When the task is interrupt-driven, the execution interval at which the task is executed may be acquired by the
処理負荷は、タスクによるコア107への負荷の程度を示す。本実施例では、処理負荷は、所定の種別のコアにおいてタスクを実行してから終了するまでにかかる実行時間の最大値である最悪実行時間を示す。 The processing load indicates the degree of load on the core 107 due to the task. In this embodiment, the processing load indicates the worst execution time, which is the maximum value of the execution time from the execution of the task to the end in the core of a predetermined type.
並列性は、タスクの並列化(タスクを複数のコア107にて並列に実行させること)による処理負荷の軽減度合いを示す。 The parallelism indicates the degree of reduction of the processing load by parallelizing the tasks (execution of the tasks in parallel by a plurality of cores 107).
図4は、タスク分類部202の動作の一例を説明するためのフローチャートである。タスク分類部202は、図4に示されるステップS301〜S306の処理をタスクリスト212が示す複数のタスクのそれぞれに対して行う。
FIG. 4 is a flowchart for explaining an example of the operation of the
先ず、タスク分類部202は、特徴情報に基づいて、タスクに対して時間制約条件に関する分類を行う(ステップS301)。本実施例では、タスク分類部202は、タスクを時間制約がある「時間制約型」と、時間制約がない「ベストエフォート型」とのいずれかに分類する。
First, the
続いて、タスク分類部202は、特徴情報に基づいて、タスクに対してASILに関する分類を行う(ステップS302)。本実施例では、タスク分類部202は、タスクを、割り当てられた安全性レベルがASIL−D〜ASIL−Aのいずれかである「ASIL」と、割り当てられた安全性レベルがQMである「QM」とのいずれかに分類する。なお、ASILに関する分類では、タスク分類部202は、タスクを、割り当てられた安全性レベルごとに、ASIL−D、ASIL−C、ASIL−B、ASIL−A及びQMのいずれかに分類してもよい。また、ASILに関する分類を行うことで、安全性を担保するために必要なタスクのオーバヘッドを低減することができる。
Subsequently, the
さらに、タスク分類部202は、特徴情報に基づいて、タスクに対して駆動形態に関する分類を行う(ステップS303)。本実施例では、タスク分類部202は、タスクを、周期的に駆動する「周期駆動」と、所定のイベントの発生に応じて駆動する「割込み駆動」とのいずれかに分類する。
Further, the
また、タスク分類部202は、特徴情報に基づいて、タスクに対して実行間隔に関する分類を行う(ステップS304)。本実施例では、タスク分類部202は、タスクを、長い時間間隔で実行される「長周期」と、短い時間間隔で実行される「短周期」とのいずれかに分類する。例えば、実行間隔が100msのタスクと、実行間隔が10msのタスクとがある場合、タスク分類部202は、実行間隔が長い方のタスク(実行間隔が100msのタスク)を「長周期」に分類し、実行間隔が短い方のタスク(実行間隔が10msのタスク)を「短周期」に分類する。また、タスクの実行間隔が3種類以上ある場合には、タスク分類部202は、タスクを、それらの種類のいずれかに分類してもよい。また、タスク分類部202は、タスクの実行間隔が閾値以上であるものを「長周期」、タスクの実行間隔が閾値未満である「短周期」としてもよい。
Further, the
さらに、タスク分類部202は、特徴情報に基づいて、タスクに対して処理負荷に関する分類を行う(ステップS305)。本実施例では、タスク分類部202は、タスクを、処理負荷である最悪実行時間が閾値以上である「高負荷」と、最悪実行時間が閾値未満である「低負荷」とのいずれかに分類する。閾値は、本実施例では、実行間隔の50%であるとするが、他の値でもよい。なお、処理負荷に関する分類を行うことで、キャッシュの利用効率を高くすることが可能になる。
Further, the
そして、タスク分類部202は、特徴情報に基づいて、タスクに対して並列性に関する分類を行う(ステップS306)。本実施例では、タスク分類部202は、タスクを、並列化によって処理負荷の軽減度合いが閾値以上軽減する「並列」と、並列化しても処理負荷の軽減度合いが閾値未満である「単一」とのいずれかに分類する。なお、タスク分類部202は、処理負荷の軽減度合いに応じて、タスクを3つ以上に分類してもよい。例えば、タスク分類部202は、軽減度合いが30%未満、30%以上かつ50%未満、50%以上の3つのサブ区分のいずかに分類してもよい。
Then, the
図5は、上記動作によるタスクの分類内容を示す図である。図5に示されるように、上記の動作の例では、タスクは、時間制約条件によって「時間制約型」又は「ベストエフォード型」に分類され、安全性レベルによって「QM」又は「ASIL」に分類され、駆動形態によって「周期駆動」又は「割込み駆動」に分類され、実行間隔によって「長周期」又は「短周期」に分類され、処理負荷によって「高負荷」又は「低負荷」に分類され、並列性によって「並列」又は「単一」に分類される。このため、タスクは、64通りに分類される。 FIG. 5 is a diagram showing the classification contents of tasks according to the above operation. As shown in FIG. 5, in the above example of operation, the task is classified into "time constraint type" or "best efford type" according to the time constraint condition, and is classified into "QM" or "ASIL" according to the safety level. It is classified into "periodic drive" or "interrupt drive" according to the drive mode, "long cycle" or "short cycle" according to the execution interval, and "high load" or "low load" depending on the processing load. It is classified as "parallel" or "single" depending on the parallelism. Therefore, the tasks are classified into 64 ways.
図6は、コア種別決定部203の機能的な構成を示す図である。図6に示すコア種別決定部203は、タスク分類部202にて生成されたタスク分類結果であるタスク分類結果601と、タスクをコア107に割り当てる際の方針を示すコア割当ポリシ602とを保持する。また、コア種別決定部203は、コア種別管理部603を有する。
FIG. 6 is a diagram showing a functional configuration of the core
図7は、タスク分類結果601の一例を示す図である。図7に示すタスク分類結果502は、タスクを識別するタスクIDを格納するフィールド701と、タスクの区分を示す区分情報であるタスク分類を格納するフィールド702とを含む。タスク分類は、例えば、上記の64通りの分類のそれぞれを示す。
FIG. 7 is a diagram showing an example of the
コア割当ポリシ602は、電子制御装置102のプロセッサ103におけるコア107の構成に応じて予め用意される。コア割当ポリシ602は、具体的には、タスク分類ごとに、そのタスク分類のタスクを割り当てるコアの種別であるコア種別と、コアの個数の上限値であるコア数とを示す。タスクに割り当てるコア種別は、1種類に限らず、2種類以上でもよい。
The
図8は、コア割当ポリシ602の一例を示す図である。図8に示すコア割当ポリシ602は、タスク分類を格納するフィールド801と、コア種別を格納するフィールド802と、コア数を格納するフィールド803とを含む。
FIG. 8 is a diagram showing an example of the
コア種別管理部603は、タスク分類結果601及びコア割当ポリシ602を用いて各タスクに割り当てるコア種別及びコア数を決定し、その決定したコア種別及びコア数を示す種別割当情報を生成する。タスク分類結果601及びコア割当ポリシ602が図7及び図8で示される場合、タスクIDが「タスク2」のタスクを例に挙げると、図7のタスク分類結果601によってタスクID「タスク2」にタスク分類として「分類2」が対応付けられており、「分類2」には、コア割当ポリシ602によって、コア種別として「コア種別1」、コア数として「4」が対応付けられている。このため、コア種別管理部603は、タスクIDが「タスク2」のタスクに割り当てるコア種別を「コア種別1」、コア数を「4」と決定する。コア種別管理部603は、このような処理をタスクIDごとに行うことで、各タスクに割り当てるコア種別及びコア数を決定する。
The core
コア割当決定部204は、種別割当情報に基づいて、タスクのコア107への割り当てを行い、その割当結果である割当情報を出力する。
The core
図9は、コア割当決定部204にて生成された割当情報の一例を示す図である。図9の例では、コア107_1〜107_8までの8個のコア107がある。コア107_1〜107_4は、処理速度が速いコア種別1のコアであり、コア107_5〜107_8は、処理速度の遅いコア種別2のコアである。
FIG. 9 is a diagram showing an example of allocation information generated by the core
「ベストエフォート型のタスク」については、適切に時分割して実行されれば、コア種別に関わらず、いずれのコア107で実行されても問題がない。このため、「ベストエフォート型のタスク」は、他の特徴によらず、コア107_1〜107_8に割り当てられている。 As for the "best effort type task", if it is executed in an appropriate time division manner, there is no problem even if it is executed in any core 107 regardless of the core type. Therefore, the "best effort type task" is assigned to the cores 107_1 to 107_8 regardless of other features.
また、「時間制約型のタスク」については、図の例では、安全性レベルが「QM」の場合、大量に実行される、つまり、実行間隔が「短周期」であるとしている。このため、安全性レベルが「QM」のタスクは、処理速度の速いコア種別1のコア107_1〜107_4に割り当てられている。このとき、並列性が「並列」のタスクである「QM並列実行タスク」は、複数(図の例では4個)のコア107_1〜107_4に割り当てられ、並列性が「単一」のタスクである「QMタスク」は、コア107_1〜107_3にそれぞれ1つずつ割り当てられる。
Further, regarding the "time-constrained task", in the example of the figure, when the safety level is "QM", it is executed in large quantities, that is, the execution interval is "short cycle". Therefore, the task having the safety level "QM" is assigned to the cores 107_1 to 107_4 of the
また、安全性レベルが「ASIL」のタスクである「ASILタスク」は、処理負荷が「高負荷」の場合、高速のコア種別1のコア107_1〜107_4のいずれかに割り当てられ、処理負荷が「低負荷」の場合、低速のコア種別2のコア107_5〜107_8のいずれかに割り当てられる。
Further, the "ASIL task", which is a task having a safety level of "ASIL", is assigned to one of the cores 107_1 to 107_4 of the high-
なお、コア割当装置101は、アプリケーションプログラムのタスクの他に、OS(Operating System)に関する処理及びBSWに関する処理などをコア107に割り当ててもよい。図9の例では、コア割当決定部204は、ASILが割り当てられているOSの処理である「ASIL OS」と、ASILが割り当てられているBSWの処理である「ASIL BSW」とをそれぞれコア種別2のコアに割り当てている。
In addition to the tasks of the application program, the
以上説明した本実施例によれば、タスクの設計情報211から取得したタスクの特徴情報に基づいてタスクがコア107に割り当てられる。したがって、タスクの実行を繰り返さずにタスクの適切な割り当てが可能となるため、適切なタスクの割り当てを容易に行うことが可能になる。
According to the present embodiment described above, the task is assigned to the core 107 based on the feature information of the task acquired from the
また、本実施例では、タスクの特徴情報に基づいて、タスクを複数の区分のいずれかに分類され、その区分に基づいて、タスクを割り当てるコア107の種別とコア数とが決定される。このため、タスクとそのタスクを実行するコア107との対応関係の組み合わせの数を減らすことが可能になり、適切なタスクの割り当てをより容易に行うことが可能になる。このため、タスクの割り当ての決定を短時間で行うことが可能になる。 Further, in this embodiment, the task is classified into one of a plurality of categories based on the feature information of the task, and the type and the number of cores 107 to which the task is assigned are determined based on the category. Therefore, it becomes possible to reduce the number of combinations of correspondences between the task and the core 107 that executes the task, and it becomes possible to more easily assign an appropriate task. Therefore, it is possible to determine the task assignment in a short time.
また、本実施例では、特徴情報は、複数の特徴を示すため、タスクの特徴を適切に考慮してタスクの割り当てが可能となる。また、特徴は、タスクの時間制約条件、タスクに要求される安全性、タスクが実行される駆動形態、タスクが実行される実行間隔、タスクの実行による処理負荷、及び、タスクの並列性の少なくとも1つを含む。このため、適切にタスクの割り当てが可能となる。 Further, in the present embodiment, since the feature information indicates a plurality of features, the task can be assigned by appropriately considering the task features. In addition, the features are at least the time constraint condition of the task, the safety required for the task, the driving mode in which the task is executed, the execution interval in which the task is executed, the processing load due to the execution of the task, and the concurrency of the task. Including one. Therefore, tasks can be assigned appropriately.
本実施例では、特徴取得部201がコアの割り当てに使用するタスクの特徴を指定する指定情報を受け付ける点で実施例1とは異なる。
This embodiment is different from the first embodiment in that the
特徴取得部201は、指定情報を受け付けると、その指定情報に基づいて、設計情報211から特徴情報を取得する。具体的には、特徴取得部201は、指定情報にて指定された特徴を示す特徴情報を設計情報211から取得する。
When the
指定情報は、入力部114を用いてユーザから受け付けることができる。例えば、電子制御装置102に搭載されているコア107がコア種別ごとに1つずつしかない場合、ユーザは、実施例1で説明した特徴(時間制約条件、安全性レベル、駆動形態、実行間隔、処理負荷及び並列性)から並列性を除外したものを指定してもよい。また、電子制御装置102が車両の自動運転の制御のようなタスクが終了するデッドラインが重要な用途に使用される場合、時間制約条件が重要となるが、タスクが終了するデッドラインが重要ではない用途に使用される場合、時間制約条件が重要とならないことがある。この場合、ユーザは、実施例1で説明した特徴から時間制約条件を除外したものを指定することができる。
The designated information can be received from the user using the
以上説明した本実施例によれば、電子制御装置102の種類や用途などに応じて使用する特徴を選択することが可能になるため、不要な分類の低減、及び、不要な割当制約による処理能力の低下を抑制することが可能になる。
According to the present embodiment described above, since the features to be used can be selected according to the type and application of the
本実施例では、特徴取得部201が処理負荷に係る特徴情報を取得する方法の第1の具体例について説明する。
In this embodiment, the first specific example of the method in which the
本実施例の方法では、電子制御装置102を用いて各タスクを実行することで、各タスクの処理負荷として最悪実行時間を計測し、その計測した最悪実行時間を設計情報211に予め組み込んでおく。この場合、特徴取得部201は、設計情報211から最悪実行時間を抽出することで、「処理負荷」に係る特徴情報を取得する。なお、同様な方法で、タスクが割込み駆動の場合の実行間隔に係る特徴情報を取得することもできる。
In the method of this embodiment, by executing each task using the
以上説明した本実施例によれば、ソースコードなどの情報からタスクの処理負荷を予測することが困難な場合においても、処理負荷に係る特徴情報を取得することが可能となる。 According to the present embodiment described above, even when it is difficult to predict the processing load of a task from information such as source code, it is possible to acquire feature information related to the processing load.
本実施例では、特徴取得部201が処理負荷に係る特徴情報を取得する方法の第2の具体例について説明する。
In this embodiment, a second specific example of the method in which the
本実施例の方法では、特徴取得部201は、設計情報211に含まれるタスクのソースコードを参照し、そのソースコードの規模であるソースコード量に基づいて、処理負荷を予測する。具体的には、特徴取得部201は、ソースコードに含まれる所定の関数を実行するのに要する関数実行時間と、ソースコード量とに基づいて、処理負荷である最悪実行時間を予測する。例えば、特徴取得部201は、ソースコード量としてソースコードの行数を求め、その行数に関数実行時間に応じた時間を乗算することで、最悪実行時間を予測する。関数実行時間は、例えば、特徴取得部201にて保持されていてもよいし、設計情報211に予め組み込まれていてもよい。
In the method of this embodiment, the
タスクの設計情報211に繰り返し文及び分岐文などの制御文が含まれる場合、特徴取得部201は、その制御文を考慮して処理負荷を予測してもよい。例えば、設計情報211に繰り返し文が含まれる場合、特徴取得部201は、繰り返し文の行数に、その繰り返し文に対応する処理を繰り返す回数を乗算することでソースコード量を補正し、その補正したソースコード量に基づいて、処理負荷を予測する。また、設計情報211に分岐文が含まれる場合、特徴取得部201は、分岐文の行数を、その分岐文で分岐される処理の数で除算することで、ソースコード量を補正し、その補正したソースコード量に基づいて、処理負荷を予測する。
When the
以上説明した本実施例によれば、タスクの処理負荷を測定する環境がない場合でも、処理負荷に係る特徴情報を取得することができる。 According to the present embodiment described above, feature information related to the processing load can be acquired even when there is no environment for measuring the processing load of the task.
本実施例では、特徴取得部201が処理負荷に係る特徴情報を取得する方法の第3の具体例について説明する。
In this embodiment, a third specific example of the method in which the
本実施例の方法では、特徴取得部201は、設計情報211に含まれるタスクのアセンブラコードを参照し、タスクが実行を要求する命令数に基づいて、処理負荷を予測する。具体的には、特徴取得部201は、コア107のクロック周波数、パイプライン段数及びメモリのアクセスに要するサイクル数などから一命令当たりの実行時間である命令実行時間を算出し、その命令実行時間と命令数とに基づいて、「処理負荷」である最悪実行時間を予測する。例えば、特徴取得部201は、命令実行時間に応じた時間と命令数とを乗算することで、最悪実行時間を予測する。
In the method of this embodiment, the
タスクの設計情報211に繰り返し文及び分岐文などの制御文が含まれる場合、特徴取得部201は、その制御文を考慮して処理負荷を予測してもよい。例えば、設計情報211に繰り返し文が含まれる場合、特徴取得部201は、繰り返し文に含まれる命令数に、その繰り返し文に対応する処理を繰り返す回数を乗算することで命令数を補正し、その補正した命令数に基づいて、処理負荷を予測する。また、設計情報211に分岐文が含まれる場合、特徴取得部201は、分岐文に含まれる命令数を、その分岐文で分岐される処理の数で除算することで、命令数を補正し、その補正した命令数に基づいて、処理負荷を予測する。
When the
以上説明した本実施例によれば、タスクの処理負荷を測定する環境がない場合でも、処理負荷に係る特徴情報を取得することができる。 According to the present embodiment described above, feature information related to the processing load can be acquired even when there is no environment for measuring the processing load of the task.
本実施例では、特徴取得部201が処理負荷に係る特徴情報を取得する方法の第4の具体例について説明する。
In this embodiment, a fourth specific example of the method in which the
本実施例の方法では、特徴取得部201は、設計情報211に含まれるタスクのソースコードを参照し、そのソースコードに含まれる所定の関数の数に基づいて、処理負荷を予測する。所定の関数は、例えば、負荷が大きい関数である。
In the method of this embodiment, the
特徴取得部201は、具体的には、ソースコードに含まれる所定の関数を実行するのに要する関数実行時間と所定の関数の数とに基づいて処理負荷である最悪実行時間を予測する。例えば、特徴取得部201は、所定の関数の数と関数実行時間に応じた時間とを乗算することで、最悪実行時間を予測する。関数実行時間は、例えば、特徴取得部201にて保持されていてもよいし、設計情報に予め組み込まれていてもよい。
Specifically, the
タスクの設計情報211に繰り返し文及び分岐文などの制御文が含まれる場合、特徴取得部201は、その制御文を考慮して処理負荷を予測してもよい。例えば、設計情報211に繰り返し文が含まれる場合、特徴取得部201は、繰り返し文に含まれる所定の関数の数に、その繰り返し文に対応する処理を繰り返す回数を乗算することで所定の関数の数を補正し、その補正した所定の関数の数に基づいて、処理負荷を予測する。また、設計情報211に分岐文が含まれる場合、特徴取得部201は、分岐文に含まれる所定の関数の数を、その分岐文で分岐される処理の数で除算することで、所定の関数の数量を補正し、その補正した所定の関数の数に基づいて、処理負荷を予測する。
When the
以上説明した本実施例によれば、タスクの処理負荷を測定する環境がない場合でも、処理負荷に係る特徴情報を取得することができる。 According to the present embodiment described above, feature information related to the processing load can be acquired even when there is no environment for measuring the processing load of the task.
本実施例では、特徴取得部201が並列性に係る特徴情報を取得する方法の具体例について説明する。
In this embodiment, a specific example of a method in which the
本実施例の方法では、特徴取得部201は、設計情報に含まれるタスクのソースコードを解析して、そのソースコードにおける複数のコアにて並列に実行することができる箇所である並列箇所を特定し、その並列箇所に基づいて、並列性に関する特徴情報を取得する。例えば、特徴取得部201は、ソースコードにおける並列箇所の行数が所定値以上の場合、処理負荷の軽減度合いが閾値以上であると判断し、並列箇所の行数が所定値未満の場合、処理負荷の軽減度合いが閾値未満と判断する。所定値は、例えば、ソースコード全体の行数の2割である。
In the method of this embodiment, the
以上説明したように本実施例によれば、タスクの並列性が設計情報211で定義されていない場合でも、タスクの並列性に係る特徴情報を取得することが可能になる。
As described above, according to the present embodiment, it is possible to acquire the feature information related to the parallelism of the tasks even when the parallelism of the tasks is not defined in the
本実施例では、タスクのコア107への割り当てを一度決定した後に変更する点で実施例1とは異なる。 This embodiment is different from the first embodiment in that the assignment of the task to the core 107 is determined once and then changed.
図10は、本実施例に係るコア割当装置101の機能的な構成を示す図である。図10に示すコア割当装置101は、図3に示した実施例1に係るコア割当装置101の構成に加えて、プロファイラ205をさらに備える。
FIG. 10 is a diagram showing a functional configuration of the
プロファイラ205は、コア割当決定部204で生成された割当情報に応じて電子制御装置102がタスクを実行した履歴である実行ログ213から、各タスクの実行に要した実行時間の実測値を実行実測値として抽出する解析部である。なお、タスクが複数回実行された場合、プロファイラ205は、各実行時間の実測値の統計値(例えば、平均値又は最大値)を実行実測値として抽出してもよい。
The
割当部210は、実行ログ213がまだ生成されていない場合、つまり、割当情報をまだ生成していない場合、実施例1と同様にして割当情報を生成して電子制御装置102に出力する。
When the
その後、電子制御装置102がタスクを実行して実行ログ213を生成すると、割当部210は、特徴取得部201が取得した特徴情報と、プロファイラ205が実行ログ213から取得した各タスクの実行実測値に基づいて、各タスクをコア107に割り当て、その割当結果である割当情報を出力する。
After that, when the
具体的には、タスク分類部202は、特徴取得部201が取得した特徴情報と、プロファイラ205が取得した各タスクの実行実測値に基づいて、各タスクの分類を再度行う。例えば、タスク分類部202は、特徴情報が示す各特徴による分類に加えて、実行実測値に関する分類を行う。実行実測値に関する分類では、例えば、タスク分類部202は、実行実測値を処理負荷である最悪実行時間と比較し、実行実測値が最悪実行時間以上である「想定以上」と、実行実測値が最悪実行時間未満である「想定未満」とのいずれかに分類する。
Specifically, the
コア種別決定部203は、実行実測値に関する分類をさらに用いて、種別割当情報を再度生成する。例えば、コア種別決定部203は、コア割当ポリシ602として、実行実測値に関する分類を含まない第1のコア割当ポリシと、実行実測値に関する分類を含む第2のコア割当ポリシとを予め保持する。コア種別決定部203は、実行実測値に関する分類を行っていない場合、第1のコア割当ポリシを用いて、種別割当情報を生成し、実行実測値に関する分類を行った場合、第2のコア割当ポリシを用いて、種別割当情報を生成する。
The core
なお、タスク分類部202は、特徴取得部201が取得した特徴情報に含まれる処理負荷である最悪実行時間を実行実測値に更新し、その更新した最悪実行時間を示す特徴情報に基づいて、実施例1と同様に特徴情報が示す各特徴による分類を行ってもよい。この場合、コア種別決定部203及びコア割当決定部204の動作は、実施例1と同様となる。
The
以上説明した本実施例によれば、タスクの処理負荷の実測値に基づいてタスクのコア107への割り当てが可能となる。これにより、コア107とタスクとの相性を考慮してタスクの割り当てが可能となる。 According to the present embodiment described above, the task can be assigned to the core 107 based on the measured value of the processing load of the task. As a result, the task can be assigned in consideration of the compatibility between the core 107 and the task.
本実施例では、実施例8と比較して、実行ログ213がリアルタイムで更新される点で異なる。実行ログ213の更新は、例えば、電子制御装置102のスケジューリング部105にてタスクが実行されるたびに行われる。本実施例の場合、コア割当装置101は電子制御装置102と共に、車両システムに配置されてもよい。
The present embodiment differs from the eighth embodiment in that the
プロファイラ205は、実行ログ213が更新されるたびに、又は、一定期間ごとに、実行ログ213から実行実測値を抽出する。
The
割当部210は、プロファイラ205が実行実測値を抽出すると、その実行実測値と、特徴取得部201が取得した特徴情報とに基づいて、各タスクをコア107に割り当て、割当情報を再度生成する。割当部210は、その生成した割当情報を電子制御装置102に出力して、その割当情報に応じて電子制御装置102の各コア107にタスクを実行させることで、実行ログ213を更新する。
When the
なお、電子制御装置102のスケジューリング部105は、駆動中に、タスクのスケジューリングに用いる割当情報を、割当部210からの割当情報に更新することが望ましい。この場合、スケジューリング部105は、処理が完了したタスクから順に、更新した割当情報に基づいてスケジューリングを行う。また、タスクを実行中のコア107は、タスクの終了後に、更新した割当情報に基づくタスクの実行を行う。
It is desirable that the
以上説明した本実施例によれば、タスクの処理負荷の実測値に基づいてタスクのコア107への割り当てが可能となる。さらに、タスクのコア107への割り当てを動的に更新することが可能になるため、環境の変化などに対応してタスクの割り当てが可能となる。 According to the present embodiment described above, the task can be assigned to the core 107 based on the measured value of the processing load of the task. Further, since the assignment of the task to the core 107 can be dynamically updated, the task can be assigned in response to changes in the environment or the like.
上述した本開示の実施形態は、本開示の説明のための例示であり、本開示の範囲をそれらの実施形態にのみ限定する趣旨ではない。当業者は、本発明の範囲を逸脱することなしに、他の様々な態様で本発明を実施することができる。 The embodiments of the present disclosure described above are examples for the purpose of explaining the present disclosure, and the scope of the present disclosure is not intended to be limited only to those embodiments. One of ordinary skill in the art can practice the present invention in various other aspects without departing from the scope of the present invention.
100:コンピュータシステム、101:コア割当装置、102:電子制御装置、103:プロセッサ、104:メモリ、105:スケジューリング部、106:周辺装置、107:コア、201:特徴取得部、202:タスク分類部、203:コア種別決定部、204:コア割当決定部、205:プロファイラ、210:割当部
100: Computer system, 101: Core allocation device, 102: Electronic control device, 103: Processor, 104: Memory, 105: Scheduling unit, 106: Peripheral device, 107: Core, 201: Feature acquisition unit, 202: Task classification unit , 203: Core type determination unit, 204: Core allocation determination unit, 205: Profiler, 210: Assignment unit
Claims (8)
前記タスクを定義する設計情報から、前記タスクの特徴を示す特徴情報を取得する特徴取得部と、
前記特徴情報と、前記プロセッサにおける前記コアの構成とに基づいて、前記タスクを前記コアに割り当てる割当部と、を有するコア割当装置。 A core allocation device that assigns tasks to be executed by multiple types of cores provided by a processor.
A feature acquisition unit that acquires feature information indicating the features of the task from the design information that defines the task, and
A core allocation device having an allocation unit that allocates the task to the core based on the feature information and the configuration of the core in the processor.
前記特徴情報に基づいて、前記タスクを複数の区分のいずれかに分類する分類部と、
前記タスクの区分と前記コアの構成とに基づいて、前記タスクを実行するコアの種別及び数を決定する種別決定部と、
前記種別決定部の決定結果に基づいて、前記タスクを前記コアに割り当てる割当決定部と、を有する、請求項1に記載のコア割当装置。 The allocation unit
A classification unit that classifies the task into any of a plurality of categories based on the feature information,
A type determination unit that determines the type and number of cores that execute the task based on the task classification and the core configuration.
The core allocation device according to claim 1, further comprising an allocation determination unit that allocates the task to the core based on the determination result of the type determination unit.
前記割当部は、前記特徴情報及び前記実行時間に基づいて、前記タスクを前記コアに割り当てる、請求項1に記載のコア割当装置。 The processor further has an analysis unit that extracts the execution time required for the execution of the task from the execution log of executing the task according to the allocation result of the task by the allocation unit.
The core allocation device according to claim 1, wherein the allocation unit allocates the task to the core based on the feature information and the execution time.
前記解析部は、前記割当部によって更新された実行ログに基づいて、前記実行時間を抽出する、請求項6に記載のコア割当装置。 The allocation unit updates the execution log by causing the processor to execute the task according to the allocation result.
The core allocation device according to claim 6, wherein the analysis unit extracts the execution time based on the execution log updated by the allocation unit.
前記タスクを定義する設計情報から、前記タスクの特徴を示す特徴情報を取得し、
前記特徴情報と、前記プロセッサにおける前記コアの構成とに基づいて、前記タスクを前記コアに割り当てる、コア割当方法。
This is a core allocation method using a core allocation device that allocates tasks to be executed by the cores of multiple types provided by the processor.
From the design information that defines the task, the feature information indicating the feature of the task is acquired, and the feature information is obtained.
A core allocation method for allocating the task to the core based on the feature information and the configuration of the core in the processor.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019162073A JP2021039666A (en) | 2019-09-05 | 2019-09-05 | Core allocation device and core allocation method |
PCT/JP2020/030551 WO2021044810A1 (en) | 2019-09-05 | 2020-08-11 | Core allocation device and core allocation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019162073A JP2021039666A (en) | 2019-09-05 | 2019-09-05 | Core allocation device and core allocation method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2021039666A true JP2021039666A (en) | 2021-03-11 |
Family
ID=74847269
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2019162073A Pending JP2021039666A (en) | 2019-09-05 | 2019-09-05 | Core allocation device and core allocation method |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP2021039666A (en) |
WO (1) | WO2021044810A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113657759A (en) * | 2021-08-17 | 2021-11-16 | 北京百度网讯科技有限公司 | Task processing method, device, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003271405A (en) * | 2002-03-13 | 2003-09-26 | Hitachi Ltd | Job execution computer determining method for job scheduler |
JP2014206979A (en) * | 2013-04-11 | 2014-10-30 | 三星電子株式会社Samsung Electronics Co.,Ltd. | Apparatus and method of parallel processing execution |
-
2019
- 2019-09-05 JP JP2019162073A patent/JP2021039666A/en active Pending
-
2020
- 2020-08-11 WO PCT/JP2020/030551 patent/WO2021044810A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003271405A (en) * | 2002-03-13 | 2003-09-26 | Hitachi Ltd | Job execution computer determining method for job scheduler |
JP2014206979A (en) * | 2013-04-11 | 2014-10-30 | 三星電子株式会社Samsung Electronics Co.,Ltd. | Apparatus and method of parallel processing execution |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113657759A (en) * | 2021-08-17 | 2021-11-16 | 北京百度网讯科技有限公司 | Task processing method, device, equipment and storage medium |
CN113657759B (en) * | 2021-08-17 | 2023-10-31 | 北京百度网讯科技有限公司 | Task processing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2021044810A1 (en) | 2021-03-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2176751B1 (en) | Scheduling by growing and shrinking resource allocation | |
US9632822B2 (en) | Multi-core device and multi-thread scheduling method thereof | |
US8970607B2 (en) | Run-time allocation of functions to a hardware accelerator | |
US8875146B2 (en) | Systems and methods for bounding processing times on multiple processing units | |
US20130346985A1 (en) | Managing use of a field programmable gate array by multiple processes in an operating system | |
JP2012511204A (en) | How to reorganize tasks to optimize resources | |
KR101640848B1 (en) | Job Allocation Method on Multi-core System and Apparatus thereof | |
US10255114B2 (en) | Abnormality detection apparatus, control method, and program | |
WO2013165451A1 (en) | Many-core process scheduling to maximize cache usage | |
CN111897647B (en) | Multithreading scheduling method, device and equipment in multi-core system | |
JP7385989B2 (en) | Arithmetic control unit | |
JP6214469B2 (en) | Vehicle control device | |
CN109992366B (en) | Task scheduling method and task scheduling device | |
CN114217966A (en) | Deep learning model dynamic batch processing scheduling method and system based on resource adjustment | |
WO2021044810A1 (en) | Core allocation device and core allocation method | |
CN108139929B (en) | Task scheduling apparatus and method for scheduling a plurality of tasks | |
CN112925616A (en) | Task allocation method and device, storage medium and electronic equipment | |
EP2418582A2 (en) | Apparatus and method for thread progress tracking using deterministic progress index | |
JP6156379B2 (en) | Scheduling apparatus and scheduling method | |
JP2009048358A (en) | Information processor and scheduling method | |
WO2008148624A1 (en) | Method and device for providing a schedule for a predictable operation of an algorithm on a multi-core processor | |
CN116126937A (en) | Job scheduling method, job scheduling device, electronic equipment and storage medium | |
KR102022972B1 (en) | Runtime management apparatus for heterogeneous multi-processing system and method thereof | |
KR101378058B1 (en) | Dynamic memory managing methof in embedded system | |
JP7107275B2 (en) | PARALLELIZATION METHOD, SEMICONDUCTOR CONTROL DEVICE, AND VEHICLE CONTROL DEVICE |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20220413 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230117 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230313 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20230704 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20230901 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20231031 |