JP6686599B2 - Image processing apparatus, load balancing method, and load balancing program - Google Patents
Image processing apparatus, load balancing method, and load balancing program Download PDFInfo
- Publication number
- JP6686599B2 JP6686599B2 JP2016060140A JP2016060140A JP6686599B2 JP 6686599 B2 JP6686599 B2 JP 6686599B2 JP 2016060140 A JP2016060140 A JP 2016060140A JP 2016060140 A JP2016060140 A JP 2016060140A JP 6686599 B2 JP6686599 B2 JP 6686599B2
- Authority
- JP
- Japan
- Prior art keywords
- core
- target
- thread
- processing
- unit
- 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.)
- Active
Links
- 238000012545 processing Methods 0.000 title claims description 338
- 238000000034 method Methods 0.000 title claims description 54
- 230000008859 change Effects 0.000 claims description 16
- 230000015654 memory Effects 0.000 claims description 15
- 230000004044 response Effects 0.000 claims description 6
- 230000008569 process Effects 0.000 description 38
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000004904 shortening Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000005012 migration Effects 0.000 description 3
- 238000013508 migration Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000005674 electromagnetic induction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
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, a multi-core processor having a plurality of cores is known, and it is conceivable to mount the multi-core processor on an MFP (Multi Function Peripheral) typified by an image processing apparatus that processes an image. In a multi-core processor, threads are assigned to a plurality of cores to execute different processes in parallel. However, depending on the thread allocation state, the load on one core may be greater than that on another core. Therefore, there is known a technique for distributing the load among a plurality of cores.
例えば、特開2008−191949号公報には、複数のコアプロセッサを有する複数のマルチコアプロセッサと、各マルチコアプロセッサの資源を共有する共有資源とを有するマルチコアシステムであって、前記各マルチコアプロセッサの負荷情報と、前記共有資源に対するアクセス時の負荷情報とを取得する負荷情報収集手段と、前記負荷情報収集手段により取得した前記各マルチコアプロセッサの負荷情報と、前記アクセス時の負荷情報との条件に基づいて、負荷分散を行うか否かの判定を行う負荷分散判定手段と、前記負荷分散判定手段により、負荷分散を行うと判断された際には、負荷を分散する負荷分散手段とを有するマルチコアシステムであることを特徴とする、マルチコアシステムが記載されている。特開2008−191949号公報に記載のマルチコアシステムにおいては、負荷の増大したマルチコアプロセッサに割り当てられたスレッドを、負荷の少ないマルチコアプロセッサに移動するので、複数のマルチコアプロセッサ間で負荷を分散することができる。 For example, Japanese Unexamined Patent Application Publication 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 that shares the resources of each multi-core processor, and the load information of each multi-core processor. And load information collecting means for acquiring load information at the time of accessing the shared resource, load information of each of the multi-core processors acquired by the load information collecting means, and load information at the time of access based on conditions In a multi-core system having a load balancing determining unit that determines whether to perform load balancing, and a load balancing unit that balances the load when the load balancing determining unit determines to perform load balancing. A multi-core system is described, characterized in that In the multi-core system described in Japanese Unexamined Patent Application Publication No. 2008-191949, the threads assigned to the multi-core processor with the increased load are moved to the multi-core processor with the lighter load, so that the load can be distributed among the multi-core processors. it can.
しかしながら、スレッドを移動した後のマルチコアプロセッサにおいては、キャッシュメモリにデータを書き込む時間が必要となり、また、移動の対象となるスレッドを実行する際のキャッシュメモリにアクセスするキャッシュヒット率が移動前よりも高くなるとは限らない。このため、移動後のマルチコアプロセッサが移動の対象となるスレッドを実行する処理速度が、移動前よりも遅くなる場合があるといった問題がある。
この発明は上述した問題点を解決するためになされたもので、この発明の目的の1つは、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な画像処理装置を提供することである。 The present invention has been made to solve the above-described problems, and one of the objects of the present invention is to reduce the processing time after the movement of a thread to be moved and to distribute the load of a plurality of processor cores. 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 the loads of a plurality of processor cores while shortening the processing time after the migration target thread is migrated.
この発明のさらに他の目的は、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することが可能な負荷分散プログラムを提供することである。 Still another object of the present invention is to provide a load distribution program capable of distributing the loads of a plurality of processor cores while shortening the processing time after the migration of threads to be migrated.
上述した目的を達成するためにこの発明のある局面によれば、画像処理装置は、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定手段と、複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得手段と、ヒット率取得手段により対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度を予測する第1予測手段と、複数のプロセッサコアのうち対象コアとは別の候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度を予測する第2予測手段と、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かを判断する判断手段と、判断手段による判断結果に基づいて、対象スレッドの割り当てを、対象コアから候補コアに変更する割当変更手段と、を備える。 According to an aspect of the present invention in order to achieve the above-mentioned object, an image processing apparatus includes a plurality of processor cores, a plurality of cache memories respectively corresponding to the plurality of processor cores, and a target core of the plurality of processor cores. Target thread determining means for determining one of the one or more threads allocated to the target thread as a target thread, a hit rate acquiring means for acquiring a cache hit rate of each of a plurality of processor cores, and a target rate acquiring means for acquiring the target core. Based on the cache hit rate, the first predicting unit that predicts the first processing speed at which the target core executes the target thread, and the candidate core different from the target core among the plurality of processor cores determines the cache hit rate. Second predicting means for predicting a second processing speed when the target thread is executed as zero, and a first processing speed And a second processing speed are compared to determine the allocation of the target thread from the target core to the candidate core, and the allocation of the target thread based on the result of the determination by the determination means. Allocation changing means for changing the target core to the 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. In this case, the second processing speed is predicted, and by comparing the first processing speed and the second processing speed, it is determined whether 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. Therefore, since the first processing speed before moving the target thread and the second processing speed after moving the target thread are compared, it is predicted that the processing speed for processing the target thread will be high. The target thread is moved to. 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 the movement of the thread to be moved.
好ましくは、複数のプロセッサコアそれぞれが実行する1以上のスレッドそれぞれについて、スレッド処理時間の全体に占める割合である占有率を取得する占有率取得手段を、さらに備え、第1予測手段は、占有率取得手段により取得された対象スレッドの占有率と、ヒット率取得手段により取得された対象コアのキャッシュヒット率とに基づいて、第1処理速度を予測し、第2予測手段は、占有率取得手段により取得される候補コアが実行する1以上のスレッドそれぞれの占有率から算出される候補コアの余力に基づいて、第2処理速度を予測する。 Preferably, a occupancy ratio acquisition unit for acquiring an occupancy ratio, which is a ratio of the entire thread processing time, to each of the one or more threads executed by each of the plurality of processor cores is further provided, and the first prediction unit includes the occupancy ratio. The first processing speed is predicted based on the occupancy ratio of the target thread acquired by the acquisition unit and the cache hit ratio of the target core acquired by the hit ratio acquisition unit, and the second prediction unit is the occupancy ratio acquisition unit. The second processing speed is predicted based on the spare capacity of the candidate core calculated from the occupancy of each of the one or more threads executed by the candidate core acquired by.
この局面に従えば、対象スレッドの占有率と、対象コアのキャッシュヒット率とに基づいて、第1処理速度が予測され、候補コアが実行する1以上のスレッドそれぞれの占有率から算出される候補コアの余力に基づいて、第2処理速度が予測される。このため、対象スレッドを移動する前後の処理速度を正確に予測することができる。 According to this aspect, the first processing speed is predicted based on the occupancy rate of the target thread and the cache hit rate of the target core, and the candidate is calculated from the occupancy rates of the one or more threads executed by the candidate core. The second processing speed is predicted based on the remaining capacity of the core. Therefore, the processing speed before and after moving the target thread can be accurately predicted.
好ましくは、複数のプロセッサコアの処理能力を取得する能力情報取得手段を、さらに備え、第1予測手段は、対象コアの処理能力にさらに基づいて、第1処理速度を予測し、第2予測手段は、候補コアの処理能力にさらに基づいて、第2処理速度を予測する。
Preferably, the system further comprises capacity information acquisition means for acquiring the processing capacities of the plurality of processor cores, and the first prediction means predicts the first processing speed further based on the processing capacity of the target core , and the second prediction means. Estimates the second processing speed further based on the processing capabilities of the candidate cores.
この局面に従えば、対象スレッドを移動前のプロセッサコアと、移動後のプロセッサコアの処理能力が異なる場合に適応することができる。 According to this aspect, it is possible to adapt to the case where the processing performance of the processor core before moving the target thread is different from that of the processor core after moving.
好ましくは、判断手段は、所定時間間隔で、対象スレッドの割り当てを対象コアから候補コアに変更するか否かを判断する。 Preferably, the determination means determines whether to change the allocation of the target thread from the target core to the candidate core at predetermined time intervals.
この局面に従えば、所定時間間隔で、対象スレッドの割り当てを変更するか否かを判断するので、所定時間間隔で複数のプロセッサコアの負荷を分散することができる。 According to this aspect, it is determined whether or not the allocation of the target thread is changed at a predetermined time interval, so that it is possible to distribute the load on the plurality of processor cores at the predetermined time interval.
好ましくは、割当変更手段は、対象スレッドが処理対象とする画像データを複数の処理単位部分に分割して処理する場合、判断手段により割り当てを変更すると決定された対象スレッドの割り当てを、対象スレッドが複数の処理単位部分のいずれかの処理が完了することに応じて変更する。 Preferably, when the target thread divides the image data to be processed by the target thread into a plurality of processing unit parts to process, the target thread assigns the allocation of the target thread determined to be changed by the determining means. The value is changed according to the completion of processing of any of the plurality of processing unit parts.
この局面に従えば、画像データの複数の処理単位部分のいずれかの処理単位部分の処理が完了するまでスレッドの割り当てを変更しないので、移動前後で同じ処理が重複して実行されるのを回避することができる。 According to this aspect, 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, so that the same processing is prevented from being executed before and after the movement. can do.
好ましくは、複数のプロセッサコアのいずれかが画像データを変換する処理を定めたプログラムを実行するスレッドを可変スレッドに決定する可変スレッド決定手段を、さらに備え、対象スレッド決定手段は、可変スレッド決定手段により決定される1以上の可変スレッドの1つを対象スレッドに決定する。 Preferably, the target thread determining means further comprises a variable thread determining means for determining a thread for executing a program in which any one of the plurality of processor cores defines a process for converting image data, as a variable thread. One of the one or more variable threads determined by is determined as the target thread.
この局面に従えば、画像データを変換する処理を定めたプログラムを実行するスレッドを、移動御対象とするので、第1処理速度と第2処理速度とを正確に予測することができる。 According to this aspect, since the thread that executes the program that defines the processing for converting the image data is the target of movement, it is possible to accurately predict the first processing speed and the second processing speed.
好ましくは、対象スレッド決定手段は、可変スレッド決定手段により決定された複数の可変スレッドのうちから優先順位が高い順に対象スレッドを決定する。 Preferably, the target thread determining means determines the target thread in the descending order of priority among the plurality of variable threads determined by the variable thread determining means.
この局面に従えば、複数の可変スレッドを優先順位が高い順に移動させるか否かを判断するので、優先順位の高い可変スレッドの処理を早期に終了させることができる。 According to this aspect, it is determined whether or not the plurality of variable threads are moved in descending order of priority, so that the processing of the variable threads with high priority can be terminated early.
この発明の他の局面によれば、負荷分散方法は、画像処理装置で実行される負荷分散方法であって、画像処理装置は、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、ヒット率取得ステップにおいて対象コアについて取得されたキャッシュヒット率に基づいて、対象コアが対象スレッドを実行する第1処理速度を予測する第1予測ステップと、複数のプロセッサコアのうち対象コアとは別の候補コアが、キャッシュヒット率をゼロとして対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、第1処理速度と第2処理速度とを比較することにより、対象スレッドの割り当てを、対象コアから候補コアに変更するか否かを判断する判断ステップと、判断ステップにおける判断結果に基づいて、対象スレッドの割り当てを、対象コアから候補コアに変更する割当変更ステップと、を含む。 According to another aspect of the present invention, a load balancing method is a load balancing method executed by an image processing apparatus, wherein the image processing apparatus 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 the one or more threads allocated to the target core among the plurality of processor cores as a target thread, and a cache hit ratio 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 other than the target core executes the target thread with a cache hit rate of zero. The second prediction step of predicting the second processing speed in the case of performing the first processing speed and the second processing speed are compared to determine whether the allocation of the target thread is changed from the target core to the candidate core. The determination step includes a determination step of determining, and an assignment changing step of changing the assignment 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 balancing method capable of balancing the loads of a plurality of processor cores while shortening the processing time after the migration of the thread to be migrated.
この発明のさらに他の局面によれば、負荷分散プログラムは、画像処理装置を制御するマルチコアプロセッサで実行される負荷分散プログラムであって、マルチコアプロセッサは、複数のプロセッサコアと、複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、複数のプロセッサコアのうち対象コアに割り当てられた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 target thread determining step of determining one of the one or more threads allocated to the target core among the plurality of processor cores as a target thread, and a cache of each of the plurality of processor cores. A hit rate acquisition step of acquiring a hit rate, and 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, Different from the target core among multiple processor cores The core allocates the target thread by comparing the first processing speed and the second processing speed with the second prediction step of predicting the second processing speed when the target thread is executed with the cache hit rate set to zero. A multi-core processor, a determination step of determining whether to change from the target core to the candidate core, and an assignment change step of changing the assignment 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 the thread to be moved is moved.
以下、本発明の実施の形態を図面を参照して説明する。以下の説明では同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがって、それらについての詳細な説明は繰り返さない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts are designated 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 this 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に接続されたファクシミリ装置に送信する。
外部記憶装置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)などの半導体メモリであってもよい。
A CD-
また、マルチコアプロセッサ111が実行するプログラムは、CD−ROM118に記録されたプログラムに限られず、HDD115に記憶されたプログラムをRAM114にロードして実行するようにしてもよい。この場合、ネットワークに接続された他のコンピューターが、MFP100のHDD115に記憶されたプログラムを書換える、または、新たなプログラムを追加して書き込むようにしてもよい。さらに、MFP100が、ネットワークに接続された他のコンピューターからプログラムをダウンロードして、そのプログラムをHDD115に記憶するようにしてもよい。ここでいうプログラムは、マルチコアプロセッサ111が直接実行可能なプログラムだけでなく、ソースプログラム、圧縮処理されたプログラム、暗号化されたプログラム等を含む。
Further, the program executed by the
操作パネル160は、表示部161と操作部163とを含む。表示部161は、例えば、液晶表示装置(LCD)であり、ユーザーに対する指示メニューや取得した画像データに関する情報等を表示する。操作部163は、タッチパネル165と、ハードキー部167とを含む。タッチパネル165は、静電容量方式である。なお、タッチパネル165は、静電容量方式に限らず、例えば、抵抗膜方式、表面弾性波方式、赤外線方式、電磁誘導方式等の他の方式を用いることができる。ハードキー部167は、複数のハードキーを含む。ハードキーは、例えば接点スイッチである。
The
図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 showing an example of a configuration of a multi-core processor included in the MFP according to the present embodiment. With reference 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以上のスレッドが割り当てられる場合、複数のスレッドが並列に実行される。
In 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 showing an example of functions of the multicore processor included in the MFP according to the present embodiment. The function shown in FIG. 4 is realized by one of 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のうちから処理対象スレッドが割り当てられた一方を特定する。
In 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 showing an example of the ability definition data. The capability definition data defines the relationship between the processing time for processing unit data and the occupancy rate for each of a plurality of cache hit rates. In FIG. 5, the horizontal axis represents the CPU occupancy rate, the vertical axis represents 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に出力する。
In response to the thread identification information of the processing target thread input from the processing target
第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 to be changed is input from the
割当変更部23は、処理単位決定部27を含む。処理単位決定部27は、処理対象スレッドが画像データを複数の処理単位部分に分割して処理する場合、処理単位を決定する。割当変更部23は、複数の処理単位部分のいずれかの処理が完了することに応じて、割当を変更する。例えば、処理単位決定部27は、画像データが複数ページを含む場合、複数ページそれぞれの部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数ページのいずれかページの処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
The
また、処理単位決定部27は、画像データが複数行を含む場合、複数行それぞれの部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数行のいずれかの行の処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
Further, when the image data includes a plurality of lines, the processing
また、処理単位決定部27は、画像データが、属性の異なる複数の属性別データを含む場合、複数の属性別データを処理単位部分に決定する。例えば、画像データが、文字が表された文字領域、図形が表された線画領域、および写真が表された写真領域を含む場合、画像データは、文字領域のみからなる属性別データと、図形のみからなる属性別データと、写真のみからなる属性別データとを含む。また、画像データがカラーの場合、画像データは、赤色のみからなる属性別データと、緑色のみからなる属性別データと、青色のみからなる属性別データと、を含む。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データに含まれる複数の属性別データのいずれかの属性別データの処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
When the image data includes a plurality of attribute-based data having different attributes, the processing
また、処理単位決定部27は、対象スレッドが画像データを符号化する符号化処理を実行する場合、符号化の対象となる単位部分を処理単位部分に決定する。この場合、割当変更部23は、第1プロセッサコア51に割り当てられた処理対象スレッドが画像データを符号化処理をする際に、画像データに含まれる符号化の対象となる複数の単位部分のいずれかの単位部分の処理が完了することに応じて、処理対象スレッドを第2のプロセッサコアに割り当てる。
In addition, when the target thread executes the encoding process of encoding the image data, the processing
<具体例>
次に、第1プロセッサコア51および第2プロセッサコア55の能力が同じ場合について、具体例を説明する。
<Specific example>
Next, a specific example will be described when the capabilities of 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 showing an example of the flow of load distribution processing. In the load distribution process, 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. A variable thread is determined as one or more threads that are executing in 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. A 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 a processor core not selected in step S07. If there is an unselected processor core, the process returns to step S07, but if not, the process proceeds to step S10. If the process proceeds to step S10 and the number of processor cores is three or more, the second processing time is determined for each of the 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 the 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 higher than the first processing speed, the process proceeds to step S12. If not, the process proceeds to step S15. In step S15, it is determined whether or not there is an unselected variable tax. Among the variable threads determined in step S02, it is determined whether or not there is a variable thread that is not set as the processing target thread in step S03. If there is an unselected variable thread, the process returns to step S03, but if not, the process returns to step S01.
ステップS12においては、処理単位を決定する。ステップS03において処理対象スレッドに設定された可変スレッドが実行する処理、または、可変スレッドが処理対象とする画像データに基づいて処理単位を決定する。画像データが複数ページを含む場合、複数ページそれぞれの部分を処理単位部分に決定する。また、画像データが複数行を含む場合、複数行それぞれの部分を処理単位部分に決定する。画像データが、属性の異なる複数の属性別データを含む場合、複数の属性別データを処理単位部分に決定する。また、可変スレッドが実行する処理が画像データを符号化する符号化処理の場合、符号化の対象となる単位部分を処理単位部分に決定する。 In step S12, the processing unit is determined. The processing unit is determined based on the processing executed by the variable thread set as the processing target thread in step S03 or the image data to be processed by the variable thread. When the image data includes a plurality of pages, the portion of each of the plurality of pages is determined as the processing unit portion. In addition, when the image data includes a plurality of lines, each of the plurality of lines is determined as a processing unit part. When the image data includes a plurality of attribute-based data having different attributes, the plurality of attribute-based data are determined as the processing unit portion. When the process executed by the variable thread is a coding process for coding image data, the unit part to be coded is determined as the processing unit part.
ステップS13においては、ステップS12において決定された処理単位の処理が終了したか否かを判断する。第1プロセッサコア51において実行されている処理対象スレッドにおいて、処理単位部分の処理が終了するまで待機状態となり、処理単位部分の処理が終了したならば処理をステップS14に進める。
In step S13, it is determined whether or not the processing of the processing unit determined in step S12 is completed. In the processing target thread that is being 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 executed in the
以上説明したように、本実施の形態におけるMFP100は、画像処理装置として機能し、処理対象スレッドが割り当てられた第1プロセッサコア51について取得されたキャッシュヒット率に基づいて、第1プロセッサコア51が処理対象スレッドを実行する第1処理速度を予測し、候補コアに決定された第2プロセッサコア55が、キャッシュヒット率をゼロとして処理対象スレッドを実行する場合の第2処理速度を予測し、第1処理速度と第2処理速度とを比較し、第2処理速度が第1処理速度より大きい場合に、処理対象スレッドの割り当てを、第1プロセッサコア51から第2プロセッサコア55に変更する。このため、対象スレッドを移動する前の第1の処理速度と、対象スレッドを移動した後の第2処理速度とを比較するので、対象スレッドを処理する処理速度が速くなることが予測される場合に、対象スレッドが移動される。その結果、移動対象となるスレッドの移動後の処理時間を短くしつつ複数のプロセッサコアの負荷を分散することができる。
As described above, the
また、第1プロセッサコア51における処理対象スレッドの占有率と、第1プロセッサコア51のキャッシュヒット率とに基づいて、第1処理速度を予測し、第2プロセッサコア55が実行する1以上のスレッドそれぞれの占有率から算出される第2プロセッサコア55の余力に基づいて、第2処理速度を予測するので、処理対象スレッドを移動する前後の処理速度を正確に予測することができる。
Further, 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 capacity definition data corresponding to the processing capacity of the
また、処理対象スレッドの割り当てを変更するか否かを、所定時間間隔で判断するので、所定時間間隔で複数のプロセッサコアの負荷を分散することができる。 Further, since it is determined at predetermined time intervals whether or not to change the allocation of the threads to be processed, it is possible to distribute the load on the plurality of processor cores at predetermined time intervals.
また、処理対象スレッドが処理対象とする画像データを複数の処理単位部分に分割して処理する場合、複数の処理単位部分のいずれかの処理単位部分の処理が完了するまで処理対象スレッドの割り当てを変更しないので、移動前後で同じ処理が重複して実行されるのを回避することができる。 In addition, when the image data to be processed by the processing target thread is divided into a plurality of processing unit parts for processing, the processing target threads are allocated until the processing of any one of the plurality of processing unit parts is completed. Since it is not changed, it is possible to prevent the same processing from being executed repeatedly before and after the movement.
また、画像データを変換する処理を定めたプログラムを実行するスレッドを可変スレッドに決定し、1以上の可変スレッドの1つを対象スレッドに決定するので、同じ処理を繰り返し実行する処理を実行するスレッドを対象スレッドに決定することができる。また、移動前後の第1処理速度と第2処理速度とを正確に予測することができる。 In addition, 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 for repeatedly executing the same process. Can be determined as the target thread. Moreover, 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 embodiments disclosed this time are to be considered as illustrative in all points and not restrictive. The scope of the present invention is shown not by the above description but by the claims, and is intended to include meanings equivalent to the claims and all modifications within the scope.
<付記>
(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 device according to claim 5 or (1), wherein when the image data includes a plurality of lines, the allocation changing unit determines each of the plurality of lines as a processing unit part.
(3) When the image data includes a plurality of attribute-based data having different attributes, the allocation changing unit determines the plurality of attribute-based data as a processing unit portion. The image processing device according to any one of 1) to 5).
(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 Unit, 140 image forming unit, 150 paper feeding unit, 160 operation panel, 161 display unit, 163 operation unit, 165 touch panel, 167 hard key unit, 11 variable thread determination unit, 13 processing target thread determination unit, 15 first prediction unit , 17 candidate core determination unit, 19 second prediction unit, 21 determination unit, 23 allocation change unit, 25 acquisition unit, 27 processing unit determination unit, 31 capability information acquisition unit, 33 hit ratio acquisition unit, 35 occupancy ratio acquisition unit, 51 first processor core, 53 first cache memory, 55 2 processor cores, 57 second cache memory.
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,
A target thread determining unit that determines one of the one or more threads assigned to the target core among the plurality of processor cores as the target thread;
Hit ratio acquisition means for acquiring the cache hit ratio of 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 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;
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 the determination result by the determination unit.
前記第1予測手段は、前記占有率取得手段により取得された前記対象スレッドの占有率と、前記ヒット率取得手段により取得された前記対象コアのキャッシュヒット率とに基づいて、前記第1処理速度を予測し、
前記第2予測手段は、前記占有率取得手段により取得される前記候補コアが実行する1以上のスレッドそれぞれの占有率から算出される前記候補コアの余力に基づいて、前記第2処理速度を予測する、請求項1に記載の画像処理装置。 For each of one or more threads executed by each of the plurality of processor cores, an occupancy rate acquisition unit for acquiring an occupancy rate, which is a ratio of the entire thread processing time, is further provided.
The first predicting unit is configured to perform the first processing speed based on an occupancy ratio of the target thread acquired by the occupancy ratio acquiring unit and a cache hit ratio of the target core acquired by the hit ratio acquiring unit. Predict
The second prediction unit predicts the second processing speed based on the remaining capacity of the candidate core calculated from the occupancy of each of the one or more threads executed by the candidate core acquired by the occupancy acquisition unit. The image processing device according to claim 1.
前記第1予測手段は、前記対象コアの処理能力にさらに基づいて、前記第1処理速度を予測し、
前記第2予測手段は、前記候補コアの処理能力にさらに基づいて、前記第2処理速度を予測する、請求項2に記載の画像処理装置。 Further comprising capability information acquisition means for acquiring the processing capabilities of the plurality of processor cores,
The first predicting means predicts the first processing speed further based on the processing capacity of the target core ;
The image processing apparatus according to claim 2, wherein the second predicting unit predicts the second processing speed further based on the processing capacity of the candidate core.
前記対象スレッド決定手段は、前記可変スレッド決定手段により決定される1以上の可変スレッドの1つを対象スレッドに決定する、請求項1〜5のいずれかに記載の画像処理装置。 A variable thread determining means for determining a thread one of the plurality of processor cores to execute a program that defines the processing for converting image data into variable thread, further comprising,
The image processing apparatus according to claim 1, wherein the target thread determination unit determines one of the 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 device, comprising:
The image processing device 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 the one or more threads allocated to the target core among the plurality of processor cores as the target thread;
A hit ratio acquisition step of acquiring a cache hit ratio 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 prediction 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 balancing method comprising: an assignment changing step of changing the assignment of the target thread from the target core to the candidate core based on the determination result in the determination step.
前記マルチコアプロセッサは、複数のプロセッサコアと、
前記複数のプロセッサコアにそれぞれ対応する複数のキャッシュメモリと、を備え、
前記複数のプロセッサコアのうち対象コアに割り当てられた1以上のスレッドの1つを対象スレッドに決定する対象スレッド決定ステップと、
前記複数のプロセッサコアそれぞれのキャッシュヒット率を取得するヒット率取得ステップと、
前記ヒット率取得ステップにおいて前記対象コアについて取得されたキャッシュヒット率に基づいて、前記対象コアが前記対象スレッドを実行する第1処理速度を予測する第1予測ステップと、
前記複数のプロセッサコアのうち前記対象コアとは別の候補コアが、キャッシュヒット率をゼロとして前記対象スレッドを実行する場合の第2処理速度を予測する第2予測ステップと、
前記第1処理速度と前記第2処理速度とを比較することにより、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更するか否かを判断する判断ステップと、
前記判断ステップにおける判断結果に基づいて、前記対象スレッドの割り当てを、前記対象コアから前記候補コアに変更する割当変更ステップと、を前記マルチコアプロセッサに実行させる負荷分散プログラム。 A load balancing program executed by a multi-core processor that controls an 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 the one or more threads allocated to the target core among the plurality of processor cores as the target thread;
A hit ratio acquisition step of acquiring a cache hit ratio 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 prediction 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 balancing program that causes the multi-core processor to execute an assignment changing step of changing the assignment of the target thread from the target core to the candidate core based on the 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 JP2017174194A (en) | 2017-09-28 |
| JP6686599B2 true 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) |
Families Citing this family (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 |
| CN113842642B (en) * | 2021-09-29 | 2024-05-28 | 联想(北京)有限公司 | Method for distributing resources for game application and electronic equipment |
-
2016
- 2016-03-24 JP JP2016060140A patent/JP6686599B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2017174194A (en) | 2017-09-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6241300B2 (en) | Job scheduling apparatus, job scheduling method, and job scheduling program | |
| US20200201763A1 (en) | Memory hierarchy-aware processing | |
| CN107968810B (en) | A resource scheduling method, device and system for a server cluster | |
| US20130339956A1 (en) | Computer system and optimal arrangement method of virtual machine in computer system | |
| WO2013051056A1 (en) | Multi-client storage system and storage system management method | |
| CN111104222A (en) | Task processing method and device, computer equipment and storage medium | |
| CN107562512B (en) | A method, device and system for migrating virtual machine | |
| JP6669961B2 (en) | Processor, control method of reconfigurable circuit, and program | |
| CN114968567B (en) | Methods, apparatus, and media for allocating computing resources for computing nodes | |
| US12028269B2 (en) | Method for optimal resource selection based on available GPU resource analysis in large-scale container platform | |
| EP4492238A1 (en) | Query task execution method, apparatus, computer device and storage medium | |
| KR20140145748A (en) | Method for allocating process in multi core environment and apparatus therefor | |
| JP6686599B2 (en) | Image processing apparatus, load balancing method, and load balancing program | |
| US11941450B2 (en) | Automatic placement decisions for running incoming workloads on a datacenter infrastructure | |
| JP5867238B2 (en) | Auto scaling method, auto scaling program and computer node | |
| KR20190057558A (en) | Multi core control system | |
| JP2011192049A (en) | Virtual machine system, automatic migration method, and automatic migration program | |
| JP6666553B2 (en) | Information processing apparatus, job management method, and job management program | |
| CN109324886A (en) | Cluster resource scheduling method and device | |
| US20250028553A1 (en) | Optimizing job preemption using dynamic and static information | |
| TW202223645A (en) | Machine learning system and resource allocation method thereof | |
| US20240086727A1 (en) | Automatically Building Efficient Machine Learning Model Training Environments | |
| US12487859B2 (en) | Prevention of resource starvation across stages and/or pipelines in computer environments | |
| JP5750018B2 (en) | Image processing system, printing system, control device, image processing method and program | |
| JP7200746B2 (en) | Control device and control program |
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 |