JP2012164209A - Cache control method, cache control device, and program for cache control - Google Patents
Cache control method, cache control device, and program for cache control Download PDFInfo
- Publication number
- JP2012164209A JP2012164209A JP2011025245A JP2011025245A JP2012164209A JP 2012164209 A JP2012164209 A JP 2012164209A JP 2011025245 A JP2011025245 A JP 2011025245A JP 2011025245 A JP2011025245 A JP 2011025245A JP 2012164209 A JP2012164209 A JP 2012164209A
- Authority
- JP
- Japan
- Prior art keywords
- area
- received data
- cache
- data
- written
- 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.)
- Withdrawn
Links
Images
Abstract
Description
本発明は、キャッシュインジェクションを利用してキャッシュメモリを制御するキャッシュ制御方法、キャッシュ制御装置およびキャッシュ制御用プログラムに関する。 The present invention relates to a cache control method, a cache control apparatus, and a cache control program for controlling a cache memory using cache injection.
まず、通信ネットワークを介してパケットを受信する際の受信処理について説明する。一般的な受信処理では、デバイスドライバがメインメモリ(以降、メモリ)上に予め用意した受信バッファ/受信キュー(Receive Queue 。以下、RQと記す。)が使用される。 First, reception processing when receiving a packet via a communication network will be described. In general reception processing, a reception buffer / reception queue (Receive Queue, hereinafter referred to as RQ) prepared in advance by the device driver on the main memory (hereinafter referred to as memory) is used.
図13は、一般的な受信処理および受信処理を行う際のRQの状態を示す説明図である。NIC(Network Interface Card)は、パケットを受信すると(図13(a)におけるステップS601)、受信したデータをDMA(Direct Memory Access)によりメモリへと転送する(ステップS602)。メモリでは、図13(b)におけるステップB1に示すように、ドライバがメモリ上に用意した受信バッファ/受信キュー(RQ)に転送されたデータが書き込まれる(ステップS603)。 FIG. 13 is an explanatory diagram illustrating a general reception process and a state of the RQ when performing the reception process. When the NIC (Network Interface Card) receives the packet (step S601 in FIG. 13A), the received data is transferred to the memory by DMA (Direct Memory Access) (step S602). In the memory, as shown in step B1 in FIG. 13B, the data transferred by the driver to the reception buffer / reception queue (RQ) prepared on the memory is written (step S603).
その後、NICがハードウェア割り込み(以下、H/W割り込みと記す。)をCPUに通知すると(ステップS604)、CPUは、受信したデータに対する処理を開始する(ステップS605)。 Thereafter, when the NIC notifies the CPU of a hardware interrupt (hereinafter referred to as H / W interrupt) (step S604), the CPU starts processing on the received data (step S605).
このとき、キャッシュメモリ(以下、キャッシュと記すこともある。)には受信データが登録されていないため、図13(b)におけるステップB2に示すように、CPUがキャッシュのデータを参照すると(ステップS606)、キャッシュミスが発生する(ステップS607)。その結果、メモリ上の受信バッファからキャッシュへデータが読み出される(ステップS608)。メモリからデータが読み出される間、CPUは、処理を中断してデータが取得されるのを待つことになる(ステップS609)。メモリから読み出されたデータがキャッシュに登録されると(ステップS610)、CPUは、そのデータを読み取り、処理を再開する(ステップS611)。以上のステップS601〜ステップS611の処理が行われ、受信処理が終了する(ステップS612)。 At this time, since the received data is not registered in the cache memory (hereinafter also referred to as a cache), as shown in Step B2 in FIG. S606), a cache miss occurs (step S607). As a result, data is read from the reception buffer on the memory to the cache (step S608). While the data is read from the memory, the CPU interrupts the process and waits for the data to be acquired (step S609). When the data read from the memory is registered in the cache (step S610), the CPU reads the data and resumes the process (step S611). The processes in steps S601 to S611 described above are performed, and the reception process ends (step S612).
次に、メモリアクセスによる遅延を解決する方法として広く用いられているプリフェッチについて説明する。プリフェッチとは、CPUがあるデータを参照する前にそのデータをメモリからキャッシュへ読み込むことにより、メモリアクセスによる遅延を解決するキャッシュ制御方法である。 Next, prefetch widely used as a method for solving a delay caused by memory access will be described. Prefetch is a cache control method for solving a delay due to memory access by reading the data from the memory into the cache before referring to the data.
次に、データの書き込みの観点からメモリアクセスによる遅延を解決するキャッシュ制御方法であるキャッシュインジェクションについて説明する。キャッシュインジェクションは、データをメモリへ書き込まず、直接キャッシュに書き込むキャッシュ制御方法である。 Next, cache injection, which is a cache control method for solving a delay due to memory access from the viewpoint of data writing, will be described. Cache injection is a cache control method for writing data directly to the cache without writing it to the memory.
非特許文献1には、キャッシュインジェクションの実装方法が記載されている。非特許文献1に記載された方法では、インジェクトするデータのアドレスをキャッシュに付属するテーブルに登録し、そのアドレスに対する書き込みをスヌープすることでキャッシュへの書き込みを行う。また、非特許文献1には、キャッシュインジェクションの対象アドレスを登録する命令にopen_window命令(opwd)を使用する方法が記載されている。 Non-Patent Document 1 describes a cache injection mounting method. In the method described in Non-Patent Document 1, the address of data to be injected is registered in a table attached to the cache, and writing to the address is performed by snooping, and writing to the cache is performed. Non-Patent Document 1 describes a method of using an open_window instruction (opwd) as an instruction for registering a cache injection target address.
また、特許文献1には、すでにキャッシュしているデータを対象としたキャッシュインジェクションの実装方法について記載されている。特許文献1に記載された方法は、キャッシュされたアドレス領域をキャッシュインジェクションの対象とするものである。キャッシュを作成することで、キャッシュインジェクションの対象を設定することが可能になる。 Further, Patent Document 1 describes a method for implementing cache injection for data that has already been cached. The method described in Patent Document 1 uses a cached address area as a target for cache injection. By creating a cache, it is possible to set the target for cache injection.
なお、Powerアーキテクチャによるキャッシュの作成方法が、非特許文献2に記載されている。非特許文献2に記載された方法では、メモリにアクセスせず、0で初期化したキャッシュを作成するData Cache Block Set to Zero(dcbz)命令によりキャッシュを作成する。
Note that Non-Patent
また、特許文献2には、ネットワークを介して外部と通信を行う情報処理装置が記載されている。特許文献2に記載された情報処理装置は、キャッシュメモリに格納されたデータを利用した後、キャッシュメモリにおける利用後のデータに対応するキャッシュラインを消去する。
特許文献3には、バッファメモリを有するパケット転送装置が記載されている。特許文献3に記載されたパケット転送装置は、パケット処理完了後にバッファ領域が不要になったときにバッファ領域を解放し、ヘッダ領域として必要な容量がバッファアレイ内の1個分の容量より大きい場合、バッファを複数個割り当てる。
特許文献4には、プロセッサ間のデータ転送方法が記載されている。特許文献4に記載されたデータ転送方法では、一連のパケット転送において、最初のパケット列の最後のパケットデータを主記憶に書き込んだ時点でCPUに受信終了割り込みがかけられる。そして、割り込み時に通知された主記憶の書き込み範囲を示すアドレス範囲情報に従って、今回主記憶に書き込まれた範囲を認識し、その部分に関してのキャッシュ処理を実行する。 Patent Document 4 describes a data transfer method between processors. In the data transfer method described in Patent Document 4, in a series of packet transfers, a reception end interrupt is applied to the CPU when the last packet data of the first packet sequence is written to the main memory. Then, according to the address range information indicating the write range of the main memory notified at the time of interruption, the range written in the main memory at this time is recognized, and the cache processing for that portion is executed.
図13(a)に示す一般的な受信処理では、メモリからキャッシュへデータの読み出し処理が行われている間はCPUでの処理が中断するため、受信処理が遅れてしまうという問題がある。 The general reception process shown in FIG. 13A has a problem that the reception process is delayed because the process in the CPU is interrupted while the process of reading data from the memory to the cache is being performed.
また、プリフェッチするためには、読み出すデータが既にメモリに存在することが前提である。すなわち、メモリ上におけるネットワークの受信バッファにデータが書き込まれ、CPUがその書き込みを検知した後(CPUが割り込みを検知した後)、CPUはプリフェッチできるようになる。 In order to perform prefetching, it is assumed that data to be read already exists in the memory. That is, after data is written to the network reception buffer on the memory and the CPU detects the writing (after the CPU detects an interrupt), the CPU can prefetch.
したがって、CPUがそのパケットを即座に参照しようとすると、プリフェッチが間に合わず、CPUの処理が中断してしまうため、遅延が発生する。具体的には、CPUが受信パケットの各種ヘッダや受信データの先頭に対してプリフェッチしようとすると、対象のパケットは、受信処理が開始された直後または比較的早い段階で参照されるため、プリフェッチが間に合わない。したがって、CPUの処理が中断してしまい、メモリアクセスによる遅延を解決できない。特に、データサイズの小さなパケットの受信処理では、プリフェッチの効果を得られないことになる。 Therefore, if the CPU tries to refer to the packet immediately, the prefetch is not in time and the processing of the CPU is interrupted, causing a delay. Specifically, when the CPU tries to prefetch various headers of the received packet or the beginning of the received data, the target packet is referred to immediately after the reception processing is started or at a relatively early stage. Not in time. Therefore, the processing of the CPU is interrupted, and the delay due to memory access cannot be solved. In particular, in the reception process of a packet having a small data size, the prefetch effect cannot be obtained.
さらに、プリフェッチする方法では、メモリアクセスは削減されない。例えば、マルチコアプロセッサが通信ネットワークを介したパケットの受信処理や、他のメモリアクセスが発生する処理を並列で行う場合、メモリアクセスが集中するとメモリアクセスのバンド幅を圧迫してしまう。その結果、処理性能が向上しない(スケールアウトしない)という問題がある。 Furthermore, memory access is not reduced by the prefetch method. For example, when a multi-core processor performs a packet reception process via a communication network and a process in which another memory access occurs in parallel, if the memory access is concentrated, the memory access bandwidth is compressed. As a result, there is a problem that the processing performance does not improve (does not scale out).
一方、キャッシュインジェクションでは、データが直接キャッシュに書き込まれることから、CPUはキャッシュのデータを読み込めばよく、メモリから読み込む必要はないため、メモリアクセスによる遅延が発生しない。この方法は、通信ネットワークを介してパケットを受信する受信処理やマルチコアによる並列処理で、メモリ上に存在しないデータをNICまたは他のコアから受け取る場合に有用である。 On the other hand, in cache injection, since data is directly written into the cache, the CPU only needs to read the data in the cache and does not need to read from the memory, so there is no delay due to memory access. This method is useful when data that does not exist in the memory is received from the NIC or another core in a reception process for receiving a packet via a communication network or parallel processing by a multi-core.
さらに、キャッシュインジェクションでは、一般的にデータをメモリに書き出さないため、メモリアクセスを削減できる。また、通信ネットワークを介したパケットの受信処理やコア間のデータ転送にキャッシュインジェクションを用いることで、メモリアクセスバンド幅が圧迫されることにより処理性能が向上しない(スケールアウトしない)という問題も解決できる。 Further, in the cache injection, since data is generally not written to the memory, memory access can be reduced. In addition, the use of cache injection for packet reception processing and data transfer between cores via a communication network can solve the problem that the processing performance does not improve (does not scale out) due to pressure on the memory access bandwidth. .
しかし、パケットの受信処理またはマルチコアによる並列処理で、単にキャッシュインジェクションを用いた場合、高負荷時において、キャッシュインジェクションによる効果を十分に得られないという問題がある。具体的には、高負荷時の場合、メモリアクセスによる処理遅延の解決や、メモリアクセスバンド幅の制限による処理性能限界の解決といった効果を十分に得られない。 However, when cache injection is simply used in packet reception processing or multi-core parallel processing, there is a problem that the effect of cache injection cannot be sufficiently obtained at high load. Specifically, in the case of a high load, it is not possible to sufficiently obtain effects such as resolution of processing delay due to memory access and resolution of processing performance limit due to memory access bandwidth limitation.
キャッシュの容量は一般的に小さいため、大量のデータがキャッシュに書き込まれる状況では、他のデータがキャッシュから追い出されることになる。すなわち、パケットの受信処理が高負荷になり、受信処理性能を超えて大量のデータがキャッシュインジェクションによりキャッシュに送られた場合、キャッシュが溢れ、CPUにより参照されるデータが処理前にキャッシュからメモリへと追い出されてしまう。 Since the capacity of the cache is generally small, in a situation where a large amount of data is written to the cache, other data is evicted from the cache. That is, when the packet reception processing becomes heavy and a large amount of data exceeding the reception processing performance is sent to the cache by cache injection, the cache overflows and the data referenced by the CPU is transferred from the cache to the memory before processing. It will be kicked out.
処理前のデータがメモリへ追い出されると、CPUが追い出されたデータを参照しようとする際、キャッシュミスが起こる。このとき、CPUは、キャッシュインジェクションを用いていない場合と同様、メモリから対象のデータを読み込むことになる。そのため、メモリアクセスによる処理遅延が発生してしまう。 If the data before processing is evicted to the memory, a cache miss occurs when the CPU tries to refer to the evicted data. At this time, the CPU reads the target data from the memory as in the case where the cache injection is not used. Therefore, a processing delay due to memory access occurs.
また、キャッシュメモリを共有するマルチコアにおいて並列処理を行っている場合でも、あるコアでの受信処理により大量のキャッシュが使用されることで、他のコアで処理しているデータがキャッシュからメモリへ追い出されると、追い出されたデータを参照するためにメモリアクセスによる遅延が発生する。これによって、全体の処理性能が低下する。 Also, even when parallel processing is performed in a multi-core sharing a cache memory, a large amount of cache is used for reception processing in one core, so that data processed in other cores is evicted from the cache to the memory. When this occurs, a delay due to memory access occurs to refer to the evicted data. This reduces the overall processing performance.
そこで、本発明は、受信したデータをキャッシュメモリに書き込んで処理を行う場合に、大量のデータを受信する状況であっても、処理性能が低下することを抑制できるキャッシュ制御方法、キャッシュ制御装置およびキャッシュ制御用プログラムを提供することを目的とする。 Therefore, the present invention provides a cache control method, a cache control device, and a cache control method capable of suppressing a decrease in processing performance even when a large amount of data is received when processing is performed by writing the received data to a cache memory. An object is to provide a cache control program.
本発明によるキャッシュ制御方法は、予め定められた量の受信データを書き込み可能な領域である書き込み領域をキャッシュメモリに設定し、書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、その処理の対象になった受信データが書き込まれた領域を削除し、受信データに対する処理ごとに、予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定することを特徴とする。 The cache control method according to the present invention sets a write area, which is an area in which a predetermined amount of received data can be written, in the cache memory, and performs processing for some or all of the received data written in the write area. Delete the area where the received data to be processed is written, and write the received data to the position where the received data to be received is written after receiving a predetermined amount of received data for each process on the received data As a possible area, an area corresponding to the deleted area is newly set.
本発明によるキャッシュ制御装置は、予め定められた量の受信データを書き込み可能な領域である書き込み領域をキャッシュメモリに設定する領域設定手段と、書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、その処理の対象になった受信データが書き込まれた領域を削除する削除手段とを備え、領域設定手段が、受信データに対する処理ごとに、予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定することを特徴とする。 The cache control device according to the present invention includes an area setting means for setting a write area, which is an area in which a predetermined amount of received data can be written, in the cache memory, and a part or all of the received data written in the write area. A deletion unit that deletes an area in which received data to be processed is written for each process, and the area setting unit receives a predetermined amount of received data for each process on the received data An area corresponding to the deleted area is newly set as an area where the received data can be written at a position where received data to be received later is written.
本発明によるキャッシュ制御用プログラムは、コンピュータに、予め定められた量の受信データを書き込み可能な領域である書き込み領域をキャッシュメモリに設定する領域設定処理、および、書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、その処理の対象になった受信データが書き込まれた領域を削除する削除処理を実行させ、領域設定処理で、受信データに対する処理ごとに、予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定させることを特徴とする。 The cache control program according to the present invention includes an area setting process for setting a write area, which is an area in which a predetermined amount of received data can be written, in a cache memory, and a part or For each process for all received data, a deletion process is executed to delete the area in which the received data to be processed is written. In the area setting process, a predetermined amount is set for each process for the received data. It is characterized in that an area corresponding to the deleted area is newly set as an area where the received data can be written at a position where received data to be received after receiving the received data is written.
本発明によれば、受信したデータをキャッシュメモリに書き込んで処理を行う場合に、大量のデータを受信する状況であっても、処理性能が低下することを抑制できる。 According to the present invention, when the received data is written in the cache memory for processing, it is possible to suppress a decrease in processing performance even when a large amount of data is received.
以下、本発明の実施形態を図面を参照して説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.
実施形態1.
図1は、本発明の第1の実施形態におけるキャッシュ制御装置の例を示すブロック図である。本実施形態におけるキャッシュ制御装置は、プロセッサ1と、NIC2と、メモリ3とを備えている。
Embodiment 1. FIG.
FIG. 1 is a block diagram showing an example of a cache control device according to the first embodiment of the present invention. The cache control device in this embodiment includes a processor 1, a
プロセッサ1は、CPU11と、キャッシュメモリ12(以下、キャッシュ12と記す。)と、メモリコントローラ13(以下、MC13と記す。)と、I/Oコントローラ15(以下、IOC15と記す。)とを含む。NIC2は、IOC15に接続され、メモリ3は、MC13に接続される。
The processor 1 includes a
プロセッサ1の内部では、CPU11がキャッシュ12に接続され、キャッシュ12、MC13およびIOC15が、内部バス14で相互に接続される。
Inside the processor 1, the
受信バッファ(図示せず)は、メモリ3上に確保され、CPU11によるアクセスまたはキャッシュインジェクションにより、受信バッファの一部がキャッシュ12に一時的に記憶される。
A reception buffer (not shown) is secured on the
図2は、本実施形態におけるCPU11の例を示すブロック図である。CPU11は、領域設定手段21と、領域削除手段22とを有する。
FIG. 2 is a block diagram illustrating an example of the
領域設定手段21は、予め定められた量の受信データを書き込み可能な領域(以下、書き込み領域と記す。)をキャッシュインジェクションの対象としてキャッシュ12に設定する。具体的には、領域設定手段21は、初期化時、受信キュー(RQ)の先頭から整数個(n個)分のパケットを書き込む領域をキャッシュインジェクションの対象としてキャッシュ12に設定する。領域設定手段21は、例えば、特許文献1および非特許文献2に記載されているように、0で初期化したキャッシュを作成することで、そのキャッシュ領域をキャッシュインジェクションの対象としてもよい。ただし、キャッシュ12上にキャッシュインジェクションの対象となる領域を設定する方法は、上記方法に限定されない。
The area setting means 21 sets an area in which a predetermined amount of received data can be written (hereinafter referred to as a write area) in the
また、領域設定手段21は、後述する領域削除手段22が書き込み領域の一部または全部を削除したあと、削除された領域に相当する量の領域をキャッシュインジェクションの対象としてキャッシュ12に新たに設定する。このとき、領域設定手段21は、予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に新たな書き込み領域を設定する。
The area setting means 21 newly sets an area corresponding to the deleted area in the
領域削除手段22は、キャッシュ12の書き込み領域に書き込まれた受信データのうち、予め定められた処理の対象になった受信データが書き込まれている領域の削除を行う。予め定められた処理として、例えば、受信パケットのヘッダを解析する処理や、パケットを破棄する処理、上位レイヤのハンドラ起動を行う処理などが挙げられる。ただし、行われる処理は、上記処理に限定されない。なお、以下の説明では、キャッシュ12でデータが書き込まれている領域の削除を行うことを、キャッシュを削除すると記すこともある。
The
IOC15は、メモリ3とキャッシュ12のいずれかを選択して受信データを書き込む。具体的には、IOC15は、キャッシュ12の書き込み領域に受信データを書き込む。一方、IOC15は、受信データをキャッシュ12に書き込めない場合に、書き込めなかった受信データをメモリ3に書き込む。
The
なお、CPU11は、キャッシュ制御装置の記憶部(図示せず)に記憶されたプログラム(キャッシュ制御用プログラム)を読み込み、そのプログラムに従って、領域設定手段21および領域削除手段22として動作してもよい。
The
次に、プロセッサ1内の動作について説明する。図3は、本実施形態におけるキャッシュ制御装置の動作例を示すフローチャートである。まず、初期化時に、領域設定手段21は、受信キュー(RQ)の先頭から整数個(n個)分のパケットが書き込まれる領域をキャッシュインジェクションの対象として設定する。以降、パケットを受信するごとに、図3に例示するステップS301〜ステップS303の処理が行われる。
Next, the operation in the processor 1 will be described. FIG. 3 is a flowchart illustrating an operation example of the cache control device according to the present embodiment. First, at the time of initialization, the
キャッシュ制御装置がパケットを受信すると、一般的なパケット処理が行われる(ステップS301)。CPU11は、例えば、Etherヘッダの宛先MACアドレスが自身のものと異なる場合にパケットを破棄してもよい。また、CPU11は、Etherヘッダのプロトコル情報に応じて上位レイヤのハンドラを起動する処理を行ってもよい。ただし、ここで行われるパケット処理は、上記内容に限定されず、他の処理が行われてもよい。
When the cache control device receives the packet, general packet processing is performed (step S301). For example, the
パケット処理の完了後、領域削除手段22は、処理を終えた対象データのキャッシュを削除する(ステップS302)。その後、領域設定手段21は、処理対象であったパケットのn個後に受信するパケット(すなわち、n個先のパケット)が書き込まれるキャッシュ12の領域をキャッシュインジェクションの対象として設定する(ステップS303)。
After completion of the packet processing, the
次に、キャッシュ制御装置全体の動作について説明する。図4は、本実施形態におけるキャッシュ制御装置の動作例およびRQの状態例を示すフローチャートである。図4(b)に例示するRQの状態例では、n=3の場合を例示している。 Next, the operation of the entire cache control device will be described. FIG. 4 is a flowchart showing an example of the operation of the cache control device and an example of the RQ state in the present embodiment. In the example of the RQ state illustrated in FIG. 4B, the case where n = 3 is illustrated.
NIC2がパケットを受信すると(図4(a)におけるステップS701)、IOC15は、受信したデータをキャッシュインジェクションによりキャッシュ12へ転送する(ステップS702)。これにより、図4(b)におけるステップB3に例示するように、キャッシュ12には、メモリ3上の受信バッファ/受信キュー(RQ)のキャッシュとして受信データが書き込まれる(ステップS703)。
When the
その後、NIC2がH/W割り込みをCPU11に通知すると(ステップS704)、CPU11は、受信処理を開始する(ステップS705)。この際、キャッシュインジェクションにより、対象のデータがキャッシュ12に書き込まれるため、CPU11は、受信処理において受信データを参照したとき(ステップS706)、図4(b)におけるステップB4に例示するように、キャッシュミスを発生させず、即座にデータを参照できる(ステップS707)。
Thereafter, when the
その後、図4(b)におけるステップB5に例示するように、領域削除手段22は、受信処理の最後にキャッシュ12を操作し、処理対象データのキャッシュを削除する(ステップS711)。そして、領域設定手段21は、n個先のパケットが書き込まれるキャッシュ12の領域をキャッシュインジェクションの対象として新たに設定する。その結果、キャッシュ12の内容が更新される(ステップS710)。以上のステップS701〜ステップS711の処理が行われ、受信処理が終了する(ステップS712)。
Thereafter, as illustrated in step B5 in FIG. 4B, the
以上のように、本実施形態によれば、領域設定手段21が書き込み可能領域をキャッシュ12に設定し、削除手段22がキャッシュ12に書き込まれた一部または全部の受信データに対する処理ごとにその処理の対象になった受信データが書き込まれている領域の削除を行う。そして、領域設定手段21が、受信データに対する処理ごとに、予め定められた量の受信データを受信した後に受信する受信データが書き込まれる位置に、削除された領域に相当する量の領域を新たに設定する。
As described above, according to the present embodiment, the
そのような構成により、受信したデータをキャッシュメモリに書き込んで処理を行う場合に、大量のデータを受信する状況であっても、処理性能が低下することを抑制できる。すなわち、メモリアクセスを削減し、キャッシュ使用量を抑制することで、キャッシュインジェクションの効果を最大限に引き出すことができる。 With such a configuration, when the received data is written in the cache memory for processing, it is possible to suppress a decrease in processing performance even in a situation where a large amount of data is received. That is, it is possible to maximize the effects of cache injection by reducing memory access and suppressing cache usage.
例えば、図13(a)に示す一般的な受信処理と比較すると、ステップS603に示すNIC2からメモリ3への書き込み処理、ステップS608に示すCPU11からメモリ3への読み出し処理、および、これらの処理に伴ってキャッシュ12に記憶されたデータが追い出される際に、そのデータがメモリ3へ書き出される処理に伴うメモリアクセスが削減される。これらのメモリアクセスが削減されることで、メモリアクセスに伴う処理遅延が解消されるため、処理性能を向上させることができる。
For example, when compared with the general reception process shown in FIG. 13A, the write process from the
また、本実施形態によれば、使用されるキャッシュ12がパケットn個分に制限される。したがって、nを適切な値に設定することで、キャッシュの使用量を制御できる。さらに、キャッシュが大量に使用されることを回避できると共に、次に処理する受信データがキャッシュからメモリへ追い出されることを回避できる。すなわち、追い出されたデータを再度メモリから読み出すことによる処理性能の低下を抑制できる。
Further, according to the present embodiment, the
実施形態2.
次に、第2の実施形態について説明する。図5は、本発明の第2の実施形態におけるキャッシュ制御装置の例を示すブロック図である。なお、第1の実施形態と同様の構成については、図1と同一の符号を付し、説明を省略する。本実施形態におけるキャッシュ制御装置も、プロセッサ1と、NIC2と、メモリ3とを備えている。NIC2およびメモリ3については、第1の実施形態と同様である。
Next, a second embodiment will be described. FIG. 5 is a block diagram illustrating an example of the cache control device according to the second embodiment of the present invention. In addition, about the structure similar to 1st Embodiment, the code | symbol same as FIG. 1 is attached | subjected and description is abbreviate | omitted. The cache control apparatus according to the present embodiment also includes a processor 1, a
プロセッサ1は、2つのCPU11と、キャッシュ12と、MC13と、IOC15とを含む。2つのCPU11は、それぞれキャッシュ12に接続される。すなわち、本実施形態におけるキャッシュ制御装置は、図5に例示するように、複数のCPU11がキャッシュ12を共有する構成のマルチコアプロセッサである。なお、CPU11、キャッシュ12、MC13、および、IOC15の内容は、第1の実施形態と同様である。
The processor 1 includes two
このように、キャッシュ制御装置が図5に例示する構成をとる場合であっても、第1の実施形態と同様、メモリアクセスの削減およびキャッシュ使用量の抑制により、処理性能を向上させることができる。 As described above, even when the cache control apparatus has the configuration illustrated in FIG. 5, the processing performance can be improved by reducing the memory access and suppressing the cache usage, as in the first embodiment. .
さらに、本実施形態によれば、共有されるキャッシュが大量に使用されることを抑制できる。よって、他のコアによる処理で扱われるデータをキャッシュからメモリに追い出すことが減るため、他の処理の性能低下を抑えられる。すなわち、本実施形態によれば、並列処理によるスケールアウトが可能になる。 Furthermore, according to the present embodiment, it is possible to suppress the use of a large amount of shared cache. Therefore, since data handled by processing by other cores is less expelled from the cache to the memory, it is possible to suppress degradation in performance of other processing. That is, according to this embodiment, scale-out by parallel processing becomes possible.
実施形態3.
次に、第3の実施形態について説明する。本実施形態におけるキャッシュ制御装置の構成は、第1の実施形態と同様である。すなわち、本実施形態におけるキャッシュ制御装置も、プロセッサ1と、NIC2と、メモリ3とを備えている。また、プロセッサ1は、CPU11と、キャッシュ12と、MC13と、IOC15とを含む。ただし、図5に例示するように、キャッシュ制御装置が複数のCPU11を備えていてもよい。
Next, a third embodiment will be described. The configuration of the cache control device in this embodiment is the same as that in the first embodiment. That is, the cache control device according to the present embodiment also includes the processor 1, the
第3の実施形態では、受信したパケットの処理をCPU11が行っている間に、キャッシュ制御装置がn個以上のパケットを新たに受け取った場合の処理について説明する。
In the third embodiment, a process when the cache control apparatus newly receives n or more packets while the
図6は、本実施形態におけるCPU11の例を示すブロック図である。本実施形態におけるCPU11は、領域設定手段21と、領域削除手段22と、受信データ判定手段23と、データ読取手段24とを有する。なお、領域設定手段21および領域削除手段22については、第1の実施形態と同様である。また、CPU11は、キャッシュ制御装置の記憶部(図示せず)に記憶されたプログラム(キャッシュ制御用プログラム)を読み込み、そのプログラムに従って、領域設定手段21、領域削除手段22、受信データ判定手段23およびデータ読取手段24として動作してもよい。
FIG. 6 is a block diagram illustrating an example of the
受信データ判定手段23は、予め定められた所定量の受信データを書き込み可能な領域(すなわち、書き込み領域)に書き込むことが可能な量を超えるデータを受信したか否かを判定する。具体的には、受信データ判定手段23は、n個先の受信データを受信したか否かを確認する。受信データ判定手段23は、例えば、キャッシュ12に設定されたキャッシュインジェクションの対象が予め定められた所定量になっているか否かを判定することにより、書き込み領域に設定可能な量を超えるデータを受信したか否かを判定してもよい。設定可能な量を超えるデータを受信した場合、受信データ判定手段23は、IOC15に対して、設定可能な量を超えるデータをメモリ3に書き込むよう指示する。
The reception
図7は、受信バッファキュー(RQ)に設定されるデータ構造の例を示す説明図である。図7に示す例では、受信バッファキューが、受信したデータを記憶する領域である受信データ領域と、受信したデータを管理する領域である管理用データ領域とを含んでいることを示す。このように、受信バッファキューには、パケットごとに管理用データ領域と受信データ領域が確保される。なお、図7では、受信バッファキューを連続領域として確保している場合を例示しているが、受信バッファキューをリスト構造で管理する場合のデータ構造も同様である。また、受信データ領域のみをキャッシュインジェクションの対象としてもよく、受信データ領域と管理用データ領域の両方をキャッシュインジェクションの対象としてもよい。 FIG. 7 is an explanatory diagram showing an example of a data structure set in the reception buffer queue (RQ). In the example illustrated in FIG. 7, the reception buffer queue includes a reception data area that is an area for storing received data and a management data area that is an area for managing the received data. In this way, a management data area and a reception data area are secured for each packet in the reception buffer queue. FIG. 7 illustrates the case where the reception buffer queue is secured as a continuous area, but the data structure when the reception buffer queue is managed in a list structure is the same. Further, only the reception data area may be the target of cache injection, and both the reception data area and the management data area may be the target of cache injection.
受信されたデータは、受信データ領域に、その領域の先頭から書き込まれる。また、管理用データ領域には、受信時のタイムスタンプ、受信データサイズ、受信が完了したことを示す受信完了フラグなどが含まれる。受信データ判定手段23は、メモリ3にデータを書き込む指示を行う際、管理用データ領域に設定すべき情報を受信したデータと合わせて書き込む指示を行う。
The received data is written in the reception data area from the beginning of the area. In addition, the management data area includes a time stamp at the time of reception, a reception data size, a reception completion flag indicating that reception has been completed, and the like. The reception
データ読取手段24は、メモリ3とキャッシュ12のいずれかを選択して書き込まれたデータを読み取る。例えば、メモリ3が図7に例示するデータ構造の場合、受信したデータに対して受信データフラグが受信完了を示しているのであれば、その受信データはメモリ上に書き込まれていることを意味する。この場合、データ読取手段24は、プリフェッチを行う。一方、受信したデータがメモリ3上に記憶されていない場合、領域設定手段21は、受信したデータを記憶する領域をキャッシュインジェクションの対象としてキャッシュ12に新たに設定する。
The
このように、受信データ判定手段23が書き込み領域に設定可能な量を超えるデータを受信したと判定した場合(すなわち、n個先のデータを受信したと判定した場合)、データ読取手段24は、受信データをメモリ3からプリフェッチする。
As described above, when the received
次に、プロセッサ1内の動作について説明する。図8は、本実施形態におけるキャッシュ制御装置の動作例を示すフローチャートである。なお、初期化時に書き込み領域をキャッシュインジェクションの対象として設定する処理は、第1の実施形態と同様である。以降、パケットを受信するごとに、図8に例示するステップS401〜ステップS405の処理が行われる。 Next, the operation in the processor 1 will be described. FIG. 8 is a flowchart illustrating an operation example of the cache control device according to the present embodiment. Note that the process of setting a write area as a target for cache injection at the time of initialization is the same as in the first embodiment. Thereafter, every time a packet is received, the processing of step S401 to step S405 illustrated in FIG. 8 is performed.
キャッシュ制御装置がパケットを受信すると、受信したパケットに対するパケット処理が行われる(ステップS401)。なお、ステップS401の処理は、第1の実施形態におけるステップS301の処理と同様である。パケット処理の完了後、領域削除手段22は、処理を終えた対象データのキャッシュを削除する(ステップS402)。
When the cache control device receives the packet, packet processing is performed on the received packet (step S401). Note that the processing in step S401 is the same as the processing in step S301 in the first embodiment. After completing the packet processing, the
キャッシュの削除後、受信データ判定手段23は、n個先のパケットが既に受信されているか否かを確認する(ステップS403)。受信データ判定手段23は、例えば、図7に例示する管理用データ領域内に含まれる受信完了フラグをもとにn個先のパケットが既に受信されているか否かを確認する。
After deleting the cache, the reception
n個先のパケットが既に受信されている場合(ステップS403におけるYES)、n個先のパケットデータはメモリ上に書き込まれているため、データ読取手段24は、プリフェッチを行う(ステップS404)。一方、n個先のパケットがまだ受信されていない場合(ステップS403におけるNO)、領域設定手段21は、そのパケットデータが書き込まれる領域をキャッシュインジェクションの対象に設定する(ステップS405)。この場合、データ読取手段24は、キャッシュ12から対象データを読み取ることになる。
If the n-th packet has already been received (YES in step S403), since the n-th packet data has been written in the memory, the
以上のように、本実施形態によれば、受信データ判定手段23が、書き込み領域に書き込むことが可能な量を超えるデータを受信したか否かを判定する。書き込み領域に書き込むことが可能な量を超えるデータを受信した場合、IOC15がその受信データをメモリ3に書き込む。そして、データ読取手段24が、その受信データをメモリ3からプリフェッチする。よって、第1の実施形態の効果に加え、キャッシュ制御装置が一時的に受信処理性能を超えたパケットを受信した場合であっても、パケットを欠落させず、かつ、メモリアクセスによる遅延を抑制して受信データを処理できる。
As described above, according to the present embodiment, the reception
例えば、dcbz命令により0で初期化されたキャッシュを設定する場合、メモリのデータは参照されない。そのため、n個目以降のパケットデータがDMAによりメモリへ書き出された後に、dcbz命令によってキャッシュを作成する方法では、CPUが0で初期化されたキャッシュ上のデータを読み込むことになる。すなわち、CPUが受信したデータと異なるデータを参照してしまうことになる。 For example, when setting a cache initialized to 0 by the dcbz instruction, the data in the memory is not referred to. Therefore, in the method of creating a cache by the dcbz instruction after the nth and subsequent packet data are written to the memory by DMA, the CPU reads the data on the cache initialized with 0. That is, data different from the data received by the CPU is referred to.
しかし、本実施形態では、図8に例示する処理に基づいてキャッシュ12を制御し、メモリ3上に書かれたパケットデータも処理するため、キャッシュの登録方法によりn個目以降のパケットデータが適切に処理されないという問題を回避できる。
However, in the present embodiment, the
実施形態4.
次に、第4の実施形態について説明する。本実施形態におけるキャッシュ制御装置の構成は、第1の実施形態と同様である。ただし、図5に例示するように、キャッシュ制御装置が複数のCPU11を備えていてもよい。
Embodiment 4 FIG.
Next, a fourth embodiment will be described. The configuration of the cache control device in this embodiment is the same as that in the first embodiment. However, as illustrated in FIG. 5, the cache control device may include a plurality of
第1の実施形態〜第3の実施形態では、各受信データ領域の全体をキャッシュインジェクションの対象にする場合について説明した。本実施形態では、キャッシュの使用量をさらに抑えるため、受信データにおけるヘッダ等の先頭部分だけをキャッシュインジェクションの対象にする点において、第1の実施形態〜第3の実施形態と異なる。それ以外については、第1の実施形態〜第3の実施形態と同様である。 In the first to third embodiments, the case has been described in which the entirety of each reception data area is the target of cache injection. This embodiment is different from the first to third embodiments in that only the top portion of the received data in the received data is subjected to cache injection in order to further suppress the cache usage. About other than that, it is the same as that of 1st Embodiment-3rd Embodiment.
図9は、受信バッファキュー(RQ)に設定されるデータ構造の他の例を示す説明図である。図9に例示するRQは、図7に例示するRQと同様、受信データ領域と管理用データ領域とを含む。また、図9に例示するRQのうち網掛け部分が、本実施形態においてキャッシュインジェクションの対象とする領域に相当する。 FIG. 9 is an explanatory diagram showing another example of the data structure set in the reception buffer queue (RQ). The RQ illustrated in FIG. 9 includes a reception data area and a management data area, similarly to the RQ illustrated in FIG. Further, the shaded portion of the RQ illustrated in FIG. 9 corresponds to a region targeted for cache injection in the present embodiment.
領域設定手段21は、キャッシュインジェクションの対象として、各受信データのうちの少なくとも一部の領域をキャッシュ12に設定する。以下、この一部に相当する領域のことを、縮小領域と記す。
The
具体的には、領域設定手段21は、各受信データ領域のうち、先頭kキャッシュラインの領域をキャッシュインジェクションの対象として設定する。ここで、kは、予め定められた整数値である。このようにすることで、受信データ領域のうち受信データが書き込まれないキャッシュの領域の使用量を削減できる。 Specifically, the area setting means 21 sets the area of the first k cache line among the received data areas as a target for cache injection. Here, k is a predetermined integer value. By doing so, it is possible to reduce the amount of use of the cache area in the received data area where the received data is not written.
例えば、受信データがkキャッシュライン分のサイズ以下の場合、受信データ全てを書き込む場合と比較すると、1パケット毎に(受信データ領域サイズ)−(kキャッシュラインのサイズ)分のキャッシュ使用量を削減できる。なお、受信データがkキャッシュライン分のサイズより大きい場合、CPU11は、メモリ3を参照して、受信データの残り部分を参照するようにすればよい。
For example, when the received data is less than or equal to the size of k cache lines, the cache usage is reduced by (received data area size)-(k cache line size) for each packet as compared to writing all the received data. it can. If the received data is larger than the size of k cache lines, the
なお、図9では、受信データ領域の情報をキャッシュインジェクションの対象とする場合を例示しているが、キャッシュインジェクションの対象に管理用データ領域の情報を含めてもよい。 Although FIG. 9 illustrates the case where the information in the received data area is the target of cache injection, the information in the management data area may be included in the target of cache injection.
以上のように、本実施形態によれば、領域設定手段21が各受信データのうちの少なくとも一部の領域をキャッシュインジェクションの対象領域としてキャッシュ12に設定する。そのため、第1の実施形態〜第3の実施形態における効果に加え、キャッシュ使用量を削減することができる。
As described above, according to the present embodiment, the
すなわち、例えば、図9に例示する受信バッファキューを用いてパケットの受信する処理を行う場合、受信データ領域すべてをキャッシュインジェクションの対象としてキャッシュ12に設定した場合、受信データ領域のうち、受信データが書き込まれない領域のキャッシュは無駄になってしまう。しかし、本実施形態では、受信データが書き込まれない領域部分を削減させるため、キャッシュの使用量をさらに抑えられる。
That is, for example, when the process of receiving a packet is performed using the reception buffer queue illustrated in FIG. 9, when all the reception data areas are set as cache injection targets in the
実施形態5.
次に、第5の実施形態について説明する。第4の実施形態では、受信データ領域のうちの一部のデータ領域をキャッシュインジェクションの対象としてキャッシュ12に設定する場合について説明した。本実施形態におけるキャッシュ制御装置は、第4の実施形態における処理に加え、受信したデータのうちキャッシュインジェクションされなかったデータの残り部分を受信データのサイズに合わせてプリフェッチする処理を行う。
Embodiment 5. FIG.
Next, a fifth embodiment will be described. In the fourth embodiment, a case has been described in which a part of the received data area is set in the
本実施形態におけるキャッシュ制御装置の構成も、第1の実施形態と同様である。すなわち、本実施形態におけるキャッシュ制御装置も、プロセッサ1と、NIC2と、メモリ3とを備えている。また、プロセッサ1は、CPU11と、キャッシュ12と、MC13と、IOC15とを含む。ただし、図5に例示するように、キャッシュ制御装置が複数のCPU11を備えていてもよい。
The configuration of the cache control device in this embodiment is the same as that in the first embodiment. That is, the cache control device according to the present embodiment also includes the processor 1, the
図10は、本実施形態におけるCPU11の例を示すブロック図である。本実施形態におけるCPU11は、領域設定手段21と、領域削除手段22と、受信データ判定手段23と、データ読取手段24と、サイズ比較手段25とを有する。なお、領域設定手段21、領域削除手段22および受信データ判定手段23については、第4の実施形態と同様である。また、CPU11は、キャッシュ制御装置の記憶部(図示せず)に記憶されたプログラム(キャッシュ制御用プログラム)を読み込み、そのプログラムに従って、領域設定手段21、領域削除手段22、受信データ判定手段23、データ読取手段24およびサイズ比較手段25として動作してもよい。
FIG. 10 is a block diagram illustrating an example of the
サイズ比較手段25は、各受信データの先頭から一部に相当する領域(すなわち、縮小領域)のサイズと、受信データのサイズとを比較する。サイズ比較手段25は、受信データのサイズを、例えば、図9に例示する管理用データ領域内に含まれる受信データサイズを基に判断してもよい。
The size comparison means 25 compares the size of the area corresponding to a part from the head of each received data (that is, the reduced area) and the size of the received data. The
受信データのサイズが縮小領域のサイズ以下の場合、受信データはキャッシュインジェクションされる。一方、受信したデータサイズが縮小領域のサイズよりも大きい場合、キャッシュインジェクションされなかった領域が存在することになる。この場合、データ読取手段24は、メモリ3からその領域のデータをプリフェッチする。このようにすることで、キャッシュの使用量を減らし、かつメモリアクセスによる遅延を削減できる。
If the size of the received data is less than or equal to the size of the reduced area, the received data is cache injected. On the other hand, when the received data size is larger than the size of the reduced area, there is an area that has not been cache-injected. In this case, the
次に、動作について説明する。図11は、本実施形態におけるキャッシュ制御装置の動作例を示すフローチャートである。キャッシュ制御装置がパケットを受信すると、サイズ比較手段25は、受信したデータのサイズとキャッシュインジェクションの対象に登録したkキャッシュラインのサイズとを比較する(ステップS501)。サイズ比較手段25は、例えば、受信バッファキューにおける管理用データ領域を参照して、受信したデータのサイズを判断すればよい。
Next, the operation will be described. FIG. 11 is a flowchart illustrating an operation example of the cache control device according to the present embodiment. When the cache control device receives the packet, the
受信したデータサイズが縮小領域のサイズ以下の場合(ステップS501におけるNO)、受信データはキャッシュインジェクションされる。一方、受信したデータサイズが縮小領域のサイズよりも大きい場合(ステップS501におけるYES)、データ読取手段24は、メモリ3からその領域のデータをプリフェッチする(ステップS502)。
If the received data size is equal to or smaller than the size of the reduced area (NO in step S501), the received data is cache injected. On the other hand, if the received data size is larger than the size of the reduced area (YES in step S501), the
その後、受信したパケットのパケット処理が行われる(ステップS503)。なお、ステップS501の処理は、第1の実施形態におけるステップS301の処理と同様である。パケット処理の完了後、領域削除手段22は、処理を終えた対象データのキャッシュを削除する(ステップS504)。そして、領域設定手段21は、n個先のパケットが書き込まれる領域をキャッシュインジェクションの対象として設定する(ステップS405)。
Thereafter, packet processing of the received packet is performed (step S503). Note that the processing in step S501 is the same as the processing in step S301 in the first embodiment. After the packet processing is completed, the
以上のように、本実施形態によれば、サイズ比較手段25が縮小領域のサイズと受信データのサイズとを比較する。そして、受信データのサイズが縮小領域のサイズ以下の場合、IOC15は、受信データのうち縮小領域のサイズを超える部分のデータをメモリ3に書き込み、データ読取手段24は、縮小領域のサイズを超える部分の受信データをメモリ3からプリフェッチする。よって、第4の実施形態における効果に加え、メモリアクセスによる遅延をより削減することができる。
As described above, according to the present embodiment, the
以下、具体的な実施例により本発明を説明するが、本発明の範囲は以下に説明する内容に限定されない。本実施例では、特許文献1に記載された実装方法を用いて、キャッシュインジェクションを実現するものとする。すなわち、本実施例におけるプロセッサは、特許文献1に記載されているように、キャッシュしているデータをキャッシュインジェクションの対象とするものとする。 Hereinafter, the present invention will be described with reference to specific examples, but the scope of the present invention is not limited to the contents described below. In the present embodiment, it is assumed that cache injection is realized using the mounting method described in Patent Document 1. That is, as described in Patent Document 1, the processor according to the present embodiment assumes cached data as a target for cache injection.
また、本実施例におけるプロセッサは、非特許文献2に記載されたdcbz命令および Data Cache Block Invalidate(dcbi)命令によりキャッシュを操作できるものとする。なお、非特許文献2に記載されたdcbi命令とは、キャッシュをメモリに書き出さずに削除する命令である。
In addition, the processor in this embodiment can operate the cache by the dcbz instruction and the Data Cache Block Invalidate (dcbi) instruction described in
次に、本実施例で用いる受信バッファのデータ構成について説明する。本実施例で用いる受信バッファは、図9に例示するように、連続した領域に等間隔で順にデータが格納されるキューを想定する。また、受信バッファには、パケットごとに管理用データ領域と受信データ領域とを有する。さらに、管理用データ領域には、受信時のタイムスタンプ、受信データサイズ、および受信完了フラグ等が含まれる。また、管理用データ領域と受信データ領域のサイズは、それぞれキャッシュラインサイズの整数倍とする。 Next, the data configuration of the reception buffer used in this embodiment will be described. As shown in FIG. 9, the reception buffer used in the present embodiment assumes a queue in which data is sequentially stored in a continuous area at equal intervals. The reception buffer has a management data area and a reception data area for each packet. Further, the management data area includes a reception time stamp, a reception data size, a reception completion flag, and the like. The sizes of the management data area and the reception data area are each an integral multiple of the cache line size.
また、領域設定手段21は、初期化時、キューの先頭からn個分のパケットを書き込む領域をキャッシュインジェクションの対象としてキャッシュ12に設定するものとする。ここで、nには、キャッシュサイズと受信処理の性能から最適な値が予め設定される。例えば、第2の実施形態で示すように、2つのCPUが並列でパケット処理を行う場合、「キャッシュサイズ/2>受信データ領域のサイズ×n」になるnを選択することで、受信データのキャッシュがメモリへ追い出されることを抑制できる。また、第3の実施形態で示すように、「プリフェッチを完了するまでにかかる時間<n個のパケットに対する処理時間」になるnを選択することで、メモリアクセスによる遅延をなくすことができる。なお、整数nの値は、プログラム実行中に変更しないものとする。
In addition, the
次に、本実施例によるキャッシュ制御装置の動作について説明する。まず初めに、全受信データ領域をDMAの対象としておく。その後、初めに受信するn個のパケットについての受信データ領域をキャッシュインジェクションの対象とするため、プロセッサ(例えば、領域設定手段21)は、dcbz命令によりキャッシュを作成する。 Next, the operation of the cache control apparatus according to this embodiment will be described. First, the entire received data area is set as a DMA target. Thereafter, in order to set the received data area for the n packets received first as the target of cache injection, the processor (for example, the area setting unit 21) creates a cache by the dcbz instruction.
その後、パケットごとに行われる一般的な受信処理の後、プロセッサ(例えば、領域削除手段22および領域設定手段21)は、ステップS711に例示するように、キャッシュを操作する。具体的には、プロセッサ(例えば、領域削除手段22)は、処理対象であったパケットに対応する受信データ領域のキャッシュをdcbi命令で削除する。そして、プロセッサ(例えば、領域設定手段21)は、n個先のパケットが書き込まれる受信データ領域をキャッシュインジェクションの対象とするため、dcbz命令によりキャッシュを作成する。その結果、ステップS710に例示するように、キャッシュ12の内容が更新される。
Thereafter, after a general reception process performed for each packet, the processor (for example, the
なお、n個先の受信データ(パケット)が書き込まれる領域は、処理対象であったパケットの受信データ領域を指すアドレスに、(管理用データ領域サイズ+受信データ領域サイズ)×nを加算することで算出できる。なお、プロセッサ(例えば、領域削除手段22および領域設定手段21)は、それぞれのキャッシュ操作を受信データ領域の全キャッシュラインに対して行う。
In the area where n-th received data (packet) is written, (management data area size + received data area size) × n is added to the address indicating the received data area of the packet to be processed. It can be calculated by The processor (for example, the
このような処理を行うことで、例えば、図4(b)に例示する受信バッファのように、常にn個のパケットデータのみキャッシュされることになる。 By performing such processing, for example, only n packet data are always cached as in the reception buffer illustrated in FIG.
次に、本発明の最小構成について説明する。図12は、本発明によるキャッシュ制御装置の最小構成の例を示すブロック図である。本発明によるキャッシュ制御装置は、予め定められた量の受信データ(例えば、n個分のパケット)を書き込み可能な領域である書き込み領域(例えば、キャッシュインジェクションの対象領域)をキャッシュメモリ(例えば、キャッシュ12)に設定する領域設定手段81と、書き込み領域に書き込まれた一部または全部の受信データに対する処理(例えば、パケット処理)ごとに、その処理の対象になった受信データが書き込まれた領域を削除する(例えば、キャッシュを削除する)領域削除手段82(例えば、領域削除手段22)とを備えている。 Next, the minimum configuration of the present invention will be described. FIG. 12 is a block diagram showing an example of the minimum configuration of the cache control device according to the present invention. A cache control device according to the present invention uses a write area (for example, a cache injection target area), which is an area into which a predetermined amount of received data (for example, n packets) can be written, as a cache memory (for example, a cache memory). 12) and for each process (for example, packet processing) for part or all of the received data written in the write area, the area in which the received data to be processed is written An area deleting unit 82 (for example, area deleting unit 22) for deleting (for example, deleting a cache) is provided.
領域設定手段81は、受信データに対する処理ごとに、予め定められた量の受信データ(例えば、n個分のパケット)を受信した後に受信する受信データ(例えば、n個先のパケット)を書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定する。
The
以上のような構成により、受信したデータをキャッシュメモリに書き込んで処理を行う場合に、大量のデータを受信する状況であっても、処理性能が低下することを抑制できる。 With the configuration as described above, when the received data is written in the cache memory for processing, it is possible to suppress a decrease in processing performance even when a large amount of data is received.
また、キャッシュ制御装置が、受信データを書き込み領域に書き込む受信データ書き込み手段(例えば、IOC15)と、メインメモリ(例えば、メモリ3)とキャッシュメモリのいずれかを選択して、書き込まれた受信データを読み取るデータ読取手段(例えば、データ読取手段24)と、書き込み領域に書き込むことが可能な量を超えるデータを受信したか否かを判定する受信データ判定手段(例えば、受信データ判定手段23)を備えていてもよい。 In addition, the cache control device selects any one of received data writing means (for example, IOC15), main memory (for example, memory 3), and cache memory for writing received data to the write area, and writes the received data to be written. Data reading means for reading (for example, data reading means 24) and reception data determining means (for example, receiving data determining means 23) for determining whether or not data exceeding the amount that can be written to the writing area has been received. It may be.
そして、受信データ書き込み手段が、書き込み領域に書き込むことが可能な量を超えた受信データをメインメモリに書き込み、データ読取手段が、受信データをメインメモリからプリフェッチしてもよい。 Then, the reception data writing means may write the reception data exceeding the amount that can be written to the writing area into the main memory, and the data reading means may prefetch the reception data from the main memory.
また、領域設定手段81は、各受信データのうちの少なくとも一部の領域(例えば、先頭kキャッシュラインの領域)である縮小領域を書き込み可能な領域としてキャッシュメモリに設定してもよい。
The
また、キャッシュ制御装置は、縮小領域のサイズと受信データのサイズとを比較するサイズ比較手段(例えば、サイズ比較手段25)を備えていてもよい。そして、受信データ書き込み手段は、受信データのサイズが縮小領域のサイズ以下の場合、受信データのうち縮小領域のサイズを超える部分のデータをメインメモリに書き込み、データ読取手段は、受信データのサイズが縮小領域のサイズ以下の場合、縮小領域のサイズを超える部分の受信データをメインメモリからプリフェッチしてもよい。 In addition, the cache control apparatus may include size comparison means (for example, size comparison means 25) that compares the size of the reduced area with the size of the received data. When the received data size is equal to or smaller than the size of the reduced area, the received data writing means writes the portion of the received data that exceeds the size of the reduced area to the main memory, and the data reading means has a size of the received data. If the size is equal to or smaller than the size of the reduced area, a portion of received data that exceeds the size of the reduced area may be prefetched from the main memory.
以上、実施形態及び実施例を参照して本願発明を説明したが、本願発明は上記実施形態および実施例に限定されるものではない。本願発明の実施形態および実施例の枠内において、種々の変更および調整が可能である。 Although the present invention has been described with reference to the embodiments and examples, the present invention is not limited to the above embodiments and examples. Various changes and adjustments are possible within the scope of the embodiments and examples of the present invention.
本発明は、キャッシュインジェクションを利用してキャッシュメモリを制御するキャッシュ制御装置に好適に適用される。また、本発明を、バッファキューを用いて処理を行う他の装置にも適応可能である。例えば、アクセラレータからのメモリ書き出しおよびキャッシュインジェクションがサポートされているアーキテクチャにおいて、そのアクセラレータを使用した処理に本発明を適応可能である。 The present invention is preferably applied to a cache control device that controls cache memory using cache injection. Further, the present invention can be applied to other apparatuses that perform processing using a buffer queue. For example, the present invention can be applied to processing using an accelerator in an architecture that supports memory writing and cache injection from the accelerator.
具体的には、アクセラレータに複数のジョブを投入し、それらの結果を順次受け取りながら処理を行う場合、それぞれのジョブについての出力データが発生する。このとき、出力データを書き込む領域の制御に、本発明による方法を適用することで、キャッシュの使用を一定量に制御できるため、メモリアクセスの削減といったキャッシュインジェクションの効果を最大限に引き出せる。 Specifically, when a plurality of jobs are input to the accelerator and processing is performed while sequentially receiving the results, output data for each job is generated. At this time, the use of the cache can be controlled to a certain amount by applying the method according to the present invention to control the area where the output data is written, so that the effect of cache injection such as memory access reduction can be maximized.
1 プロセッサ
2 NIC
3 メモリ
11 CPU
12 キャッシュメモリ
13 メモリコントローラ
14 内部バス
15 I/Oコントローラ
21 領域設定手段
22 領域削除手段
23 受信データ判定手段
24 データ読取手段
25 サイズ比較手段
1
3
12
Claims (10)
前記書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、当該処理の対象になった受信データが書き込まれた領域を削除し、
前記受信データに対する処理ごとに、前記予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定する
ことを特徴とするキャッシュ制御方法。 Set a write area, which is an area in which a predetermined amount of received data can be written, in the cache memory,
For each process on part or all of the received data written in the write area, delete the area where the received data that is the target of the process is written,
For each process on the received data, an area corresponding to the deleted area is set as an area where the received data can be written at a position where the received data received after receiving the predetermined amount of received data is written. A cache control method characterized by newly setting.
メインメモリとキャッシュメモリのいずれかを選択して、書き込まれた受信データを読み取り、
書き込み領域に書き込むことが可能な量を超えるデータを受信したか否かを判定し、
受信データを書き込み領域に書き込む際、書き込み領域に書き込むことが可能な量を超えた受信データをメインメモリに書き込み、
前記受信データをメインメモリからプリフェッチする
請求項1記載のキャッシュ制御方法。 Write the received data to the writing area,
Select either main memory or cache memory, read the received data written,
Determine if you have received more data than can be written to the write area,
When writing received data to the write area, write the received data exceeding the amount that can be written to the write area to the main memory,
The cache control method according to claim 1, wherein the received data is prefetched from a main memory.
請求項1または請求項2記載のキャッシュ制御方法。 The cache control method according to claim 1 or 2, wherein when the write area is set, a reduced area that is at least a part of each received data is set as a writable area in the cache memory.
受信データのサイズが縮小領域のサイズ以下の場合、受信データのうち縮小領域のサイズを超える部分のデータをメインメモリに書き込み、縮小領域のサイズを超える部分の受信データをメインメモリからプリフェッチする
請求項3記載のキャッシュ制御方法。 Compare the size of the reduced area with the size of the received data,
If the size of the received data is equal to or smaller than the size of the reduced area, the portion of the received data that exceeds the size of the reduced area is written to the main memory, and the portion of the received data that exceeds the size of the reduced area is prefetched from the main memory. 3. The cache control method according to 3.
請求項1から請求項4のうちのいずれか1項に記載のキャッシュ制御方法。 The cache control method according to any one of claims 1 to 4, wherein a write area is set in a cache memory as a target for cache injection.
前記書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、当該処理の対象になった受信データが書き込まれた領域を削除する領域削除手段とを備え、
前記領域設定手段は、前記受信データに対する処理ごとに、前記予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定する
ことを特徴とするキャッシュ制御装置。 An area setting means for setting a write area, which is an area in which a predetermined amount of received data can be written, in the cache memory;
An area deletion unit that deletes an area in which received data that is a target of the process is written for each process on a part or all of the received data written in the writing area;
In each of the processes for the received data, the area setting unit sets the received data as a writable area at a position where the received data received after receiving the predetermined amount of received data is written. A cache control apparatus characterized by newly setting a corresponding amount of area.
メインメモリとキャッシュメモリのいずれかを選択して、書き込まれた受信データを読み取るデータ読取手段と、
書き込み領域に書き込むことが可能な量を超えるデータを受信したか否かを判定する受信データ判定手段とを備え、
受信データ書き込み手段は、書き込み領域に書き込むことが可能な量を超えた受信データをメインメモリに書き込み、
前記データ読取手段は、前記受信データをメインメモリからプリフェッチする
請求項6記載のキャッシュ制御装置。 Received data writing means for writing received data to a writing area;
A data reading unit that selects either the main memory or the cache memory and reads the written received data;
Receiving data determination means for determining whether or not data exceeding the amount that can be written to the write area has been received,
The received data writing means writes received data exceeding the amount that can be written to the writing area to the main memory,
The cache control device according to claim 6, wherein the data reading unit prefetches the received data from a main memory.
請求項6または請求項7記載のキャッシュ制御装置。 The cache control device according to claim 6 or 7, wherein the area setting means sets a reduced area, which is at least a part of each received data, as a writable area in the cache memory.
メインメモリとキャッシュメモリのいずれかを選択して、書き込まれた受信データを読み取るデータ読取手段と、
縮小領域のサイズと受信データのサイズとを比較するサイズ比較手段とを備え、
受信データ書き込み手段は、受信データのサイズが縮小領域のサイズ以下の場合、受信データのうち縮小領域のサイズを超える部分のデータをメインメモリに書き込み、
データ読取手段は、受信データのサイズが縮小領域のサイズ以下の場合、縮小領域のサイズを超える部分の受信データをメインメモリからプリフェッチする
請求項8記載のキャッシュ制御装置。 Received data writing means for writing received data to a writing area;
A data reading unit that selects either the main memory or the cache memory and reads the written received data;
Size comparison means for comparing the size of the reduced area and the size of the received data,
When the size of the received data is equal to or smaller than the size of the reduced area, the received data writing means writes the portion of the received data that exceeds the size of the reduced area to the main memory,
The cache control device according to claim 8, wherein the data reading means prefetches the received data in a portion exceeding the size of the reduced area from the main memory when the size of the received data is equal to or smaller than the size of the reduced area.
予め定められた量の受信データを書き込み可能な領域である書き込み領域をキャッシュメモリに設定する領域設定処理、および、
前記書き込み領域に書き込まれた一部または全部の受信データに対する処理ごとに、当該処理の対象になった受信データが書き込まれた領域を削除する削除処理を実行させ、
前記領域設定処理で、前記受信データに対する処理ごとに、前記予め定められた量の受信データを受信した後に受信する受信データを書き込む位置に、受信データを書き込み可能な領域として、削除された領域に相当する量の領域を新たに設定させる
ためのキャッシュ制御用プログラム。 On the computer,
An area setting process for setting a write area, which is an area in which a predetermined amount of received data can be written, in the cache memory; and
For each process on part or all of the received data written in the writing area, execute a deletion process to delete the area in which the received data to be processed is written,
In the area setting process, each time the received data is processed, the received data received after receiving the predetermined amount of received data is written into the area where the received data is written, and the deleted data is written into the deleted area. A cache control program to set a new equivalent area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011025245A JP2012164209A (en) | 2011-02-08 | 2011-02-08 | Cache control method, cache control device, and program for cache control |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011025245A JP2012164209A (en) | 2011-02-08 | 2011-02-08 | Cache control method, cache control device, and program for cache control |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012164209A true JP2012164209A (en) | 2012-08-30 |
Family
ID=46843528
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011025245A Withdrawn JP2012164209A (en) | 2011-02-08 | 2011-02-08 | Cache control method, cache control device, and program for cache control |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012164209A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016123077A (en) * | 2014-12-23 | 2016-07-07 | インテル コーポレイション | Technologies for network packet cache management |
US10097658B2 (en) | 2013-12-17 | 2018-10-09 | Nec Corporation | Traffic control of packet transfer |
-
2011
- 2011-02-08 JP JP2011025245A patent/JP2012164209A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10097658B2 (en) | 2013-12-17 | 2018-10-09 | Nec Corporation | Traffic control of packet transfer |
JP2016123077A (en) * | 2014-12-23 | 2016-07-07 | インテル コーポレイション | Technologies for network packet cache management |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210089343A1 (en) | Information processing apparatus and information processing method | |
US10402114B2 (en) | Information processing system, storage control apparatus, storage control method, and storage control program | |
JP6106028B2 (en) | Server and cache control method | |
US10860225B2 (en) | Apparatus and method for routing access based on device load | |
US9632958B2 (en) | System for migrating stash transactions | |
JP2014130420A (en) | Computer system and control method of computer | |
US10592148B2 (en) | Information processing system, storage control apparatus, storage control method, and storage control program for evaluating access performance to a storage medium | |
CN112540935A (en) | Method for adjusting prefetch operation and system for managing prefetch operation | |
US20160085450A1 (en) | System for providing remote memory and temporary page pool operating method for providing remote memory | |
JP5893028B2 (en) | System and method for efficient sequential logging on a storage device that supports caching | |
CN110059024B (en) | Memory space data caching method and device | |
WO2017016380A1 (en) | Advance cache allocator | |
CN112639749A (en) | Method, apparatus and system for reducing pipeline stalls due to address translation misses | |
US20200310690A1 (en) | Dynamic near-data processing control mechanism based on computer resource availability on solid-state disk platforms | |
US8635384B2 (en) | Managing data movement in a cell broadband engine processor | |
JP2012164209A (en) | Cache control method, cache control device, and program for cache control | |
US20140160954A1 (en) | Host ethernet adapter frame forwarding | |
US20170147517A1 (en) | Direct memory access system using available descriptor mechanism and/or pre-fetch mechanism and associated direct memory access method | |
CN105830027B (en) | method and apparatus for prefetching and processing jobs for processor cores in a network processor | |
KR102334473B1 (en) | Adaptive Deep Learning Accelerator and Method thereof | |
US7805572B2 (en) | Cache pollution avoidance | |
JP6224684B2 (en) | Store merge apparatus, information processing apparatus, store control method, and computer program | |
US20170178275A1 (en) | Method and system for using solid state device as eviction pad for graphics processing unit | |
JP4431492B2 (en) | Data transfer unit that supports multiple coherency granules | |
CN117032594B (en) | Read command scheduling method, processing method, device and storage equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20140513 |