JP2011203995A - Analysis device, analysis method and analysis program - Google Patents

Analysis device, analysis method and analysis program Download PDF

Info

Publication number
JP2011203995A
JP2011203995A JP2010070505A JP2010070505A JP2011203995A JP 2011203995 A JP2011203995 A JP 2011203995A JP 2010070505 A JP2010070505 A JP 2010070505A JP 2010070505 A JP2010070505 A JP 2010070505A JP 2011203995 A JP2011203995 A JP 2011203995A
Authority
JP
Japan
Prior art keywords
cache
sector
configuration
sector configuration
accesses
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
Application number
JP2010070505A
Other languages
Japanese (ja)
Other versions
JP5521687B2 (en
Inventor
Naoki Sueyasu
直樹 末安
Keiichi Ida
圭一 井田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2010070505A priority Critical patent/JP5521687B2/en
Publication of JP2011203995A publication Critical patent/JP2011203995A/en
Application granted granted Critical
Publication of JP5521687B2 publication Critical patent/JP5521687B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To analyze the configuration of a sector cache, with accuracy.SOLUTION: An analysis device 20 collects sampling data D1, including the number of accesses and the number of cache misses obtained by sampling, while switching the sector configuration of a cache memory during execution of an application program 11 from a processor 10. The analysis device 20, having acquired the sampling data D1, calculates cache miss ratio, by dividing the number of cache misses by the number of accesses for each sector configuration.

Description

本発明は、分析装置、分析方法および分析プログラムに関する。   The present invention relates to an analysis apparatus, an analysis method, and an analysis program.

従来、スカラープロセッサのメモリアクセスを高速化するために、プロセッサとメインメモリの間にキャッシュメモリを配置する構成が利用されている。   Conventionally, in order to increase the memory access speed of the scalar processor, a configuration in which a cache memory is arranged between the processor and the main memory is used.

さらに近年、キャッシュメモリを複数のセクタに論理的に分割し、各メモリアクセス命令がどのセクタを使用するかを指定することで、キャッシュの使用状況を変化させるセクタキャッシュが開発されている。このキャッシュメモリのセクタの大きさは、実行時にプログラムで変更することができる。   Further, in recent years, sector caches have been developed that logically divide a cache memory into a plurality of sectors and specify which sector is used by each memory access instruction to change the cache usage status. The size of the sector of the cache memory can be changed by a program at the time of execution.

例えば、10ウェイ構造のキャッシュをセクタ0とセクタ1に分ける場合、セクタ0に属する最大ウェイ数とセクタ1に属する最大ウェイ数を指定することにより、この10ウェイを、二つのセクタに割ることが出来る。この場合の可能な組み合わせは、9×9=81通りであり、セクタキャッシュを使用しない場合を含めて82通りとなる。   For example, when a 10-way structure cache is divided into sector 0 and sector 1, by designating the maximum number of ways belonging to sector 0 and the maximum number of ways belonging to sector 1, this 10-way can be divided into two sectors. I can do it. There are 9 × 9 = 81 possible combinations in this case, and there are 82 combinations including the case where the sector cache is not used.

スカラープロセッサにおいては、アプリケーションプログラムによるメモリアクセスのローカリティが性能を左右するので、メモリアクセスを二つのグループに分けることによりメモリアクセスのローカリティを高め、性能を向上させることができる。   In the scalar processor, the locality of the memory access by the application program affects the performance. Therefore, by dividing the memory access into two groups, the locality of the memory access can be improved and the performance can be improved.

キャッシュをどのようなセクタに構成するか、すなわちキャッシュのセクタ構成は、アプリケーションプログラムを実行した際の性能に大きく影響する。そこで、キャッシュ構成を分析し、アプリケーションプログラムにとって最適なキャッシュ構成や、アプリケーションプログラム自体にフィードバックすることが求められている。   The sector in which the cache is configured, that is, the sector configuration of the cache greatly affects the performance when the application program is executed. Therefore, it is required to analyze the cache configuration and feed back to the optimal cache configuration for the application program or the application program itself.

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

一般に、アプリケーションの動作は複雑であり、セクタキャッシュが性能に及ぼす効果を予測することは困難である。セクタキャッシュのどの組み合わせが最も高速であるかは、実際に実測してみないとわからない。   In general, the operation of an application is complex, and it is difficult to predict the effect of sector cache on performance. You cannot know which combination of sector caches is the fastest unless you actually measure it.

このため、従来技術のような静的な分析では、十分にセクタキャッシュの構成を評価することが出来ない。セクタキャッシュの組み合わせをプログラム実行中に固定するとしても、82通りの設定があるため、最悪の場合、アプリケーションを82回実行し、それぞれの性能を比較し、最適なセクタキャッシュ構成を選択することになる。   For this reason, the static analysis as in the conventional technique cannot sufficiently evaluate the sector cache configuration. Even if the combination of sector caches is fixed during program execution, there are 82 settings, so in the worst case, the application is executed 82 times, the performance of each is compared, and the optimum sector cache configuration is selected. Become.

開示の技術は、上記に鑑みてなされたものであって、セクタキャッシュの構成の分析の精度を高めることを目的とする。   The disclosed technique has been made in view of the above, and an object thereof is to improve the accuracy of analysis of the sector cache configuration.

本願の開示する分析装置、分析方法および分析プログラムは、アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながらサンプリングしたデータを収集する。サンプリングしたデータには、キャッシュメモリに対するアクセス数とキャッシュミス数が含まれる。開示の装置、方法、プログラムは、セクタ構成ごとにキャッシュミス数をアクセス数で除してキャッシュミス率を算出する。   An analysis apparatus, an analysis method, and an analysis program disclosed in the present application collect sampled data while switching a sector configuration of a cache memory during execution of an application program. The sampled data includes the number of accesses to the cache memory and the number of cache misses. The disclosed apparatus, method, and program calculate the cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration.

本願の開示する本願の開示する分析装置、分析方法および分析プログラムによれば、セクタキャッシュの構成の分析の精度を高めることができる。   According to the analysis device, analysis method, and analysis program disclosed in the present application disclosed by the present application, the accuracy of the analysis of the sector cache configuration can be increased.

図1は、実施例に係る分析装置の構成図である。FIG. 1 is a configuration diagram of an analyzer according to an embodiment. 図2は、セクタキャッシュの説明図である。FIG. 2 is an explanatory diagram of the sector cache. 図3は、セクタキャッシュ対応オブジェクトプログラム作成の説明図である。FIG. 3 is an explanatory diagram of creating a sector cache compatible object program. 図4は、本実施例にかかる処理動作を説明するフローチャートである。FIG. 4 is a flowchart for explaining the processing operation according to the present embodiment. 図5は、図4に示したサンプリングスレッド12によるサンプリングについてさらに説明するフローチャートである。FIG. 5 is a flowchart for further explaining sampling by the sampling thread 12 shown in FIG. 図6は、分析装置20の処理動作を説明するフローチャートである。FIG. 6 is a flowchart for explaining the processing operation of the analyzer 20. 図7は、サンプリングデータと結果出力の具体例についての説明図である。FIG. 7 is an explanatory diagram of a specific example of sampling data and result output. 図8は、スラッシングの評価について説明する説明図である。FIG. 8 is an explanatory diagram for explaining evaluation of thrashing. 図9は、スラッシング多重度の算出にかかる処理動作を説明するフローチャートである。FIG. 9 is a flowchart for explaining the processing operation for calculating the thrashing multiplicity. 図10は、コンパイル時におけるセクタ選択処理を説明するフローチャートである。FIG. 10 is a flowchart for explaining sector selection processing during compilation. 図11は、変数の形状と使用セクタの判断結果の説明図である。FIG. 11 is an explanatory diagram of variable shape and use sector determination results. 図12は、プログラムの修正による改善についての説明図である。FIG. 12 is an explanatory diagram of the improvement by correcting the program.

以下に、本願の開示する分析装置、分析方法および分析プログラムを図面に基づいて詳細に説明する。なお、以下の具体的な実施例に本発明を限定するものではない。   Hereinafter, an analysis apparatus, an analysis method, and an analysis program disclosed in the present application will be described in detail with reference to the drawings. The present invention is not limited to the following specific examples.

[システムの構成]
図1は、実施例に係る分析装置の構成図である。図1に示した例では、分析装置20は、プロセッサ10と接続し、プロセッサ10が使用するキャッシュメモリのセクタ構成とプロセッサ10が実行するアプリケーションプログラムについて分析を行う。
[System configuration]
FIG. 1 is a configuration diagram of an analyzer according to an embodiment. In the example illustrated in FIG. 1, the analysis apparatus 20 is connected to the processor 10 and analyzes the sector configuration of the cache memory used by the processor 10 and the application program executed by the processor 10.

プロセッサ10は、L1(level 1)キャッシュメモリとL2(level 2)キャッシュメモリを使用して、メインメモリの一部をキャッシュする。プロセッサ10が使用するキャッシュメモリは、複数のセクタに論理的に分割し、各メモリアクセス命令がどのセクタを使用するかを指定することで、キャッシュの使用状況を変化させることができるセクタキャッシュ機構を備える。セクタに分割されたキャッシュをセクタキャッシュという。   The processor 10 caches a part of the main memory using the L1 (level 1) cache memory and the L2 (level 2) cache memory. A cache memory used by the processor 10 is logically divided into a plurality of sectors, and a sector cache mechanism that can change a cache usage state by designating which sector each memory access instruction uses. Prepare. A cache divided into sectors is called a sector cache.

セクタの大きさは、実行時にプログラムで変更することができる。L1キャッシュとL2キャッシュのいずれもセクタキャッシュとすることができるが、以降の説明では、10ウェイ構造のL2キャッシュをセクタ0とセクタ1に分ける場合を例に説明する。   The sector size can be changed by a program at the time of execution. Both the L1 cache and the L2 cache can be sector caches. However, in the following description, an example in which a 10-way L2 cache is divided into sectors 0 and 1 will be described.

10ウェイ構造のL2キャッシュをセクタ0とセクタ1に分ける場合、セクタ0に属する最大ウェイ数とセクタ1に属する最大ウェイ数を指定することによって可能な組み合わせは、9×9=81通りである。従って、セクタキャッシュを使用しない場合を含めると82通りとなる。   When the 10-way L2 cache is divided into sector 0 and sector 1, there are 9 × 9 = 81 possible combinations by designating the maximum number of ways belonging to sector 0 and the maximum number of ways belonging to sector 1. Therefore, 82 cases including the case where the sector cache is not used are included.

プロセッサ10は、アプリケーションプログラムを構成する複数のアプリケーションプロセス11を順次実行することで、アプリケーションプログラムを動作させる。加えて、プロセッサ10は、アプリケーションプロセス11の実行とともにサンプリングスレッド12を実行する。サンプリングスレッド12は、セクタ構成変更部13と、サンプリング処理部14を有する。   The processor 10 operates the application program by sequentially executing a plurality of application processes 11 constituting the application program. In addition, the processor 10 executes the sampling thread 12 together with the execution of the application process 11. The sampling thread 12 includes a sector configuration changing unit 13 and a sampling processing unit 14.

セクタ構成変更部13は、アプリケーションプログラムの実行中、すなわちアプリケーションプロセス11の実行中に、キャッシュメモリのセクタ構成を切り替える処理を行なう。また、サンプリング処理部14は、アプリケーションプロセス11のキャッシュメモリに対するアクセス数、キャッシュミス数、アプリケーションプロセス11が実行した命令数をセクタ構成に対応付けてサンプリングすることでサンプリングデータD1を作成し、蓄積する。   The sector configuration changing unit 13 performs a process of switching the sector configuration of the cache memory during execution of the application program, that is, during execution of the application process 11. The sampling processing unit 14 creates and accumulates sampling data D1 by sampling the number of accesses to the cache memory of the application process 11, the number of cache misses, and the number of instructions executed by the application process 11 in association with the sector configuration. .

分析装置20は、プロセッサ10からサンプリングデータD1を取得して分析を行なう装置である。分析装置20は、データ収集部21、キャッシュミス率算出部22、選択部23、有効性評価部24、キャッシュミス率微分処理部25、スラッシング多重度算出部26、出力部27を有する。   The analysis device 20 is a device that acquires the sampling data D1 from the processor 10 and performs analysis. The analysis apparatus 20 includes a data collection unit 21, a cache miss rate calculation unit 22, a selection unit 23, an effectiveness evaluation unit 24, a cache miss rate differentiation processing unit 25, a thrashing multiplicity calculation unit 26, and an output unit 27.

データ取得部21は、プロセッサ10からサンプリングデータD1を収集する処理部である。キャッシュミス率算出部22は、サンプリングデータD1のキャッシュミス数をアクセス数でセクタ構成ごとに除し、各セクタ構成のキャッシュミス率を算出する。   The data acquisition unit 21 is a processing unit that collects sampling data D1 from the processor 10. The cache miss rate calculation unit 22 divides the number of cache misses of the sampling data D1 by the number of accesses for each sector configuration, and calculates the cache miss rate for each sector configuration.

選択部23は、各セクタ構成のキャッシュミス率を比較し、他のセクタ構成に比してキャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択する。有効性評価部24は、セクタ構成ごとにアクセス数を命令数で除して各構成のキャッシュアクセス率を求め、キャッシュアクセス率の相対標準偏差が所定値未満である場合に選択部による選択結果が有効であると評価する。   The selection unit 23 compares the cache miss rates of the respective sector configurations, and selects a sector configuration having a smaller cache miss rate as compared with other sector configurations as an appropriate sector configuration. The effectiveness evaluation unit 24 obtains the cache access rate of each configuration by dividing the number of accesses by the number of instructions for each sector configuration, and if the relative standard deviation of the cache access rate is less than a predetermined value, the selection result by the selection unit is Evaluate as effective.

キャッシュミス率微分処理部25は、キャッシュミス率のセクタ構成変化に対する微分値を求める。スラッシング多重度算出部26は、キャッシュミス率の微分値の変化から前記アプリケーションプログラムによるキャッシュメモリの利用状態を示すスラッシング多重度を算出する利用状態算出部である。   The cache miss rate differential processing unit 25 obtains a differential value with respect to the sector configuration change of the cache miss rate. The thrashing multiplicity calculation unit 26 is a use state calculation unit that calculates a thrashing multiplicity indicating the use state of the cache memory by the application program from a change in the differential value of the cache miss rate.

出力部27は、アプリケーションプログラムに対して適切なセクタ構成とその有効性、アプリケーションプログラムのスラッシング多重度を出力する処理部である。   The output unit 27 is a processing unit that outputs an appropriate sector configuration for the application program, its effectiveness, and thrashing multiplicity of the application program.

[セクタキャッシュ対応アプリケーション]
図2は、セクタキャッシュの説明図である。図2に示したプロセッサであるCPU(Central Processing Unit)31は、メインメモリ33を主記憶装置として使用する演算装置である。
[Sector cache application]
FIG. 2 is an explanatory diagram of the sector cache. A CPU (Central Processing Unit) 31 that is the processor shown in FIG. 2 is an arithmetic device that uses the main memory 33 as a main storage device.

キャッシュメモリ32は、メインメモリ33に比して高速なメモリであり、メインメモリ33の一部を保持する。CPU31は、メモリアクセスを行う際に、キャッシュメモリ32にアクセスする。キャッシュメモリ32がアクセス対象を保持している場合には、低速なメモリ33に対するアクセスは不要となり、処理速度が向上する。   The cache memory 32 is a memory that is faster than the main memory 33 and holds a part of the main memory 33. The CPU 31 accesses the cache memory 32 when performing memory access. When the cache memory 32 holds an access target, access to the low-speed memory 33 is unnecessary, and the processing speed is improved.

このため、キャッシュメモリ32がCPU31のアクセス要求に対応するキャッシュを保持している確率が高いほど、アプリケーションプログラムの性能が向上する。キャッシュメモリのサイズが大きいほど、性能は向上し、また、アプリケーションプログラムのメモリアクセスのローカリティが高いほど、性能は向上する。   For this reason, the higher the probability that the cache memory 32 holds the cache corresponding to the access request of the CPU 31, the higher the performance of the application program. The performance increases as the size of the cache memory increases, and the performance improves as the locality of the memory access of the application program increases.

キャッシュメモリ32は、way0からway9を有する10ウェイセットアソシアティブのL2キャッシュメモリである。加えて、キャッシュメモリ32は、セクタキャッシュ機構を備え、way0からway9をセクタ0、セクタ1の2つのセクタに論理的に分割して使用することができる。   The cache memory 32 is a 10-way set associative L2 cache memory having way0 to way9. In addition, the cache memory 32 includes a sector cache mechanism, and can use way0 to way9 logically divided into two sectors, sector 0 and sector 1.

このようなセクタキャッシュを利用する場合、アプリケーションプログラムは、各メモリアクセス命令がどのセクタを使用するかを指定することなる。具体的には、図3に示したように、ソースプログラム41をセクタキャッシュ最適化コンパイラ42にかけることで、セクタキャッシュ対応オブジェクトプログラム43を得ることが出来る。   When such a sector cache is used, the application program designates which sector each memory access instruction uses. Specifically, as shown in FIG. 3, by applying the source program 41 to the sector cache optimizing compiler 42, a sector cache compatible object program 43 can be obtained.

[処理動作]
図4は、本実施例にかかる処理動作を説明するフローチャートである。まず、アプリケーションプログラムのコンパイルでは、セクタキャッシュ最適化コンパイラ42がソースプログラム41を読み込み(S101)、コンパイルを行って(S102)、オブジェクトプログラム43を書き出す(S103)。
[Processing operation]
FIG. 4 is a flowchart for explaining the processing operation according to the present embodiment. First, in compiling the application program, the sector cache optimizing compiler 42 reads the source program 41 (S101), compiles (S102), and writes the object program 43 (S103).

オブジェクトプログラム43として得られたアプリケーションプログラムをプロセッサ10が実行すると、プロセッサ10は、処理の開始時にサンプリングスレッド12を生成する(S201)。プロセッサ10は、アプリケーションプロセス11の計算処理を実行する(S202)とともに、サンプリングスレッド12によるサンプリング処理を行う(S300)。   When the processor 10 executes the application program obtained as the object program 43, the processor 10 generates the sampling thread 12 at the start of processing (S201). The processor 10 executes calculation processing of the application process 11 (S202) and performs sampling processing by the sampling thread 12 (S300).

プロセッサ10は、計算処理(S202)が終了した後、サンプリングスレッド12の消去を待ち(S203)、サンプリングデータD1を出力して(S204)、処理を終了する。   After completing the calculation process (S202), the processor 10 waits for the sampling thread 12 to be erased (S203), outputs the sampling data D1 (S204), and ends the process.

図5は、図4に示したサンプリングスレッド12によるサンプリングについてさらに説明するフローチャートである。図5に示したように、サンプリングスレッド12は、まず、セクタキャッシュのセクタ構成、すなわち、セクタ0とセクタ1にどのwayを割り当てるかを選択する(S301)。   FIG. 5 is a flowchart for further explaining sampling by the sampling thread 12 shown in FIG. As shown in FIG. 5, the sampling thread 12 first selects the sector configuration of the sector cache, that is, which way is assigned to sector 0 and sector 1 (S301).

つぎに、サンプリングスレッド12は、アプリケーションプロセス11からサンプリングをおこなって、実行命令数、キャッシュアクセス数、キャッシュミス数を測定し(S302)、現在のセクタ構成に対応づけて加算する(S304)。   Next, the sampling thread 12 samples from the application process 11, measures the number of executed instructions, the number of cache accesses, and the number of cache misses (S302), and adds them in association with the current sector configuration (S304).

サンプリングスレッド12はS305の終了後、現在のセクタ構成を選択してから100msが経過したかを判定する(S305)。現在のセクタ構成を選択してから100msが経過していなければ(S305,No)、サンプリングスレッド12は、S302に戻って同一構成でのサンプリングを継続する。   After completion of S305, the sampling thread 12 determines whether 100 ms has elapsed since the current sector configuration was selected (S305). If 100 ms has not elapsed since the current sector configuration was selected (S305, No), the sampling thread 12 returns to S302 and continues sampling with the same configuration.

一方、現在のセクタ構成を選択してから100msが経過している場合(S305,Yes)は、サンプリングスレッド12は次のセクタ構成を選択して(S301)、サンプリングを継続する。   On the other hand, if 100 ms has elapsed since the current sector configuration was selected (S305, Yes), the sampling thread 12 selects the next sector configuration (S301) and continues sampling.

図6は、分析装置20の処理動作を説明するフローチャートである。図6に示したように、まず、データ取得部31がサンプリングデータD1を収集する(S401)。キャッシュミス率算出部22は、サンプリングデータD1のキャッシュミス数をアクセス数で除し、各セクタ構成のキャッシュミス率を算出する(S402)。また、有効性評価部24は、セクタ構成ごとにアクセス数を命令数で除して各構成のキャッシュアクセス率を求める。   FIG. 6 is a flowchart for explaining the processing operation of the analyzer 20. As shown in FIG. 6, first, the data acquisition unit 31 collects sampling data D1 (S401). The cache miss rate calculation unit 22 calculates the cache miss rate for each sector configuration by dividing the number of cache misses of the sampling data D1 by the number of accesses (S402). In addition, the effectiveness evaluation unit 24 divides the number of accesses by the number of instructions for each sector configuration to obtain the cache access rate of each configuration.

選択部23は、キャッシュミス率が最も低い構成を最適構成とし(S404)、有効性評価部24は、キャッシュアクセス率の相対標準偏差が所定値未満である場合に選択部23による選択結果が有効であると判定する。   The selection unit 23 sets the configuration having the lowest cache miss rate as the optimal configuration (S404), and the validity evaluation unit 24 determines that the selection result by the selection unit 23 is valid when the relative standard deviation of the cache access rate is less than a predetermined value. It is determined that

そして、出力部27は、セクタキャッシュの最適構成と有効性の評価結果を出力して(S406)、処理を終了する。   Then, the output unit 27 outputs the optimal configuration and validity evaluation result of the sector cache (S406), and ends the process.

[データの具体例]
図7は、サンプリングデータと結果出力の具体例についての説明図である。図7に示したように、サンプリングデータD1は、セクタ構成、実行命令数、キャッシュアクセス数、キャッシュミス数の情報を有する。
[Specific examples of data]
FIG. 7 is an explanatory diagram of a specific example of sampling data and result output. As shown in FIG. 7, the sampling data D1 has information on the sector configuration, the number of executed instructions, the number of cache accesses, and the number of cache misses.

図7に示した例では、セクタ構成c1の実行命令数が2000、キャッシュアクセス数が1000、キャッシュミス数が500である。また、セクタ構成c2の実行命令数が4000、キャッシュアクセス数が2000、キャッシュミス数が1300である。そして、セクタ構成c82の実行命令数が3000、キャッシュアクセス数が1600、キャッシュミス数が800である。   In the example shown in FIG. 7, the number of instructions executed in sector configuration c1 is 2000, the number of cache accesses is 1000, and the number of cache misses is 500. In addition, the number of instructions executed in sector configuration c2 is 4000, the number of cache accesses is 2000, and the number of cache misses is 1300. In the sector configuration c82, the number of executed instructions is 3000, the number of cache accesses is 1600, and the number of cache misses is 800.

このサンプリングデータD1からもとめた最適構成と有効性の判断結果が出力データD2である。図7の例では、最適セクタ構成は、セクタ構成c33、キャッシュミス率は30%、キャッシュアクセス率の相対標準偏差が5%であり、結果は有効である。   The output data D2 is the optimum configuration and validity determination result obtained from the sampling data D1. In the example of FIG. 7, the optimum sector configuration is the sector configuration c33, the cache miss rate is 30%, and the relative standard deviation of the cache access rate is 5%, and the result is valid.

ここで、有効性の判断について説明する。キャッシュアクセス数を実行命令数で割ったキャッシュアクセス率は、セクタキャッシュ構成によって変化しない。このため、各構成における測定がプログラムの各種部分をまんべんなく実行した場合には、各構成におけるキャッシュアクセス率は同一になるという特徴があるので、有効性の判定に利用することができる。   Here, the determination of effectiveness will be described. The cache access rate obtained by dividing the number of cache accesses by the number of executed instructions does not change depending on the sector cache configuration. For this reason, when the measurement in each configuration is executed evenly for various parts of the program, the cache access rate in each configuration is the same, and therefore, it can be used for determining the validity.

具体的には、各構成におけるキャッシュアクセス率は計82個になるが、これらの相対標準偏差を求め、キャッシュアクセス率のブレを求める。それが一定値以上であれば、統計的に不適切な値であるため、構成の選択は失敗していると判断し、測定失敗の結論を出す。利用者は、アプリケーションの動作時間を延ばして再測定することになる。一定値以下であれば、統計的に適切な値であるため、キャッシュミス率が最も低かったセクタキャッシュ構成が決定する。   Specifically, the cache access rate in each configuration is 82 in total, and the relative standard deviation of these is obtained, and the fluctuation of the cache access rate is obtained. If it is above a certain value, it is a statistically inappropriate value, so it is judged that the configuration selection has failed, and a conclusion of measurement failure is drawn. The user extends the operation time of the application and re-measures. If it is below a certain value, it is a statistically appropriate value, so the sector cache configuration with the lowest cache miss rate is determined.

このように、82通りのセクタキャッシュの組み合わせ設定について、分析装置20は、アプリケーションプログラムを1回実行だけで最適な組み合わせを求めることが可能である。   In this way, with regard to 82 sector cache combination settings, the analysis apparatus 20 can obtain an optimum combination by executing the application program only once.

アプリケーションプログラムは数時間程度動作することが多いが、100msecを単位として、セクタキャッシュの構成をラウンドロビン的に変更するので、82通りでは、8.2秒で全組み合わせで一回ずつの測定が完了する。したがって、アプリケーションプログラムを1時間実行すれば、約440回ずつの測定を行なうことが可能である。   Application programs often run for several hours, but the sector cache configuration is changed in a round-robin manner in units of 100 msec. Therefore, in 82 ways, measurements are completed once for all combinations in 8.2 seconds. To do. Therefore, if the application program is executed for one hour, it is possible to perform measurement about 440 times.

それぞれの構成の場合ごとにCPU−PA機能により得られる、実行命令数、キャッシュアクセス数、キャッシュミス数を測定し加算し、アプリケーションの実行が完了した時点で、各構成のキャッシュミス率を求め、キャッシュミス率が最も低かったセクタキャッシュ構成を最適な構成として選択する。   Measure and add the number of execution instructions, the number of cache accesses, the number of cache misses obtained by the CPU-PA function for each configuration, and when the application execution is completed, determine the cache miss rate for each configuration, The sector cache configuration with the lowest cache miss rate is selected as the optimal configuration.

このように、アプリケーションプログラムの一回の実行で多くの試行を行い最良の結果を求めることができ、また、その際にキャッシュアクセス率が所定範囲内に収束するというプログラム特性を利用した統計的判断により、結果の有効性を判定することができる。   In this way, it is possible to obtain the best result by making many trials in a single execution of the application program, and at the same time statistical judgment using the program characteristics that the cache access rate converges within a predetermined range Thus, the validity of the result can be determined.

なお、一定時間間隔でセクタ構成をラウンドロビン的に変更することで、サンプリング的に各構成でのキャッシュミス率を求める例を説明したが、サンプリング方式をベースとしているために、実行時間が少ない場合に統計的に不適切な値となる可能性がある。   In addition, although the example which calculates | requires the cache miss rate in each structure by sampling by changing a sector structure in a round-robin manner with a fixed time interval was explained, since it is based on a sampling system, execution time is short May be statistically inappropriate.

そこで、サブルーチンの開始と終了時にセクタキャッシュの構成をラウンドロビン的に変更することで、各構成でのキャッシュミス率を求めることとしてもよい。サブルーチンの実行に応じて構成を変更することにより、時間間隔で構成を変更する場合に比べて、より精度の高い計測を行うことができる。なお、サブルーチンの開始と終了時に何らかの処理を行うことは、一般に、コンパイラの機能により可能である。   Therefore, the cache miss rate in each configuration may be obtained by changing the configuration of the sector cache in a round robin manner at the start and end of the subroutine. By changing the configuration according to the execution of the subroutine, it is possible to perform measurement with higher accuracy than when the configuration is changed at time intervals. Note that it is generally possible to perform some processing at the start and end of a subroutine by the function of the compiler.

[スラッシング多重度の算出]
キャッシュ性能を著しく低下させる現象としてスラッシングがある。一般にウェイ数が減少するとスラッシングが発生するが、高度にチューニングされたアプリケーションでは、少ないウェイ数でも性能の低下は限定的である。スラッシングを減少するようにチューニングされたアプリケーションは、性能ぶれ等の問題を起こしにくいという優良な特性を持つ。分析装置20は、ウェイ数の減少と性能の関係を調べることで、アプリケーションがスラッシングに対応しているかどうかを調査することができる。
[Calculation of thrashing multiplicity]
Thrashing is a phenomenon that significantly reduces cache performance. In general, when the number of ways decreases, thrashing occurs. However, in a highly tuned application, the performance degradation is limited even with a small number of ways. Applications that are tuned to reduce thrashing have superior characteristics that are less likely to cause performance blurring. The analysis device 20 can investigate whether the application supports thrashing by examining the relationship between the decrease in the number of ways and the performance.

分析装置20は、82通りのセクタキャッシュの組み合わせのうち、10ウェイを過不足なく二つに割る9通りの組み合わせの性能を取り上げ、ウェイ数と性能の関係を分析する。   The analysis apparatus 20 takes up the performance of nine combinations of 82 sector cache combinations and divides 10 ways into two without excess and shortage, and analyzes the relationship between the number of ways and the performance.

図8は、スラッシングの評価について説明する説明図である。図8に示したように、分析装置20は、(セクタ0,セクタ1)のウェイ数が(1,9)、(2,8)、(3,7)、(4,6)、(5,5)、(6,4)、(7,3)、(8,2)、(9,1)の組み合わせを取り上げる。   FIG. 8 is an explanatory diagram for explaining evaluation of thrashing. As shown in FIG. 8, the analyzing apparatus 20 has the number of ways in (sector 0, sector 1) as (1, 9), (2, 8), (3, 7), (4, 6), (5 , 5), (6, 4), (7, 3), (8, 2), (9, 1).

図8の例は、セクタ1のキャッシュミス率D4は、(1,9)で3.0%、(2,8)で1.7%、(3,7)で1.2%、(4,6)で1.0%、(5,5)で1.1%、(6,4)で2.5%、(7,3)で2.6%、(8,2)で2.8%、(9,1)で3.0%である。   In the example of FIG. 8, the cache miss rate D4 of sector 1 is 3.0% at (1,9), 1.7% at (2,8), 1.2% at (3,7), (4 6) 1.0%, (5,5) 1.1%, (6,4) 2.5%, (7,3) 2.6%, (8,2) 2. 8% and (9,1) are 3.0%.

スラッシング対策が行なわれている場合は、セクタのウェイ数が減少してもキャッシュミス率が上がることは無い。図8に示したキャッシュミス率D3のように上昇する場合は、スラッシング対策が不十分であることを示している。具体的には、セクタ1に割り当てられたデータのうち、再利用性が低いと判断された複数のデータにおいて、1ウェイのキャッシュ量に対し、近接したアドレスでのメモリアクセスが多いために、スラッシングが発生し、キャッシュミス率が増加していることを示している。この場合は、5ウェイまでキャッシュミス率D4は増加してないため、5個のデータが競合している可能性が高い。   When thrashing countermeasures are taken, the cache miss rate does not increase even if the number of ways in the sector decreases. When the cache miss rate D3 increases as shown in FIG. 8, it indicates that thrashing countermeasures are insufficient. Specifically, among the data assigned to sector 1, a plurality of data determined to be low in reusability has many memory accesses at addresses close to the cache amount of 1 way. And the cache miss rate is increasing. In this case, since the cache miss rate D4 has not increased up to 5 ways, there is a high possibility that 5 data are competing.

このように、キャッシュミス率からセクタ1に割り当てられ、再利用性が低いと判断された複数のデータでスラッシングが発生していると判断できる。その場合は、スラッシングが発生するセクタ構成を選択した上で、既存の性能チューニングツールを使いキャッシュミスの多発箇所を特定し、キャッシュミスを減少させる。この手順は、任意のキャッシュ・チューニング手法を用いればよい。   In this way, it can be determined that thrashing has occurred in a plurality of data assigned to sector 1 from the cache miss rate and determined to have low reusability. In such a case, after selecting a sector configuration in which thrashing occurs, an existing performance tuning tool is used to identify locations where cache misses occur frequently, thereby reducing cache misses. For this procedure, any cache tuning method may be used.

スラッシング発生を判断する場合、ウェイ数によるキャッシュミス率の微分(変化)を求め、この変化が大きな部分をスラッシング発生ウェイ数と判断する。このウェイ数をスラッシング多重度と呼ぶ。   When the occurrence of thrashing is determined, the differential (change) of the cache miss rate according to the number of ways is obtained, and the portion where this change is large is determined as the number of ways of occurrence of thrashing. This number of ways is called thrashing multiplicity.

図8の例では、キャッシュミス率微分値D4は、(2,8)で−1.3、(3,7)で−0.5、(4,6)で−0.2、(5,5)で0.1、(6,4)で1.4、(7,3)で0.1、(8,2)で0.2、(9,1)で0.2である。   In the example of FIG. 8, the cache miss rate differential value D4 is -1.3 at (2,8), -0.5 at (3,7), -0.2 at (4,6), (5, 5) 0.1, (6, 4) 1.4, (7, 3) 0.1, (8, 2) 0.2, (9, 1) 0.2.

この例では、(6,4)で変化が大きくなっており、セクタ1側に着目しているため、スラッシング多重度は5である。このスラッシング多重度に基づいてアプリケーションプログラムをチューニングした結果の例をキャッシュミス率D6に示す。   In this example, the change is large at (6, 4), and since the focus is on the sector 1 side, the thrashing multiplicity is 5. An example of the result of tuning the application program based on this thrashing multiplicity is shown in the cache miss rate D6.

改善したキャッシュミス率は、(1,9)で3.0%、(2,8)で1.7%、(3,7)で1.2%、(4,6)で1.0%、(5,5)で1.0%、(6,4)で0.9%、(7,3)で0.8%、(8,2)で0.9%、(9,1)で0.8%である。   Improved cache miss rates are 3.0% for (1,9), 1.7% for (2,8), 1.2% for (3,7), 1.0% for (4,6) , (5,5) 1.0%, (6,4) 0.9%, (7,3) 0.8%, (8,2) 0.9%, (9,1) 0.8%.

改善前のキャッシュミス率D3は、セクタ構成が(4,6)の時に最も小さくなり、1.0%であるが、改善後のキャッシュミス率D6は、セクタ構成が(8,2)の時に最小となり、0.7%である。このように、改善前の1.0%より30%のキャッシュミスの減少が実現されている。   The cache miss rate D3 before improvement is the smallest when the sector configuration is (4, 6) and is 1.0%, but the cache miss rate D6 after improvement is when the sector configuration is (8, 2). The minimum is 0.7%. In this way, a cache miss reduction of 30% is realized from 1.0% before improvement.

図9は、スラッシング多重度の算出にかかる処理動作を説明するフローチャートである。図9に示したように、分析装置20のデータ取得部31がサンプリングデータD1を取得し(S501)、キャッシュミス率算出部22がキャッシュミス率を算出する。キャッシュミス率微分処理部25は、82通りのセクタ構成から対象とするセクタ構成を選出し(S502)、キャッシュミス率の微分値を算出する(S503)。スラッシング多重度算出部22は、キャッシュミス率の微分値に基づいてスラッシング多重度を算出し(S504)、出力部27が解析結果としてスラッシング多重度を出力して(S505)、処理を終了する。   FIG. 9 is a flowchart for explaining the processing operation for calculating the thrashing multiplicity. As shown in FIG. 9, the data acquisition unit 31 of the analyzer 20 acquires the sampling data D1 (S501), and the cache miss rate calculation unit 22 calculates the cache miss rate. The cache miss rate differential processing unit 25 selects a target sector configuration from the 82 sector configurations (S502), and calculates a differential value of the cache miss rate (S503). The thrashing multiplicity calculation unit 22 calculates the thrashing multiplicity based on the differential value of the cache miss rate (S504), the output unit 27 outputs the thrashing multiplicity as an analysis result (S505), and the process is terminated.

[セクタの選択]
セクタキャッシュには二つのセクタがあるが、各メモリアクセスをどちらのセクタに割り当てると高性能を得られるかを判断する指標の設定について説明する。プログラムを静的に解析してデータの再利用性を判断することは難しい。データの再利用性は、プログラムの動的な特性であるためである。ここでは、セクタを選択するための手段の一つとして、データの宣言形状(大きさ)に基づいて再利用性を判断する手法を示す。
[Sector selection]
There are two sectors in the sector cache, and setting of an index for determining which sector each memory access is assigned to obtain high performance will be described. It is difficult to determine the reusability of data by analyzing a program statically. This is because data reusability is a dynamic characteristic of a program. Here, as one of means for selecting a sector, a technique for determining reusability based on the declaration shape (size) of data is shown.

まず、二つのセクタを次のように用途分けする。
セクタ0:再利用性が高いと思われるデータのために利用する
セクタ1:再利用性が低いと思われるデータのために利用する
First, the two sectors are divided into uses as follows.
Sector 0: Used for data that seems to be highly reusable Sector 1: Used for data that seems to be low reusable

このように用途分けすると、再利用性が高いものと低いものを分けたことにより、再利用性が低いメモリアクセスがキャッシュ全体を汚すことを防止することができる。また、再利用性が低いと思われるデータにもウェイを残すことで、プリフェッチ等のアドレス空間的ローカリティが高いメモリアクセスのキャッシュ効率を保つことができる。   By dividing the usage in this way, it is possible to prevent memory accesses with low reusability from polluting the entire cache by separating those with high reusability and those with low reusability. In addition, by leaving a way for data that is considered to be low in reusability, it is possible to maintain cache efficiency of memory access with high address space locality such as prefetch.

一般にデータの宣言形状が大きい場合、データ参照も大きな範囲に及ぶことが予想されるため、アクセスの局所性が低く、再利用性も低いと推測することができる。キャッシュの1ウェイの大きさは一例として512KByteである。データの大きさがわかる場合には、次のような判断を行なう。
・512KByte以下のデータは、再利用性が高いと判断し、セクタ0を利用する。
・512KByteより大きいデータは、再利用性が低いと判断し、セクタ1を利用する。
In general, when the data declaration shape is large, it is expected that the data reference also covers a large range. Therefore, it can be assumed that the locality of access is low and the reusability is low. As an example, the size of one way of the cache is 512 KB. When the data size is known, the following judgment is made.
-It is determined that data of 512 Kbytes or less is highly reusable, and sector 0 is used.
-Data larger than 512 KBytes is judged to have low reusability, and sector 1 is used.

データの大きさがわからない場合は、配列の次元数から類推する。
・次元数が所定数、例えば2以下のデータは、再利用性が高いと判断し、セクタ0を利用する。
・次元数が2より大きいデータは、再利用性が低いと判断し、セクタ1を利用する。
If you don't know the size of the data, you can guess from the number of dimensions of the array.
The data whose dimension number is a predetermined number, for example, 2 or less is judged to be highly reusable and sector 0 is used.
Data having a dimension number greater than 2 is judged to have low reusability, and sector 1 is used.

上記の判断に従い、セクタキャッシュ最適化コンパイラにより、セクタキャッシュ対応オブジェクトプログラムを生成する。図10は、コンパイル時におけるセクタ選択処理を説明するフローチャートである。   According to the above determination, a sector cache compatible object program is generated by the sector cache optimization compiler. FIG. 10 is a flowchart for explaining sector selection processing during compilation.

図10に示したように、セクタキャッシュ最適化コンパイラは、まず変数を選択し(S601)、データの大きさが求められるかを判定する(S602)。データの大きさが求められる場合(S602,Yes)、所定サイズ以下のデータはセクタ0、それ以外のデータはセクタ1を利用する(S603)。一方、データの大きさが求められない場合(S602,No)、次元数が例えば2以下のデータはセクタ0、それ以外のデータはセクタ1を利用する(S604)。   As shown in FIG. 10, the sector cache optimizing compiler first selects a variable (S601), and determines whether the data size is obtained (S602). When the data size is required (S602, Yes), sector 0 is used for data of a predetermined size or less, and sector 1 is used for other data (S603). On the other hand, when the size of the data cannot be obtained (S602, No), for example, data having a dimension number of 2 or less uses sector 0, and other data uses sector 1 (S604).

セクタキャッシュ最適化コンパイラは、S603,S604の後、全ての変数を選択したか判定し(S605)、選択していない変数が残っている場合には(S605,No)、変数の選択(S601)に戻る。そして、全ての変数を選択している場合(S605,Yes)、セクタキャッシュ最適化コンパイラは処理を終了する。   After S603 and S604, the sector cache optimizing compiler determines whether all variables have been selected (S605). If there are unselected variables remaining (S605, No), variable selection (S601). Return to. If all variables have been selected (S605, Yes), the sector cache optimizing compiler ends the process.

図11は、変数の形状と使用セクタの判断結果の説明図である。図11に示した利用セクタ判断結果D7は、変数Va1の形状が(100,100)、すなわちサイズが判り、512KB以下であるのでセクタ0を利用することを示している。   FIG. 11 is an explanatory diagram of variable shape and use sector determination results. The use sector determination result D7 shown in FIG. 11 indicates that the sector Va is used because the shape of the variable Va1 is (100, 100), that is, the size is 512 KB or less.

同様に、利用セクタ判断結果D7は、変数Va2の形状が(100,100,100)、すなわち、サイズが判り、512KB以下でないのでセクタ1を利用することを示している。また、利用セクタ判断結果D7は、変数Va3の形状が(NN,MM)、すなわちサイズがわからず、次元数が2以下であるので、セクタ0を利用することを示している。そして、利用セクタ判断結果D7は、変数Va4の形状が(AA,BB,CC)、すなわちサイズが判らず、次元数が2以下でないので、セクタ1を利用することを示している。   Similarly, the use sector determination result D7 indicates that the shape of the variable Va2 is (100, 100, 100), that is, the size is known and the sector 1 is used because it is not 512 KB or less. The use sector determination result D7 indicates that sector 0 is used because the shape of variable Va3 is (NN, MM), that is, the size is unknown and the number of dimensions is 2 or less. The use sector determination result D7 indicates that the shape of the variable Va4 is (AA, BB, CC), that is, the size is not known, and the number of dimensions is not less than 2, so that the sector 1 is used.

図12は、プログラムの修正による改善についての説明図である。図12に示したソースプログラム41では、real*8 a(256,256)、real*8 d(256,256)、a(i,j)=b(i,j)+c(i,j)*d(i,j)+e(i,j)*f(i,j)の関係から、同一のキャッシュインデクスを引いてキャッシュ競合が発生する可能性が高くなる。この結果、ソースプログラム41のハードウェアモニタ情報D8では、L2データキャッシュのミス率が9.1415%にのぼり、実行時間が長くなっている。   FIG. 12 is an explanatory diagram of the improvement by correcting the program. In the source program 41 shown in FIG. 12, real * 8 a (256,256), real * 8 d (256,256), a (i, j) = b (i, j) + c (i, j) * d (i , j) + e (i, j) * f (i, j), it is highly possible that the same cache index is subtracted to cause cache contention. As a result, in the hardware monitor information D8 of the source program 41, the L2 data cache miss rate is 9.1415%, and the execution time is long.

このように、キャッシュ機構の特性から2のべき乗のデータサイズを持つ大きなデータ間でキャッシュの競合が発生しやすい。   In this way, due to the characteristics of the cache mechanism, cache contention tends to occur between large data having a data size that is a power of two.

一方、修正したソースプログラム41aは、real*8 a(257,256)、b(257,256)として、データサイズが2のべき乗にならないようにしている。このため、ソースプログラム41aのハードウェアモニタ情報D8aでは、L2データキャッシュのミス率が7.7722%に下がり、実行時間が改善している。   On the other hand, in the modified source program 41a, the data size does not become a power of 2 as real * 8 a (257,256) and b (257,256). For this reason, in the hardware monitor information D8a of the source program 41a, the miss rate of the L2 data cache is reduced to 7.7722%, and the execution time is improved.

上述してきたように、本実施例にかかる分析装置20は、アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながらサンプリングしたアクセス数やキャッシュミス数を収集する。サンプリングデータを取得した分析装置20は、セクタ構成ごとにキャッシュミス数をアクセス数で除してキャッシュミス率を算出する。このキャッシュミス率は、その値が小さいセクタ構成を適切なセクタ構成として選択する際に利用できる。   As described above, the analysis apparatus 20 according to the present embodiment collects the sampled access count and cache miss count while switching the sector configuration of the cache memory during execution of the application program. The analysis apparatus 20 that has acquired the sampling data calculates the cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration. This cache miss rate can be used when a sector configuration having a small value is selected as an appropriate sector configuration.

また、分析装置20は、キャッシュミス率のセクタ構成変化に対する微分値を求め、キャッシュミス率の微分値の変化からアプリケーションプログラムによるキャッシュメモリの利用状態を求める。   Further, the analysis device 20 obtains a differential value of the cache miss rate with respect to the sector configuration change, and obtains a use state of the cache memory by the application program from the change of the differential value of the cache miss rate.

このため、分析装置20は、セクタキャッシュの構成を高精度に分析し、もってアプリケーションプログラムの性能向上に寄与することが出来る。加えて、アプリケーションプログラムを1回実行する間にセクタキャッシュの構成を評価することができるので、セクタキャッシュの構成を高速に分析可能である。   For this reason, the analysis device 20 can analyze the configuration of the sector cache with high accuracy, thereby contributing to the performance improvement of the application program. In addition, since the sector cache configuration can be evaluated during one execution of the application program, the sector cache configuration can be analyzed at high speed.

なお、本実施例はあくまで一例であり、構成及び動作は適宜変更して実施することができる。例えば、分析装置20の各処理部をソフトウェアによって実現すれば、コンピュータを分析装置として動作させる分析プログラムを得ることができる。この分析プログラムを実行するのは、対象となるアプリケーションプログラムを実行するプロセッサ10自身であってもよいし、他のコンピュータであっても良い。また、L1キャッシュのセクタキャッシュに対しても開示の技術は適用可能である。マルチプロセッサに対して適用することも出来る。   In addition, a present Example is an example to the last, A structure and operation | movement can be changed suitably and can be implemented. For example, if each processing unit of the analysis device 20 is realized by software, an analysis program for operating a computer as the analysis device can be obtained. The analysis program may be executed by the processor 10 itself that executes the target application program or may be another computer. The disclosed technology can also be applied to the sector cache of the L1 cache. It can also be applied to multiprocessors.

以上の各実施例を含む実施形態に関し、さらに以下の付記を開示する。   The following supplementary notes are further disclosed with respect to the embodiments including the above examples.

(付記1)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する収集部と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するキャッシュミス率算出部と、
他のセクタ構成に比して前記キャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択する選択部と
を備えたことを特徴とする分析装置。
(Appendix 1) A collection unit that collects data obtained by sampling at least the number of accesses to the cache memory and the number of cache misses in association with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
A cache miss rate calculator for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration;
An analysis apparatus comprising: a selection unit that selects a sector configuration having a smaller cache miss rate than other sector configurations as an appropriate sector configuration.

(付記2)他のセクタ構成に比して前記キャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択する選択部をさらに備えたことを特徴とする付記1に記載の分析装置。 (Supplementary note 2) The analyzer according to supplementary note 1, further comprising a selection unit that selects a sector configuration having a smaller cache miss rate as compared to other sector configurations as an appropriate sector configuration.

(付記3)前記取得部は、前記アプリケーションプログラムが実行した命令数を前記セクタ構成に対応付けて更に取得し、
前記セクタ構成ごとに前記アクセス数を前記命令数で除してキャッシュアクセス率を求め、前記キャッシュアクセス率の相対標準偏差が所定値未満である場合に前記選択部による選択結果が有効であると評価する有効性評価部をさらに備えたことを特徴とする付記2に記載の分析装置。
(Supplementary Note 3) The acquisition unit further acquires the number of instructions executed by the application program in association with the sector configuration,
A cache access rate is obtained by dividing the number of accesses by the number of instructions for each sector configuration, and when the relative standard deviation of the cache access rate is less than a predetermined value, it is evaluated that the selection result by the selection unit is valid The analyzer according to appendix 2, further comprising an effectiveness evaluation unit for

(付記4)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する収集部と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するキャッシュミス率算出部と、
前記キャッシュミス率のセクタ構成変化に対する微分値を求めるキャッシュミス率微分処理部と、
前記キャッシュミス率の微分値の変化から前記アプリケーションプログラムによる前記キャッシュメモリの利用状態を求める利用状態算出部と
を備えたことを特徴とする分析装置。
(Appendix 4) A collection unit that collects sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
A cache miss rate calculator for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration;
A cache miss rate differential processing unit for obtaining a differential value with respect to a sector configuration change of the cache miss rate;
An analysis apparatus comprising: a usage state calculation unit that obtains a usage state of the cache memory by the application program from a change in a differential value of the cache miss rate.

(付記5)前記アプリケーションプログラムは、変数が使用するデータの大きさと次元数に基づいて使用するセクタを決定することを特徴とする付記1〜4のいずれか一つに記載の分析装置。 (Additional remark 5) The said application program determines the sector to be used based on the magnitude | size and dimension number of the data which a variable uses, The analyzer as described in any one of additional marks 1-4 characterized by the above-mentioned.

(付記6)前記収集部は、前記アプリケーションプログラムによるサブルーチン処理の開始後と終了前にセクタ構成を切り替えながらサンプリングしたデータを収集することを特徴とする付記1〜5のいずれか一つに記載の分析装置。 (Additional remark 6) The said collection part collects the sampled data, switching a sector structure after the start of the subroutine process by the said application program, and before completion | finish, The additional description 1-5 characterized by the above-mentioned. Analysis equipment.

(付記7)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集するステップと、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するステップと
を含んだことを特徴とする分析方法。
(Appendix 7) Collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
And a step of calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration.

(付記8)他のセクタ構成に比して前記キャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択するステップをさらに含んだことを特徴とする付記7に記載の分析方法。 (Supplementary note 8) The analysis method according to supplementary note 7, further comprising a step of selecting a sector configuration having a smaller cache miss rate as compared to other sector configurations as an appropriate sector configuration.

(付記9)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集するステップと、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するステップと、
前記キャッシュミス率のセクタ構成変化に対する微分値を求めるステップと、
前記キャッシュミス率の微分値の変化から前記アプリケーションプログラムによる前記キャッシュメモリの利用状態を求めるステップと
を含んだことを特徴とする分析方法。
(Supplementary Note 9) Collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
Dividing the number of cache misses by the number of accesses for each sector configuration to calculate a cache miss rate;
Obtaining a differential value for a sector configuration change of the cache miss rate;
And a step of obtaining a use state of the cache memory by the application program from a change in the differential value of the cache miss rate.

(付記10)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する手順と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出する手順と、
をコンピュータに実行させることを特徴とする分析プログラム。
(Supplementary Note 10) A procedure for collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
A procedure for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration;
An analysis program characterized in that a computer is executed.

(付記11)他のセクタ構成に比して前記キャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択する手順をさらにコンピュータに実行させることを特徴とする付記10に記載の分析プログラム。 (Additional remark 11) The analysis program of Additional remark 10 characterized by making a computer further perform the procedure which selects the sector structure with a small cache miss rate compared with another sector structure as an appropriate sector structure.

(付記12)アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する手順と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出する手順と、
前記キャッシュミス率のセクタ構成変化に対する微分値を求める手順と、
前記キャッシュミス率の微分値の変化から前記アプリケーションプログラムによる前記キャッシュメモリの利用状態を求める手順と
をコンピュータに実行させることを特徴とする分析プログラム。
(Supplementary Note 12) A procedure for collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
A procedure for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration;
A procedure for obtaining a differential value with respect to a sector configuration change of the cache miss rate;
An analysis program causing a computer to execute a procedure for obtaining a use state of the cache memory by the application program from a change in a differential value of the cache miss rate.

10 プロセッサ
11 アプリケーションプロセス
12 サンプリングスレッド
13 セクタ構成変更部
14 サンプリング処理部
20 分析装置
21 データ収集部
22 キャッシュミス率算出部
23 選択部
24 有効性評価部
25 キャッシュミス率微分処理部
26 スラッシング多重度算出部
27 出力部
31 CPU
41 ソースプログラム
42 セクタキャッシュ最適化コンパイラ
43 セクタキャッシュ対応オブジェクトプログラム
DESCRIPTION OF SYMBOLS 10 Processor 11 Application process 12 Sampling thread 13 Sector structure change part 14 Sampling process part 20 Analyzing device 21 Data collection part 22 Cache miss rate calculation part 23 Selection part 24 Effectiveness evaluation part 25 Cache miss rate differentiation process part 26 Thrashing multiplicity calculation Unit 27 Output unit 31 CPU
41 Source program 42 Sector cache optimization compiler 43 Sector cache object program

Claims (8)

アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する収集部と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するキャッシュミス率算出部と
を備えたことを特徴とする分析装置。
A collecting unit that collects sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
An analysis apparatus comprising: a cache miss rate calculation unit that calculates a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration.
他のセクタ構成に比して前記キャッシュミス率の小さいセクタ構成を適切なセクタ構成として選択する選択部をさらに備えたことを特徴とする請求項1に記載の分析装置。   The analysis apparatus according to claim 1, further comprising a selection unit that selects a sector configuration having a smaller cache miss rate as compared to other sector configurations as an appropriate sector configuration. 前記取得部は、前記アプリケーションプログラムが実行した命令数を前記セクタ構成に対応付けて更に取得し、
前記セクタ構成ごとに前記アクセス数を前記命令数で除してキャッシュアクセス率を求め、前記キャッシュアクセス率の相対標準偏差が所定値未満である場合に前記選択部による選択結果が有効であると評価する有効性評価部をさらに備えたことを特徴とする請求項2に記載の分析装置。
The acquisition unit further acquires the number of instructions executed by the application program in association with the sector configuration,
A cache access rate is obtained by dividing the number of accesses by the number of instructions for each sector configuration, and when the relative standard deviation of the cache access rate is less than a predetermined value, it is evaluated that the selection result by the selection unit is valid The analyzer according to claim 2, further comprising an effectiveness evaluation unit that performs the evaluation.
アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する収集部と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するキャッシュミス率算出部と、
前記キャッシュミス率のセクタ構成変化に対する微分値を求めるキャッシュミス率微分処理部と、
前記キャッシュミス率の微分値の変化から前記アプリケーションプログラムによる前記キャッシュメモリの利用状態を求める利用状態算出部と
を備えたことを特徴とする分析装置。
A collecting unit that collects sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
A cache miss rate calculator for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration;
A cache miss rate differential processing unit for obtaining a differential value with respect to a sector configuration change of the cache miss rate;
An analysis apparatus comprising: a usage state calculation unit that obtains a usage state of the cache memory by the application program from a change in a differential value of the cache miss rate.
前記アプリケーションプログラムは、変数が使用するデータの大きさと次元数に基づいて使用するセクタを決定することを特徴とする請求項1〜4のいずれか一つに記載の分析装置。   The analysis apparatus according to claim 1, wherein the application program determines a sector to be used based on a size and a number of dimensions of data used by a variable. 前記収集部は、前記アプリケーションプログラムによるサブルーチン処理の開始後と終了前にセクタ構成を切り替えながらサンプリングしたデータを収集することを特徴とする請求項1〜5のいずれか一つに記載の分析装置。   6. The analysis apparatus according to claim 1, wherein the collection unit collects sampled data while switching the sector configuration after the start and end of the subroutine processing by the application program. アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集するステップと、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出するステップと
を含んだことを特徴とする分析方法。
Collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
And a step of calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration.
アプリケーションプログラムの実行中にキャッシュメモリのセクタ構成を切り替えながら少なくとも前記キャッシュメモリに対するアクセス数とキャッシュミス数を前記セクタ構成に対応付けてサンプリングしたデータを収集する手順と、
前記セクタ構成ごとに前記キャッシュミス数を前記アクセス数で除してキャッシュミス率を算出する手順と
をコンピュータに実行させることを特徴とする分析プログラム。
A procedure for collecting sampled data by associating at least the number of accesses to the cache memory and the number of cache misses with the sector configuration while switching the sector configuration of the cache memory during execution of the application program;
An analysis program causing a computer to execute a procedure for calculating a cache miss rate by dividing the number of cache misses by the number of accesses for each sector configuration.
JP2010070505A 2010-03-25 2010-03-25 Analysis apparatus, analysis method, and analysis program Expired - Fee Related JP5521687B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010070505A JP5521687B2 (en) 2010-03-25 2010-03-25 Analysis apparatus, analysis method, and analysis program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010070505A JP5521687B2 (en) 2010-03-25 2010-03-25 Analysis apparatus, analysis method, and analysis program

Publications (2)

Publication Number Publication Date
JP2011203995A true JP2011203995A (en) 2011-10-13
JP5521687B2 JP5521687B2 (en) 2014-06-18

Family

ID=44880573

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010070505A Expired - Fee Related JP5521687B2 (en) 2010-03-25 2010-03-25 Analysis apparatus, analysis method, and analysis program

Country Status (1)

Country Link
JP (1) JP5521687B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015222477A (en) * 2014-05-22 2015-12-10 富士通株式会社 Information processor, information processing system, control method of information processor and control program of information processor
US9983798B2 (en) 2015-06-16 2018-05-29 Fujitsu Limited Information processing apparatus and data accessing method
US11669458B2 (en) 2021-06-30 2023-06-06 Fujitsu Limited Computer-readable recording medium storing adjustment program and adjustment method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015222477A (en) * 2014-05-22 2015-12-10 富士通株式会社 Information processor, information processing system, control method of information processor and control program of information processor
US9477601B2 (en) 2014-05-22 2016-10-25 Fujitsu Limited Apparatus and method for determining a sector division ratio of a shared cache memory
US9983798B2 (en) 2015-06-16 2018-05-29 Fujitsu Limited Information processing apparatus and data accessing method
US11669458B2 (en) 2021-06-30 2023-06-06 Fujitsu Limited Computer-readable recording medium storing adjustment program and adjustment method

Also Published As

Publication number Publication date
JP5521687B2 (en) 2014-06-18

Similar Documents

Publication Publication Date Title
US9477601B2 (en) Apparatus and method for determining a sector division ratio of a shared cache memory
CN101957773B (en) method and system for multiple purpose dynamic analysis
US20080215863A1 (en) Method and Apparatus for Autonomically Initiating Measurement of Secondary Metrics Based on Hardware Counter Values for Primary Metrics
JP6925473B2 (en) Real-time adjustment of application-specific operating parameters for backward compatibility
EP2115583A2 (en) Speculative throughput computing
US6088525A (en) Loop profiling by instrumentation
US8359291B2 (en) Architecture-aware field affinity estimation
EP3835944A1 (en) Apparatus and method for source code optimisation
EP1351150A2 (en) Sampling mechanism including instruction filtering
Guerreiro et al. Multi-kernel auto-tuning on GPUs: Performance and energy-aware optimization
JP4940996B2 (en) Profiling device and profiling program
JP2009075812A (en) Profiling method and program
JP5521687B2 (en) Analysis apparatus, analysis method, and analysis program
Wang et al. MDM: The GPU memory divergence model
US20030126591A1 (en) Stride-profile guided prefetching for irregular code
JP2017167930A (en) Information processing device, power measurement method and power measurement program
Ibrahim et al. Characterizing the relation between Apex-Map synthetic probes and reuse distance distributions
US20160357655A1 (en) Performance information generating method, information processing apparatus and computer-readable storage medium storing performance information generation program
Sazeides Modeling value speculation
Mariano et al. Analyzing and improving memory access patterns of large irregular applications on numa machines
JP2016224811A (en) Information processor, execution information recording program and execution information recording method
Rane et al. Performance optimization of data structures using memory access characterization
WO2018032897A1 (en) Method and device for evaluating packet forwarding performance and computer storage medium
Cruz et al. A sharing-aware memory management unit for online mapping in multi-core architectures
JP2004318538A (en) Method for monitoring performance

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130206

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131210

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140210

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140324

R150 Certificate of patent or registration of utility model

Ref document number: 5521687

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees