JP5045334B2 - Cash system - Google Patents
Cash system Download PDFInfo
- Publication number
- JP5045334B2 JP5045334B2 JP2007246192A JP2007246192A JP5045334B2 JP 5045334 B2 JP5045334 B2 JP 5045334B2 JP 2007246192 A JP2007246192 A JP 2007246192A JP 2007246192 A JP2007246192 A JP 2007246192A JP 5045334 B2 JP5045334 B2 JP 5045334B2
- Authority
- JP
- Japan
- Prior art keywords
- cache
- core
- entry
- caches
- lru information
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Description
本発明は、キャッシュシステムに関する。 The present invention relates to a cache system.
コンピュータシステムにおいては一般に、主記憶とは別に小容量で高速なキャッシュメモリが設けられる。主記憶に記憶される情報の一部をキャッシュにコピーしておくことで、この情報をアクセスする場合には主記憶からではなくキャッシュから読み出すことで、高速な情報の読み出しが可能となる。 In general, in a computer system, a small-capacity and high-speed cache memory is provided separately from the main memory. By copying a part of the information stored in the main memory to the cache, when accessing this information, it is possible to read the information at a high speed by reading from the cache instead of the main memory.
キャシュは複数のキャッシュラインを含み、主記憶からキャッシュへの情報のコピーはキャッシュライン単位で実行される。主記憶のメモリ空間はキャッシュライン単位で分割され、分割されたメモリ領域を順番にキャッシュラインに割当てておく。キャッシュの容量は主記憶の容量よりも小さいので、主記憶のメモリ領域を繰り返して同一のキャッシュラインに割当てることになる。 The cache includes a plurality of cache lines, and information is copied from the main memory to the cache in units of cache lines. The memory space of the main memory is divided in units of cache lines, and the divided memory areas are sequentially assigned to the cache lines. Since the capacity of the cache is smaller than the capacity of the main memory, the memory area of the main memory is repeatedly assigned to the same cache line.
メモリ空間上のあるアドレスに最初のアクセスが実行されると、そのアドレスの情報(データやプログラム)をキャシュ内の対応するキャッシュラインにコピーする。同一アドレスに対して次のアクセスを実行する場合にはキャシュから直接に情報を読み出す。一般に、アドレスの全ビットのうちで、所定数の下位ビットがキャッシュのインデックスとなり、それより上位に位置する残りのビットがキャッシュのタグとなる。 When the first access is executed to an address in the memory space, the information (data or program) at that address is copied to the corresponding cache line in the cache. When executing the next access to the same address, information is read directly from the cache. Generally, out of all bits of the address, a predetermined number of lower bits serve as a cache index, and the remaining bits positioned higher than that serve as a cache tag.
データをアクセスする場合には、アクセス先を示すアドレス中のインデックス部分を用いて、キャッシュ中の対応するインデックスのタグを読み出す。読み出したタグと、アドレス中のタグ部分のビットパターンが一致するか否かを判断する。一致しない場合にはキャッシュミスとなる。一致する場合には、キャッシュヒットとなり、当該インデックスに対応するキャッシュデータ(1キャッシュライン分の所定ビット数のデータ)がアクセスされる。 When accessing the data, the tag of the corresponding index in the cache is read using the index portion in the address indicating the access destination. It is determined whether or not the read tag matches the bit pattern of the tag portion in the address. If they do not match, a cache miss occurs. If they match, a cache hit occurs, and the cache data corresponding to the index (data of a predetermined number of bits for one cache line) is accessed.
各キャッシュラインに対して1つだけタグを設けたキャッシュの構成を、ダイレクトマッピング方式と呼ぶ。各キャッシュラインに対してN個のタグを設けたキャッシュの構成をNウェイセットアソシアティブと呼ぶ。ダイレクトマッピング方式は1ウェイセットアソシアティブとみなすことができる。 A cache configuration in which only one tag is provided for each cache line is called a direct mapping method. A cache configuration in which N tags are provided for each cache line is called an N-way set associative. The direct mapping method can be regarded as a one-way set associative.
キャッシュミスが発生した場合に、主記憶にアクセスすることによるペナルティーを軽減するために、キャッシュメモリを多階層化したシステムが用いられる。例えば、1次キャッシュと主記憶との間に、主記憶よりは高速にアクセスできる2次キャッシュを設けることにより、1次キャッシュにおいてキャッシュミスが発生した場合に、主記憶にアクセスが必要になる頻度を低くして、キャッシュミス・ペナルティーを軽減することができる。 In order to reduce the penalty for accessing the main memory when a cache miss occurs, a system in which the cache memory is hierarchized is used. For example, by providing a secondary cache that can be accessed faster than the main memory between the primary cache and the main memory, the frequency at which access to the main memory is required when a cache miss occurs in the primary cache. Can be reduced to reduce the cache miss penalty.
従来、プロセッサにおいては動作周波数の向上やアーキテクチャの改良により処理速度を向上させてきた。しかし近年、周波数をこれ以上高くすることには技術的な限界が見え始めており、複数のプロセッサを用いたマルチプロセッサ構成により処理速度の向上を目指す動きが強くなっている。 Conventionally, in a processor, the processing speed has been improved by improving the operating frequency and improving the architecture. However, in recent years, a technical limit has begun to appear when the frequency is further increased, and there is a strong movement toward improving the processing speed by a multiprocessor configuration using a plurality of processors.
複数のプロセッサが存在するシステムは、各々がキャッシュを有する既存のシングルプロセッサコアを複数個設け、それらを単純に繋げることで実現可能である。このような構成は、設計コストを低く抑えることができるが、キャッシュの使用効率やキャッシュの一貫性に関して問題がある。 A system having a plurality of processors can be realized by providing a plurality of existing single processor cores each having a cache and simply connecting them. Such a configuration can keep the design cost low, but there are problems with cache usage efficiency and cache consistency.
下記の特許文献1には、各々が1つ以上のノードの組のうちのあるノード上に存在する複数個のキャッシュのバッファに記憶されるデータの置換を管理するための方法であって、前記1つ以上のノードの組の各ノードは、前記複数個のキャッシュのうちの1つ以上のキャッシュを含み、複数個のキャッシュは第1のキャッシュを含み、前記方法は、1つ以上の要因に基づいて前記第1のキャッシュから第1のバッファを置換のために選択するステップを含み、前記第1のバッファは、第1のデータ項目を記憶するために現在使用されており、前記1つ以上の要因は、前記複数個のキャッシュのうち少なくとも1つの他のキャッシュの状態、または前記複数個のキャッシュのうち前記少なくとも1つの他のキャッシュの構成、のいずれかを含み、さらに、前記第1のバッファに記憶された前記第1のデータ項目を第2のデータ項目と置換するステップを含む、方法が記載されている。
The following
また、下記の特許文献2には、主記憶装置のデータの一部をブロック単位でコピーして格納し、新たなブロックの格納に際してリプレースすべきブロックをLRU方式で決定するバッファ記憶装置において、バッファ記憶装置のブロックを複数のブロックを複数のグループに分け、各グループ毎にLRU方式でリプレースブロックを決定する手段を設けるとともに、どのグループをリプレース対象とするかを指示するフラグビットを設け、かつこのフラグビットを三重化して設けて、読出し時には多数決をとるようにしたことを特徴とするバッファ記憶装置のLRU制御方式が記載されている。
Further, in
また、下記の特許文献3には、CPUキャッシュを内蔵するCPUとCPUキャッシュ複製タグメモリを内蔵するCPU−SCインタフェース制御部を備えた複数のプロセッサモジュールと、メインメモリとが、システムコネクション(SC)を介して結合されたマルチプロセッサシステムにおけるキャッシュ構成方法であって、前記CPUのCPUキャッシュをセット数k、ウェイ数wのセットアソシアティブとし、前記CPU−SCインタフェース制御部のCPUキャッシュ複製タグメモリをセット数k、ウェイ数w+αのセットアソシアティブとすることを特徴とするキャッシュ構成方法が記載されている。
In
本発明の目的は、複数の処理装置に一対一に複数のキャッシュを接続した場合に、複数のキャッシュ間で効率的にデータ転送を行うことができるキャッシュシステムを提供することである。 An object of the present invention is to provide a cache system capable of efficiently transferring data between a plurality of caches when a plurality of caches are connected to a plurality of processing devices on a one-to-one basis.
本発明のキャッシュシステムは、複数の処理装置と、前記複数の処理装置に一対一に接続された複数のキャッシュと、前記複数のキャッシュに接続され、前記複数のキャッシュ間のデータ転送を制御するコントローラと、前記処理装置毎に自己のキャッシュ内のエントリ及び他のキャッシュの使用古さ順を示す第1の情報を記憶する情報メモリとを有することを特徴とする。 A cache system according to the present invention includes a plurality of processing devices, a plurality of caches connected to the plurality of processing devices on a one-to-one basis, and a controller connected to the plurality of caches and controlling data transfer between the plurality of caches. And an information memory for storing first information indicating an entry in its own cache and the order of use of other caches for each of the processing devices.
第1の情報を用いることにより、複数のキャッシュ間で効率的にデータ転送を行うことができ、トラフィックの増大を防止することができる。 By using the first information, data can be efficiently transferred between a plurality of caches, and an increase in traffic can be prevented.
図14は、共有分散キャッシュシステムの構成例を示す図である。この共有分散キャッシュシステムは、複数のコア(プロセッサ:処理装置)101〜103、複数のコア101〜103に一対一に対応する複数のキャッシュ(キャッシュメモリ)111〜113、キャッシュ111〜113に接続されるキャッシュ間接続コントローラ(ICC)120、及びメインメモリ130を含む。コア101〜103はそれぞれ、自己に直接に接続されるキャッシュ(自コアキャッシュ)111〜113を1次キャッシュとしてアクセス可能である。この共有分散キャッシュシステムでは、さらに、他のコアのキャッシュ(他コアキャッシュ)を2次キャッシュとしてアクセス可能なように構成される。すなわち、例えばコア101から見たときに、キャッシュ111を1次キャッシュとしてアクセス可能であるとともに、さらにキャッシュ112及び113を2次キャッシュとしてアクセス可能なように構成される。このような2次キャッシュをアクセスする経路は、キャッシュ間接続コントローラ120を介して提供される。キャッシュ間接続コントローラ120は、LRU情報1400を有する。LRUはLeast Recent Usedの意味であり、LRU情報は最も長いこと使用されていないものを特定する情報である。具体的には、複数のエントリに対するLRU情報は、それら複数のエントリの使用古さ順(最も長いこと使用されていない順)を示す情報である。
FIG. 14 is a diagram illustrating a configuration example of a shared distributed cache system. This shared distributed cache system is connected to a plurality of cores (processors: processing devices) 101 to 103, a plurality of caches (cache memories) 111 to 113 corresponding to the plurality of
例えば、コア101は、自コアキャッシュ111にロード要求し、キャッシュヒットすれば、自コアキャッシュ111からデータを読み出す。キャッシュミスすれば、2次キャッシュ112又は113にアクセスする。例えば、2次キャッシュ112でキャッシュヒットすれば、処理1411のように、1次キャッシュ111と2次キャッシュ112との間でキャッシュラインのデータ交換処理を行う。2次キャッシュ112及び113でキャッシュミスした場合には、処理1412によりメインメモリ130のデータがキャッシュライン分、1次キャッシュ111にコピーされると共に、そのデータがコア101に出力される。また、その際、処理1413により、1次キャッシュ111から追い出されたキャッシュラインは、2次キャッシュ112に移動される。
For example, the
他コアキャッシュ112又は113にヒットした時、ヒットしたエントリのLRU情報1400が最新でない場合は必ず交換処理1411を行う。しかし、この場合、あまり利用しないエントリのときでも交換処理1411が発生し、トラフィックが増加してしまう。これにより、システムの動作が低下してしまうため、トラフィックを減少させる必要がある。
When the
また、コア101〜103の数が増加した場合に、より多くの他コアキャッシュを下位階層キャッシュとして利用するため、LRU情報1400のビット数が増加してしまう。したがって、LRU情報1400のビット数増加を防止する対策が望まれる。
Further, when the number of
図15は、他の共有分散キャッシュシステムの構成例を示す図である。以下、図15が図14と異なる点を説明する。LRU情報1500は、図14のLRU情報1400に対応するものである。第1のLRU情報1501は、キャッシュ111のエントリa,b,cの最古順を示し、「0」が最古、「2」が最新を示す。第1のLRU情報1502は、キャッシュ112のエントリa,b,cの最古順を示す。第1のLRU情報1503は、キャッシュ113のエントリa,b,cの最古順を示す。第1のLRU情報1501〜1503を2項関係方式によりエンコードすると、それぞれ3ビットになる。第2のLRU情報1509は、3個のキャッシュ111〜113全体でのエントリの最古順を示す。第2のLRU情報1509を順序関係方式によりエンコードすると、18ビットになる。したがって、LRU情報1500は、3+3+3+18=27ビットになる。これにより、全コアのキャッシュ111〜113のキャッシュラインを大きな1つのキャッシュと見て、完全な最古関係を保持することができる。
FIG. 15 is a diagram illustrating a configuration example of another shared distributed cache system. Hereinafter, the points of FIG. 15 different from FIG. 14 will be described. The LRU
図16は、図15の共有分散キャッシュシステムにおけるキャッシュエントリ追い出し処理を示すフローチャートである。複数のコア101〜103の何れか1つのコアが、自己に直接に接続されたキャッシュ(自コアキャッシュ)へアクセス要求を発行し、まず自コアでキャッシュミスし、さらにその下位のキャッシュでもキャッシュミスし、メインメモリ130からデータを読み出して自コアにアロケートする必要が生じた時点で、図16のフローチャートの動作が実行される。なおここで、図16のフローチャートの動作が読み出すデータの読み出し元は、必ずしもメインメモリ130である必要はない。キャッシュ間接続コントローラ120は、キャッシュ111〜113を優先順位に応じてアクセスすることでキャッシュを階層化しているが、その階層構造のキャッシュの下に、キャッシュとは別の管理単位として管理されているメモリが読み出し元となる。階層構造のキャッシュの下に直ぐにメインメモリ130が位置されているのであれば、データの読み出し先はメインメモリ130となる。以下では、メインメモリ130の場合を例にとって説明する。
FIG. 16 is a flowchart showing cache entry eviction processing in the shared distributed cache system of FIG. Any one of the plurality of
ステップS11で、コア101〜103のうちの1つがメインメモリ130にアクセスするために、アクセス先のアドレス(例えば読み出し先のアドレス)をキャッシュ間接続コントローラ120に送信する。ステップS12で、第2のLRU情報1509を参照し、アクセス先に対応するインデックスのエントリのうちで、キャッシュ111〜113全体で最古のエントリを探索する。
In step S <b> 11, one of the
ステップS13で、全体で最古のエントリが自コアキャッシュ(アクセス要求を出したコアに対応するキャッシュ)にあるか否かを判定する。全体で最古のエントリが自コアキャッシュに存在する場合には、ステップS14において、第1のLRU情報1501〜1503及び第2のLRU情報1509を更新する。すなわち、自コアキャッシュで最古のエントリが最新のエントリとなるように第1のLRU情報1501〜1503を更新するとともに、全体で最古のエントリが最新のエントリとなるように第2のLRU情報1509を更新する。その後、ステップS17で、メインメモリ130から読み出したデータを自コアキャッシュ内の最古エントリ(LRU更新により最新エントリに更新されたエントリ)に上書きする。
In step S13, it is determined whether the oldest entry as a whole is in its own core cache (cache corresponding to the core that issued the access request). If the oldest entry in total exists in the own core cache, the
全体で最古のエントリが自コアキャッシュに存在しないとステップS13で判定された場合には、ステップS15において、第1のLRU情報1501〜1503及び第2のLRU情報1509を更新する。すなわち、自コアキャッシュで最古のエントリが最新のエントリとなるように自コアキャッシュの第1のLRU情報を更新するとともに、自コアキャッシュから追い出されたエントリ(追い出しエントリ)の移動先のキャッシュにおける最古のエントリ(全体で最古のエントリ)が追い出しエントリの古い順に一致するように移動先キャッシュの第1のLRU情報を更新する。また第2のLRU情報1509については、全体で最古のエントリが追い出しエントリの古い順に一致する順番のエントリとなり、かつ自コアキャッシュで最古のエントリが最新のエントリとなるように更新する。
If it is determined in step S13 that the oldest entry does not exist in the own core cache as a whole, the first LRU information 1501-1503 and the
その後ステップS16で、自コアキャッシュで最古のエントリを全体で最古のエントリに転送する(移動する)。最後にステップS17で、メインメモリ130から読み出したデータを自コアキャッシュ内の最古エントリ(LRU更新により最新エントリに更新されたエントリ)に上書きする。
Thereafter, in step S16, the oldest entry in the own core cache is transferred (moved) to the oldest entry as a whole. Finally, in step S17, the data read from the
しかし、図14のシステムの交換動作判定方式では、そのトラフィックが大きくなりシステムの動作を低下させる可能性があるという問題がある。また、図15のシステムのLRU符号化方式では、一般性はあるが、共有分散キャッシュ特有の性質を十分に利用していない。また、コアが増加してきた場合に、より多くの他コアキャッシュを下位階層キャッシュとして利用するためには他コアキャッシュの増加に対するLRU情報のビット数増加を抑える方式が必要である。以下、本発明の実施形態では、上記の課題を解決するための手段を説明する。 However, the system replacement operation determination method of FIG. 14 has a problem that the traffic becomes large and the operation of the system may be reduced. In addition, the LRU encoding method of the system of FIG. 15 is general, but does not fully utilize the characteristics unique to the shared distributed cache. Also, in order to use more other core caches as lower layer caches when the number of cores has increased, a method for suppressing an increase in the number of bits of LRU information with respect to the increase in other core caches is required. Hereinafter, in the embodiment of the present invention, means for solving the above problems will be described.
図1は、本発明の実施形態による共有分散キャッシュシステムの構成例を示す図である。この共有分散キャッシュシステムは、3個のコア(プロセッサ:処理装置)101〜103、3個のコア101〜103に一対一に対応する3個の3ウェイ1次キャッシュ111〜113、キャッシュ111〜113に接続されるキャッシュ間接続コントローラ(ICC)120、及びメインメモリ(又は2次キャッシュ)130を含む。コア101〜103はそれぞれ、自己に直接に接続されるキャッシュ(自コアキャッシュ)を上位階層キャッシュとしてアクセス可能である。この共有分散キャッシュシステムでは、さらに、他のコアのキャッシュ(他コアキャッシュ)を下位階層キャッシュとしてアクセス可能なように構成される。すなわち、例えばコア101から見たときに、キャッシュ111を上位階層キャッシュとしてアクセス可能であるとともに、さらに他コアキャッシュ112及び113を下位階層キャッシュとしてアクセス可能なように構成される。このような下位階層キャッシュをアクセスする経路は、キャッシュ間接続コントローラ120を介して提供される。
FIG. 1 is a diagram showing a configuration example of a shared distributed cache system according to an embodiment of the present invention. This shared distributed cache system has three cores (processors: processing devices) 101 to 103, three three-way
キャッシュ間接続コントローラ120は、第1のLRU情報121〜123及び第2のLRU情報129を記憶する情報メモリを有する。情報メモリは、キャッシュ間接続コントローラ120の外にあってもよい。第1のLRU情報121は、キャッシュ111のエントリa,b,c及び他コアキャッシュ112及び113のグループxの最古順を示し、「0」が最古、「2」が最新を示す。すなわち、第1のLRU情報121は、自己のキャッシュ111の3個のエントリa,b,cに、n個(=1個)の他コアキャッシュグループxを追加したLRU情報である。
The
図2は、図1の第1のLRU情報121〜123及び第2のLRU情報129の詳細を示す図である。第1のLRU情報122は、第1のLRU情報121と同様に、キャッシュ112のエントリa,b,c及び他コアキャッシュ111及び113のグループxの最古順を示す。第1のLRU情報123も、第1のLRU情報121と同様に、キャッシュ113のエントリa,b,c及び他コアキャッシュ111及び112のグループxの最古順を示す。第1のLRU情報121〜123を2項関係方式によりエンコードすると、それぞれ6ビットになる。
FIG. 2 is a diagram showing details of the
コア101はコアAであり、キャッシュ111はキャッシュAである。コア102はコアBであり、キャッシュ112はキャッシュBである。コア103はコアCであり、キャッシュ113はキャッシュCである。
The
第2のLRU情報129は、3個のコア101〜103間での自己のキャッシュ111〜113に対する使用古さ順を示し、AがキャッシュA(111)のLRU情報、BがキャッシュB(112)のLRU情報、CがキャッシュC(113)のLRU情報である。第2のLRU情報129を2項関係方式によりエンコードすると、3ビットになる。したがって、LRU情報121〜123、129の合計は、6+6+6+3=21ビットになり、図15のシステムのビット数より少なくなる。第1のLRU情報121〜123の情報メモリは、各キャッシュ111〜113のローカルなLRU情報に、他コアキャッシュグループが1ウェイ増えたとみて、各キャッシュ毎に第1のLRU情報121〜123を保持する。
The
図3は、本発明の実施形態による共有分散キャッシュシステムの他の構成例を示す図である。以下、図3が図1と異なる点を説明する。この共有分散キャッシュシステムは、6個のコア101〜106、6個のコア101〜106に一対一に対応する6個の1次キャッシュ111〜116、キャッシュ111〜116に接続されるキャッシュ間接続コントローラ(ICC)120、及びメインメモリ(又は2次キャッシュ)130を含む。キャッシュ111〜114及び116は3ウェイであり、キャッシュ115は2ウェイである。コア101〜106はそれぞれ、自コアキャッシュ111〜116を上位階層キャッシュとしてアクセス可能である。この共有分散キャッシュシステムでは、さらに、他コアキャッシュを下位階層キャッシュとしてアクセス可能なように構成される。すなわち、例えばコア101から見たときに、キャッシュ111を上位階層キャッシュとしてアクセス可能であるとともに、さらに他コアキャッシュ112及び113のグループx、他コアキャッシュ114及び115のグループy、他コアキャッシュ116のグループzを下位階層キャッシュとしてアクセス可能なように構成される。
FIG. 3 is a diagram showing another configuration example of the shared distributed cache system according to the embodiment of the present invention. Hereinafter, the points of FIG. 3 different from FIG. 1 will be described. The shared distributed cache system includes six
キャッシュ間接続コントローラ120は、第1のLRU情報121〜126及び第2のLRU情報129を記憶する情報メモリを有する。第1のLRU情報121は、キャッシュ111のエントリa,b,c、他コアキャッシュ112及び113のグループx、他コアキャッシュ114及び115のグループy、他コアキャッシュ116グループzの最古順を示し、「0」が最古、「5」が最新を示す。すなわち、第1のLRU情報121は、自己のキャッシュ111の3個のエントリa,b,cに、n個(=3個)の他コアキャッシュグループx,y,zを追加したLRU情報である。
The
図4は、図3の第1のLRU情報121〜126及び第2のLRU情報129の詳細を示す図である。第1のLRU情報122は、第1のLRU情報121と同様に、キャッシュ112のエントリa,b,c、n個(=3個)の他コアキャッシュ111及び113のグループx、他コアキャッシュ114及び115のグループy、他コアキャッシュ116のグループzの最古順を示す。第1のLRU情報123は、キャッシュ113のエントリa,b,c、n個(=3個)の他コアキャッシュ111及び112のグループx、他コアキャッシュ114及び115のグループy、他コアキャッシュ116のグループzの最古順を示す。第1のLRU情報124は、キャッシュ114のエントリa,b,c、n個(=2個)の他コアキャッシュ111及び112のグループx、他コアキャッシュ113、115及び116のグループyの最古順を示す。第1のLRU情報125は、キャッシュ115の2個のエントリa,b、n個(=3個)の他コアキャッシュ111及び112のグループx、他コアキャッシュ113及び114のグループy、他コアキャッシュ116のグループzの最古順を示す。第1のLRU情報126は、キャッシュ116のエントリa,b,c、n個(=3個)の他コアキャッシュ111及び112のグループx、他コアキャッシュ113及び114のグループy、他コアキャッシュ115のグループzの最古順を示す。グループの組み合わせは、任意に決めることができる。
FIG. 4 is a diagram showing details of the
第1のLRU情報121〜123,126を2項関係方式によりエンコードすると、それぞれ15ビットになる。第1のLRU情報124は、2個の他コアキャッシュグループx及びyの情報を有するので、2項関係方式によりエンコードすると10ビットになる。第1のLRU情報125は、キャッシュ115の2個のエントリa及びbの情報を有するので、2項関係方式によりエンコードすると10ビットになる。
When the
コア101はコアAであり、キャッシュ111はキャッシュAである。コア102はコアBであり、キャッシュ112はキャッシュBである。コア103はコアCであり、キャッシュ113はキャッシュCである。コア104はコアDであり、キャッシュ114はキャッシュDである。コア105はコアEであり、キャッシュ115はキャッシュEである。コア106はコアFであり、キャッシュ116はキャッシュFである。
The
第2のLRU情報129は、6個のコア101〜106間での自己のキャッシュ111〜116に対する使用古さ順を示し、AがキャッシュA(111)のLRU情報、BがキャッシュB(112)のLRU情報、CがキャッシュC(113)のLRU情報、DがキャッシュD(114)のLRU情報、EがキャッシュE(115)のLRU情報、FがキャッシュF(116)のLRU情報である。第2のLRU情報129を2項関係方式によりエンコードすると、15ビットになる。したがって、LRU情報121〜126、129の合計は、15+15+15+10+10+15+15=95ビットになり、コア数が多いときにはビット数を少なくできる効果が大きい。
The
図5は、本実施形態による共有分散キャッシュシステムにおけるデータロードアクセス動作を示すフローチャートである。以下、図1のシステムを例に説明する。ステップS1において、まず、複数のコア101〜103の何れか1つのコアが、自己に直接に接続されたキャッシュ(自コアキャッシュ)へロード要求を発行する。
FIG. 5 is a flowchart showing a data load access operation in the shared distributed cache system according to the present embodiment. Hereinafter, the system of FIG. 1 will be described as an example. In step S1, first, any one of the plurality of
ステップS2において、ロード要求を受け取ったキャッシュは、要求対象のデータがキャッシュ内に存在するか否か、すなわちキャッシュヒットであるか否かを判定する。キャッシュヒットである場合には、ステップS3において、自コアキャッシュから要求対象のデータを読み出して、ロード要求を発行したコアにデータを返送する。 In step S2, the cache that has received the load request determines whether or not the requested data exists in the cache, that is, whether or not it is a cache hit. If it is a cache hit, in step S3, the requested data is read from the own core cache, and the data is returned to the core that issued the load request.
ステップS2においてキャッシュミスである場合には、ステップS4に進む。このステップS4において、キャッシュミスが検出されたキャッシュの下に、下位階層キャッシュが存在するか否かを判定する。例えばステップS2においてキャッシュミスが検出されてステップS4に進んだ場合には、キャッシュミスが検出されたキャッシュはキャッシュ111〜113の何れか1つであるので、この場合、他の2つのキャッシュが下位階層キャッシュとして存在する。下位階層キャッシュが存在する場合には、ステップS5に進む。
If there is a cache miss in step S2, the process proceeds to step S4. In step S4, it is determined whether or not a lower hierarchy cache exists under the cache in which a cache miss is detected. For example, when a cache miss is detected in step S2 and the process proceeds to step S4, the cache in which the cache miss is detected is any one of the
ステップS5において、キャッシュ階層が1つ下の他コアキャッシュにアクセスする。ステップS6において、アクセス要求を受け取ったキャッシュは、要求対象のデータがキャッシュ内に存在するか否か、すなわちキャッシュヒットであるか否かを判定する。キャッシュミスである場合には、ステップS4に戻り、上記の処理を繰り返す。 In step S5, the cache hierarchy accesses the other core cache one level below. In step S6, the cache that has received the access request determines whether or not the requested data exists in the cache, that is, whether or not it is a cache hit. If it is a cache miss, the process returns to step S4 and the above processing is repeated.
ステップS6においてキャッシュヒットである場合には、ステップS7に進む。このステップS7において、キャッシュデータの交換処理を行う。すなわち、キャッシュヒットしたキャッシュからアクセス対象のキャッシュライン(アクセス対象のデータ)を自コアキャッシュに移動し、コアへデータを返送する。この際に、キャッシュラインの自コアキャッシュへの移動に伴い、自コアキャッシュから追い出されるキャッシュラインを他コアに移動する。ステップS7の詳細は、後に図6を参照しながら説明する。 If it is a cache hit in step S6, the process proceeds to step S7. In step S7, cache data exchange processing is performed. That is, the cache line to be accessed (data to be accessed) is moved from the cache hit to the own core cache, and the data is returned to the core. At this time, as the cache line moves to the own core cache, the cache line evicted from the own core cache is moved to another core. Details of step S7 will be described later with reference to FIG.
またステップS4において、下位階層キャッシュが存在しないと判定された場合には、ステップS8に進む。例えばステップS6においてキャッシュミスが検出されてステップS4に進んだ際に、このキャッシュミスが検出されたキャッシュが既に最下層のキャッシュであった場合、その下層にはメインメモリ130しか存在しない。このような場合には、ステップS8で、メインメモリ130から要求対象のデータを読み出し、自コアキャッシュにアロケート(1キャッシュライン分の要求対象のデータを自コアキャッシュにコピー)するとともに、ロード要求を発行したコアにデータを返送する。またこの動作に伴い自コアキャッシュから追い出されたキャッシュラインは、例えば下位階層キャッシュに移動される。ステップS8の詳細は、後に図10を参照しながら説明する。
If it is determined in step S4 that there is no lower hierarchy cache, the process proceeds to step S8. For example, when a cache miss is detected in step S6 and the process proceeds to step S4, if the cache in which this cache miss is detected is already the lowermost cache, only the
上記の動作フローにおいて、ステップS7はキャッシュとキャッシュとの間のデータ転送に関連する動作であり、ステップS8はメインメモリ130とキャッシュとの間のデータ転送に関連する動作である。
In the above operation flow, step S7 is an operation related to data transfer between the cache and the cache, and step S8 is an operation related to data transfer between the
図6は、図5のステップS7の交換処理を示すフローチャートである。まず、ステップA1では、図5のステップS6の判断により、下位階層キャッシュとして利用可能な他コアキャッシュにヒットしたと判断される。 FIG. 6 is a flowchart showing the exchange process in step S7 of FIG. First, in step A1, it is determined that another core cache that can be used as a lower hierarchy cache has been hit by the determination in step S6 of FIG.
次に、ステップA2では、キャッシュ間接続コントローラ120は判定処理を行う。すなわち、ヒットした他コアキャッシュが所属するグループの自コアローカルの第1のLRU情報が最新であり、かつ、ヒットした他コアキャッシュの第1のLRU情報のエントリが最新でないことの条件を満たすか否かを判定する。条件を満たす場合にはステップA4に進み、条件を満たさない場合にはステップA7に進む。
Next, in step A2, the
ステップA4では、キャッシュ間接続コントローラ120は自コアキャッシュ及び他コアキャッシュ間で交換処理を行う。すなわち、自コアキャッシュの最古エントリと他コアキャッシュのヒットしたエントリを交換する。
In step A4, the
次に、ステップA5では、キャッシュ間接続コントローラ120はLRU更新処理を行う。すなわち、自コアの第1のLRU情報については自コアキャッシュの交換されたエントリを最新に更新し、他コアの第1のLRU情報については他コアキャッシュの交換されたエントリを最古に更新し、第2のLRU情報については自コアキャッシュが最新となるように更新する。その後、ステップA6に進み、処理を終了する。
Next, in step A5, the
ステップA7では、自コアはキャッシュ間接続コントローラ120を介して参照処理を行う。すなわち、他コアキャッシュのヒットしたエントリを直接参照する(読み出す)。
In step A7, the self-core performs a reference process via the
次に、ステップA3では、キャッシュ間接続コントローラ120はLRU更新処理を行う。すなわち、自コアの第1のLRU情報についてはヒットした他コアキャッシュが所属するグループを最新に更新し、他コアの第1のLRU情報についてはヒットした他コアキャッシュのエントリが最新であれば2番目に新しいものと交換するように更新し、第2のLRU情報についてはヒットした他コアキャッシュが最新となるように更新する。その後、ステップA6に進み、処理を終了する。
Next, in step A3, the
図7〜図9は、図1及び図2のシステムにおける図6の交換処理の例を示す図である。図7は、初期状態を示す。第1のLRU情報121〜123及び第2のLRU情報129は、0が最古であり、値が大きくなるほど新しいことを示す。
7 to 9 are diagrams illustrating an example of the exchange process of FIG. 6 in the system of FIGS. 1 and 2. FIG. 7 shows an initial state. The
まず、ステップA1において、自コアA(101)から他コアB(102)のキャッシュB(112)のエントリcにヒットした場合を説明する。 First, the case where the entry c of the cache B (112) of the other core B (102) is hit from the own core A (101) in step A1 will be described.
次に、ステップA2では、ヒットした他コアキャッシュB(112)が所属するグループxの自コアローカルの第1のLRU情報121が1であり、最新でないので、ステップA7に進む。ステップA7では、他コアキャッシュB(112)のヒットしたエントリcを直接参照する。
Next, in step A2, the
次に、ステップA3では、図8に示すように、自コアA(101)の第1のLRU情報121についてはヒットした他コアキャッシュB(112)が所属するグループxを最新(値「3」)に更新し、他コアB(102)の第1のLRU情報122についてはヒットした他コアキャッシュB(112)のエントリcが最新(図7の値「3」)であるので、2番目に新しいエントリxと交換するように更新し、第2のLRU情報129についてはヒットした他コアキャッシュB(112)が最新となるように更新する。その後、ステップA6に進み、処理を終了する。
Next, in step A3, as shown in FIG. 8, for the
次に、ステップA1において、再度、自コアA(101)から他コアB(102)のキャッシュB(112)のエントリcにヒットした場合を説明する。 Next, the case where the entry c of the cache B (112) of the other core B (102) is hit again from the own core A (101) in step A1 will be described.
次に、ステップA2では、ヒットした他コアキャッシュB(112)が所属するグループxの自コアローカルの第1のLRU情報121が最新(値「3」)であり、かつ、ヒットした他コアキャッシュB(112)の第1のLRU情報122のエントリcが最新でない(値「2」)ので、ステップA4に進む。ステップA4では、自コアキャッシュA(111)の最古エントリbと他コアキャッシュB(112)のヒットしたエントリcを交換する。
Next, in Step A2, the
次に、ステップA5では、図9に示すように、自コアA(101)の第1のLRU情報121については自コアキャッシュA(111)の交換されたエントリbを最新に更新し、他コアB(102)の第1のLRU情報122については他コアキャッシュB(112)の交換されたエントリcを最古に更新し、第2のLRU情報129については自コアキャッシュA(111)が最新となるように更新する。その後、ステップA6に進み、処理を終了する。
Next, in step A5, as shown in FIG. 9, for the
以上のように、第1回目に他コアキャッシュBのエントリcにヒットした場合には、交換処理を行わず、第2回目に他コアキャッシュBのエントリcにヒットした場合に交換処理行うことにより、無駄な交換処理をなくし、トラフィックを減少させることができる。すなわち、自コアAが連続してアクセスし、かつ、ヒットした他コアキャッシュBで現在あまり使っていないエントリcのみ交換することにより、効率的な交換処理を行うことができる。 As described above, when the entry c of the other core cache B is hit at the first time, the replacement process is not performed, and when the entry c of the other core cache B is hit at the second time, the replacement process is performed. , Useless exchange processing can be eliminated and traffic can be reduced. In other words, efficient exchange processing can be performed by exchanging only the entry c that is continuously accessed by the own core A and that is currently not frequently used in the hit other core cache B.
次に、図3及び図4のシステムを例に交換処理を説明する。上記と同様に、第1回目は交換せず、第2回目は交換する場合の動作例を示す。 Next, the exchange process will be described by taking the system of FIGS. 3 and 4 as an example. Similarly to the above, an example of operation when the first time is not exchanged and the second time is exchanged is shown.
以下に、初期の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: bxaczy
コアBの第1のLRU情報122: abxzyc
コアCの第1のLRU情報123: bxczya
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: CBFADE
The initial first and second LRU information is shown below. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: bxaczy
Core B first LRU information 122: abxzyc
Core C first LRU information 123: bxczya
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: CBFADE
まず、ステップA1では、コアAからコアBのキャッシュBのエントリcにヒットする。
ステップA2では、キャッシュAのエントリxが最新でないため交換しない。
ステップA7では、直接参照する。
ステップA3では、LRU更新処理により、キャッシュAのエントリxを最新に、キャッシュBのエントリcを2番目に各々のコアA,コアBに対応する第1のLRU情報を更新し、キャッシュBが最新となるように第2のLRU情報129を更新する。
ステップA6で終了する。
First, in step A1, an entry c in the cache B of the core B is hit from the core A.
In step A2, since the entry x of the cache A is not the latest, it is not exchanged.
In step A7, direct reference is made.
In step A3, the entry x of the cache A is updated to the latest, the entry c of the cache B is updated second to the first LRU information corresponding to each of the cores A and B, and the cache B is updated. The
The process ends at step A6.
以下に、更新後の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: baczyx
コアBの第1のLRU情報122: abxzcy
コアCの第1のLRU情報123: bxczya
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: CFADEB
Below, the 1st and 2nd LRU information after an update is shown. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: baczyx
Core B first LRU information 122: abxzcy
Core C first LRU information 123: bxczya
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: CFADEB
次に、ステップA1では、再度、コアAからコアBのキャッシュBのエントリcにヒットする。
ステップA2では、キャッシュAのエントリxが最新であり、かつ、キャッシュBのエントリcが最新でないため交換する。
ステップA4では、キャッシュAのエントリbとキャッシュBのエントリcを交換する。
ステップA5では、LRU更新処理により、キャッシュAのエントリbを最新に、キャッシュBのエントリcを最古に各々のコアA,コアBに対応する第1のLRU情報を更新し、キャッシュAが最新となるように第2のLRU情報129を更新する。
ステップA6で終了する。
Next, in step A1, the entry c of the cache B of the core B is hit again from the core A.
In step A2, since the entry x of the cache A is the latest and the entry c of the cache B is not the latest, they are exchanged.
In step A4, the entry b in the cache A and the entry c in the cache B are exchanged.
In step A5, the first LRU information corresponding to each of core A and core B is updated with the latest entry b of cache A and the oldest entry c of cache B by the LRU update process, and cache A is the latest. The
The process ends at step A6.
以下に、更新後の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: aczyxb
コアBの第1のLRU情報122: cabxzy
コアCの第1のLRU情報123: bxczya
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: CFDEBA
Below, the 1st and 2nd LRU information after an update is shown. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: aczyxb
Core B first LRU information 122: cabxzy
Core C first LRU information 123: bxczya
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: CFDEBA
以上のように、他コアキャッシュにヒットした場合の交換動作判定は、そのヒットエントリが自コアで頻繁に使われて、かつ、そのエントリを有している他コアが時間的に同時期に頻繁にアクセスしないという条件を満たすときに、交換処理を行うと判定する。 As described above, when the other core cache is hit, the replacement operation determination is that the hit entry is frequently used by the own core, and the other core having the entry is frequently used at the same time in time. When the condition that no access is made is satisfied, it is determined that the exchange process is performed.
図10は、図5のステップS8の追い出し処理を示すフローチャートである。まず、ステップB1では、図5のステップS4の判断により、下位階層キャッシュとして利用可能な他コアキャッシュに全てミスしたと判断される。 FIG. 10 is a flowchart showing the eviction process in step S8 of FIG. First, in step B1, it is determined that all other core caches that can be used as the lower hierarchy cache have missed by the determination in step S4 of FIG.
次に、ステップB2では、キャッシュ間接続コントローラ120は判定処理を行う。すなわち、第2のLRU情報を参照し、自コアが最近そのインデックスのエントリを最も使っていないコアでないことの条件を満たすか否かを判定する。条件を満たす場合にはステップB4に進み、条件を満たさない場合にはステップB7に進む。
Next, in step B2, the
ステップB4では、キャッシュ間接続コントローラ120は自コアキャッシュから他コアキャッシュへ追い出し処理を行う。すなわち、最近最も使われていない他コアキャッシュの最古エントリに自コアキャッシュの最古エントリ(他コアグループ用エントリを含まないものの中で最古エントリ)を移動する。
In step B4, the
次に、ステップB5では、キャッシュ間接続コントローラ120はLRU更新処理を行う。すなわち、自コアの第1のLRU情報については自コアキャッシュの最古エントリを最新に更新し、他コアの第1のLRU情報については追い出し先の他コアキャッシュの最古エントリを最新に更新し、第2のLRU情報については自コアキャッシュが最新に、追い出し先の他コアキャッシュを2番目に新しいものとなるように更新する。その後、ステップB6に進む。
Next, in step B5, the
ステップB7では、キャッシュ間接続コントローラ120は破棄処理を行う。すなわち、自コアキャッシュの最古エントリを破棄する。具体的には、このステップでは何も処理せず、後のステップB6の上書き処理により自コアキャッシュの最古エントリが破棄される。
In step B7, the
次に、ステップB3では、キャッシュ間接続コントローラ120はLRU更新処理を行う。すなわち、自コアの第1のLRU情報については自コアキャッシュの最古エントリを最新に更新し、第2のLRU情報については自コアキャッシュが最新になるように更新する。その後、ステップB6に進む。
Next, in step B3, the
ステップB6では、キャッシュ間接続コントローラ120は、自コアキャッシュの最古エントリ(LRU情報更新後の最新エントリ)にメインメモリ130から読み出したデータを上書きし、自コアはそのデータを取得する。以上で、処理を終了する。
In step B6, the
図11〜図13は、図1及び図2のシステムにおける図10の追い出し処理の例を示す図である。図11は、初期状態を示す。第1のLRU情報121〜123及び第2のLRU情報129は、0が最古であり、値が大きくなるほど新しいことを示す。
11 to 13 are diagrams illustrating an example of the eviction process of FIG. 10 in the system of FIGS. 1 and 2. FIG. 11 shows an initial state. The
まず、ステップB1において、自コアA(101)のアクセスが全ての他コアキャッシュでミスした場合を説明する。 First, in step B1, the case where the access of the own core A (101) misses in all other core caches will be described.
次に、ステップB2では、第2のLRU情報129を参照すると、自コアキャッシュA(111)が最近最も使っていないので、ステップB7を介してステップB3に進む。
Next, in step B2, when referring to the
ステップB3では、図12に示すように、自コアA(101)の第1のLRU情報121については自コアキャッシュA(111)の最古エントリbを最新に更新し、第2のLRU情報129については自コアキャッシュAが最新になるように更新する。
In step B3, as shown in FIG. 12, for the
次に、ステップB6では、自コアキャッシュA(111)の最古エントリ(LRU情報更新後の最新エントリ)bにメインメモリ130から読み出したデータを上書きする。以上で処理を終了する。
Next, in step B6, the data read from the
次に、ステップB1において、再度、自コアA(101)のアクセスが全ての他コアキャッシュでミスした場合を説明する。 Next, the case where the access of the own core A (101) misses in all other core caches again in step B1 will be described.
次に、ステップB2では、第2のLRU情報129を参照すると、他コアキャッシュC(113)が最近最も使っていないので、ステップB4に進む。
Next, in step B2, referring to the
ステップB4では、最近最も使われていない他コアキャッシュC(113)の最古エントリbに自コアキャッシュA(111)の最古エントリ(他コアグループ用エントリを含まないものの中で最古エントリ)aを移動する。 In step B4, the oldest entry b of the own core cache A (111) is included in the oldest entry b of the other core cache C (113) that has not been used most recently (the oldest entry among those not including the other core group entry). Move a.
次に、ステップB5では、図13に示すように、自コアA(101)の第1のLRU情報121については自コアキャッシュA(111)の最古エントリaを最新に更新し、他コアC(103)の第1のLRU情報123については追い出し先の他コアキャッシュC(113)の最古エントリbを最新に更新し、第2のLRU情報129については自コアキャッシュA(111)が最新に、追い出し先の他コアキャッシュC(113)を2番目に新しいものとなるように更新する。
Next, in step B5, as shown in FIG. 13, for the
次に、ステップB6では、自コアキャッシュA(111)の最古エントリ(LRU情報更新後の最新エントリ)aにメインメモリ130から読み出したデータを上書きする。以上で処理を終了する。
Next, in step B6, the data read from the
以上のように、第1回目に全ての他コアキャッシュでミスした場合には、追い出し処理を行わず、第2回目に全ての他コアキャッシュでミスした場合に追い出し処理行うことにより、無駄な追い出し処理をなくし、トラフィックを減少させることができる。すなわち、自コアAが連続してキャッシュミスし、かつ、他コアキャッシュが最古であるときのみ追い出し処理することにより、効率的な追い出し処理を行うことができる。 As described above, if all other core caches miss in the first time, the eviction process is not performed, and if the other core cache misses in the second time, the eviction process is performed, so that unnecessary eviction is performed. Processing can be eliminated and traffic can be reduced. In other words, efficient eviction processing can be performed by performing eviction processing only when the own core A continuously misses the cache and the other core cache is the oldest.
次に、図3及び図4のシステムを例に追い出し処理を説明する。上記と同様に、第1回目は追い出しせず、第2回目は追い出しする場合の動作例を示す。 Next, the eviction process will be described using the system of FIGS. 3 and 4 as an example. In the same manner as described above, an operation example in the case where the first time is not driven and the second time is driven is shown.
以下に、初期の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: bxaczy
コアBの第1のLRU情報122: abxzyc
コアCの第1のLRU情報123: bxczya
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: ACBFDE
The initial first and second LRU information is shown below. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: bxaczy
Core B first LRU information 122: abxzyc
Core C first LRU information 123: bxczya
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: ACBFDE
まず、ステップB1では、コアAのアクセスが全ての他コアキャッシュでミスする。
ステップB2では、第2のLRU情報129から、自コアAが最近最もアクセスしていないため追い出ししない。
ステップB3では、LRU更新処理により、キャッシュAのエントリbを最新に、コアAに対応する第1のLRU情報を更新し、キャッシュAが最新となるように第2のLRU情報129を更新する。
ステップB6では、キャッシュAのエントリbに上書きする。
First, in step B1, the access of core A misses in all other core caches.
In step B2, since the own core A has not been accessed most recently from the
In step B3, the entry B of the cache A is updated to the latest, the first LRU information corresponding to the core A is updated by the LRU update process, and the
In step B6, the entry b in the cache A is overwritten.
以下に、更新後の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: xaczyb
コアBの第1のLRU情報122: abxzyc
コアCの第1のLRU情報123: bxczya
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: CBFDEA
Below, the 1st and 2nd LRU information after an update is shown. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: xaczyb
Core B first LRU information 122: abxzyc
Core C first LRU information 123: bxczya
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: CBFDEA
次に、ステップB1では、再度、コアAのアクセスが全ての他コアキャッシュでミスする。
ステップB2では、第2のLRU情報129から、他コアが最近最もアクセスしていないため追い出しが発生する。
ステップB4では、キャッシュAのエントリbとキャッシュCのエントリbを交換する。
ステップB5では、LRU更新処理により、キャッシュAのエントリbを最新に、キャッシュCのエントリbを最新に各々のコアA,コアCに対応する第1のLRU情報を更新し、キャッシュAが最新に、キャッシュCが2番目に最新になるように第2のLRU情報129を更新する。
ステップB6では、キャッシュAのエントリbに上書きする。
Next, in step B1, the access of core A misses again in all other core caches.
In step B2, eviction occurs from the
In step B4, the entry b of the cache A and the entry b of the cache C are exchanged.
In step B5, the LRU update process updates the entry b of the cache A to the latest, updates the entry b of the cache C to the latest, and updates the first LRU information corresponding to each of the cores A and C. The
In step B6, the entry b in the cache A is overwritten.
以下に、更新後の第1及び第2のLRU情報を示す。第1及び第2のLRU情報は、古→新の順にエントリを示す。
コアAの第1のLRU情報121: xaczyb
コアBの第1のLRU情報122: cabxzy
コアCの第1のLRU情報123: xczyab
コアDの第1のLRU情報124: abcxy
コアEの第1のLRU情報125: abxyz
コアFの第1のLRU情報126: abcxyz
第2のLRU情報129: BFDECA
Below, the 1st and 2nd LRU information after an update is shown. The first and second LRU information indicate entries in the order of old → new.
Core A first LRU information 121: xaczyb
Core B first LRU information 122: cabxzy
Core C first LRU information 123: xczyab
Core D first LRU information 124: abcxy
Core E first LRU information 125: abxyz
Core F first LRU information 126: abcxyz
Second LRU information 129: BFDECA
以上のように、追い出し動作判定は、第2のLRU情報129で最古のコアに追い出す。本実施形態では、第2のLRU情報129は最新のアクセスのみしか保持していないが、完全な最古順を保持しても構わない。最新のアクセスのみしか保持しない理由は、ビット数削減のためである。また、第2のLRU情報129の更新時に追い出し先コアを2番目に新しいものに更新して、追い出し先を持ち回りすることで、完全な最古順を保持した場合に比べた性能低下を抑えられる。
As described above, in the eviction operation determination, the
図14のシステムのキャッシュライン交換トラフィックの発生確率は、(全キャッシュのウェイ数−1)/(全キャッシュのウェイ数)である。例えば、3ウェイ4コアの場合には11/12となる。自コアが頻繁にアクセスしないエントリでも、最新でない限り交換してしまうため、交換トラフィックが大きい。 The occurrence probability of the cache line exchange traffic in the system of FIG. 14 is (the number of ways of all caches−1) / (the number of ways of all caches). For example, in the case of a 3-way 4-core, it is 11/12. Even if an entry that the core does not access frequently is exchanged unless it is the latest, the exchange traffic is large.
これに対し、本実施形態のシステムのキャッシュライン交換トラフィックの発生確率は、(1/(全キャッシュのウェイ数+n))×((キャッシュのウェイ数)/(キャッシュのウェイ数+n))である。例えば、3ウェイ4コア、n=1の場合には(1/4)×(3/4)=3/16となる。自コアが連続してアクセスし、かつ、ヒットした他コアキャッシュで現在あまり使っていないエントリのみ交換するので、交換トラフィックが小さくなる。 In contrast, the probability of occurrence of cache line exchange traffic in the system of the present embodiment is (1 / (the number of ways of all caches + n)) × ((the number of ways of caches) / (the number of ways of caches + n)). . For example, in the case of 3 ways, 4 cores and n = 1, (1/4) × (3/4) = 3/16. Since only the entries that are continuously accessed by the own core and that are not currently used in the hit other core cache are exchanged, the exchange traffic is reduced.
また、図15のシステムのLRU情報は、(第1のLRU情報)+(第2のLRU情報)により、以下のビット数となる。
3ウェイ4コア: 3×4+2×12=36ビット
4ウェイ4コア: 6×4+2×16=56ビット
3ウェイ8コア: 3×8+2×24=106ビット
4ウェイ8コア: 6×8+3×32=144ビット
Further, the LRU information in the system of FIG. 15 has the following number of bits according to (first LRU information) + (second LRU information).
3-way 4-core: 3 × 4 + 2 × 12 = 36 bits 4-way 4-core: 6 × 4 + 2 × 16 = 56 bits 3-way 8-core: 3 × 8 + 2 × 24 = 106 bits 4-way 8-core: 6 × 8 + 3 × 32 = 144 bits
これに対し、本実施形態のLRU情報は、(第1のLRU情報)+(第2のLRU情報)により、以下のビット数となる。
3ウェイ4コア: 6×4+6=30ビット
4ウェイ4コア: 10×4+6=46ビット
3ウェイ8コア: 6×8+28=76ビット
4ウェイ8コア: 10×8+28=108ビット
On the other hand, the LRU information of the present embodiment has the following number of bits according to (first LRU information) + (second LRU information).
3-way 4-core: 6 × 4 + 6 = 30 bits 4-way 4-core: 10 × 4 + 6 = 46 bits 3-way 8-core: 6 × 8 + 28 = 76 bits 4-way 8-core: 10 × 8 + 28 = 108 bits
本実施形態は、LRU情報のビット数を少なくすることができる。特に、コア数又はウェイ数が多くなった場合にビット数の減少効果が大きい。 In the present embodiment, the number of bits of LRU information can be reduced. In particular, when the number of cores or the number of ways increases, the effect of reducing the number of bits is large.
以上のように、本実施形態のキャッシュシステムは、例えば図1に示すように、複数の処理装置(コア)101〜103と、前記複数の処理装置101〜103に一対一に接続された複数のキャッシュ111〜113と、前記複数のキャッシュ111〜113に接続され、前記複数のキャッシュ111〜113間のデータ転送を制御するコントローラ120と、前記処理装置毎に自己のキャッシュ内のエントリ及び他のキャッシュの使用古さ順を示す第1の情報121〜123を記憶する情報メモリとを有する。
As described above, the cache system according to the present embodiment includes, for example, a plurality of processing devices (cores) 101 to 103 and a plurality of
例えば図6〜図9に示すように、前記コントローラ120は、前記処理装置101が要求したデータが、自己のキャッシュ111でミスし、他のキャッシュ112でヒットした場合に、前記第1の情報121を基に前記自己のキャッシュ111のエントリ及び前記ヒットした他のキャッシュ112のエントリを交換する。
For example, as shown in FIG. 6 to FIG. 9, when the data requested by the
図2に示すように、第1の情報121〜123は、前記処理装置101〜103毎に自己のキャッシュ内のエントリa,b,c及び複数の他のキャッシュがグループ化された一のエントリxの使用古さ順を示す情報である。また、図4に示すように、第1の情報121〜126は、前記処理装置101〜106毎に自己のキャッシュ内のエントリa,b,c及び複数の他のキャッシュがグループ化された複数のエントリx,y,zの使用古さ順を示す情報である。
As shown in FIG. 2, the
例えば図6〜図9に示すように、前記コントローラ120は、前記処理装置101が要求したデータが、自己のキャッシュ111でミスし、他のキャッシュ112でヒットした場合、前記複数の他のキャッシュがグループ化されたエントリxが最新であるときに、前記自己のキャッシュ111のエントリ及び前記ヒットした他のキャッシュ112のエントリを交換する。
For example, as shown in FIGS. 6 to 9, when the data requested by the
より具体的には、前記コントローラ120は、前記処理装置101が要求したデータが、自己のキャッシュ111でミスし、他のキャッシュ112でヒットした場合、前記複数の他のキャッシュがグループ化されたエントリxが最新であり、かつ前記ヒットした他のキャッシュ112のエントリcが最新でないときに、前記自己のキャッシュ111のエントリb及び前記ヒットした他のキャッシュ112のエントリcを交換する。
More specifically, when the data requested by the
前記第1の情報121〜123は、前記処理装置101が要求したデータが、自己のキャッシュ111でミスし、他のキャッシュ112でヒットした場合、前記複数の他のキャッシュがグループ化されたエントリxが最新でなく、又は前記ヒットした他のキャッシュ112のエントリcが最新であるときに、前記ヒットした他のキャッシュ112に対応する処理装置102において前記ヒットした他のキャッシュ112のエントリcが最新であるときには、そのエントリcが2番目に新しい順番に更新され、2番目に新しいエントリxが最新の順番に更新される。
The
図2に示すように、前記情報メモリは、前記複数の処理装置101〜103間での自己のキャッシュに対する使用古さ順を示す第2の情報129を記憶する。
As shown in FIG. 2, the information memory stores
例えば図10〜図13に示すように、前記コントローラ120は、前記処理装置101が要求したデータが、前記複数のキャッシュ111〜113すべてでミスした場合、前記第2の情報129を基に前記自己のキャッシュ111のエントリaを他のキャッシュ123のエントリbに移動し、主記憶装置(メインメモリ)又は前記複数のキャッシュより下位階層のキャッシュ(2次キャッシュ)130から読み出したデータを前記移動した自己のキャッシュ111のエントリaに上書きする。
For example, as shown in FIGS. 10 to 13, when the data requested by the
より具体的には、前記コントローラ120は、前記処理装置101が要求したデータが、前記複数のキャッシュ111〜113すべてでミスした場合、前記要求した処理装置101が自己のキャッシュ111を最近最も使用していない処理装置でないときに、前記自己のキャッシュ111のエントリaを他のキャッシュ113のエントリbに移動し、主記憶装置又は前記複数のキャッシュより下位階層のキャッシュ130から読み出したデータを前記移動した自己のキャッシュ111のエントリaに上書きする。
More specifically, when the data requested by the
なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、又はその主要な特徴から逸脱することなく、様々な形で実施することができる。 The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.
本発明の実施形態は、例えば以下のように種々の適用が可能である。 The embodiment of the present invention can be applied in various ways as follows, for example.
(付記1)
複数の処理装置と、
前記複数の処理装置に一対一に接続された複数のキャッシュと、
前記複数のキャッシュに接続され、前記複数のキャッシュ間のデータ転送を制御するコントローラと、
前記処理装置毎に自己のキャッシュ内のエントリ及び他のキャッシュの使用古さ順を示す第1の情報を記憶する情報メモリと
を有することを特徴とするキャッシュシステム。
(付記2)
前記コントローラは、前記処理装置が要求したデータが、自己のキャッシュでミスし、他のキャッシュでヒットした場合に、前記第1の情報を基に前記自己のキャッシュのエントリ及び前記ヒットした他のキャッシュのエントリを交換することを特徴とする付記1記載のキャッシュシステム。
(付記3)
前記第1の情報は、前記処理装置毎に自己のキャッシュ内のエントリ及び複数の他のキャッシュがグループ化された一又は複数のエントリの使用古さ順を示す情報であることを特徴とする付記1記載のキャッシュシステム。
(付記4)
前記コントローラは、前記処理装置が要求したデータが、自己のキャッシュでミスし、他のキャッシュでヒットした場合、前記複数の他のキャッシュがグループ化されたエントリが最新であるときに、前記自己のキャッシュのエントリ及び前記ヒットした他のキャッシュのエントリを交換することを特徴とする付記3記載のキャッシュシステム。
(付記5)
前記コントローラは、前記処理装置が要求したデータが、自己のキャッシュでミスし、他のキャッシュでヒットした場合、前記複数の他のキャッシュがグループ化されたエントリが最新であり、かつ前記ヒットした他のキャッシュのエントリが最新でないときに、前記自己のキャッシュのエントリ及び前記ヒットした他のキャッシュのエントリを交換することを特徴とする付記3記載のキャッシュシステム。
(付記6)
前記第1の情報は、前記処理装置が要求したデータが、自己のキャッシュでミスし、他のキャッシュでヒットした場合、前記複数の他のキャッシュがグループ化されたエントリが最新でなく、又は前記ヒットした他のキャッシュのエントリが最新であるときに、前記ヒットした他のキャッシュに対応する処理装置において前記ヒットした他のキャッシュのエントリが最新であるときには、そのエントリが2番目に新しい順番に更新され、2番目に新しいエントリが最新の順番に更新されることを特徴とする付記5記載のキャッシュシステム。
(付記7)
前記情報メモリは、前記複数の処理装置間での自己のキャッシュに対する使用古さ順を示す第2の情報を記憶することを特徴とする付記1記載のキャッシュシステム。
(付記8)
前記コントローラは、前記処理装置が要求したデータが、前記複数のキャッシュすべてでミスした場合、前記第2の情報を基に前記自己のキャッシュのエントリを他のキャッシュのエントリに移動し、主記憶装置又は前記複数のキャッシュより下位階層のキャッシュから読み出したデータを前記移動した自己のキャッシュのエントリに上書きすることを特徴とする付記7記載のキャッシュシステム。
(付記9)
前記コントローラは、前記処理装置が要求したデータが、前記複数のキャッシュすべてでミスした場合、前記要求した処理装置が自己のキャッシュを最近最も使用していない処理装置でないときに、前記自己のキャッシュのエントリを他のキャッシュのエントリに移動し、主記憶装置又は前記複数のキャッシュより下位階層のキャッシュから読み出したデータを前記移動した自己のキャッシュのエントリに上書きすることを特徴とする付記8記載のキャッシュシステム。
(Appendix 1)
A plurality of processing devices;
A plurality of caches connected one-to-one to the plurality of processing devices;
A controller connected to the plurality of caches for controlling data transfer between the plurality of caches;
A cache system comprising: an information memory for storing an entry in its own cache and first information indicating the order of use of other caches for each processing device.
(Appendix 2)
The controller, when the data requested by the processing device misses in its own cache and hits in another cache, based on the first information, the entry in the own cache and the other cache hit The cache system according to
(Appendix 3)
The first information is information indicating an order of use of one or a plurality of entries in which an entry in its own cache and a plurality of other caches are grouped for each processing device. 1. The cache system according to 1.
(Appendix 4)
When the data requested by the processing unit misses in its own cache and hits in another cache, when the entry into which the plurality of other caches are grouped is the latest, the controller 4. The cache system according to
(Appendix 5)
When the data requested by the processing device misses in its own cache and hits in another cache, the controller has the latest entry in which the other caches are grouped, and the other hit 4. The cache system according to
(Appendix 6)
In the first information, when the data requested by the processing device misses in its own cache and hits in another cache, an entry in which the plurality of other caches are grouped is not the latest, or When the entry of the other hit cache is the latest, when the entry of the other hit cache is the latest in the processing device corresponding to the other hit cache, the entry is updated in the second newest order. The cache system according to
(Appendix 7)
2. The cache system according to
(Appendix 8)
When the data requested by the processing device misses in all of the plurality of caches, the controller moves the cache entry to another cache entry based on the second information, and the main storage device Alternatively, the cache system according to appendix 7, wherein data read from a cache lower than the plurality of caches is overwritten on the entry of the moved own cache.
(Appendix 9)
The controller, when the data requested by the processing device misses in all of the plurality of caches, when the requested processing device is not the processing device that has not used the cache most recently, The cache according to appendix 8, wherein the entry is moved to an entry in another cache, and the data read from the main storage device or a cache in a lower hierarchy than the plurality of caches is overwritten on the moved cache entry. system.
101〜103 コア(処理装置)
111〜113 キャッシュ
120 キャッシュ間接続コントローラ
121〜123 第1のLRU情報
129 第2のLRU情報
130 メインメモリ
101-103 core (processing equipment)
111 to 113
Claims (5)
前記複数の処理装置に一対一に接続された複数のキャッシュと、
前記複数のキャッシュに接続され、前記複数のキャッシュ間のデータ転送を制御するコントローラと、
前記処理装置毎に自己のキャッシュ内のエントリ及び他のキャッシュの使用古さ順を示す第1の情報を記憶する情報メモリと
を有することを特徴とするキャッシュシステム。 A plurality of processing devices;
A plurality of caches connected one-to-one to the plurality of processing devices;
A controller connected to the plurality of caches for controlling data transfer between the plurality of caches;
A cache system comprising: an information memory for storing an entry in its own cache and first information indicating the order of use of other caches for each processing device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007246192A JP5045334B2 (en) | 2007-09-21 | 2007-09-21 | Cash system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007246192A JP5045334B2 (en) | 2007-09-21 | 2007-09-21 | Cash system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009075978A JP2009075978A (en) | 2009-04-09 |
JP5045334B2 true JP5045334B2 (en) | 2012-10-10 |
Family
ID=40610860
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007246192A Expired - Fee Related JP5045334B2 (en) | 2007-09-21 | 2007-09-21 | Cash system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5045334B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6094303B2 (en) * | 2013-03-25 | 2017-03-15 | 富士通株式会社 | Arithmetic processing apparatus, information processing apparatus, and control method for information processing apparatus |
-
2007
- 2007-09-21 JP JP2007246192A patent/JP5045334B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2009075978A (en) | 2009-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7711902B2 (en) | Area effective cache with pseudo associative memory | |
US7552286B2 (en) | Performance of a cache by detecting cache lines that have been reused | |
US8745334B2 (en) | Sectored cache replacement algorithm for reducing memory writebacks | |
US7277992B2 (en) | Cache eviction technique for reducing cache eviction traffic | |
US20060155934A1 (en) | System and method for reducing unnecessary cache operations | |
KR19980079433A (en) | Method and system for implementing cache coherency mechanism for use in non-cache cache hierarchy | |
WO2010100679A1 (en) | Computer system, control method, recording medium and control program | |
US11599483B2 (en) | Dedicated cache-related block transfer in a memory system | |
JP2019517689A (en) | Replacing cache entries based on the availability of entries in other caches | |
EP1980945B1 (en) | Memory access control apparatus and memory access control method | |
US7093075B2 (en) | Location-based placement algorithms for set associative cache memory | |
US7555610B2 (en) | Cache memory and control method thereof | |
US8392660B2 (en) | Cache system including a plurality of processing units | |
US8397029B2 (en) | System and method for cache coherency in a multiprocessor system | |
JP6036457B2 (en) | Arithmetic processing apparatus, information processing apparatus, and control method for information processing apparatus | |
WO2006040689A1 (en) | Implementation and management of moveable buffers in cache system | |
US10565111B2 (en) | Processor | |
JP5045334B2 (en) | Cash system | |
US9983994B2 (en) | Arithmetic processing device and method for controlling arithmetic processing device | |
US20070101064A1 (en) | Cache controller and method | |
US9053030B2 (en) | Cache memory and control method thereof with cache hit rate | |
JP5104139B2 (en) | Cash system | |
US20120102271A1 (en) | Cache memory system and cache memory control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100517 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120615 |
|
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: 20120619 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120702 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150727 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |