JP2016126424A - Multitask processing method, multitask processing program, and multitask processing apparatus - Google Patents
Multitask processing method, multitask processing program, and multitask processing apparatus Download PDFInfo
- Publication number
- JP2016126424A JP2016126424A JP2014265106A JP2014265106A JP2016126424A JP 2016126424 A JP2016126424 A JP 2016126424A JP 2014265106 A JP2014265106 A JP 2014265106A JP 2014265106 A JP2014265106 A JP 2014265106A JP 2016126424 A JP2016126424 A JP 2016126424A
- Authority
- JP
- Japan
- Prior art keywords
- copy
- dma
- multitask processing
- data
- tasks
- 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
Images
Abstract
Description
本発明はマルチタスク処理方法、マルチタスク処理プログラム、マルチタスク処理装置に関する。 The present invention relates to a multitask processing method, a multitask processing program, and a multitask processing apparatus.
現在、マルチコアを備えるプロセッサの普及に伴い、並列処理や分散処理において、プロセッサを効率よく利用する研究が進められている。 Currently, with the widespread use of processors with multi-cores, research is being conducted on efficient use of processors in parallel processing and distributed processing.
例えば、先行技術文献1、2には、分散処理向けネットワーク計算機の転送パケットを利用する際に並列分散処理とDMA(Direct Memory Access)転送とを使用することが記載されている。
For example,
また、先行技術文献3には、CELLプロセッサを使った例において、ダブルバッファリングのためのDMA転送について記述している。これらの先行技術文献では、カーネルにおいてDMAコピーを用いることにより処理を高速化している。 Prior art document 3 describes DMA transfer for double buffering in an example using a CELL processor. In these prior art documents, the processing is speeded up by using a DMA copy in the kernel.
しかしながら、従来のマルチタスク処理方法では、アプリケーションにおいて、マルチタスク間のデータのコピーに時間がかかり、マルチタスク処理が遅いという問題があった。
本発明は、マルチタスク処理を高速化することを目的としている。
However, the conventional multitask processing method has a problem in that it takes time to copy data between multitasks in an application and the multitask processing is slow.
An object of the present invention is to speed up multitask processing.
本発明のマルチタスク処理方法は、複数のタスクに対して、入出力データに依存関係のある複数のタスク間でのデータのコピーをDMAコピーで行うようにした。 According to the multitask processing method of the present invention, data copying between a plurality of tasks having dependency relations with input / output data is performed by DMA copying for a plurality of tasks.
本発明のマルチタスク処理方法は、タスクの出力データを保存するバッファから、前記タスクの出力データに依存関係のあるタスクの入力バッファにDMAコピーを行うようにした。 According to the multitask processing method of the present invention, DMA copying is performed from a buffer storing task output data to a task input buffer having a dependency relationship with the task output data.
このような構成によれば、依存関係のあるタスク間のデータのコピーをDMAコピーで行うことにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by copying data between tasks having dependencies with DMA copy.
本発明のマルチタスク処理方法は、入出力データに依存関係のある複数のタスク間でのデータのコピーをアプリケーションにおいて受け付け、前記コピーをDMAコピーで実行することをカーネルから指示するようにした。 In the multitask processing method of the present invention, a copy of data between a plurality of tasks having dependency relations with input / output data is received by an application, and execution of the copy by DMA copy is instructed from the kernel.
このような構成によれば、アプリケーションのDMAコピーの指示をCPUからDMAコントローラに出力し、DMAコントローラにおいてDMAコピーを実行することにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by outputting an application DMA DMA instruction from the CPU to the DMA controller and executing the DMA copy in the DMA controller.
本発明のマルチタスク処理方法は、DMAコピー先の領域を物理メモリ上に連続して確保するようにした。 In the multitask processing method of the present invention, DMA copy destination areas are continuously secured on the physical memory.
このような構成によれば、連続した物理メモリを確保することにより、DMAコピーが高速で処理可能なデータサイズとすることができ、マルチタスク処理を高速化できる。 According to such a configuration, by securing a continuous physical memory, it is possible to achieve a data size that allows DMA copying to be processed at high speed, and to speed up multitask processing.
本発明のマルチタスク処理方法は、複数のDMAチャネルが異なる連続した物理メモリにアクセスして、前記コピーを実行するようにした。 In the multitask processing method of the present invention, a plurality of DMA channels access different continuous physical memories to execute the copy.
このような構成によれば、同じ物理メモリに対して複数のDMAチャネルがアクセスすることが防げるので、マルチタスク処理を高速化できる。 According to such a configuration, a plurality of DMA channels can be prevented from accessing the same physical memory, so that multitask processing can be speeded up.
本発明のマルチタスク処理方法は、コピーするデータ量と帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、前記コピーをDMAコピーで実行するようにした。 In the multitask processing method of the present invention, when the DMA copy is earlier than the CPU copy based on the amount of data to be copied and the bandwidth, the copy is executed by the DMA copy.
このような構成によれば、コピーするデータ量とDMAコピー及びCPUコピー帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、DMAコピーで実行することにより、最適なコピー方法でコピーできるので、マルチタスク処理を高速化できる。 According to such a configuration, when the DMA copy is faster than the CPU copy based on the amount of data to be copied, the DMA copy, and the CPU copy bandwidth, the copy can be performed with the optimum copy method by executing the DMA copy. Multi-task processing can be accelerated.
本発明のマルチタスク処理プログラムは、複数のタスクに対して、入出力データに依存関係のある複数のタスク間でのデータのコピーをCPUが受け付ける受付ステップと、前記コピーをDMAコントローラに実行させるコピーステップを備えるようにした。 The multitask processing program of the present invention includes a reception step in which a CPU receives a copy of data between a plurality of tasks having dependency relations with input / output data for a plurality of tasks, and a copy for causing the DMA controller to execute the copy Steps are provided.
本発明のマルチタスク処理プログラムは、前記コピーステップは、タスクの出力データを保存するバッファから、前記タスクの出力データに依存関係のあるタスクの入力バッファにDMAコピーを行うようにした。 In the multitask processing program of the present invention, the copying step performs DMA copying from a buffer storing task output data to a task input buffer having a dependency relationship with the task output data.
このような構成によれば、依存関係のあるタスク間のデータのコピーをDMAコピーで行うことにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by copying data between tasks having dependencies with DMA copy.
本発明のマルチタスク処理プログラムは、前記受付ステップは、複数のタスクに対して、入出力データに依存関係のある複数のタスク間でのデータのコピーをアプリケーションにおいて受け付け、前記コピーステップは、カーネルに前記コピーをDMAコピーで実行させるようにした。 In the multitask processing program of the present invention, the accepting step accepts a copy of data between a plurality of tasks having dependency relations with input / output data for a plurality of tasks in an application, and the copying step is performed by a kernel. The copy is executed by DMA copy.
このような構成によれば、アプリケーションのDMAコピーの指示をCPUからDMAコントローラに出力し、DMAコントローラにおいてDMAコピーを実行することにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by outputting an application DMA DMA instruction from the CPU to the DMA controller and executing the DMA copy in the DMA controller.
本発明のマルチタスク処理プログラムは、DMAコピー先の領域を物理メモリ上に連続して確保する確保ステップを有するようにした。 The multitask processing program of the present invention has a securing step for continuously securing the DMA copy destination area on the physical memory.
このような構成によれば、連続した物理メモリを確保することにより、DMAコピーが高速で処理可能なデータサイズとすることができ、マルチタスク処理を高速化できる。 According to such a configuration, by securing a continuous physical memory, it is possible to achieve a data size that allows DMA copying to be processed at high speed, and to speed up multitask processing.
本発明のマルチタスク処理プログラムは、前記コピーステップは、複数のDMAチャネルが異なる連続した物理メモリにアクセスして、前記コピーを実行するようにした。 In the multitask processing program of the present invention, in the copying step, a plurality of DMA channels access different physical memories and execute the copying.
このような構成によれば、同じ物理メモリに対して複数のDMAチャネルがアクセスすることが防げるので、マルチタスク処理を高速化できる。 According to such a configuration, a plurality of DMA channels can be prevented from accessing the same physical memory, so that multitask processing can be speeded up.
本発明のマルチタスク処理プログラムは、前記コピーステップは、コピーするデータ量と帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、前記コピーをDMAコピーで実行するようにした。 In the multitask processing program of the present invention, the copy step executes the copy by the DMA copy when the DMA copy is earlier than the CPU copy based on the amount of data to be copied and the bandwidth.
このような構成によれば、コピーするデータ量とDMAコピー及びCPUコピー帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、DMAコピーで実行することにより、最適なコピー方法でコピーできるので、マルチタスク処理を高速化できる。 According to such a configuration, when the DMA copy is faster than the CPU copy based on the amount of data to be copied, the DMA copy, and the CPU copy bandwidth, the copy can be performed with the optimum copy method by executing the DMA copy. Multi-task processing can be accelerated.
本発明のマルチタスク処理装置は、複数のタスクに対して、入出力データに依存関係のある複数のタスク間でのデータのコピーをDMAコピーで行うDMAコントローラを備えるようにした。 The multitask processing apparatus of the present invention is provided with a DMA controller that performs DMA copying of data between a plurality of tasks having dependency relations with input / output data for a plurality of tasks.
本発明のマルチタスク処理装置は、前記DMAコントローラは、タスクの出力データを保存するバッファから、前記タスクの出力データに依存関係のあるタスクの入力バッファにDMAコピーを行うようにした。 In the multitask processing device of the present invention, the DMA controller performs DMA copying from a buffer storing task output data to an input buffer of a task having a dependency relationship with the task output data.
このような構成によれば、依存関係のあるタスク間のデータのコピーをDMAコピーで行うことにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by copying data between tasks having dependencies with DMA copy.
本発明のマルチタスク処理装置は、入出力データに依存関係のある複数のタスク間でのデータのコピーをアプリケーションにおいて受け付けるCPUを備え、前記DMAコントローラは、カーネルに前記コピーをDMAコピーで実行させるようにした。 The multitask processing device of the present invention includes a CPU that accepts, in an application, data copy between a plurality of tasks having dependency relations with input / output data, and the DMA controller causes the kernel to execute the copy by DMA copy. I made it.
このような構成によれば、アプリケーションのDMAコピーの指示をCPUからDMAコントローラに出力し、DMAコントローラにおいてDMAコピーを実行することにより、マルチタスク処理を高速化できる。 According to such a configuration, it is possible to speed up multitask processing by outputting an application DMA DMA instruction from the CPU to the DMA controller and executing the DMA copy in the DMA controller.
本発明のマルチタスク処理装置は、前記CPUは、DMAコピー先の領域を物理メモリ上に連続して確保するようにした。 In the multitask processing apparatus of the present invention, the CPU continuously secures DMA copy destination areas on the physical memory.
このような構成によれば、連続した物理メモリを確保することにより、DMAコピーが高速で処理可能なデータサイズとすることができ、マルチタスク処理を高速化できる。 According to such a configuration, by securing a continuous physical memory, it is possible to achieve a data size that allows DMA copying to be processed at high speed, and to speed up multitask processing.
本発明のマルチタスク処理装置は、複数のDMAチャネルが異なる連続した物理メモリにアクセスして、前記コピーを実行するようにした。 In the multitask processing apparatus of the present invention, a plurality of DMA channels access different continuous physical memories to execute the copying.
このような構成によれば、同じ物理メモリに対して複数のDMAチャネルがアクセスすることが防げるので、マルチタスク処理を高速化できる。 According to such a configuration, a plurality of DMA channels can be prevented from accessing the same physical memory, so that multitask processing can be speeded up.
本発明のマルチタスク処理装置は、コピーするデータ量と帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、前記DMAコントローラは、前記コピーをDMAコピーで実行するようにした。 In the multitask processing device of the present invention, when the DMA copy is earlier than the CPU copy based on the amount of data to be copied and the bandwidth, the DMA controller executes the copy by the DMA copy.
このような構成によれば、コピーするデータ量とDMAコピー及びCPUコピー帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、DMAコピーで実行することにより、最適なコピー方法でコピーできるので、マルチタスク処理を高速化できる。 According to such a configuration, when the DMA copy is faster than the CPU copy based on the amount of data to be copied, the DMA copy, and the CPU copy bandwidth, the copy can be performed with the optimum copy method by executing the DMA copy. Multi-task processing can be accelerated.
本発明の処理方法は、メモリの初期化にDMAコピーを用いるようにした。 The processing method of the present invention uses DMA copy for memory initialization.
本発明の処理プログラムは、メモリの初期化を受け付けるステップと、初期値を保存するアドレスから初期化するアドレスにDMAコピーを実行するステップと、を備えるようにした。 The processing program of the present invention comprises a step of accepting initialization of the memory and a step of executing DMA copy from the address for storing the initial value to the address to be initialized.
本発明の処理装置は、メモリの初期化に初期値のDMAコピーで行うDMAコントローラを備えるようにした。 The processing apparatus of the present invention is provided with a DMA controller that performs initial value DMA copy for memory initialization.
このような構成によれば、メモリの初期化にDMAコピーを用いることにより、処理速度が高速化できる。 According to such a configuration, the processing speed can be increased by using the DMA copy for the initialization of the memory.
本発明のマルチタスク処理は、アプリケーションにおいて、マルチタスクの処理におけるデータのコピーをDMAコピーで実行することにより、マルチタスク処理を高速化できる。 The multitask processing of the present invention can speed up the multitask processing by executing data copy in the multitask processing by DMA copy in the application.
(実施の形態1)
以下、図面を参照して本発明の実施の形態について説明する。
最初に、各タスクとバッファとの関係について説明する。図1は、実施の形態1に係るマルチタスク処理方法の例を示す図である。図1は、タスク0とタスク1の2つのタスクがそれぞれデータを処理している例を示している。またバッファAにおいて、処理前のデータ用の領域をSrcA、処理後のデータ用の領域をDstAとする。同様にバッファBにおいて、処理前のデータ用の領域をSrcB、処理後のデータ用の領域をDstBとする。
(Embodiment 1)
Embodiments of the present invention will be described below with reference to the drawings.
First, the relationship between each task and the buffer will be described. FIG. 1 is a diagram illustrating an example of a multitask processing method according to the first embodiment. FIG. 1 shows an example in which two tasks, task 0 and
タスク0は、バッファA内のSrcAにあるデータを読み込み、処理を行う。そしてタスク0で得られたデータをバッファAのDstAに書き込む。 Task 0 reads the data in SrcA in buffer A and performs processing. Then, the data obtained in task 0 is written to DstA of buffer A.
同様に、タスク1は、バッファB内のSrcBにあるデータを読み込み、処理を行う。そしてタスク1で得られたデータをバッファBのDstBに書き込む。
Similarly,
このようにタスク0及び1はそれぞれ、データを読み込み及び書き込むバッファA、Bをそれぞれ有し、処理前のデータをバッファA、BのSrcA、Bに読み込み、処理後のデータをバッファA、BのDstA、Bに書き込む。
Thus,
ここで、タスク0の出力がタスク1の入力となる依存関係を有する場合、タスク0とタスク1は個々バッファを有するので、タスク0の処理後のデータをタスク0のバッファからタスク1のバッファにコピーする必要がある。本発明のマルチタスク処理方法では、タスク0のバッファAとタスク1のバッファBとの間のコピーにおいてDMAコピーを行う。
Here, if the output of task 0 has a dependency relationship that becomes the input of
図2は、実施の形態1に係るマルチタスク処理方法の例を示す図である。図2において、タスク0は、処理により得られたデータをバッファAのDstAに書き込む。ここで、タスク1は、タスク0の処理の結果を利用して処理を行うタスクである。すなわち、タスク0とタスク1は、依存関係にある。
FIG. 2 is a diagram illustrating an example of the multitask processing method according to the first embodiment. In FIG. 2, task 0 writes the data obtained by the processing to DstA of buffer A. Here,
処理により得られたデータがバッファAのDstAに書き込まれた後に、バッファAのDstAの内容をバッファBのSrcBにDMAコピーする。 After the data obtained by the processing is written to DstA of buffer A, the contents of DstA of buffer A are DMA copied to SrcB of buffer B.
DMAコピー後、タスク0は、バッファBのSrcBに書き込まれたデータを読み込み、処理を行う。 After the DMA copy, task 0 reads the data written in SrcB of buffer B and performs processing.
このように、実施の形態1のマルチタスク処理方法は、依存関係のあるタスク間のデータのコピーをDMAコピーで行うことにより、マルチタスク処理を高速化できる。 As described above, the multitask processing method according to the first embodiment can speed up multitask processing by copying data between tasks having a dependency relationship by DMA copy.
ところで、一般にDMAコピーは、OS(Operating System)のカーネルで用いられるものであり、アプリケーションでは、そのままでは利用することができない。 Incidentally, the DMA copy is generally used in an OS (Operating System) kernel, and cannot be used as it is in an application.
そこで、アプリケーションでDMAコピーを利用するインターフェースを用意する必要がある。図3は、実施の形態1に係るマルチタスク処理プログラムの階層を示す図である。 Therefore, it is necessary to prepare an interface for using DMA copy in the application. FIG. 3 is a diagram showing a hierarchy of the multitask processing program according to the first embodiment.
図3において、アプリケーション層は、アプリケーションと、タスクと、NDK(Native development Kit)と、DMAインターフェースとから構成される。また、カーネル層は、OSと、DMAエンジンと、DMAドライバとから構成される。一般的なアプリケーションはNDKを介してOSでネイティブアプリケーションとして実行される。 In FIG. 3, the application layer includes an application, a task, an NDK (Native development Kit), and a DMA interface. The kernel layer is composed of an OS, a DMA engine, and a DMA driver. A general application is executed as a native application in the OS via NDK.
DMAインターフェースは、アプリケーション層においてDMAコピーの実行を受け付けるインターフェースである。DMAインターフェースは、アプリケーションまたはタスクからDMAコピーの実行の要求を受け付けた場合、DMAエンジンにDMAインターフェースにDMAコピーの指示と共に、DMAコピーに必要な情報を送る。 The DMA interface is an interface that accepts execution of DMA copy in the application layer. When the DMA interface receives a DMA copy execution request from an application or task, the DMA interface sends information necessary for the DMA copy together with a DMA copy instruction to the DMA interface.
DMAエンジンは、アプリケーション側からのDMAコピーの指示をカーネル側で受け付けるエンジンであり、DMAドライバにDMAコピーの指示と共に、DMAコピーに必要な情報を送る。 The DMA engine is an engine that accepts a DMA copy instruction from the application side on the kernel side, and sends information necessary for the DMA copy together with the DMA copy instruction to the DMA driver.
DMAドライバは、ハードウェアであるDMAコントローラを制御するドライバであり、DMAエンジンからのDMAコピーの指示とDMAコピーに必要な情報から、DMAコントローラに対応する指示内容で、DMAコピーを命令する。 The DMA driver is a driver that controls a DMA controller that is hardware, and instructs DMA copy with instructions corresponding to the DMA controller from a DMA copy instruction from the DMA engine and information necessary for the DMA copy.
このように、実施の形態1のマルチタスク処理プログラムでは、アプリケーション層にDMAインターフェースを設け、アプリケーション層のDMAインターフェースとカーネル層のDMAエンジンとが通信することにより、アプリケーションがDMAコピーを実行することができる。 As described above, in the multitask processing program of the first embodiment, a DMA interface is provided in the application layer, and the application executes the DMA copy by communicating between the DMA interface in the application layer and the DMA engine in the kernel layer. it can.
次にハードウェアの構成について説明する。図4は、実施の形態1に係るマルチタスク処理装置の構成を示すブロック図である。 Next, the hardware configuration will be described. FIG. 4 is a block diagram showing the configuration of the multitask processing apparatus according to the first embodiment.
図4において、マルチタスク処理装置10は、CPU(Central Processing Unit)11と、メモリ12と、DMAコントローラ13とを備える。
In FIG. 4, the
CPU11は、マルチタスクを処理するプロセッサである。CPU11はマルチコアを有することが好適である。具体的にはCPU11は、図1、2のタスク0、1を実行するプロセッサである。また、CPU11は、図3に示すアプリケーション層及びカーネル層の各プログラムを実行する。
The CPU 11 is a processor that processes multitasking. The CPU 11 preferably has a multi-core. Specifically, the CPU 11 is a processor that executes
メモリ12は、データ及びプログラムを記憶するメモリである。具体的には、図1、2におけるバッファA、Bの領域は、メモリ12に確保される。
The
DMAコントローラ13は、CPUを介さずにメモリ12にアクセスし、メモリ12内のデータをコピーするコントローラである。具体的には、DMAコントローラ13は、図2のDMAコピーを実行する。
The
以下、図4に示すマルチタスク処理装置の動作について説明する。まず、CPU11は、アプリケーションのタスクを処理し、処理により得られたデータをメモリ12に書き込む。
Hereinafter, the operation of the multitask processing apparatus shown in FIG. 4 will be described. First, the CPU 11 processes an application task and writes the data obtained by the processing to the
そして、CPU11は、アプリケーションにおいてタスク間のデータのコピーの実行を受け付けると、データをDMAコピーする命令をDMAコントローラ13に出力する。
When the CPU 11 accepts execution of data copying between tasks in the application, the CPU 11 outputs a command for DMA copying data to the
DMAコントローラ13は、CPUの命令に従い、タスク間のデータのコピーを実行する。
The
このように、実施の形態1のマルチタスク処理方法によれば、アプリケーションのDMAコピーの指示をCPUからDMAコントローラに出力し、DMAコントローラにおいてDMAコピーを実行する。 Thus, according to the multitask processing method of the first embodiment, the DMA copy instruction of the application is output from the CPU to the DMA controller, and the DMA copy is executed in the DMA controller.
次に、DMAコピーとCPUコピーの所要時間の比較について説明する。
図5は、DMAコピーとCPUコピーとの所要時間の比較の図である。図5において、横軸はコピーするデータサイズを示し、縦軸はコピーに要した時間を示す。また、図5において、実線はDMAコピーを示し、破線はCPUコピーを示す。
Next, a comparison of required time between DMA copy and CPU copy will be described.
FIG. 5 is a diagram for comparing the required time between the DMA copy and the CPU copy. In FIG. 5, the horizontal axis indicates the data size to be copied, and the vertical axis indicates the time required for copying. In FIG. 5, the solid line indicates the DMA copy, and the broken line indicates the CPU copy.
図5では、SPMesh(SimPlificationMeshes)処理においてタスク間でデータをコピーした場合の比較を行っている。 In FIG. 5, a comparison is made when data is copied between tasks in the SPMesh (SimPlificationMeshes) process.
図5に示すように、データサイズが大きくなるほど、DMAコピーがCPUコピーよりも短時間でコピーを完了している。 As shown in FIG. 5, as the data size increases, the DMA copy is completed in a shorter time than the CPU copy.
このように、実施の形態1のマルチタスク処理装置は、アプリケーションのDMAコピーの指示をCPUからDMAコントローラに出力し、DMAコントローラにおいてDMAコピーを実行することにより、マルチタスク処理を高速化できる。 As described above, the multitask processing apparatus according to the first embodiment can speed up multitask processing by outputting a DMA copy instruction of an application from the CPU to the DMA controller and executing the DMA copy in the DMA controller.
また、実施の形態1のマルチタスク処理装置は、依存関係のある複数のタスク間でのデータのコピーをDMAコピーで行うことにより、CPUより消費電力が少ないDMAコントローラでコピーを行うので、電力消費量を削減することができる。また、実施の形態1のマルチタスク処理装置は、電力消費量の削減に伴い、CPUの温度上昇を抑制できる。 In addition, the multitask processing apparatus according to the first embodiment performs copying with a DMA controller that consumes less power than the CPU by copying data between a plurality of dependent tasks using DMA copying. The amount can be reduced. In addition, the multitask processing device according to the first embodiment can suppress an increase in the temperature of the CPU as the power consumption is reduced.
次に、物理メモリにDMAコピーする具体的な例について説明する。図6は、DMAコピーの例を示す図である。図6に示すように、DMAコントローラは、メモリ上の分断された領域をアクセスして、コピーを行う。 Next, a specific example of DMA copying to the physical memory will be described. FIG. 6 is a diagram illustrating an example of a DMA copy. As shown in FIG. 6, the DMA controller accesses a divided area on the memory to perform copying.
図7は、実施の形態2に係るマルチタスク処理方法におけるDMAコピーの例を示す図である。図7に示すように、マルチタスク処理装置は連続した物理メモリを確保し、DMAコントローラはメモリ上の連続した領域をアクセスして、コピーを行う。 FIG. 7 is a diagram illustrating an example of a DMA copy in the multitask processing method according to the second embodiment. As shown in FIG. 7, the multitask processing apparatus secures continuous physical memory, and the DMA controller accesses continuous areas on the memory to perform copying.
DMAコントローラによるDMAコピーは、コピーするデータのサイズが一定以上である場合に、特に速度が速くなるという性質を有している。したがって、コピー元またはコピー先、あるいはコピー元及びコピー先に連続した物理メモリを確保して、コピー元、コピー先として割り当て、DMAコピーを実行することにより、更にマルチタスク処理を高速化できる。 The DMA copy by the DMA controller has a property that the speed is particularly high when the size of data to be copied is a certain size or more. Therefore, it is possible to further speed up the multitasking process by securing physical memory continuous to the copy source or the copy destination, or the copy source and the copy destination, assigning them as the copy source and the copy destination, and executing the DMA copy.
このように、実施の形態1のマルチタスク処理方法によれば、連続した物理メモリを確保することにより、DMAコピーが高速で処理可能なデータサイズとすることができ、マルチタスク処理を高速化できる。 As described above, according to the multitask processing method of the first embodiment, by securing a continuous physical memory, it is possible to achieve a data size that allows DMA copy to be processed at high speed, and to speed up multitask processing. .
なお、物理メモリに連続して確保する領域のサイズは、DMAコントローラが一度にコピーできるデータサイズより大きいことが望ましい。 It is desirable that the size of the area continuously secured in the physical memory is larger than the data size that can be copied at one time by the DMA controller.
次に所定の条件を満たした場合にDMAコピーを実行する例について説明する。図8は、DMAコピーとCPUコピーとのデータサイズ別の帯域幅の比較の図である。図8において、横軸は、コピーするデータの大きさを示し、縦軸は帯域幅を示す。また、図8において、実線はDMAコピーを示し、破線はCPUコピーを示す。 Next, an example in which DMA copy is executed when a predetermined condition is satisfied will be described. FIG. 8 is a comparison of bandwidths according to data size between DMA copy and CPU copy. In FIG. 8, the horizontal axis indicates the size of data to be copied, and the vertical axis indicates the bandwidth. In FIG. 8, the solid line indicates DMA copy, and the broken line indicates CPU copy.
図8に示すように、コピーするデータの大きさが小さい場合、CPUコピーがDMAコピーより帯域幅が大きい。一方コピーするデータの大きさが大きい場合、DMAコピーがCPUコピーより帯域幅が大きい。 As shown in FIG. 8, when the size of data to be copied is small, the CPU copy has a larger bandwidth than the DMA copy. On the other hand, when the size of data to be copied is large, the bandwidth of the DMA copy is larger than that of the CPU copy.
CPUコピーの帯域幅とDMAコピーの帯域幅との大小関係は、CPU及びDMAコントローラのスペックにより変化する。そこで、CPU及びDMAコントローラのスペック及びデータの大きさに基づいて、DMAコピーがCPUコピーより帯域幅が大きい条件を満たすときに、マルチタスク処理装置がDMAコピーする。 The magnitude relationship between the CPU copy bandwidth and the DMA copy bandwidth varies depending on the specifications of the CPU and the DMA controller. Therefore, based on the specifications of the CPU and the DMA controller and the size of the data, the multitask processing device performs the DMA copy when the DMA copy satisfies the condition that the bandwidth is larger than the CPU copy.
この条件は、CPU及びDMAコントローラのスペック及びデータの大きさから計算式またはシミュレーションにより決定することができる。 This condition can be determined by a calculation formula or simulation from the specifications of CPU and DMA controller and the size of data.
また、DMAコピーを行うか否かの判断は、コピーするデータサイズ、CPU及びDMAコントローラのスペックに基づいて前もって決めても良いし、アプリケーションまたはDMAインターフェースで判断しても良い。 Whether to perform DMA copying may be determined in advance based on the data size to be copied, the specifications of the CPU and the DMA controller, or may be determined by an application or a DMA interface.
このように、実施の形態1に係るマルチタスク処理方法は、コピーするデータ量とDMAコピー及びCPUコピー帯域幅とに基づいてDMAコピーがCPUコピーより早い場合に、DMAコピーで実行することにより、最適なコピー方法でコピーできるので、マルチタスク処理を高速化できる。 As described above, the multitask processing method according to the first embodiment is executed by the DMA copy when the DMA copy is earlier than the CPU copy based on the data amount to be copied and the DMA copy and the CPU copy bandwidth. Multi-task processing can be sped up because it can be copied with an optimal copy method.
(実施の形態2)
実施の形態2では、メモリを初期化する場合に、初期値をDMAコピーする例について説明する。DMAコピーを行う処理装置及び処理プログラムは実施の形態1と同様である。
(Embodiment 2)
In the second embodiment, an example in which the initial value is DMA copied when the memory is initialized will be described. The processing apparatus and processing program for performing the DMA copy are the same as those in the first embodiment.
図9は、実施の形態2に係る処理方法の例を示す図である。図9において、初期値は、バッファAのSrcAにDMAコピーされる。具体的には図4のメモリ12に記憶された初期値が、DMAコントローラ13によりメモリ12内に確保されたバッファAのSrcAにDMAコピーされる。
FIG. 9 is a diagram illustrating an example of a processing method according to the second embodiment. In FIG. 9, the initial value is DMA copied to SrcA of buffer A. Specifically, the initial value stored in the
初期値が、同じ値を繰り返すデータである場合には、最小単位の初期値を繰り返しDMAコピーしても良い。例えば、初期値が1桁の0として、書き込む初期値の大きさに合わせて複数回、バッファAのSrcAにDMAコピーすることにより、タスク0の初期値を設定することができる。また、一度、バッファAのSrcAにDMAコピーした初期値をコピー元として、バッファAのSrcAに複数回、バッファAのSrcAにDMAコピーしても良い。 When the initial value is data that repeats the same value, the initial value of the minimum unit may be repeatedly DMA copied. For example, the initial value of task 0 can be set by performing DMA copying to SrcA of buffer A a plurality of times according to the size of the initial value to be written, assuming that the initial value is 0 in one digit. Alternatively, an initial value that has been DMA copied to SrcA of buffer A once may be used as a copy source, and DMA copied to SrcA of buffer A multiple times to SrcA of buffer A.
一般に、タスクの初期値はアプリケーションが決定するものであるので、実施の形態1で説明したDMAインターフェースを用いてDMAコピーを実現することが好適である。 Generally, since the initial value of a task is determined by an application, it is preferable to implement DMA copy using the DMA interface described in the first embodiment.
このように、実施の形態2に係る処理方法は、メモリの初期化にDMAコピーを用いることにより、処理速度が高速化できる。 As described above, the processing method according to the second embodiment can increase the processing speed by using the DMA copy for the initialization of the memory.
なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。 Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention.
例えば、マルチタスク処理装置がDMAコントローラを複数備え、複数のDMAコントローラが、それぞれ異なるDMAチャネルを有し、それぞれ異なる連続した物理メモリにアクセスして、DMAコピーを実行しても良い。このような構成によれば、同じ物理メモリに対して複数のDMAチャネルがアクセスすることが防げるので、マルチタスク処理を高速化できる。 For example, the multitask processing apparatus may include a plurality of DMA controllers, and each of the plurality of DMA controllers may have a different DMA channel and access a different continuous physical memory to execute the DMA copy. According to such a configuration, a plurality of DMA channels can be prevented from accessing the same physical memory, so that multitask processing can be speeded up.
また、本発明のマルチタスク処理装置は、マルチタスク処理を行える装置であれば、いずれにも適用できる。例えば、マルチコアのプロセッサを搭載したスマートフォンに適用することもできる。 The multitask processing apparatus of the present invention can be applied to any apparatus that can perform multitask processing. For example, it can be applied to a smartphone equipped with a multi-core processor.
また、本発明のマルチタスク処理プログラムは、タスク間に依存関係のあるアプリケーションに適用できるものであれば、いずれも適用することができる。例えば、物理Engineの1つであるFluid Simulation()としてSmoothed Particle Hydrodynamics “SPH” アルゴリズムに適用することもできる。この物理Engineの中には、重要かつ処理時間の大きい関数処理SPHupdate, calculatePoints, generateMarchingSquares, Drawが4つ存在している。これらの関数処理に適用することもできる。 In addition, the multitask processing program of the present invention can be applied as long as it can be applied to an application having a dependency relationship between tasks. For example, it can be applied to the Smoothed Particle Hydrodynamics “SPH” algorithm as Fluid Simulation () which is one of physical engines. In this physical engine, there are four important and long processing functions SPHupdate, calculatePoints, generateMarchingSquares, and Draw. It can also be applied to these function processes.
また、本発明は、ASIC(Application Specific Integrated Circuit)等のハードウェアまたはソフトウェアで実施できる。また、処理の一部をソフトウェアで実施し、それ以外をハードウェアで実施することとしても良い。ソフトウェアで実施する際には、マイクロプロセッサ等の1つあるいは複数のCPU(Central Processing Unit)を有するコンピュータシステムに機能ブロックの処理に関するプログラムを実行させればよい。これらのプログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non-transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Compact Disc Read Only Memory)、CD−R、CD−R/W、DVD−ROM(Digital Versatile Disc Read Only Memory)、DVD−R(DVD Recordable)、DVD−R DL(DVD-R Dual Layer)、DVD−RW(DVD ReWritable)、DVD−RAM、DVD+R、DVR+R DL、DVD+RW、BD−R(Blu-ray(登録商標) Disc Recordable)、BD−RE(Blu-ray (登録商標)Disc Rewritable)、BD−ROM、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。 Further, the present invention can be implemented by hardware such as ASIC (Application Specific Integrated Circuit) or software. Further, part of the processing may be performed by software, and the rest may be performed by hardware. When implemented by software, a computer system having one or a plurality of CPUs (Central Processing Units) such as a microprocessor may be caused to execute a program related to processing of functional blocks. These programs can be stored using various types of non-transitory computer readable media and supplied to a computer. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Compact Disc Read Only Memory), CD- R, CD-R / W, DVD-ROM (Digital Versatile Disc Read Only Memory), DVD-R (DVD Recordable), DVD-R DL (DVD-R Dual Layer), DVD-RW (DVD ReWritable), DVD- RAM, DVD + R, DVR + R DL, DVD + RW, BD-R (Blu-ray (registered trademark) Disc Rewritable), BD-RE (Blu-ray (registered trademark) Disc Rewritable), BD-ROM, semiconductor memory (for example, mask ROM) , PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (random access memory)). The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.
マルチタスク処理装置 10
CPU 11
メモリ 12
DMAコントローラ 13
Multitask processing
CPU 11
Claims (21)
前記コピーステップは、カーネルに前記コピーをDMAコピーで実行させる7または8に記載のマルチタスク処理プログラム。 The accepting step accepts a copy of data between a plurality of tasks having dependency relations with input / output data for a plurality of tasks,
The multitask processing program according to 7 or 8, wherein the copy step causes the kernel to execute the copy by DMA copy.
初期値を保存するアドレスから初期化するアドレスにDMAコピーを実行するステップと、を備える処理プログラム。 Accepting memory initialization; and
Executing a DMA copy from an address for storing an initial value to an address to be initialized.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014265106A JP2016126424A (en) | 2014-12-26 | 2014-12-26 | Multitask processing method, multitask processing program, and multitask processing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014265106A JP2016126424A (en) | 2014-12-26 | 2014-12-26 | Multitask processing method, multitask processing program, and multitask processing apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2016126424A true JP2016126424A (en) | 2016-07-11 |
Family
ID=56357925
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014265106A Pending JP2016126424A (en) | 2014-12-26 | 2014-12-26 | Multitask processing method, multitask processing program, and multitask processing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2016126424A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094876A (en) * | 2023-07-12 | 2023-11-21 | 荣耀终端有限公司 | Data processing method, electronic device and readable storage medium |
-
2014
- 2014-12-26 JP JP2014265106A patent/JP2016126424A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117094876A (en) * | 2023-07-12 | 2023-11-21 | 荣耀终端有限公司 | Data processing method, electronic device and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10621093B2 (en) | Heterogeneous computing system configured to adaptively control cache coherency | |
US9396009B2 (en) | Optimized global capacity management in a virtualized computing environment | |
EP3230873B1 (en) | Computing method and apparatus with persistent memory | |
JP2014533859A (en) | Thermally driven workload scheduling in heterogeneous multiprocessor system on chip | |
TWI489392B (en) | Graphics processing unit sharing between many applications | |
US20200201763A1 (en) | Memory hierarchy-aware processing | |
US20220236911A1 (en) | Data streaming for computational storage | |
CN107729119B (en) | Virtual machine migration method and system | |
US10409350B2 (en) | Instruction optimization using voltage-based functional performance variation | |
US10289418B2 (en) | Cooperative thread array granularity context switch during trap handling | |
US20150324292A1 (en) | Employing prefetch to reduce write overhead | |
US20150254116A1 (en) | Data processing apparatus for pipeline execution acceleration and method thereof | |
US20130205298A1 (en) | Apparatus and method for memory overlay | |
TWI530785B (en) | Computer system and control method for non-volatile memory | |
KR102205899B1 (en) | Method and apparatus for avoiding bank conflict in memory | |
US10289329B2 (en) | Burst buffer dynamic logical volume sizing in high performance computing environment | |
US20230289207A1 (en) | Techniques for Concurrently Supporting Virtual NUMA and CPU/Memory Hot-Add in a Virtual Machine | |
US9483320B2 (en) | Computing apparatus, method of controlling computing apparatus, and computer-readable storage medium having program for controlling computing apparatus stored therein to move processes to a same processor core for execution | |
JP2016126424A (en) | Multitask processing method, multitask processing program, and multitask processing apparatus | |
US10353597B2 (en) | Prioritizing pages to transfer for memory sharing | |
JP2013114538A (en) | Information processing apparatus, information processing method and control program | |
US11003488B2 (en) | Memory-fabric-based processor context switching system | |
US9069702B2 (en) | Reducing read starvation | |
US11481250B2 (en) | Cooperative workgroup scheduling and context prefetching based on predicted modification of signal values | |
US10572671B2 (en) | Checking method, checking system and checking device for processor security |