JP2017174194A - Image processing apparatus, load distribution method and load distribution program - Google Patents
Image processing apparatus, load distribution method and load distribution program Download PDFInfo
- Publication number
- JP2017174194A JP2017174194A JP2016060140A JP2016060140A JP2017174194A JP 2017174194 A JP2017174194 A JP 2017174194A JP 2016060140 A JP2016060140 A JP 2016060140A JP 2016060140 A JP2016060140 A JP 2016060140A JP 2017174194 A JP2017174194 A JP 2017174194A
- Authority
- JP
- Japan
- Prior art keywords
- core
- thread
- target
- processing
- target thread
- 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.)
- Granted
Links
Images
Abstract
Description
この発明は、画像処理装置、負荷分散方法および負荷分散プログラムに関し、特に、複数のコアを有するマルチコアプロセッサを備えた画像処理装置、その画像処理装置で実行される負荷分散方法および負荷分散プログラムに関する。 The present invention relates to an image processing apparatus, a load distribution method, and a load distribution program, and more particularly to an image processing apparatus including a multi-core processor having a plurality of cores, a load distribution method and a load distribution program executed by the image processing apparatus.
近年、複数のコアを有するマルチコアプロセッサが知られており、画像を処理する画像処理装置で代表されるMFP(Multi Function Periferal)にマルチコアプロセッサを搭載することが考えられる。マルチコアプロセッサにおいては、複数のコアにそれぞれにスレッドを割り当てることにより、異なる処理を並列で実行する。しかしながら、スレッドの割り当て状態によっては、あるコアの負荷が他のコアに比較して大きくなってしまう場合がある。このため、複数のコア間で負荷を分散する技術が知られている。 In recent years, multi-core processors having a plurality of cores are known, and it is conceivable that a multi-core processor is mounted on an MFP (Multi Function Peripheral) represented by an image processing apparatus that processes images. In a multi-core processor, different processes are executed in parallel by assigning threads to a plurality of cores. However, depending on the thread allocation state, the load on a certain core may become larger than on other cores. For this reason, a technique for distributing a load among a plurality of cores is known.
例えば、特開2008−191949号公報には、複数のコアプロセッサを有する複数のマルチコアプロセッサと、各マルチコアプロセッサの資源を共有する共有資源とを有するマルチコアシステムであって、前記各マルチコアプロセッサの負荷情報と、前記共有資源に対するアクセス時の負荷情報とを取得する負荷情報収集手段と、前記負荷情報収集手段により取得した前記各マルチコアプロセッサの負荷情報と、前記アクセス時の負荷情報との条件に基づいて、負荷分散を行うか否かの判定を行う負荷分散判定手段と、前記負荷分散判定手段により、負荷分散を行うと判断された際には、負荷を分散する負荷分散手段とを有するマルチコアシステムであることを特徴とする、マルチコアシステムが記載されている。特開2008−191949号公報に記載のマルチコアシステムにおいては、負荷の増大したマルチコアプロセッサに割り当てられたスレッドを、負荷の少ないマルチコアプロセッサに移動するので、複数のマルチコアプロセッサ間で負荷を分散することができる。 For example, Japanese Patent Laid-Open No. 2008-191949 discloses a multi-core system having a plurality of multi-core processors having a plurality of core processors and a shared resource sharing the resources of each multi-core processor, and load information of each multi-core processor. Load information collection means for acquiring load information at the time of accessing the shared resource, load information of each multi-core processor acquired by the load information collection means, and load information at the time of access A load distribution determination unit that determines whether or not to perform load distribution, and a load distribution unit that distributes a load when the load distribution determination unit determines that load distribution is to be performed. A multi-core system is described, characterized in that it is. In the multi-core system described in Japanese Patent Application Laid-Open No. 2008-191949, threads allocated to a multi-core processor with an increased load are moved to a multi-core processor with a low load, so that the load can be distributed among a plurality of multi-core processors. it can.
しかしながら、スレッドを移動した後のマルチコアプロセッサにおいては、キャッシュメモリにデータを書き込む時間が必要となり、また、移動の対象となるスレッドを実行する際のキャッシュメモリにアクセスするキャッシュヒット率が移動前よりも高くなるとは限らない。このため、移動後のマルチコアプロセッサが移動の対象となるスレッドを実行する処理速度が、移動前よりも遅くなる場合があるといった問題がある。
この発明は上述した問題点を解決するためになされたもので、この発明の目的の1つは、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な画像処理装置を提供することである。 The present invention has been made to solve the above-described problems, and one object of the present invention is to distribute the load of a plurality of processor cores while shortening the processing time after the movement of a thread to be moved. It is to provide an image processing apparatus capable of performing the above.
この発明の他の目的は、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な負荷分散方法を提供することである。 Another object of the present invention is to provide a load distribution method capable of distributing loads of a plurality of processor cores while shortening a processing time after movement of a thread to be moved.
この発明のさらに他の目的は、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な負荷分散プログラムを提供することである。 Still another object of the present invention is to provide a load distribution program capable of distributing the load of a plurality of processor cores while shortening the processing time after movement of a thread to be moved.
上述した目的を達成するためにこの発明のある局面によれば、画像処理装置は、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定手段と、複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得手段と、ヒット率取得手段により対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度を予測する第1予測手段と、複数のプロセッサコアのうち対象コアとは別の候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度を予測する第2予測手段と、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かを判断する判断手段と、判断手段による判断結果に基づいて、対象スレッドの割り当てを、対象コアから候補コアに変更する割当変更手段と、を備える。 In order to achieve the above object, according to one aspect of the present invention, an image processing device includes a plurality of processor cores, a plurality of cache memories respectively corresponding to the plurality of processor cores, and a target core among the plurality of processor cores. Target thread determination means for determining one of one or more threads assigned to the target thread, hit rate acquisition means for acquiring the cache hit ratio of each of the plurality of processor cores, and acquisition of the target core by the hit ratio acquisition means A first prediction means for predicting a first processing speed at which the target core executes the target thread based on the cache hit rate, and a candidate core different from the target core among the plurality of processor cores determines the cache hit rate Second prediction means for predicting the second processing speed when the target thread is executed as zero, and the first processing speed And the second processing speed to determine whether to change the target thread assignment from the target core to the candidate core, and based on the determination result by the determination means, assign the target thread. Allocation changing means for changing from a target core to a candidate core.
この局面に従えば、対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度が予測され、候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度が予測され、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かが判断され、判断結果に基づいて、対象スレッドの割り当てが、対象コアから候補コアに変更される。このため、対象スレッドを移動する前の第1の処理速度と、対象スレッドを移動した後の第2処理速度とを比較するので、対象スレッドを処理する処理速度が速くなることが予測される場合に、対象スレッドが移動される。その結果、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な画像処理装置を提供することができる。 According to this aspect, the first processing speed at which the target core executes the target thread is predicted based on the cache hit rate acquired for the target core, and the candidate core executes the target thread with the cache hit rate set to zero. The second processing speed is predicted, and by comparing the first processing speed and the second processing speed, it is determined whether or not the allocation of the target thread is changed from the target core to the candidate core. Based on this, the allocation of the target thread is changed from the target core to the candidate core. For this reason, since the first processing speed before moving the target thread is compared with the second processing speed after moving the target thread, the processing speed for processing the target thread is expected to increase. The target thread is moved. As a result, it is possible to provide an image processing apparatus capable of distributing the loads of a plurality of processor cores while shortening the processing time after movement of a thread to be moved.
好ましくは、複数のプロセッサコアそれぞれが実行する1以上のスレッドそれぞれについて占有率を取得する占有率取得手段を、さらに備え、第1予測手段は、占有率取得手段により取得された対象スレッドの占有率と、ヒット率取得手段により取得された対象コアのキャッシュヒット率とに基づいて、第1処理速度を予測し、第2予測手段は、占有率取得手段により取得される候補コアが実行する1以上のスレッドそれぞれの占有率から算出される候補コアの余力に基づいて、第2処理速度を予測する。 Preferably, an occupancy rate acquisition unit that acquires an occupancy rate for each of one or more threads executed by each of the plurality of processor cores is further provided, and the first prediction unit includes the occupancy rate of the target thread acquired by the occupancy rate acquisition unit And the first processing speed is predicted based on the cache hit rate of the target core acquired by the hit rate acquisition unit, and the second prediction unit is executed by one or more candidate cores acquired by the occupation rate acquisition unit The second processing speed is predicted based on the remaining capacity of the candidate core calculated from the occupancy of each thread.
この局面に従えば、対象スレッドの占有率と、対象コアのキャッシュヒット率とに基づいて、第1処理速度が予測され、候補コアが実行する1以上のスレッドそれぞれの占有率から算出される候補コアの余力に基づいて、第2処理速度が予測される。このため、対象スレッドを移動する前後の処理速度を正確に予測することができる。 According to this aspect, the first processing speed is predicted based on the occupancy ratio of the target thread and the cache hit ratio of the target core, and the candidate is calculated from the occupancy ratio of each of one or more threads executed by the candidate core. The second processing speed is predicted based on the remaining capacity of the core. For this reason, the processing speed before and after moving the target thread can be accurately predicted.
好ましくは、複数のプロセッサコアの処理能力を取得する能力情報取得手段を、さらに備え、第1予測手段は、対象スレッドの処理能力にさらに基づいて、第1処理速度を予測し、第2予測手段は、候補コアの処理能力にさらに基づいて、第2処理速度を予測する。 Preferably, the information processing apparatus further comprises capability information acquisition means for acquiring processing capacities of the plurality of processor cores, wherein the first prediction means predicts the first processing speed based on the processing capacity of the target thread, and second prediction means Predicts the second processing speed further based on the processing capability of the candidate core.
この局面に従えば、対象スレッドを移動前のプロセッサコアと、移動後のプロセッサコアの処理能力が異なる場合に適応することができる。 According to this aspect, the target thread can be adapted to a case where the processing capability of the processor core before moving and the processor core after moving are different.
好ましくは、判断手段は、所定時間間隔で、対象スレッドの割り当てを対象コアから候補コアに変更するか否かを判断する。 Preferably, the determination unit determines whether or not to change the allocation of the target thread from the target core to the candidate core at predetermined time intervals.
この局面に従えば、所定時間間隔で、対象スレッドの割り当てを変更するか否かを判断するので、所定時間間隔で複数のプロセッサコアの負荷を分散することができる。 According to this aspect, since it is determined whether or not the assignment of the target thread is changed at a predetermined time interval, the loads of the plurality of processor cores can be distributed at the predetermined time interval.
好ましくは、割当変更手段は、対象スレッドが処理対象とする画像データを複数の処理単位部分に分割して処理する場合、判断手段により割り当てを変更すると決定された対象スレッドの割り当てを、対象スレッドが複数の処理単位部分のいずれかの処理が完了することに応じて変更する。 Preferably, the assignment changing means, when the image data to be processed by the target thread is divided into a plurality of processing unit parts and processed, the assignment of the target thread determined to change the assignment by the judging means It changes in response to the completion of any of the processing unit parts.
この局面に従えば、画像データの複数の処理単位部分のいずれかの処理単位部分の処理が完了するまでスレッドの割り当てを変更しないので、移動前後で同じ処理が重複して実行されるのを回避することができる。 According to this aspect, since the thread assignment is not changed until the processing of any one of the plurality of processing unit parts of the image data is completed, the same process is prevented from being repeatedly executed before and after the movement. can do.
好ましくは、複数のプロセッサコアのいずれかが画像データを変換する処理を定めたプログラムを実行するスレッドを可変スレッドに決定する可変スレッド決定手段を、さらに備え、対象スレッド決定手段は、可変スレッド決定手段により決定される1以上の可変スレッドの1つを対象スレッドに決定する。 Preferably, a variable thread determining unit that determines a thread that executes a program in which any one of the plurality of processor cores defines a process for converting image data as a variable thread is further provided, and the target thread determining unit is a variable thread determining unit One of the one or more variable threads determined by the above is determined as the target thread.
この局面に従えば、画像データを変換する処理を定めたプログラムを実行するスレッドを、移動御対象とするので、第1処理速度と第2処理速度とを正確に予測することができる。 According to this aspect, since the thread that executes the program that defines the process for converting the image data is the object of movement, the first processing speed and the second processing speed can be accurately predicted.
好ましくは、対象スレッド決定手段は、可変スレッド決定手段により決定された複数の可変スレッドのうちから優先順位が高い順に対象スレッドを決定する。 Preferably, the target thread determination unit determines the target thread in descending order of priority from the plurality of variable threads determined by the variable thread determination unit.
この局面に従えば、複数の可変スレッドを優先順位が高い順に移動させるか否かを判断するので、優先順位の高い可変スレッドの処理を早期に終了させることができる。 According to this aspect, since it is determined whether or not to move a plurality of variable threads in descending order of priority, the processing of variable threads having a high priority can be terminated early.
この発明の他の局面によれば、負荷分散方法は、画像処理装置で実行される負荷分散方法であって、画像処理装置は、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、ヒット率取得ステップにおいて対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度を予測する第1予測ステップと、複数のプロセッサコアのうち対象コアとは別の候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かを判断する判断ステップと、判断ステップにおける判断結果に基づいて、対象スレッドの割り当てを、対象コアから候補コアに変更する割当変更ステップと、を含む。 According to another aspect of the present invention, the load distribution method is a load distribution method executed by an image processing device, and the image processing device includes a plurality of processor cores and a plurality of processor cores respectively corresponding to the plurality of processor cores. A target thread determining step of determining one of one or more threads assigned to the target core among the plurality of processor cores as a target thread, and obtaining a cache hit rate of each of the plurality of processor cores A hit rate acquisition step, a first prediction step of predicting a first processing speed at which the target core executes the target thread based on the cache hit rate acquired for the target core in the hit rate acquisition step, and a plurality of processor cores A candidate core that is different from the target core executes the target thread with a cache hit rate of zero. Whether to change the allocation of the target thread from the target core to the candidate core by comparing the first processing speed and the second processing speed with the second prediction step for predicting the second processing speed when A determination step of determining, and an allocation change step of changing the allocation of the target thread from the target core to the candidate core based on the determination result in the determination step.
この局面に従えば、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な負荷分散方法を提供することができる。 According to this aspect, it is possible to provide a load distribution method capable of distributing the load of a plurality of processor cores while shortening the processing time after movement of a thread to be moved.
この発明のさらに他の局面によれば、負荷分散プログラムは、画像処理装置を制御するマルチコアプロセッサで実行される負荷分散プログラムであって、マルチコアプロセッサは、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、ヒット率取得ステップにおいて対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度を予測する第1予測ステップと、複数のプロセッサコアのうち対象コアとは別の候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かを判断する判断ステップと、判断ステップにおける判断結果に基づいて、対象スレッドの割り当てを、対象コアから候補コアに変更する割当変更ステップと、をマルチコアプロセッサに実行させる。 According to still another aspect of the present invention, the load distribution program is a load distribution program executed by a multi-core processor that controls the image processing apparatus, and the multi-core processor includes a plurality of processor cores and a plurality of processor cores. A plurality of corresponding cache memories, a target thread determining step for determining one of one or more threads assigned to the target core among the plurality of processor cores as a target thread, and a cache for each of the plurality of processor cores A hit rate acquisition step for acquiring a hit rate; a first prediction step for predicting a first processing speed at which the target core executes the target thread based on the cache hit rate acquired for the target core in the hit rate acquisition step; Of the multiple processor cores, different from the target core The second prediction step of predicting the second processing speed when the core executes the target thread with the cache hit rate being zero is compared with the first processing speed and the second processing speed, thereby assigning the target thread. A determination step for determining whether or not to change from the target core to the candidate core, and an assignment changing step for changing the allocation of the target thread from the target core to the candidate core based on the determination result in the determination step. To run.
この局面に従えば、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な負荷分散プログラムを提供することができる。 According to this aspect, it is possible to provide a load distribution program capable of distributing the loads of a plurality of processor cores while shortening the processing time after movement of a thread to be moved.
以下、本発明の実施の形態を図面を参照して説明する。以下の説明では同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがって、それらについての詳細な説明は繰り返さない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.
図1は、本実施の形態におけるMFPの外観を示す斜視図である。図2は、本実施の形態におけるMFPのハードウェア構成の概要を示すブロック図である。図1および図2を参照して、画像処理装置として機能するMFP100は、メイン回路110と、原稿を読み取るための原稿読取部130と、原稿を原稿読取部130に搬送するための自動原稿搬送装置120と、原稿読取部130が原稿を読み取って出力する画像データに基づいて用紙等に画像を形成するための画像形成部140と、画像形成部140に用紙を供給するための給紙部150と、ユーザーインターフェースとしての操作パネル160とを含む。
FIG. 1 is a perspective view showing the appearance of the MFP according to the present embodiment. FIG. 2 is a block diagram showing an outline of the hardware configuration of the MFP according to the present embodiment. 1 and 2,
メイン回路110は、マルチコアプロセッサ111と、通信インターフェース(I/F)部112と、ROM113と、RAM114と、大容量記憶装置としてのハードディスクドライブ(HDD)115と、ファクシミリ部116と、CD−ROM(Compact Disk ROM)118が装着される外部記憶装置117と、を含む。マルチコアプロセッサ111は、自動原稿搬送装置120、原稿読取部130、画像形成部140、給紙部150、および操作パネル160と接続され、MFP100の全体を制御する。
The
ROM113は、マルチコアプロセッサ111が実行するプログラム、またはそのプログラムを実行するために必要なデータを記憶する。RAM114は、マルチコアプロセッサ111がプログラムを実行する際の作業領域として用いられる。
The
通信I/F部112は、MFP100をネットワークに接続するためのインターフェースである。マルチコアプロセッサ111は、通信I/F部112を介して、ネットワークに接続されたコンピューターとの間で通信し、データを送受信する。また、通信I/F部112は、ネットワークを介してインターネットに接続されたコンピューターと通信が可能である。
Communication I /
ファクシミリ部116は、公衆交換電話網(PSTN)に接続され、PSTNにファクシミリデータを送信する、またはPSTNからファクシミリデータを受信する。ファクシミリ部116は、受信したファクシミリデータを、HDD115に記憶する、または画像形成部140に出力する。画像形成部140は、ファクシミリ部116により受信されたファクシミリデータを用紙にプリントする。また、ファクシミリ部116は、HDD115に記憶されたデータをファクシミリデータに変換して、PSTNに接続されたファクシミリ装置に送信する。
The
外部記憶装置117は、CD−ROM118が装着される。マルチコアプロセッサ111は、外部記憶装置117を介してCD−ROM118にアクセス可能である。マルチコアプロセッサ111は、外部記憶装置117に装着されたCD−ROM118に記録されたプログラムをRAM114にロードして実行する。なお、マルチコアプロセッサ111が実行するプログラムを記憶する媒体としては、CD−ROM118に限られず、光ディスク(MO(Magnetic Optical disc)/MD(Mini Disc)/DVD(Digital Versatile Disc))、ICカード、光カード、マスクROM、EPROM(Erasable Programmable ROM)、EEPROM(Electrically EPROM)などの半導体メモリであってもよい。
The
また、マルチコアプロセッサ111が実行するプログラムは、CD−ROM118に記録されたプログラムに限られず、HDD115に記憶されたプログラムをRAM114にロードして実行するようにしてもよい。この場合、ネットワークに接続された他のコンピューターが、MFP100のHDD115に記憶されたプログラムを書換える、または、新たなプログラムを追加して書き込むようにしてもよい。さらに、MFP100が、ネットワークに接続された他のコンピューターからプログラムをダウンロードして、そのプログラムをHDD115に記憶するようにしてもよい。ここでいうプログラムは、マルチコアプロセッサ111が直接実行可能なプログラムだけでなく、ソースプログラム、圧縮処理されたプログラム、暗号化されたプログラム等を含む。
The program executed by the
操作パネル160は、表示部161と操作部163とを含む。表示部161は、例えば、液晶表示装置(LCD)であり、ユーザーに対する指示メニューや取得した画像データに関する情報等を表示する。操作部163は、タッチパネル165と、ハードキー部167とを含む。タッチパネル165は、静電容量方式である。なお、タッチパネル165は、静電容量方式に限らず、例えば、抵抗膜方式、表面弾性波方式、赤外線方式、電磁誘導方式等の他の方式を用いることができる。ハードキー部167は、複数のハードキーを含む。ハードキーは、例えば接点スイッチである。
図3は、本実施の形態におけるMFPが備えるマルチコアプロセッサの構成の一例を示す図である。図3を参照して、マルチコアプロセッサ111は、第1プロセッサコア51と、第1プロセッサコア51に専用の第1キャッシュメモリ53と、第2プロセッサコア55と、第2プロセッサコア55に専用の第2キャッシュメモリ57と、を含む。第1キャッシュメモリ53と第2キャッシュメモリ57と、はRAM114に接続され、第1プロセッサコア51および第2プロセッサコア55がRAM114を共有する。
FIG. 3 is a diagram illustrating an example of a configuration of a multi-core processor included in the MFP according to the present embodiment. Referring to FIG. 3, the
マルチコアプロセッサ111は、第1プロセッサコア51および第2プロセッサコア55それぞれがプログラムを実行可能なので、プログラムを並列化して実行することが可能である。マルチコアプロセッサ111が実行するオペレーティングシステム(以下「OS」という)が、第1プロセッサコア51および第2プロセッサコア55のいずれかにスレッドを割り当てる。スレッドは、プログラムの一部で定められる処理である。マルチコアプロセッサ111が実行するOSは、一般的に、互いに依存関係のない処理に対する複数のスレッドそれぞれを、第1プロセッサコア51または第2プロセッサコア55のいずれかに割り当てる。第1プロセッサコア51に1以上のスレッドが割り当てられ、第2プロセッサコア55に1以上のスレッドが割り当てられる場合、複数のスレッドが並列に実行される。
Since the
第1プロセッサコア51および第2プロセッサコア55それぞれの負荷は、第1プロセッサコア51および第2プロセッサコア55は、それに割り当てられた1以上のスレッドが実行する処理に依存する。このため、第1プロセッサコア51に割り当てられたスレッドと、第2プロセッサコア55に割り当てられたスレッドとの違いによって、第1プロセッサコア51および第2プロセッサコア55それぞれの負荷が異なる。また、第1プロセッサコア51に割り当てられたスレッドが第1キャッシュメモリ53にアクセスする頻度およびキャッシュヒット率と、第2プロセッサコア55に割り当てられたスレッドが第2キャッシュメモリ57にアクセスする頻度およびキャッシュヒット率と、が異なる場合が多い。このため、マルチコアプロセッサ111が実行するOSは、第1プロセッサコア51の負荷と第2プロセッサコア55の負荷とを平準化するため、スレッドの割り当てを変更する。
The load of each of the
図4は、本実施の形態におけるMFPが備えるマルチコアプロセッサが有する機能の一例を示す図である。図4に示す機能は、マルチコアプロセッサ111が有する第1プロセッサコア51および第2プロセッサコア55のいずれかが、ROM113、HDD115またはCD−ROM118に記憶された負荷分散プログラムを実行することにより、マルチコアプロセッサ111で実現される機能である。図4を参照して、マルチコアプロセッサ111は、可変スレッド決定部11と、処理対象スレッド決定部13と、第1予測部15と、候補コア決定部17と、第2予測部19と、判断部21と、割当変更部23と、取得部25と、を含む。
FIG. 4 is a diagram illustrating an example of functions of the multi-core processor included in the MFP according to the present embodiment. The function shown in FIG. 4 is obtained by executing a load distribution program stored in the
可変スレッド決定部11は、第1プロセッサコア51および第2プロセッサコア55それぞれに割り当てられたスレッドのうちから可変スレッドを決定する。可変スレッドは、第1プロセッサコア51および第2プロセッサコア55のいずれかが実行するスレッドのうち、画像データを変換する処理を定めたプログラムを実行するスレッドである。画像データを変換する処理は、予め定められた処理を複数回繰り返す処理を含む。可変スレッド以外の処理を、固定スレッドという。可変スレッド決定部11は、決定された可変スレッドを識別するためのスレッド識別情報を処理対象スレッド決定部13に出力する。可変スレッド決定部11は、複数の可変スレッドを決定する場合、複数の可変スレッドをそれぞれ識別するための複数のスレッド識別情報を処理対象スレッド決定部13に出力する。
The variable
処理対象スレッド決定部13は、可変スレッド決定部11から入力される1以上のスレッド識別情報にそれぞれ対応する1以上の可変スレッドのうちから処理対象とする可変スレッドを決定する。可変スレッドには、予め優先度が設定されており、処理対象スレッド決定部13は、1以上の可変スレッドのうちから優先度が最も高い可変スレッドを処理対象スレッドに決定する。処理対象スレッド決定部13は、処理対象スレッドを決定した後に、後述する判断部21から判断結果が入力される。処理対象スレッド決定部13は、判断部21から割り当てを変更しないことを示す判断結果が入力される場合、可変スレッド決定部11から入力される1以上のスレッド識別情報にそれぞれ対応する1以上の可変スレッドのうちから、先に処理対象スレッドに決定した可変スレッドの優先度の次に高い優先度が設定された可変スレッドを処理対象スレッドに決定する。処理対象スレッド決定部13は、処理対象スレッドを決定することに応じて、処理対象スレッドに決定された可変スレッドのスレッド識別情報を第1予測部15および候補コア決定部17に出力する。
The processing target
取得部25は、第1プロセッサコア51および第2プロセッサコア55それぞれの状態を、取得する。取得部25は、第1プロセッサコア51および第2プロセッサコア55それぞれの状態を取得すると、取得された状態を第1予測部15および第2予測部19に出力する。取得部25は、能力情報取得部31と、ヒット率取得部33と、占有率取得部35と、を含む。
The
能力情報取得部31は、第1プロセッサコア51および第2プロセッサコア55それぞれの能力情報を取得する。第1プロセッサコア51および第2プロセッサコア55それぞれの能力情報は、演算速度を示す情報である。演算速度を示す情報は、例えば、クロック周波数である。
The capability
ヒット率取得部33は、第1プロセッサコア51および第2プロセッサコア55それぞれのキャッシュヒット率を取得する。キャッシュヒット率は、読み出しの対象となるデータがキャッシュメモリに記憶されている割合である。ヒット率取得部33は、第1プロセッサコア51に対する第1キャッシュヒット率と、第2プロセッサコア55に対する第2キャッシュヒット率と、を取得する。
The hit
占有率取得部35は、第1プロセッサコア51および第2プロセッサコア55それぞれにおける占有率を取得する。占有率取得部35が占有率を取得するタイミングは、ヒット率取得部33がキャッシュヒット率を取得するタイミングと同じである。占有率は、スレッドの処理時間が全体に占める割合である。占有率取得部35は、第1プロセッサコア51について、第1プロセッサコア51に割り当てられた1以上のスレッドごとに占有率を取得し、第1プロセッサコア51について、第1プロセッサコア51に割り当てられた1以上のスレッドごとに占有率を取得する。
The occupation
第1予測部15は、処理対象スレッド決定部13から処理対象スレッドのスレッド識別情報が入力され、取得部25から第1プロセッサコア51および第2プロセッサコア55それぞれの状態が入力される。第1予測部15は、第1プロセッサコア51および第2プロセッサコア55のうちから処理対象スレッドが割り当てられた一方を特定する。
The
ここでは、処理対象スレッドが第1プロセッサコア51に割り当てられている場合を例に説明する。この場合、第1予測部15は、処理対象スレッドを実行する第1プロセッサコア51を特定する。第1予測部15は、第1プロセッサコア51のキャッシュヒット率および処理対象スレッドの占有率に基づいて、第1プロセッサコア51が処理対象スレッドを実行する第1処理速度を予測する。具体的には、第1予測部15は、第1プロセッサコア51の能力情報に対して予め定められた能力定義データを参照して、第1処理速度を予測する。能力定義データは、複数のキャッシュヒット率ごとに、占有率と、単位データを処理する処理時間とを定める。
Here, a case where the processing target thread is assigned to the
図5は、能力定義データの一例を示す図である。能力定義データは、複数のキャッシュヒット率ごとに単位データを処理する処理時間と占有率との関係を定める。図5においては、横軸がCPU占有率を示し、縦軸が処理時間を示し、単位データを1GByteのデータとしている。キャッシュヒット率が0%に対応する能力定義データ201、キャッシュヒット率が40%における能力定義データ203、キャッシュヒット率が80%における能力定義データ205を示している。図5に示すように、キャッシュヒット率が高いほど、処理時間が短く、CPU占有率が高いほど、処理時間が短くなる。
FIG. 5 is a diagram illustrating an example of capability definition data. The capability definition data defines the relationship between the processing time for processing unit data and the occupation rate for each of a plurality of cache hit rates. In FIG. 5, the horizontal axis indicates the CPU occupation ratio, the vertical axis indicates the processing time, and the unit data is 1 GByte data. The
図4に戻って、第1予測部15は、第1プロセッサコア51の能力情報に対応する能力定義データを予め記憶しており、その能力定義データに基づいて、第1プロセッサコア51のキャッシュヒット率および処理対象スレッドの占有率に基づいて、第1処理速度を予測し、第1プロセッサコア51を識別するためのコア識別情報と第1処理速度との組を判断部21に出力する。具体的には、第1予測部15は、第1プロセッサコア51の能力情報に対応する能力定義データを参照して、第1プロセッサコア51のキャッシュヒット率に対応する能力定義データにおいて、処理対象スレッドの占有率に対応する処理時間で、単位データのデータ量を除算した値を第1処理速度とする。例えば、キャッシュヒット率が80%、処理対象スレッドの占有率が20%ならば単位データを処理する処理時間は500μsなので、第1処理速度を2Mbyte/μsに決定する。キャッシュヒット率が40%、処理対象スレッドの占有率が40%ならば単位データを処理する処理時間は500μsなので、第1処理速度を2Mbyte/μsに決定する。キャッシュヒット率が0%、処理対象スレッドの占有率が75%ならば単位データを処理する処理時間は500μsなので、第1処理速度を2Mbyte/μsに決定する。
Returning to FIG. 4, the
候補コア決定部17は、処理対象スレッド決定部13から処理対象スレッドのスレッド識別情報が入力されることに応じて、処理対象スレッドが割り当てられたプロセッサコアとは別のプロセッサコアを候補コアに決定する。ここでは、処理対象スレッドが第1プロセッサコア51に割り当てられているので、候補コア決定部17は、第2プロセッサコアを候補コアに決定する。候補コア決定部17は、候補コアに決定された第2プロセッサコアを識別するためのコア識別情報と、処理対象スレッドのスレッド識別情報と、を第2予測部19に出力する。なお、マルチコアプロセッサ111が3以上のプロセッサコアを有する場合には、候補コア決定部17は、3以上のプロセッサコアのうち処理対象スレッドが割り当てられたプロセッサコアとは別の2以上のプロセッサコアそれぞれを候補コアに決定する。候補コア決定部17は、候補コアに決定された2以上のプロセッサコアをそれぞれ識別するための2以上のコア識別情報と処理対象スレッドのスレッド識別情報とを第2予測部19に出力する。
The candidate
第2予測部19は、候補コア決定部17から候補コアのコア識別情報と処理対象スレッドのスレッド識別情報とが入力される。第2予測部19は、候補コアがキャッシュヒット率をゼロとして処理対象スレッドを実行する場合の第2処理速度を予測し、候補コアのコア識別情報と第2処理速度との組を判断部21に出力する。ここでは、第2プロセッサコア55のコア識別情報が入力される。この場合、第2予測部19は、第2プロセッサコア55が、キャッシュヒット率を0%として対象スレッドを実行する場合の第2処理速度を予測する。具体的には、第2予測部19は、第2プロセッサコア55に割り当てられたすべてのスレッドそれぞれの占有率に基づいて、第2プロセッサコア55の余力を算出する。第2プロセッサコア55に割り当てられたすべてのスレッドそれぞれの占有率の和を100%から減算した値を、第2プロセッサコア55の余力とする。第2予測部19は、第2プロセッサコア55の能力情報に対して予め定められた能力定義データを参照して、処理対象スレッドが第2プロセッサコア55の算出された余力の全てを占めると仮定して、第2処理速度を予測する。能力定義データは、複数のキャッシュヒット率ごとに、占有率と、単位データを処理する処理時間とを定める。第2予測部19は、キャッシュヒット率が0%に対応する能力定義データを参照して、余力を占有率として、その占有率に対応する処理時間で、単位データのデータ量を除算した値を第2処理速度に決定する。第2予測部19は、第2プロセッサコアのコア識別情報と第2処理速度との組を判断部21に出力する。なお、第2予測部19は、候補コア決定部17から複数のコア識別情報が入力される場合、複数のコア識別情報で識別される複数のプロセッサコアごとに、第2処理速度を予測し、第2処理速度が最大となるプロセッサコアを特定し、特定したプロセッサコアのコア識別情報と第2処理速度との組を判断部21に出力する。
The
判断部21は、第1予測部15から処理対象スレッドが割り当てられたプロセッサコアのコア識別情報と第1処理速度との組が入力され、第2予測部19から候補コアのコア識別情報と第2処理速度との組が入力される。判断部21は、第1処理速度と第2処理速度とを比較し、処理対象スレッドの割り当てを変更するか否かを判断し、判断結果を割当変更部23に出力する。判断部21は、所定時間間隔で、処理対象スレッドの割り当てを変更するか否かを判断する。判断部21は、第2処理速度が第1処理速度より大きければ処理対象スレッドの割り当てを変更すると判断するが、第2の処理時間が第1の処理時間以下であれば処理対象スレッドの割り当てを変更しないと判断する。判断結果は、割当を変更するか否かを示す。判断部21は、割当を変更すると判断する場合には、判断結果に加えて、候補コアのコア識別情報を割当変更部23に出力する。
The
ここでは、判断部21は、第1予測部15から処理対象スレッドが割り当てられた第1プロセッサコア51のコア識別情報と第1処理速度との組が入力され、第2予測部19から候補コアに決定された第2プロセッサコア55のコア識別情報と第2処理速度との組が入力される。判断部21は、第2処理速度が第1処理速度より大きければ処理対象スレッドの割り当てを変更すると判断し、割当を変更することを示す判断結果と、第2プロセッサコア55のコア識別情報とを割当変更部23に出力する。判断部21は、第2処理速度が第1処理速度以下ならば処理対象スレッドの割り当てを変更しないと判断し、割当を変更しないことを示す判断結果を処理対象スレッド決定部13に出力する。
Here, the
割当変更部23は、判断部21から割当を変更することを示す判断結果が入力される場合、処理対象スレッド決定部13から入力される処理対象スレッドを、判断部21から判断結果とともに入力されるコア識別情報で特定される第2プロセッサコアに割り当てる。これにより、第1プロセッサコア51で実行されていた処理対象スレッドである可変スレッドが、第2プロセッサコア55により実行される。
When the determination result indicating that the allocation is changed is input from the
割当変更部23は、処理単位決定部27を含む。処理単位決定部27は、処理対象スレッドが画像データを複数の処理単位部分に分割して処理する場合、処理単位を決定する。割当変更部23は、複数の処理単位部分のいずれかの処理が完了することに応じて、割当を変更する。例えば、処理単位決定部27は、画像データが複数ページを含む場合、複数ページそれぞれの部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数ページのいずれかページの処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
The
また、処理単位決定部27は、画像データが複数行を含む場合、複数行それぞれの部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数行のいずれかの行の処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
In addition, when the image data includes a plurality of lines, the processing
また、処理単位決定部27は、画像データが、属性の異なる複数の属性別データを含む場合、複数の属性別データを処理単位部分に決定する。例えば、画像データが、文字が表された文字領域、図形が表された線画領域、および写真が表された写真領域を含む場合、画像データは、文字領域のみからなる属性別データと、図形のみからなる属性別データと、写真のみからなる属性別データとを含む。また、画像データがカラーの場合、画像データは、赤色のみからなる属性別データと、緑色のみからなる属性別データと、青色のみからなる属性別データと、を含む。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数の属性別データのいずれかの属性別データの処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
Further, when the image data includes a plurality of attribute-specific data having different attributes, the processing
また、処理単位決定部27は、対象スレッドが画像データを符号化する符号化処理を実行する場合、符号化の対象となる単位部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データを符号化処理をする際に、画像データに含まれる符号化の対象となる複数の単位部分のいずれかの単位部分の処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
Further, when the target thread executes an encoding process for encoding image data, the processing
<具体例>
次に、第1プロセッサコア51および第2プロセッサコア55の能力が同じ場合について、具体例を説明する。
<Specific example>
Next, a specific example will be described in the case where the
図6は、処理対象スレッドの移動を説明するための第1の図である。図6を参照して、第1プロセッサコア51のキャッシュヒット率が80%の場合であって、処理対象スレッドの占有率が10%の場合、キャッシュヒット率が80%の能力定義データ205を参照すると、占有率10%対応する処理時間は1000μsなので、第1処理速度は1Mbute/μsと予測される。第2プロセッサコア55のキャッシュヒット率を0%として、キャッシュヒット率が0%の能力定義データ201を参照すると、処理時間が1000μsに対応する占有率は40%である。このため、第2プロセッサコア55に割り当てられている全てのスレッドの占有率の合計が60%より小さい場合に、第2処理速度が1Mbyte/μsより大きくなる。換言すれば、第2プロセッサコア55の余力が40%より大きければ、第2処理速度が1Mbyte/μsより大きくなる。このため、処理対象スレッドを、第1プロセッサコア51で継続して実行するよりも、第2プロセッサコア55で実行する方が、処理対象スレッドを早期に終了することが予測される。
FIG. 6 is a first diagram for explaining the movement of the processing target thread. Referring to FIG. 6, when the cache hit rate of the
図7は、処理対象スレッドの移動を説明するための第2の図である。図7を参照して、第1プロセッサコア51のキャッシュヒット率が40%の場合であって、処理対象スレッドの占有率が20%の場合、キャッシュヒット率が40%の能力定義データ203を参照すると、占有率20%対応する処理時間は1000μsなので、第1処理速度は1Mbyte/μsと予測される。第2プロセッサコア55のキャッシュヒット率を0%として、キャッシュヒット率が0%の能力定義データ201を参照すると、処理時間が1000μsに対応する占有率は40%である。このため、第2プロセッサコア55に割り当てられている全てのスレッドの占有率の合計が60%より小さい場合に、第2処理速度が1Mbyte/μsより大きくなる。換言すれば、第2プロセッサコア55の余力が40%より大きければ、第2処理速度が1Mbyte/μsより大きくなる。このため、処理対象スレッドを、第1プロセッサコア51で継続して実行するよりも、第2プロセッサコア55で実行する方が、処理対象スレッドを早期に終了することが予測される。
FIG. 7 is a second diagram for explaining the movement of the processing target thread. Referring to FIG. 7, when the cache hit rate of the
図8は、負荷分散処理の流れの一例を示すフローチャートである。負荷分散処理は、マルチコアプロセッサ111が有する第1プロセッサコア51および第2プロセッサコア55のいずれかが、ROM113、HDD115またはCD−ROM118に記憶された負荷分散プログラムを実行することにより、マルチコアプロセッサ111で実行される処理である。図8を参照して、マルチコアプロセッサ111は、所定の時間が経過したか否かを判断する(ステップS01)。所定の時間は、ステップS01の処理が実行されてからの経過時間であり、負荷分散処理の実行を開始してからの経過時間、負荷分散処理を終了してからの経過時間である。所定の時間は、任意に定めることができる。所定の時間が経過するまで待機状態となり(ステップS01でNO)、所定の時間が経過したならば(ステップS02でYES)、処理をステップS02に進める。
FIG. 8 is a flowchart illustrating an example of the flow of load distribution processing. The load distribution process is performed by the
ステップS02においては、可変スレッドを決定し、処理をステップS03に進める。第1プロセッサコア51および第2プロセッサコア55それぞれで実行している1以上のスレッドであって、画像データを変換する処理を実行するスレッドを可変スレッドに決定する。ステップS03においては、ステップS02において決定された1以上の可変スレッドのうちから優先度が最も高い可変スレッドを処理対象スレッドに設定する。ステップS02において1つの可変スレッドが決定される場合、その可変スレッドを処理対象スレッドに設定する。ここでは、第1プロセッサコア51に割り当てられた可変スレッドを処理対象スレッドに設定する場合を例に説明する。
In step S02, a variable thread is determined, and the process proceeds to step S03. One or more threads that are executed in each of the
次のステップS04においては、処理対象スレッドが割当られたプロセッサコアを対象コアに決定し、処理をステップS05に進める。処理対象スレッドが第1プロセッサコア51に割り当てられていれば第1プロセッサコア51を対象コアに決定し、処理対象スレッドが第2プロセッサコア55に割り当てられていれば第2プロセッサコア55を対象コアに決定する。ステップS05においては、第1プロセッサコア51および第2プロセッサコア55それぞれの状態情報を取得する。具体的には、第1プロセッサコア51および第2プロセッサコア55それぞれの能力情報およびキャッシュヒット率、第1プロセッサコア51に割り当てられた1以上のスレッドそれぞれの占有率、第2プロセッサコア55に割り当てられた1以上のスレッドそれぞれの占有率を取得する。
In the next step S04, the processor core to which the processing target thread is assigned is determined as the target core, and the process proceeds to step S05. If the processing target thread is assigned to the
ステップS06においては、第1処理時間を予測する。処理対象スレッドを、処理対象スレッドが割り当てられた第1プロセッサコア51で実行する第1処理速度を予測する。処理対象スレッドに対してステップS05において取得された占有率が第1プロセッサコア51において継続すると仮定して、第1プロセッサコア51に対応する能力定義データのうちステップS05において取得されたキャッシュ率に対応する能力定義データを参照して、処理対象スレッドの占有率に対応する処理時間で、単位データのデータ量を除算した値を第1処理時間に設定する。
In step S06, the first processing time is predicted. The first processing speed at which the processing target thread is executed by the
次のステップS07においては、対象コア以外のプロセッサコアを選択し、処理をステップS08に進める。ここでは、対象コアである第1プロセッサコア51以外に第2プロセッサコア55のみが存在するので、第2プロセッサコア55を選択する。なお、プロセッサコアが、3以上の場合には、対象コア以外の2以上のプロセッサコアのうちから1つを選択する。
In the next step S07, a processor core other than the target core is selected, and the process proceeds to step S08. Here, since only the
次のステップS08においては、第2処理時間を予測し、処理をステップS09に進める。ステップS07において選択された第2プロセッサコア55が、キャッシュヒット率を0%として、ステップS03において処理対象スレッドに設定された可変スレッドを実行する第2処理速度を予測する。具体的には、ステップS05において取得された、第2プロセッサコア55に割り当てられたすべてのスレッドそれぞれの占有率に基づいて、第2プロセッサコア55の余力を算出する。第2プロセッサコア55に割り当てられたすべてのスレッドそれぞれの占有率の和を100%から減算した値を、第2プロセッサコア55の余力とする。そして、第2プロセッサコア55の能力情報に対して予め定められた能力定義データのうち、キャッシュヒット率が0%に対応する能力定義データを参照して、処理対象スレッドが第2プロセッサコア55の余力の全てを第2プロセッサコア55の処理時間に占めると仮定して、余力を占有率として、その占有率に対応する処理時間で単位データのデータ量を除算した値を第2処理速度に決定する。
In the next step S08, the second processing time is predicted, and the process proceeds to step S09. The
次のステップS09においては、ステップS07において未選択のプロセッサコアが存在するか否かを判断する。未選択のプロセッサコアが存在すれば処理をステップS07に戻すが、存在しなければ処理をステップS10に進める。処理がステップS10に進む場合には、プロセッサコアが3以上の場合には、対象コア以外の2以上のプロセッサコアそれぞれに対して第2処理時間が決定される。 In the next step S09, it is determined whether or not there is an unselected processor core in step S07. If there is an unselected processor core, the process returns to step S07; otherwise, the process proceeds to step S10. When the process proceeds to step S10, if the number of processor cores is three or more, the second processing time is determined for each of two or more processor cores other than the target core.
ステップS10においては、第2処理速度が最大となるプロセッサコアを候補コアに設定し、処理をステップS11に進める。ステップS11においては、ステップS06において予測された第1処理速度と、ステップS10において候補コアに設定されたプロセッサコアに対して予測された第2処理速度とを比較する。第2処理速度が第1処理速度より大きいならば処理をステップS12に進めるが、そうでなければ処理をステップS15に進める。ステップS15においては、未選択の可変タクスが存在するか否かを判断する。ステップS02において決定された可変スレッドのうちで、ステップS03において処理対象スレッドに設定されていない可変スレッドが存在するか否かを判断する。未選択の可変スレッドが存在するならば処理をステップS03に戻すが、存在しなければ処理をステップS01に戻す。 In step S10, the processor core having the maximum second processing speed is set as a candidate core, and the process proceeds to step S11. In step S11, the first processing speed predicted in step S06 is compared with the second processing speed predicted for the processor core set as the candidate core in step S10. If the second processing speed is greater than the first processing speed, the process proceeds to step S12; otherwise, the process proceeds to step S15. In step S15, it is determined whether there is an unselected variable task. Of the variable threads determined in step S02, it is determined whether or not there is a variable thread that is not set as a processing target thread in step S03. If there is an unselected variable thread, the process returns to step S03; otherwise, the process returns to step S01.
ステップS12においては、処理単位を決定する。ステップS03において処理対象スレッドに設定された可変スレッドが実行する処理、または、可変スレッドが処理対象とする画像データに基づいて処理単位を決定する。画像データが複数ページを含む場合、複数ページそれぞれの部分を処理単位部分に決定する。また、画像データが複数行を含む場合、複数行それぞれの部分を処理単位部分に決定する。画像データが、属性の異なる複数の属性別データを含む場合、複数の属性別データを処理単位部分に決定する。また、可変スレッドが実行する処理が画像データを符号化する符号化処理の場合、符号化の対象となる単位部分を処理単位部分に決定する。 In step S12, a processing unit is determined. In step S03, a processing unit is determined based on processing executed by the variable thread set as the processing target thread or image data to be processed by the variable thread. When the image data includes a plurality of pages, a portion of each of the plurality of pages is determined as a processing unit portion. Further, when the image data includes a plurality of lines, a part of each of the plurality of lines is determined as a processing unit part. When the image data includes a plurality of attribute-specific data having different attributes, the plurality of attribute-specific data are determined as processing unit portions. When the process executed by the variable thread is an encoding process for encoding image data, a unit part to be encoded is determined as a processing unit part.
ステップS13においては、ステップS12において決定された処理単位の処理が終了したか否かを判断する。第1プロセッサコア51において実行されている処理対象スレッドにおいて、処理単位部分の処理が終了するまで待機状態となり、処理単位部分の処理が終了したならば処理をステップS14に進める。
In step S13, it is determined whether or not the processing unit determined in step S12 has been completed. In the processing target thread executed in the
ステップS14においては、ステップS03において処理対象スレッドに設定された可変スレッドを、ステップS10において候補コアに設定されたプロセッサコアに割り当て、処理をステップS01に戻す。ここでは、第1プロセッサコア51で実行されている可変スレッドを、第2プロセッサコア55に割り当てる。これにより、第1プロセッサコア51で実行されていた可変スレッドが、第2プロセッサコア55によって実行される。このため、第1プロセッサコア51の負荷を、第2プロセッサコア55に分散させることができる。
In step S14, the variable thread set as the processing target thread in step S03 is assigned to the processor core set as the candidate core in step S10, and the process returns to step S01. Here, the variable thread being executed by the
以上説明したように、本実施の形態におけるMFP100は、画像処理装置として機能し、処理対象スレッドが割り当てられた第1プロセッサコア51について取得されたキャッシュヒット率に基づいて、第1プロセッサコア51が処理対象スレッドを実行する第1処理速度を予測し、候補コアに決定された第2プロセッサコア55が、キャッシュヒット率をゼロとして処理対象スレッドを実行する場合の第2処理速度を予測し、第1処理速度と第2処理速度とを比較し、第2処理速度が第1処理速度より大きい場合に、処理対象スレッドの割り当てを、第1プロセッサコア51から第2プロセッサコア55に変更する。このため、対象スレッドを移動する前の第1の処理速度と、対象スレッドを移動した後の第2処理速度とを比較するので、対象スレッドを処理する処理速度が速くなることが予測される場合に、対象スレッドが移動される。その結果、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することができる。
As described above,
また、第1プロセッサコア51における処理対象スレッドの占有率と、第1プロセッサコア51のキャッシュヒット率とに基づいて、第1処理速度を予測し、第2プロセッサコア55が実行する1以上のスレッドそれぞれの占有率から算出される第2プロセッサコア55の余力に基づいて、第2処理速度を予測するので、処理対象スレッドを移動する前後の処理速度を正確に予測することができる。
One or more threads executed by the
また、第1プロセッサコア51の処理能力に対応する能力定義データを参照して、第1処理速度を予測し、第2プロセッサコア55の処理能力に対応する能力定義データを参照して、第2処理速度を予測するので、第1プロセッサコア51と第2プロセッサコア55の処理能力が異なる場合でも、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することができる。
Further, the first processing speed is predicted by referring to the capability definition data corresponding to the processing capability of the
また、処理対象スレッドの割り当てを変更するか否かを、所定時間間隔で判断するので、所定時間間隔で複数のプロセッサコアの負荷を分散することができる。 In addition, since it is determined at predetermined time intervals whether or not the allocation of the processing target thread is changed, it is possible to distribute the loads of the plurality of processor cores at predetermined time intervals.
また、処理対象スレッドが処理対象とする画像データを複数の処理単位部分に分割して処理する場合、複数の処理単位部分のいずれかの処理単位部分の処理が完了するまで処理対象スレッドの割り当てを変更しないので、移動前後で同じ処理が重複して実行されるのを回避することができる。 In addition, when processing image data to be processed by a processing target thread by dividing it into a plurality of processing unit parts, the processing target thread is allocated until processing of any processing unit part of the plurality of processing unit parts is completed. Since no change is made, it is possible to avoid the same process from being executed repeatedly before and after the movement.
また、画像データを変換する処理を定めたプログラムを実行するスレッドを可変スレッドに決定し、1以上の可変スレッドの1つを対象スレッドに決定するので、同じ処理を繰り返し実行する処理を実行するスレッドを対象スレッドに決定することができる。また、移動前後の第1処理速度と第2処理速度とを正確に予測することができる。 Also, a thread that executes a program that defines a process for converting image data is determined as a variable thread, and one of one or more variable threads is determined as a target thread. Therefore, a thread that executes a process that repeatedly executes the same process Can be determined as the target thread. In addition, the first processing speed and the second processing speed before and after the movement can be accurately predicted.
また、複数の可変スレッドが存在する場合には、優先順位が高い順に対象スレッドに決定するので、優先順位の高い可変スレッドを早期に終了させることができる。 Further, when there are a plurality of variable threads, the target threads are determined in descending order of priority, so that the variable threads with high priority can be terminated early.
なお、上述した実施の形態においては、画像処理装置の一例として、MFP100を例に説明したが、図8に示した負荷分散処理を、MFP100に実行させる負荷分散方法、また、その負荷分散方法をMFP100が備えるマルチコアプロセッサ111に実行させる負荷分散プログラムとして発明を捉えることができる。
In the above-described embodiment, the
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
<付記>
(1) 前記割当変更手段は、前記画像データが複数ページを含む場合、複数ページそれぞれの部分を処理単位部分に決定する、請求項5に記載の画像処理装置。
(2) 前記割当変更手段は、前記画像データが複数行を含む場合、複数行それぞれの部分を処理単位部分に決定する、請求項5または(1)に記載の画像処理装置。
(3) 前記割当変更手段は、前記画像データが、属性の異なる複数の属性別データを含む場合、前記複数の属性別データを処理単位部分に決定する、請求項5、(1)および(2)のいずれかに記載の画像処理装置。
(4) 前記割当変更手段は、対象スレッドが画像データを符号化する符号化処理を実行する場合、前記符号化の対象となる単位部分を処理単位部分に決定する、請求項5に記載の画像処理装置。
<Appendix>
(1) The image processing apparatus according to claim 5, wherein when the image data includes a plurality of pages, the allocation changing unit determines a portion of each of the plurality of pages as a processing unit portion.
(2) The image processing apparatus according to (5) or (1), wherein, when the image data includes a plurality of rows, the allocation changing unit determines a portion of each of the plurality of rows as a processing unit portion.
(3) The allocation changing unit determines the plurality of attribute-specific data as processing unit parts when the image data includes a plurality of attribute-specific data having different attributes. ).
(4) The image according to claim 5, wherein, when the target thread executes an encoding process for encoding image data, the allocation changing unit determines a unit part to be encoded as a processing unit part. Processing equipment.
100 MFP、110 メイン回路、111 マルチコアプロセッサ、112 通信I/F部、113 ROM、114 RAM、115 HDD、116 ファクシミリ部、117 外部記憶装置、118 CD−ROM、120 自動原稿搬送装置、130 原稿読取部、140 画像形成部、150 給紙部、160 操作パネル、161 表示部、163 操作部、165 タッチパネル、167 ハードキー部、11 可変スレッド決定部、13 処理対象スレッド決定部、15 第1予測部、17 候補コア決定部、19 第2予測部、21 判断部、23 割当変更部、25 取得部、27 処理単位決定部、31 能力情報取得部、33 ヒット率取得部、35 占有率取得部、51 第1プロセッサコア、53 第1キャッシュメモリ、55 第2プロセッサコア、57 第2キャッシュメモリ。
100 MFP, 110 main circuit, 111 multi-core processor, 112 communication I / F unit, 113 ROM, 114 RAM, 115 HDD, 116 facsimile unit, 117 external storage device, 118 CD-ROM, 120 automatic document feeder, 130 document reading , 140 Image forming section, 150 Paper feed section, 160 Operation panel, 161 Display section, 163 Operation section, 165 Touch panel, 167 Hard key section, 11 Variable thread determination section, 13 Processing target thread determination section, 15
Claims (9)
前記複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、
前記複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定手段と、
前記複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得手段と、
前記ヒット率取得手段により前記対象コアについて取得されたキャッシュヒット率に基づいて、前記対象コアが前記対象スレッドを実行する第1処理速度を予測する第1予測手段と、
前記複数のプロセッサコアのうち前記対象コアとは別の候補コアが、キャッシュヒット率をゼロとして前記対象スレッドを実行する場合の第2処理速度を予測する第2予測手段と、
前記第1処理速度と前記第2処理速度とを比較することにより、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更するか否かを判断する判断手段と、
前記判断手段による判断結果に基づいて、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更する割当変更手段と、を備えた画像処理装置。 Multiple processor cores,
A plurality of cache memories respectively corresponding to the plurality of processor cores;
Target thread determination means for determining one of one or more threads assigned to the target core among the plurality of processor cores as a target thread;
Hit rate acquisition means for acquiring a cache hit rate for each of the plurality of processor cores;
First prediction means for predicting a first processing speed at which the target core executes the target thread based on the cache hit rate acquired for the target core by the hit rate acquisition means;
Second prediction means for predicting a second processing speed when a candidate core different from the target core among the plurality of processor cores executes the target thread with a cache hit rate of zero;
Determining means for determining whether to change the allocation of the target thread from the target core to the candidate core by comparing the first processing speed and the second processing speed;
An image processing apparatus comprising: an assignment changing unit that changes the assignment of the target thread from the target core to the candidate core based on a determination result by the determination unit.
前記第1予測手段は、前記占有率取得手段により取得された前記対象スレッドの占有率と、前記ヒット率取得手段により取得された前記対象コアのキャッシュヒット率とに基づいて、前記第1処理速度を予測し、
前記第2予測手段は、前記占有率取得手段により取得される前記候補コアが実行する1以上のスレッドそれぞれの占有率から算出される前記候補コアの余力に基づいて、前記第2処理速度を予測する、請求項1に記載の画像処理装置。 An occupancy rate acquisition means for acquiring an occupancy rate for each of one or more threads executed by each of the plurality of processor cores,
The first prediction unit is configured to determine the first processing speed based on the occupation rate of the target thread acquired by the occupation rate acquisition unit and the cache hit rate of the target core acquired by the hit rate acquisition unit. Predict
The second predicting unit predicts the second processing speed based on a surplus capacity of the candidate core calculated from an occupancy rate of each of one or more threads executed by the candidate core acquired by the occupancy rate acquiring unit. The image processing apparatus according to claim 1.
前記第1予測手段は、前記対象スレッドの処理能力にさらに基づいて、前記第1処理速度を予測し、
前記第2予測手段は、前記候補コアの処理能力にさらに基づいて、前記第2処理速度を予測する、請求項2に記載の画像処理装置。 A capability information acquisition means for acquiring the processing capability of the plurality of processor cores;
The first predicting means predicts the first processing speed based on the processing capability of the target thread;
The image processing apparatus according to claim 2, wherein the second prediction unit predicts the second processing speed based further on a processing capability of the candidate core.
前記対象スレッド決定手段は、前記可変スレッド決定手段により決定される1以上の可変スレッドの1つを対象スレッドに決定する、請求項1〜5のいずれかに記載の画像処理装置。 Variable thread determination means for determining, as the variable thread, a thread that executes a program in which any one of the plurality of processor cores defines processing for converting image data;
The image processing apparatus according to claim 1, wherein the target thread determination unit determines one of one or more variable threads determined by the variable thread determination unit as a target thread.
前記画像処理装置は、複数のプロセッサコアと、
前記複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、
前記複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、
前記複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、
前記ヒット率取得ステップにおいて前記対象コアについて取得されたキャッシュヒット率に基づいて、前記対象コアが前記対象スレッドを実行する第1処理速度を予測する第1予測ステップと、
前記複数のプロセッサコアのうち前記対象コアとは別の候補コアが、キャッシュヒット率をゼロとして前記対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、
前記第1処理速度と前記第2処理速度とを比較することにより、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更するか否かを判断する判断ステップと、
前記判断ステップにおける判断結果に基づいて、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更する割当変更ステップと、を含む負荷分散方法。 A load balancing method executed by an image processing apparatus,
The image processing apparatus includes a plurality of processor cores,
A plurality of cache memories respectively corresponding to the plurality of processor cores,
A target thread determination step of determining one of one or more threads assigned to the target core among the plurality of processor cores as a target thread;
A hit rate acquisition step of acquiring a cache hit rate of each of the plurality of processor cores;
A first prediction step of predicting a first processing speed at which the target core executes the target thread based on the cache hit rate acquired for the target core in the hit rate acquisition step;
A second predicting step of predicting a second processing speed when a candidate core different from the target core among the plurality of processor cores executes the target thread with a cache hit rate of zero;
A determination step of determining whether or not to change the allocation of the target thread from the target core to the candidate core by comparing the first processing speed and the second processing speed;
A load distribution method comprising: an allocation changing step of changing the allocation of the target thread from the target core to the candidate core based on a determination result in the determining step.
前記マルチコアプロセッサは、複数のプロセッサコアと、
前記複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、
前記複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、
前記複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、
前記ヒット率取得ステップにおいて前記対象コアについて取得されたキャッシュヒット率に基づいて、前記対象コアが前記対象スレッドを実行する第1処理速度を予測する第1予測ステップと、
前記複数のプロセッサコアのうち前記対象コアとは別の候補コアが、キャッシュヒット率をゼロとして前記対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、
前記第1処理速度と前記第2処理速度とを比較することにより、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更するか否かを判断する判断ステップと、
前記判断ステップにおける判断結果に基づいて、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更する割当変更ステップと、を前記マルチコアプロセッサに実行させる負荷分散プログラム。 A load balancing program executed by a multi-core processor that controls the image processing apparatus,
The multi-core processor includes a plurality of processor cores,
A plurality of cache memories respectively corresponding to the plurality of processor cores,
A target thread determination step of determining one of one or more threads assigned to the target core among the plurality of processor cores as a target thread;
A hit rate acquisition step of acquiring a cache hit rate of each of the plurality of processor cores;
A first prediction step of predicting a first processing speed at which the target core executes the target thread based on the cache hit rate acquired for the target core in the hit rate acquisition step;
A second predicting step of predicting a second processing speed when a candidate core different from the target core among the plurality of processor cores executes the target thread with a cache hit rate of zero;
A determination step of determining whether or not to change the allocation of the target thread from the target core to the candidate core by comparing the first processing speed and the second processing speed;
A load distribution program that causes the multi-core processor to execute an allocation change step of changing the allocation of the target thread from the target core to the candidate core based on a determination result in the determination step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016060140A JP6686599B2 (en) | 2016-03-24 | 2016-03-24 | Image processing apparatus, load balancing method, and load balancing program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016060140A JP6686599B2 (en) | 2016-03-24 | 2016-03-24 | Image processing apparatus, load balancing method, and load balancing program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017174194A true JP2017174194A (en) | 2017-09-28 |
JP6686599B2 JP6686599B2 (en) | 2020-04-22 |
Family
ID=59973906
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016060140A Active JP6686599B2 (en) | 2016-03-24 | 2016-03-24 | Image processing apparatus, load balancing method, and load balancing program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6686599B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110333911A (en) * | 2019-07-04 | 2019-10-15 | 北京迈格威科技有限公司 | A kind of file packet read method and device |
CN113842642A (en) * | 2021-09-29 | 2021-12-28 | 联想(北京)有限公司 | Method for allocating resources for game application and electronic equipment |
-
2016
- 2016-03-24 JP JP2016060140A patent/JP6686599B2/en active Active
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110333911A (en) * | 2019-07-04 | 2019-10-15 | 北京迈格威科技有限公司 | A kind of file packet read method and device |
CN113842642A (en) * | 2021-09-29 | 2021-12-28 | 联想(北京)有限公司 | Method for allocating resources for game application and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
JP6686599B2 (en) | 2020-04-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9483319B2 (en) | Job scheduling apparatus and method therefor | |
WO2013051056A1 (en) | Multi-client storage system and storage system management method | |
JP6669961B2 (en) | Processor, control method of reconfigurable circuit, and program | |
US20090327495A1 (en) | Computing with local and remote resources using automated optimization | |
JP2007026094A (en) | Execution device and application program | |
US9626285B2 (en) | Storage resource allocation to dataflows based on data requirements and attributes | |
WO2016145904A1 (en) | Resource management method, device and system | |
EP4242843A1 (en) | Graphics card memory management method and apparatus, device, and system | |
US11012316B2 (en) | Methods and apparatus to generate and manage workload domains in virtual server racks | |
CN110493317B (en) | Method for processing cloud platform resource fragments and related equipment | |
JP6686599B2 (en) | Image processing apparatus, load balancing method, and load balancing program | |
JP5867238B2 (en) | Auto scaling method, auto scaling program and computer node | |
JP2016110248A (en) | Virtualization execution apparatus, virtualization system, and resource optimization method | |
CN112154416A (en) | Virtual machine configuration method and virtual machine configuration device for implementing same | |
JP6666553B2 (en) | Information processing apparatus, job management method, and job management program | |
KR20190057558A (en) | Multi core control system | |
US20220366217A1 (en) | Method and device of computing layout selection for efficient dnn inference | |
US9405470B2 (en) | Data processing system and data processing method | |
CN115686800A (en) | Dynamic core scheduling method and device for multi-core system | |
CN109324886A (en) | cluster resource scheduling method and device | |
CN114237902A (en) | Service deployment method and device, electronic equipment and computer readable medium | |
JPWO2014027444A1 (en) | Scheduling apparatus and scheduling method | |
JP6724631B2 (en) | Information processing device and program | |
CN112114967A (en) | GPU resource reservation method based on service priority | |
CN112631743B (en) | Task scheduling method, device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190117 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20191119 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20191126 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20200116 |
|
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: 20200303 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200316 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6686599 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |