JP2002149481A - Memory management device and method for parallel computer - Google Patents

Memory management device and method for parallel computer

Info

Publication number
JP2002149481A
JP2002149481A JP2000341343A JP2000341343A JP2002149481A JP 2002149481 A JP2002149481 A JP 2002149481A JP 2000341343 A JP2000341343 A JP 2000341343A JP 2000341343 A JP2000341343 A JP 2000341343A JP 2002149481 A JP2002149481 A JP 2002149481A
Authority
JP
Japan
Prior art keywords
cells
list
memory management
cell
cache
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
Application number
JP2000341343A
Other languages
Japanese (ja)
Inventor
Toshihiro Ozawa
年弘 小沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2000341343A priority Critical patent/JP2002149481A/en
Publication of JP2002149481A publication Critical patent/JP2002149481A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Memory System (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To shorten the time since data allocated to a cell were already used until the data are recovered. SOLUTION: A memory allocating part 38 allocates the unused cells of a heap area 22 connected to a free list to necessary data accompanying the execution of a function frame 26. When the free cells of the heap 22 are made empty, a first trash collecting part 40 searches the heap, and divides cells into using cells and used cells, and collects and returns the used cells to the unused cells. A second trash collecting part 42 analyzes and inputs the used cells to a reclaim list 28 after the execution of the function frame 26, and when the execution of the function frame is ended, the second trash recovery part 42 recovers and returns the cells of the reclaim list 28 other than the cells which are already recovered by the first trash collecting part 40 to the unused cells.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、CPU及びキャッシュ
を備えた複数のプロセッサと共有メモリをバスを介して
接続した並列計算機のメモリ管理装置及び方法に関し、
特に、使用済みとなったメモリのデータ割付け単位であ
るセルを回収して再使用可能とするゴミ回収(ガーベジ
・コレクション)を行う並列計算機のメモリ管理装置及
び方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory management apparatus and method for a parallel computer in which a plurality of processors each having a CPU and a cache and a shared memory are connected via a bus.
In particular, the present invention relates to a memory management apparatus and method for a parallel computer that performs garbage collection (garbage collection) that collects cells as data allocation units of used memories and makes the cells reusable.

【0002】[0002]

【従来技術】近年、コンピュータの解かせる問題の大規
模化に伴い、このサービスを提供するサーバ群も高性能
化し、大規模化してきている。この要求に答えるため
に、複数のプロセッサが共有メモリによって結合されて
いる並列計算機が製作されるようになっている。
2. Description of the Related Art In recent years, with the increase in the size of problems solved by computers, the number of servers that provide this service has also increased in performance and scale. To meet this demand, parallel computers have been built in which a plurality of processors are linked by a shared memory.

【0003】一方、OSのメモリ管理のみならず、JA
VA(登録商標)やLISPなどのプログラム言語の処
理系では、メモリ管理をランタイムシステムが行い、使
用するデータに対するメモリ領域を割り付け(メモリ割
付け)や、使用しなくなったデータのメモリ領域を回収
するゴミ回収、即ちガーベジ・コレクション(GC:Gar
bage Collection )は、ランタイムシステムの管理下に
ある。
On the other hand, not only memory management of OS but also JA
In a processing system of a programming language such as VA (registered trademark) or LISP, a run-time system performs memory management, allocates a memory area for data to be used (memory allocation), and collects a memory area for data that is no longer used. Collection, Garbage Collection (GC: Gar
The bage collection is under the control of the runtime system.

【0004】尚、LISPとは、マサチューセッツ工科
大学のJohn McCarthy教授を中心とする研
究グループによって開発された代表的な関数型のプログ
ラム言語であり、人工知能研究等に利用され、既に定義
されている関数を組み合わせて新しい関数を定義すると
いう形でプログラムを記述する。
[0004] LISP is a typical functional programming language developed by a research group led by Professor John McCarthy of the Massachusetts Institute of Technology, and is already used and defined for artificial intelligence research. Write programs by combining functions to define new functions.

【0005】共有メモリ並列計算機システムにおいて、
JAVAやLISPなどのプログラム言語を効率よく実
行するために、効果的なメモリ管理システムを実現する
必要がある。特に、ガーベジ・コレクションに関して
は、言語の特性や共有メモリ並列計算機の特性に合った
手法が必要である。また、ハードウェアでのサポートに
よる高速化も必要である。
In a shared memory parallel computer system,
In order to efficiently execute a program language such as JAVA or LISP, it is necessary to realize an effective memory management system. In particular, with regard to garbage collection, a method that matches the characteristics of the language and the characteristics of the shared memory parallel computer is required. It is also necessary to increase the speed by hardware support.

【0006】従来のJAVAやLISPなどの言語処理
系では、使用するデータを割り付けるメモリ領域を用意
しておき、必要になった時にデータを割り付けることを
行っている。そして、メモリ領域の消費が進み、新たな
データを割り付けられなくなると、ガーベジ・コレクシ
ョンが呼ばれる。
In a conventional language processing system such as JAVA or LISP, a memory area for allocating data to be used is prepared, and data is allocated when necessary. When the consumption of the memory area progresses and new data cannot be allocated, garbage collection is called.

【0007】ここでカーベジ・コレクションの対象とな
るメモリ領域をヒープ領域または単にヒープと呼び、ヒ
ープ領域を使用したデータの割り付け方法には次の2つ
の方法がある。第1の方法は、ヒープ領域のどこまでを
使用したかを保持するポインタを用意し、割り付け要求
があった時、そのポインタが指している場所から領域を
割付け、その後、ポインタを必要量だけずらす方法であ
る。
[0007] Here, a memory area to be subjected to garbage collection is called a heap area or simply a heap, and there are two methods for allocating data using the heap area. The first method is to prepare a pointer for storing the extent of the heap area used, allocate an area from the location pointed to by the pointer when there is an allocation request, and then shift the pointer by a required amount. It is.

【0008】第2の方法は、シグレゲート(Segregate)
メモリ管理方法として知られており、ヒープ領域を予め
決められた大きさの単位であるセルに区切る。セルには
他のセルへのポインタが含まれている。このセルをリン
クでつないだフリーリストと呼ばれるリストを作成して
おき、データ割付け要求があった時に、データの量に見
合ったセルをリストから取出してデータを割付ける。
[0008] The second method is a segregate.
Known as a memory management method, a heap area is divided into cells, which are units of a predetermined size. A cell contains a pointer to another cell. A list called a free list in which the cells are linked by a link is created, and when a data allocation request is made, a cell corresponding to the amount of data is extracted from the list and data is allocated.

【0009】図15は並列計算機のシグレゲートメモリ
管理方法である。並列計算機は、CPU100−1,1
00−2,・・・100−nで構成され、各CPUはキ
ャッシュ装置を介して共有メモリに接続されている。共
有メモリにはヒープ領域102が確保される。
FIG. 15 shows a method for managing a sigle gate memory of a parallel computer. The parallel computer has CPUs 100-1 and 1
100-n, and each CPU is connected to the shared memory via a cache device. A heap area 102 is secured in the shared memory.

【0010】並列計算機の場合には、CPU100−1
〜100−n毎にヒープ領域が割当てられる。ヒープ領
域102は、サイズの異なる複数種類のセルに区切ら
れ、CPU100−1〜100−n毎に、未使用のセル
をサイズ毎にリンクでつなげたフリーリストを設けてい
る。データの割付け要求があると、データの量に見合っ
たサイズのフリーリストからセルを取出してデータを割
付ける。
In the case of a parallel computer, the CPU 100-1
A heap area is allocated for every .about.100-n. The heap area 102 is divided into a plurality of types of cells having different sizes, and a free list is provided for each of the CPUs 100-1 to 100-n in which unused cells are linked by a link for each size. When there is a data allocation request, cells are taken out from a free list of a size corresponding to the amount of data and data is allocated.

【0011】ここでカーベジ・コレクションの対象とな
るヒープ領域に存在するセルは、未使用セル、使用中セ
ル、使用済みセルの3つの状態が混在した状態にある。
未使用セルは、フリーリストにつながれており、データ
割付け要求があると、フリーリストの先頭から未使用セ
ルを取出して割付け、データ割付けを行ったセルは使用
中セルとなる。
Here, the cells existing in the heap area to be subjected to garbage collection are in a state in which three states of an unused cell, a used cell, and a used cell are mixed.
Unused cells are connected to a free list. When there is a data allocation request, unused cells are taken out from the head of the free list and allocated, and cells to which data has been allocated are used cells.

【0012】使用中セルは、CPUが常に参照可能なレ
ジスタやスタックなとのデータ領域であるルートからの
ポインタで指し示されるリスト構造をもっている。カベ
ージ・コレクションは、ヒープ領域に存在する使用済み
セル、即ちゴミセルを回収してフリーリストに戻して再
使用可能とする処理である。
A busy cell has a list structure pointed to by a pointer from the root, which is a data area such as a register or a stack that can always be referred to by the CPU. The garbage collection is a process of collecting used cells existing in the heap area, that is, garbage cells, returning them to a free list, and making them reusable.

【0013】ガーベジ・コレクションの基本的なアルゴ
リズムは、マーク・スイープ・アルゴリズムである。こ
れは1回のガーベジ・コレクションをマークとスイープ
のフェーズに分けて行なう。フリーリストが空になると
ガーベジ・コレクションが起動する。
[0013] The basic algorithm of garbage collection is the mark sweep algorithm. This is done by dividing one garbage collection into mark and sweep phases. Garbage collection starts when the free list is empty.

【0014】まずマークフェーズでは、スタックやレジ
スタ等のルートから使用中セルのポンイタを順にたど
り、到達した使用中セルの全てに印(マーク)をつけて
ゆく。次にスイープフェーズでヒープ領域全体を走査
し、印のついていないセルを使用済みのゴミセルとして
回収し、フリーリストにつなげる。同時に次のガーベジ
・コレクションのために、その印を消しておく。
First, in the mark phase, the in-use cells are traversed in order from the root of the stack or the register, and all the used cells that have arrived are marked. Next, in the sweep phase, the entire heap area is scanned, and unmarked cells are collected as used garbage cells and connected to a free list. At the same time, unmark it for the next garbage collection.

【0015】図16は並列計算機のガーベジ・コレクシ
ョンである。並列計算機は、CPU100−1,100
−2,・・・100−nで構成されている。JAVAや
LISPなどのプログラム言語をCPU100−1〜1
00−nで実行する場合、関数呼出し処理のためスタッ
ク上に関数フレームを作成し、各関数を実行する。
FIG. 16 shows garbage collection of a parallel computer. The parallel computers are CPUs 100-1 and 100
,... 100-n. Programming languages such as JAVA and LISP
When the execution is performed at 00-n, a function frame is created on the stack for function call processing, and each function is executed.

【0016】この関数フレームを例えばCPU100−
1が実行してデータ割付け要求が発生すると、CPU1
00−1に割当てられているヒープ領域のフリーリスト
から未使用セルを取出してデータに割付ける処理が繰り
返される。
This function frame is stored in, for example, the CPU 100-
1 executes and a data allocation request occurs, the CPU 1
The process of extracting an unused cell from the free list of the heap area allocated to 00-1 and allocating it to data is repeated.

【0017】CPU100−1のフリーリストが空にな
るとガーベジ・コレクションが呼ばれ、CPU100−
1のレジスタ、スタックなど今後の実行に必ず必要とな
る先頭データであるルートR1,R2を基に、ルートR
1からポインタが指しているヒープ領域102のセルa
1をたどり、またルートR2からポインタが指している
セルb1,C2,c3をたどり、たどれないセルa2,
a3,b2,b3、c1を使用済みセルとして回収し、
フリーリストにつなげる。
When the free list of the CPU 100-1 becomes empty, a garbage collection is called, and the CPU 100-1
1 based on the root data R1 and R2 which are required for future execution, such as the register and stack,
Cell a of the heap area 102 pointed by the pointer from 1
1 and the cells b1, C2 and c3 pointed by the pointer from the route R2.
a3, b2, b3, and c1 are collected as used cells,
Connect to a free list.

【0018】ところで、JAVAやLISPなどのプロ
グラム言語では、リスト処理が行われ、リスト処理に用
いられるデータは、ポインタ連鎖によるリスト構造(li
nkedlist structure)をとっている。
By the way, in a programming language such as JAVA or LISP, list processing is performed, and data used for the list processing has a list structure (li) by a pointer chain.
nkedlist structure).

【0019】このようなリスト構造をもったJAVAや
LISPなどの言語では、セルに割付けたデータは短時
間で使用済みとなることが多いという性質がある。また
セルに割付けたデータヘのポインタが、ある関数の実行
終了以後に存在しないことを解析するエスケープ解析
(escape analysis )を行い、そのようなデータはスタ
ックに割付ける方法がある。
In languages such as JAVA and LISP having such a list structure, data allocated to cells is often used in a short time. There is also a method of performing an escape analysis for analyzing that a pointer to data allocated to a cell does not exist after the execution of a certain function is completed, and allocating such data to a stack.

【0020】図17はスタックに対するデータ割り付け
の一例であり、図17(A)のプログラム108におけ
る関数foo、bar及びgeeの実行に伴い図17
(B)のように、スタック110にそれぞれの関数フレ
ーム112,114,116が作成される。そしてエス
ケープ解析により関数の実行終了以後に使用しないこと
が判明したデータ「new data」については、スタック領
域110にnew data用領域118を確保し、こ
こに割付ける。
FIG. 17 shows an example of data allocation to the stack. FIG. 17A shows the execution of the functions foo, bar, and gee in the program 108 of FIG.
As shown in (B), each function frame 112, 114, 116 is created in the stack 110. The data “new data” determined to be not used after execution of the function by the escape analysis is stored in the stack area 110 as new. A data area 118 is secured and allocated here.

【0021】この方法によれば、関数fooの実行終了
時にスタックがたたまれるときに、スタックに割付けら
れたnew data用領域118は自動的に回収され
ることになる。
According to this method, when the stack is accumulated at the end of execution of the function foo, new assigned to the stack is used. The data area 118 is automatically collected.

【0022】[0022]

【発明が解決しようとする課題】しかしながら、エスケ
ープ解析により関数の実行終了以後に使用しないことが
判明したデータをスタックに割付けると、関数実行中に
データが不必要になってから、関数実行終了により回収
されるまでの時間が長くなるという問題がある。例え
ば、図18のサンプル・メソッド(Sample Method)のプ
ログラム120において、(1)行と(2)行で生成さ
れたデータは、「sample a」及び「sample b」からのみ
参照されており、(3)行の実行後には不要なデータと
なる。
However, if data that is determined by the escape analysis to be unused after the execution of the function is allocated to the stack, the data becomes unnecessary during execution of the function, and then the function execution is terminated. Therefore, there is a problem that the time until recovery is long. For example, in the sample method program 120 shown in FIG. 18, the data generated in lines (1) and (2) is referred to only from “sample a” and “sample b”, and 3) Unnecessary data after executing the row.

【0023】このためエスケープ解析を行えば、(3)
行以降は「sample a」及び「sampleb」が指すデータは
使用されないことが分かる。つまり、これらのデータが
ヒープ領域に割付けられている場合、(3)行の実行後
にガーベジ・コレクションを実行すれば、(1)行及び
(2)行のデータはこの時点で回収される。
Therefore, if escape analysis is performed, (3)
It can be seen that the data indicated by “sample a” and “sampleb” is not used after the line. In other words, when these data are allocated to the heap area, if the garbage collection is executed after the execution of the row (3), the data of the rows (1) and (2) is collected at this point.

【0024】しかし、これらのデータをスタックに割付
けると、サンプル・メソッドのプログラム120の実行
が完了した時点でないと回収できず、使用済みとなった
データの回収に時間がかかる問題がある。
However, when these data are allocated to the stack, the data cannot be collected until the execution of the sample method program 120 is completed, and it takes a long time to collect the used data.

【0025】一方、シグレゲートメモリ管理方法では、
図16のように、いろいろな大きさのセルについてフリ
ーリストを用意してデータの割り付けに備えている。ガ
ーベジ・コレクションにおいて回収される使用済みセル
は、その大きさに従って対応するフリーリストに戻され
る。
On the other hand, in the method for managing the gate memory,
As shown in FIG. 16, free lists are prepared for cells of various sizes to prepare for data allocation. The used cells collected in the garbage collection are returned to the corresponding free list according to their size.

【0026】対称型マルチプロセッサシステム(SM
P)などの並列計算機においては、フリーリストがシス
テムに一つしかないと、データ割付け時、フリーリスト
の取り合いが起きるので、図16のように、CPU10
0−1〜100−nごとに複数のフリーリストを持つこ
とが行われている。
A symmetric multiprocessor system (SM)
In a parallel computer such as P), if there is only one free list in the system, the free list is involved in data allocation, and as shown in FIG.
It is performed to have a plurality of free lists for each of 0-1 to 100-n.

【0027】しかし、ガーベジ・コレクションを実行し
たCPUが、回収した使用済みセルを自分のフリーリス
トにつなげると、回収されたデータはそのCPUのキャ
ッシュ装置に乗せられることになり、実際にセルの割付
データを使用したCPUのキャッシュ装置との間で、キ
ャッシュミスを生じやすい。また、実際に使用しようと
するCPUが、回収したCPUと異なる場合にも、キャ
ッシュミスが生じるという問題があった。
However, when the CPU that has executed garbage collection connects the collected used cells to its own free list, the collected data is loaded on the cache device of the CPU, and the cells are actually allocated. A cache miss easily occurs between the CPU and a cache device using data. There is also a problem that a cache miss occurs when the CPU actually used is different from the recovered CPU.

【0028】即ち、各CPUが自分のフリーリストにつ
なげている使用済みセルが他のキャッシュ装置に分散し
て存在するようになり、未使用セルをデータに割付ける
際に、キャッシュ間での未使用セルの移動やキャッシュ
ブロックの状態遷移の制御が必要となり、その結果キャ
ッシュミスが生じ易くなり、処理に時間もかかる。
In other words, the used cells connected to the free list of each CPU are distributed to other cache devices, and when allocating the unused cells to data, the unused cells between the caches are used. It is necessary to control the movement of the cell to be used and the state transition of the cache block. As a result, a cache miss is likely to occur, and the processing takes time.

【0029】本発明は、セルに割付けたデータが使用済
みとなってから回収するまでの時間を短縮するようにし
た並列計算機のメモリ管理装置及び方法を提供すること
を目的とする。
It is an object of the present invention to provide a memory management apparatus and method for a parallel computer, which shortens the time from when data allocated to a cell is used to when it is collected.

【0030】また本発明は、未使用セルのフリーリスト
をキャッシュミスを少なくできるようにキャッシュ上に
保持して、高速な処理ができる並列計算機のメモリ管理
装置及方法を提供することを目的とする。
Another object of the present invention is to provide a memory management device and method for a parallel computer which can hold a free list of unused cells in a cache so as to reduce cache misses and can perform high-speed processing. .

【0031】[0031]

【課題を解決するための手段】図1は本発明の原理説明
図である。本発明は、図1(A)のように、CPU12
及びキャッシュ装置14を備えた複数のプロセッサ10
と共有メモリ20をバス16を介して接続した並列計算
機のメモリ管理装置を対象とする。この並列計算機のメ
モリ管理装置として本発明は、データ割付けに使用する
セルに分離されたメモリ領域で構成されるヒープ領域2
2と、関数呼出しで共有メモ20のスタック領域に作成
した関数フレーム26の実行に伴って必要なデータにヒ
ープ領域22の未使用セルを割付けるメモリ割付部38
と、ヒープ領域22の未使用セルが空になったときに、
ヒープ領域をサーチして使用中セルと使用済みセルに分
け、使用済みセルを回収して未使用セルに戻す第1ゴミ
回収部40と、使用中セルが関数フレーム26の実行後
に使用済みセルとなるか否か解析し、関数フレームの実
行終了時に、第1ゴミ回収部40による回収の済んだセ
ルを除く使用済みセルを回収して未使用セルに戻す第2
ゴミ回収部42とを備えたことを特徴とする。このよう
に本発明は、関数の実行終了後に不要となるデータを割
付けたセルについて、関数の実行終了でスタック領域の
関数フレームをたたむときに回収するだけでなく、関数
実行中にガーベジ・コレクションによっても回収できる
ようにし、これによってデータが不必要になってから、
その割当てセルが回収されるまでの時間を短くする。
FIG. 1 is a diagram illustrating the principle of the present invention. The present invention, as shown in FIG.
Processors 10 each having a cache device 14
And a shared memory 20 connected via a bus 16 to a memory management device of a parallel computer. As a memory management device of this parallel computer, the present invention provides a heap area 2 composed of a memory area divided into cells used for data allocation.
2, and a memory allocating unit 38 that allocates unused cells of the heap area 22 to necessary data in accordance with the execution of the function frame 26 created in the stack area of the shared memo 20 by the function call.
When the unused cells of the heap area 22 become empty,
A first garbage collection unit 40 which searches the heap area to divide the used cells and used cells, collects the used cells and returns them to unused cells, and sets the used cells to the used cells after executing the function frame 26. It is analyzed whether or not the second cell is used, and at the end of the execution of the function frame, used cells other than the cells collected by the first dust collection unit 40 are collected and returned to unused cells.
And a refuse collection unit 42. In this way, the present invention not only collects cells to which unnecessary data has been allocated after the execution of a function is completed when the function frame in the stack area is folded at the end of the function execution, but also performs garbage collection during the function execution. Can be recovered, so that when the data is no longer needed,
The time until the assigned cell is collected is shortened.

【0032】ここでヒープ領域22は未使用セルをポイ
ンタで繋げた第1リスト(フリーリスト)に入れて管理
し、第2回収部42は関数の実行後に不要となる使用中
セルを第2リスト(リクレームリスト)に入れて管理
し、第1ゴミ回収部40は、その最終フェーズで回収済
みセルを第2リストから外す。
Here, the heap area 22 is managed by putting the unused cells in a first list (free list) linked by pointers, and the second collecting unit 42 lists the used cells that become unnecessary after the execution of the function in the second list. The first garbage collection unit 40 removes the collected cells from the second list in the final phase.

【0033】更に詳細に説明すると、ヒープ領域22の
各セルは、データの割付けた時にオフし、第1リストに
戻す時にオンするフラグ(フリーフラグ)を備え、第1
ゴミ回収部40は、その最終フレーズでフラグがオン
(回収済みを示す)となっているセルを第2リスト28
から外す。第1ゴミ回収部40により回収済みとなった
第2リストのセルが関数フレームの実行終了後に重複し
て回収されるの防止する。
More specifically, each cell in the heap area 22 is provided with a flag (free flag) that turns off when data is allocated and turns on when returning to the first list.
The garbage collection unit 40 lists the cells whose flag is turned on (indicating collection) in the final phrase in the second list 28.
Remove from It prevents the cells of the second list that have been collected by the first garbage collection unit 40 from being redundantly collected after the execution of the function frame.

【0034】ヒープ領域22の各セルは、第2リストに
リンクするポインタを格納するポインタ領域を備える。
これによって関数実行後に使用済みセルとなるセルをポ
インタでつなげた第2リスト28が作成できる。また別
の第2リスト28のデータ構造として、関数の実行後に
使用済みとなる使用中セルを指し示すデータポインタと
次のリンク先を指示すリンクポインタを組とした1又は
複数のセルをリンクでつなげたリスト構造とする。これ
はLISPの組込関数consを使用した第2リストの
データ構造である。
Each cell of the heap area 22 has a pointer area for storing a pointer linked to the second list.
As a result, a second list 28 in which cells that become used cells after executing the function are connected by the pointer can be created. As another data structure of the second list 28, one or a plurality of cells in which a data pointer indicating a used cell which is used after execution of a function and a link pointer indicating a next link destination are connected by a link. List structure. This is the data structure of the second list using the built-in function cons of LISP.

【0035】第1リスト(フリーリスト)24は、サイ
ズの異なる複数種類の未使用セルをCPU毎に準備し、
メモリ割付部38は、特定のCPUによるデータの割付
け要求を受けた際に、そのCPUに割付けられている第
1リスト(フリーリスト)からデータ量に見合ったサイ
ズの未使用セルを選択して割付ける。これはヒープ領域
22について、各CPU毎にサイズの異なる未使用セル
のフリーリストを設けたシグレゲートメモリ管理法の適
用を意味する。
The first list (free list) 24 prepares a plurality of types of unused cells having different sizes for each CPU.
When receiving a data allocation request from a specific CPU, the memory allocation unit 38 selects and allocates an unused cell having a size corresponding to the data amount from a first list (free list) allocated to the CPU. wear. This means that the heap area 22 employs a method of managing a sigle gate memory in which a free list of unused cells having different sizes is provided for each CPU.

【0036】本発明のメモリ管理装置は、任意のCPU
が第1ゴミ回収部40によるヒープ領域サーチを実行し
て使用済みセルを検索した場合、他のキャシュ装置に回
収可能な使用済みセルの保持を問い合わせ、複数のキャ
ッシュ装置から応答があった場合、第1リストを保持し
ている特定のキャッシュ装置に回収動作を指示して、そ
のCPUに第1ゴミ回収部40による回収処理を実行さ
せる。
The memory management device of the present invention can
Executes a heap area search by the first garbage collection unit 40 to search for used cells, inquires of another cache device about holding of used cells that can be collected, and when there is a response from a plurality of cache devices, A specific cache device holding the first list is instructed to perform a collection operation, and the CPU causes the first garbage collection unit 40 to execute a collection process.

【0037】これによってガーベジ・コレクションで回
収した使用済みセルは、必ず使用済みセルを保持してい
るキャッシュ装置のCPUが持つフリーリストに使用済
みセルをつなげることができる。この結果、各CPUの
フリーリスト中の未使用セルは自分のキャッシュ装置の
中に存在することとなり、他のキャッシュ装置に分散し
てしまうことによるデータ割付け時のキャッシュミスを
減らし、高速に処理可能とする。
Thus, the used cells collected by the garbage collection can be always connected to the free list of the CPU of the cache device holding the used cells. As a result, unused cells in the free list of each CPU are present in their own cache devices, and cache misses during data allocation due to being distributed to other cache devices can be reduced, and high-speed processing can be performed. And

【0038】更に詳細には、任意のCPUが第1ゴミ回
収部40によるヒープ領域のサーチを実行して使用済み
セルを検索した場合、自己のキャッシュ装置からスヌー
プバス16を使用して他のキャッシュ装置に回収可能な
使用済みセルの保持を問い合わせ、複数のキャッシュ装
置からスヌープバス16のアービタ18に応答があった
場合、アービタ18のアービトレーションにより使用済
みセルを保持している特定のキャッシュ装置に回収動作
を指示し、この回収指示を受けたキャッシュ装置が、自
己のCPUに割込みを掛けて第1ゴミ回収部40による
回収処理を実行させる。
More specifically, when an arbitrary CPU searches for a used cell by executing a search of a heap area by the first garbage collection unit 40, another cache is used from its own cache device using the snoop bus 16. When the plurality of cache devices respond to the arbiter 18 of the snoop bus 16, the device requests the device to hold the used cells that can be collected, and the arbiter 18 arbitrates the collected cells to a specific cache device holding the used cells. The cache device that has instructed the operation and has received the collection instruction interrupts its own CPU and causes the first garbage collection unit 40 to execute the collection process.

【0039】ここで第1ゴミ回収部によるヒープ領域サ
ーチを実行して使用済みセルを検索したCPUは、自己
のキャッシュ装置にフリーリスト作成命令(MKF命令:ma
ke-free-list命令)を発行し、フリーリスト作成命令を
受けたキャッシュ装置はフリーリスト作成コマンド(MKF
コマンド:make-free-list コマンド)をスヌープバス1
6に発行する。
Here, the CPU that has searched the used cell by executing the heap area search by the first garbage collection unit, sends a free list creation instruction (MKF instruction: ma) to its cache device.
The cache device that has issued the ke-free-list command) and received the free list creation command issues a free list creation command (MKF
Command: make-free-list command) snoop bus 1
Issue to 6.

【0040】また回収された使用済みセルが1又は複数
のキャッシュブロックを完全に含んでいる場合、アービ
トレーションに負けたキャッシュ装置は、該当するキャ
ッシュブロックを無効状態に遷移させる。また回収可能
な使用済みセルの保持の問い合わせ対し、特定のキャッ
シュ装置のみからスヌープバスに応答があった場合、応
答を行ったキャッシュ装置が自己のCPUに割込みを掛
けて第1ゴミ回収部40の回収処理を実行させる。
If the recovered used cell completely includes one or a plurality of cache blocks, the cache device that has lost arbitration causes the corresponding cache block to transition to an invalid state. Also, in response to an inquiry about the retention of used cells that can be collected, if only a specific cache device responds to the snoop bus, the responding cache device interrupts its own CPU and causes the first garbage collection unit 40 to respond. Execute the collection process.

【0041】また、どのキャッシュ装置も回収可能な使
用済みセルを保持していない場合、回収可能と判断した
CPUのキャッシュ装置に共有メモリ20から使用済み
セルを読込んで第1ゴミ回収部40の回収処理を実行さ
せる。更に、同じくどのキャッシュ装置も回収可能な使
用済みセルを保持していない場合、共有メモリ側18で
ランダムに選んだCPUのキャッシュ装置に回収可能な
使用済みセルを送って第1ゴミ回収部40の回収処理を
実行させるるようにしてもよい。
If none of the cache devices holds the reusable used cells, the used cells are read from the shared memory 20 into the cache device of the CPU determined to be retrievable, and the first garbage collection unit 40 collects the used cells. Execute the process. Further, if none of the cache devices holds the reusable used cells, the retrievable used cells are sent to the cache device of the CPU randomly selected on the shared memory side 18 and the first garbage collection unit 40 The collection process may be executed.

【0042】本発明は、CPU及びキャッシュ装置を備
えた複数のプロセッサと共有メモリをバスを介して相互
に接続した並列計算機のメモリ管理方法を提供する。こ
の並列計算機のメモリ管理方法は、関数呼出しで共有メ
モリ20のスタック領域に作成した関数フレームの実行
に伴って必要なデータに、セルに分離されたメモリ領域
で構成されるヒープ領域の未使用セルを割付けるメモリ
割付ステップと;ヒープ領域の未使用セルが空になった
ときに、ヒープ領域をサーチして使用中セルと使用済み
セルに分け、使用済みセルを回収して未使用セルに戻す
第1ゴミ回収ステップと;使用中セルが関数フレームの
実行後に使用済みセルとなるか否か解析し、関数フレー
ムの実行終了時に、第1回収ステップで回収済みを除く
使用済みセルを回収して未使用セルに戻す第2ゴミ回収
ステップと;を備えたことを特徴とする。この並列計算
機のメモリ管理方法の詳細は、装置構成の場合と基本的
に同じになる。
The present invention provides a memory management method for a parallel computer in which a plurality of processors each having a CPU and a cache device and a shared memory are interconnected via a bus. This memory management method for a parallel computer is based on a method for storing unused cells in a heap area composed of memory areas divided into cells in data necessary for execution of a function frame created in a stack area of the shared memory 20 by a function call. Allocating memory; when unused cells in the heap area are emptied, search the heap area to divide into used cells and used cells, collect used cells and return to unused cells A first garbage collection step; analyzing whether or not the used cells become used cells after execution of the function frame, and collecting the used cells excluding the collection in the first collection step at the end of execution of the function frame. A second dust collection step of returning to unused cells. The details of the memory management method of the parallel computer are basically the same as those of the device configuration.

【0043】[0043]

【発明の実施の形態】図2は本発明による並列計算機の
システム構成の説明図である。図2において、本発明の
並列計算機は、複数のプロセッサモジュール10−1〜
10−nを備え、それぞれCPU12−1〜12−nと
キャッシュ装置14−1〜14−nを備えている。
FIG. 2 is an explanatory diagram of the system configuration of a parallel computer according to the present invention. 2, the parallel computer of the present invention includes a plurality of processor modules 10-1 to 10-1.
10-n, and CPUs 12-1 to 12-n and cache devices 14-1 to 14-n, respectively.

【0044】プロセッサモジュール10−1〜10−n
のキャッシュ装置14−1〜14−nはスヌープバス1
6により接続し、このスヌープバスはアービタ18を備
える。更にスヌープバス16には共有メモリ20が接続
されている。ここで本発明の並列計算機は、対称型マル
チプロセッサシステムSMPを構築している。対称型マ
ルチプロセッサシステムSMPは、複数のCPU12−
1〜12−nが同等な立場で処理を分担する手法であ
る。
Processor modules 10-1 to 10-n
Cache devices 14-1 to 14-n are snoop bus 1
The snoop bus comprises an arbiter 18. Further, a shared memory 20 is connected to the snoop bus 16. Here, the parallel computer of the present invention constructs a symmetric multiprocessor system SMP. The symmetric multiprocessor system SMP includes a plurality of CPUs 12-
Methods 1 to 12-n share the processing from an equivalent standpoint.

【0045】図3は本発明による並列計算機のメモリ管
理のための機能構成のブロック図である。CPU12−
1〜12−nのそれぞれにはメモリ管理部30−1〜3
0−nと関数実行部32−1〜32−nが設けられてい
る。メモリ管理部30−1〜30−nは、ランタイムシ
ステムの管理下に置かれている。
FIG. 3 is a block diagram of a functional configuration for memory management of a parallel computer according to the present invention. CPU12-
Each of the memory management units 30-1 to 30-n
0-n and function execution units 32-1 to 32-n are provided. The memory management units 30-1 to 30-n are under the control of the runtime system.

【0046】関数実行部32−1〜32−nは本発明が
処理対象とするJAVAやLISPなどのプログラム言
語で記述されたプログラムを実行する。共有メモリ20
にはヒープ領域22、フリーリスト領域24、スタック
領域25が配置されている。ヒープ領域22として本発
明にあっては、図15の従来例と同じシグレゲートメモ
リ管理法を採用している。このシグレゲートメモリ管理
法によるヒープ領域22は、CPU12−1〜12−n
ごとにヒープ領域22−1〜22−nを設け、各ヒープ
領域22−1〜22−nには異なる複数種類のサイズに
分けたデータ割付け単位であるセルが設けられている。
The function execution units 32-1 to 32-n execute a program described in a program language such as JAVA or LISP to be processed by the present invention. Shared memory 20
, A heap area 22, a free list area 24, and a stack area 25 are arranged. In the present invention, the same hegre gate memory management method as the conventional example of FIG. The heap area 22 according to the cigarette gate memory management method is stored in the CPUs 12-1 to 12-n.
Each of the heap areas 22-1 to 22-n is provided with a cell, which is a data allocation unit divided into a plurality of different sizes, in each of the heap areas 22-1 to 22-n.

【0047】CPU12−1〜12−nに対応して設け
たヒープ領域22−1〜22−nに対応して、各ヒープ
領域のセルを管理するフリーリスト(第1リスト)24
−1〜24−nがフリーリスト領域24に設けられてい
る。フリーリスト24−1〜24−nは、ヒープ領域2
2−1〜22−nのそれぞれの未使用セルをポインタの
連鎖で繋げたリストであり、図15に示したと同様、各
フリーリスト24−1〜24−nはセルのサイズごとに
分けてつなげられている。
Free list (first list) 24 for managing cells in each heap area corresponding to heap areas 22-1 to 22-n provided corresponding to CPUs 12-1 to 12-n.
-1 to 24-n are provided in the free list area 24. The free lists 24-1 to 24-n correspond to the heap area 2
This is a list in which unused cells 2-1 to 22-n are linked by a chain of pointers. As shown in FIG. 15, the free lists 24-1 to 24-n are divided and connected for each cell size. Have been.

【0048】スタック領域25には、CPU12−1〜
12−nの関数実行部32−1〜32−nで関数呼出し
際に作成された関数フレーム26−1,26−2,26
−3,・・・が配置される。このスタック領域25に作
成される関数フレーム26−1,26−2,26−3に
ついて、本発明にあっては関数フレームの実行終了後に
使用済みとなるデータを割り付けた使用中セルを示すリ
クレームリスト(第2リスト)28−1,28−2,2
8−3,・・・を配置している。
In the stack area 25, the CPUs 12-1 to 12-1
Function frames 26-1, 26-2, 26 created at the time of function call by the 12-n function execution units 32-1 to 32-n
-3,... Are arranged. With respect to the function frames 26-1, 26-2, and 26-3 created in the stack area 25, according to the present invention, a reclaim indicating a used cell to which data that is to be used after the execution of the function frame is completed is allocated. List (second list) 28-1, 28-2, 2
8-3,... Are arranged.

【0049】キャッシュ装置14−1〜14−nは、C
PU12−1〜12−nでメモリ管理または関数実行を
行う際に、共有メモリ20に存在しているデータを読み
込み、一度読み込んだ後はキャッシュ上で存在させなが
らCPU側におけるメモリ管理及び関数実行を行う。
The cache devices 14-1 to 14-n store C
When memory management or function execution is performed by the PUs 12-1 to 12-n, data existing in the shared memory 20 is read, and once read, memory management and function execution on the CPU side are performed while being present on the cache. Do.

【0050】このため通常の運用状態にあっては、キャ
ッシュ装置14−1〜14−n上に共有メモリ20のフ
リーリスト24−1〜24−nをコピーしたフリーリス
ト34−1〜34−nが存在している。またキャッシュ
装置14−1〜14−nにはフリーリストから取り出さ
れてデータが割り付けられたセルをキャッシュデータと
して格納した使用中セルのセル群36−1〜36−nが
存在することになる。
For this reason, in a normal operation state, free lists 34-1 to 34-n obtained by copying the free lists 24-1 to 24-n of the shared memory 20 on the cache devices 14-1 to 14-n. Exists. In addition, the cache devices 14-1 to 14-n have cell groups 36-1 to 36-n of cells in use which store cells which are extracted from the free list and allocated data as cache data.

【0051】キャッシュ装置14−1〜14−n及び共
有メモリ20を接続しているスヌープバス16は、バス
接続している装置におけるデータの状態をバス制御線の
参照で相互に他の装置に応答を要求することなく常時見
ることができる。これによってキャッシュ装置14−1
はスヌープバス16を介して他の装置の状態を認識し、
他の装置に同じデータが存在するか否か判断して必要な
キャッシュ処理を行うことができる。
The snoop bus 16 connecting the cache devices 14-1 to 14-n and the shared memory 20 responds to the other devices by referring to the bus control line for the state of data in the device connected to the bus. Can always be viewed without requesting As a result, the cache device 14-1
Recognizes the status of other devices via the snoop bus 16,
Necessary cache processing can be performed by determining whether or not the same data exists in another device.

【0052】アービタ18は、キャッシュ装置14に対
しロードコマンドが送出された際に他の複数のキャッシ
ュ装置から応答が得られたときアービトレーションを行
って、特定のキャッシュ装置にロードコマンドの実行を
指示する機能を有する。このアービタ18のアービトレ
ーションは、本発明にあってはキャッシュ装置14−1
〜14−n上に存在するフリーリスト34−1〜34−
nに使用済みセルを繋げるゴミ回収処理の際に使用され
る。
The arbiter 18 performs arbitration when a response is obtained from a plurality of other cache devices when a load command is sent to the cache device 14, and instructs a specific cache device to execute the load command. Has functions. The arbitration of the arbiter 18 is performed by the cache device 14-1 in the present invention.
Free lists 34-1 to 34- existing on .about.14-n
n is used at the time of garbage collection processing for connecting used cells to n.

【0053】図4は、図3のCPU12−1〜12−n
に設けているメモリ管理部30−1〜30−nの機能構
成であり、CPU12−1のメモリ管理部30−1を例
にとっている。
FIG. 4 shows the CPUs 12-1 to 12-n of FIG.
Is a functional configuration of the memory management units 30-1 to 30-n provided in the CPU 12-1, and the memory management unit 30-1 of the CPU 12-1 is taken as an example.

【0054】メモリ管理部30−1には、メモリ割付部
38、第1ゴミ回収部40、第2ゴミ回収部42が設け
られる。メモリ割付部38は、関数呼出しでスタック領
域25に作成した関数フレームの実行に伴ってデータ割
付要求が発生した際に、割付要求を処理するCPUにフ
リーリストからデータ量に見合ったサイズの未使用セル
を取り出してデータを割り付ける。このデータ割付けに
よってヒープ領域の未使用セルは使用中セルとなる。
The memory management section 30-1 is provided with a memory allocating section 38, a first dust collecting section 40, and a second dust collecting section 42. When a data allocation request is generated along with the execution of the function frame created in the stack area 25 by the function call, the memory allocation unit 38 notifies the CPU that processes the allocation request of a free list of a size corresponding to the data amount from the free list. Take out a cell and assign data. By this data allocation, unused cells in the heap area become used cells.

【0055】第1ゴミ回収部40は、ヒープ領域の未使
用セルが空になったとき、具体的には特定のCPUに設
けている特定サイズのフリーリストが空になったときに
呼ばれ、ヒープ領域をサーチして使用中セルと使用済み
セルに分け、使用済みセルを回収してフリーリストに繋
げることで未使用セルに戻すゴミ回収処理を行う。
The first garbage collection unit 40 is called when an unused cell in the heap area is emptied, specifically when a free list of a specific CPU provided in a specific CPU is emptied, A garbage collection process is performed in which the heap area is searched to divide the cell into a used cell and a used cell, and the used cell is collected and connected to a free list to return the cell to an unused cell.

【0056】この第1ゴミ回収部40による回収処理
は、例えば基本的なゴミ回収アルゴリズムとしてマーク
・スイープ・アルゴリズムを採用する。マーク・スイー
プ・アルゴリズムは、図15の従来例に示したと同様、
CPUで常時参照可能なレジスタやスタックのルートか
ら出発してポインタの参照関係を辿りながら使用中セル
に印(マーク)を付け、次にヒープ全体を操作して印の
ないセル、即ちゴミとなっている使用済みセルを回収す
る。
The collection process by the first dust collection unit 40 employs, for example, a mark sweep algorithm as a basic dust collection algorithm. The mark sweep algorithm is similar to the conventional example shown in FIG.
Starting from the root of a register or a stack that can always be referred to by the CPU, the used cell is marked while tracing the reference relation of the pointer, and then the whole heap is operated to become a cell without a mark, that is, garbage. Collect used cells.

【0057】この第1ゴミ回収部40による回収処理に
はマーク・スイープ・アルゴリズム以外に、参照カウン
タを用いる方法や移動法などを採用しても良い。いずれ
の方法にあっても、第1ゴミ回収部40は、未使用、使
用中、使用済みの3つの状態のセルが混在した状態にあ
るヒープ領域について、セルの状態を区別して仕分ける
ことにより、使用済みセルを回収し、未使用セルを再生
する処理を行うことになる。
In the collection processing by the first garbage collection unit 40, a method using a reference counter, a moving method, or the like may be employed in addition to the mark sweep algorithm. In any method, the first garbage collection unit 40 sorts the heap area in which cells in three states of unused, used, and used are mixed by distinguishing the state of the cells. A process of collecting used cells and regenerating unused cells is performed.

【0058】また図3の並列計算機にあっては、関数フ
レームの実行と第1ゴミ回収部によるガーベジ・コレク
ションを別々のCPUで並列に実行する。例えばCPU
12−2でスタック領域25の関数フレーム26−1の
実行中に、そのフリーリスト24−2が空になった場
合、他のCPU例えばCPU12−1のメモリ管理部3
0−1に設けている第1ゴミ回収部40が起動して、フ
リーリスト24−2に対応したヒープ領域22−2のゴ
ミ回収処理を実行する関数実行とゴミ回収の並列処理を
行う。これによって並列計算機システムは、関数実行と
平行してメモリ管理によるゴミ回収処理がダイナミック
に実現できる。
In the parallel computer shown in FIG. 3, execution of the function frame and garbage collection by the first garbage collection unit are executed in parallel by different CPUs. For example, CPU
If the free list 24-2 becomes empty during execution of the function frame 26-1 of the stack area 25 in 12-2, the memory management unit 3 of another CPU, for example, the CPU 12-1
The first garbage collection unit 40 provided in 0-1 is activated, and executes a function for executing garbage collection processing of the heap area 22-2 corresponding to the free list 24-2 and performs parallel processing of garbage collection. Thereby, the parallel computer system can dynamically realize the dust collection processing by the memory management in parallel with the function execution.

【0059】更に図4のメモリ管理部30−1に設けた
第2ゴミ回収部42は、図3の共有メモリ20のスタッ
ク領域25に作成した関数フレーム、例えば関数フレー
ム26−1の実行によりメモリ割付部38でフリーリス
ト24−2の未使用セルにデータに割り付けた際に、そ
のデータが関数の実行後に不要な使用済みセルとなるか
否かエスケープ解析を行う。
Further, the second garbage collection unit 42 provided in the memory management unit 30-1 in FIG. 4 executes the function frame created in the stack area 25 of the shared memory 20 in FIG. When the allocating unit 38 allocates data to an unused cell in the free list 24-2, an escape analysis is performed to determine whether or not the data becomes an unnecessary used cell after the execution of the function.

【0060】もし関数実行後に使用済みセルとなる場合
には、関数フレーム26−1に設けているリクレームリ
スト28−1に使用済みとなるセルを入れる。そして第
2ゴミ回収部42は関数フレーム26−1の実行終了後
に、リクレームリスト28−1に入っている関数実行後
に不要となっている使用済みセルを回収してフリーリス
ト24−2につなげるゴミ回収を行う。
If the cell becomes a used cell after executing the function, the used cell is put in a reclaim list 28-1 provided in the function frame 26-1. Then, after the execution of the function frame 26-1, the second garbage collection unit 42 collects the used cells that have become unnecessary after the execution of the function included in the reclaim list 28-1 and connects them to the free list 24-2. Collect garbage.

【0061】また第1ゴミ回収部40は、その最終フェ
ーズにおいて、回数済みのセルをリクレームリスト28
−1から外す。これによって第2ゴミ回収部42が、既
に第1ゴミ回収部40で回収済みとなっているセルを重
複して回収してフリーリストにつなげることを防止す
る。
In the final phase, the first garbage collection unit 40 stores the number of cells that have already been counted in the reclaim list 28.
Remove from -1. This prevents the second trash collection unit 42 from repeatedly collecting cells already collected by the first trash collection unit 40 and connecting them to the free list.

【0062】このように本発明のメモリ管理部にあって
は、第1ゴミ回収部40と第2ゴミ回収部42による使
用済みセルの平行したゴミ回収が行われる。即ち第1ゴ
ミ回収部40は、マーク・スイープ、カウンタ参照法、
移動法などのガーベジ・コレクション・アルゴリズムに
従って関数フレームの実行中にフリーリストが空になっ
たときに起動して使用済みセルを回収してフリーリスト
に繋げ、一方、第2ゴミ回収部42は、関数フレームの
実行終了でリクレームリストに入っている使用中セルを
使用済みセルとして回収してフリーリストに繋げる。
As described above, in the memory management unit of the present invention, the first and second dust collection units 40 and 42 collect the used dust in parallel from the used cells. That is, the first garbage collection unit 40 performs the mark sweep, the counter reference method,
According to a garbage collection algorithm such as a moving method, the function list is activated when the free list becomes empty during execution of the function frame to collect used cells and connect them to the free list. At the end of the execution of the function frame, the used cells included in the reclaim list are collected as used cells and connected to the free list.

【0063】このため関数フレームのエスケープ解析で
関数実行終了後に使用済みセルとなるデータの割付セル
については、関数フレームの実行終了まで回収すること
ができないが、関数フレームの実行中に、もしフリーリ
ストが空になれば、第1ゴミ回収部40による使用済み
セルの回収が自動的に行われ、結果として、その時点で
使用済みとなっているセルは、関数フレームの実行終了
を待つことなく即時にフリーリストに使用済みセルとし
て回収することができ、使用済みセルがフリーリストに
つなげて再使用可能とするまでの時間を短縮できる。
For this reason, in the escape analysis of the function frame, the allocated cell of the data which becomes the used cell after the execution of the function cannot be collected until the execution of the function frame is completed. Becomes empty, the used cells are automatically collected by the first garbage collection unit 40. As a result, the cells that have been used at that time are immediately collected without waiting for the completion of the execution of the function frame. Can be collected as used cells in a free list, and the time required for a used cell to be connected to a free list and made reusable can be reduced.

【0064】図5は、図3のヒープ領域22に存在する
セルのデータ構造の説明図である。本発明のヒープ領域
に存在するセル44は、ヘッダ46とデータ48から構
成され、ヘッダ46にはデータ48に対しデータ割付け
が行われた際にCPUが常時参照可能なレジスタやスタ
ックなどのルートからポインタ連鎖によりリンクが行わ
れるポインタを格納するポインタ領域50が設けられて
いる。
FIG. 5 is an explanatory diagram of the data structure of a cell existing in the heap area 22 of FIG. The cell 44 existing in the heap area of the present invention is composed of a header 46 and data 48, and the header 46 is provided from a root such as a register or a stack which can always be referred to by the CPU when data is allocated to the data 48. A pointer area 50 for storing a pointer linked by a pointer chain is provided.

【0065】このポインタ領域50は従来のセル44に
あっても同様であるが、本発明にあってはヘッダ46に
新たにフリーフラグ52を設けている。フリーフラグ5
2は、セル44をフリーリストに繋ぐときにオンとな
り、フリーリストから外してデータを割り付けるときに
オフとなる。即ちフリーフラグ52は、オン状態でフリ
ーリストに繋がっており、フリーリストから取り外して
データ割付けによる使用中セルになるとオフとなる。
The same applies to the pointer area 50 in the conventional cell 44. However, in the present invention, a free flag 52 is newly provided in the header 46. Free flag 5
2 is turned on when the cell 44 is connected to the free list, and turned off when the cell 44 is removed from the free list and data is allocated. That is, the free flag 52 is connected to the free list in the on state, and is turned off when the cell is removed from the free list and becomes a busy cell by data allocation.

【0066】このセル44のヘッダ46に設けたフリー
フラグ52は、図3のスタック領域25の関数フレーム
26−1のリクレームリストにセル44を入れた場合に
利用する。即ち関数フレーム26のリクレームリスト2
8には、エスケープ解析により関数実行後に使用済みと
なるセルを入れており、リクレームリスト28に入れた
セルはすべてデータ割付けを行った使用中セルであるこ
とから、そのフリーフラグ52はすべてオフとなってい
る。
The free flag 52 provided in the header 46 of the cell 44 is used when the cell 44 is put in the reclaim list of the function frame 26-1 in the stack area 25 in FIG. That is, the reclaim list 2 of the function frame 26
In FIG. 8, cells that have been used after the execution of the function by escape analysis are entered, and all the cells entered in the reclaim list 28 are in-use cells to which data has been allocated, so that their free flags 52 are all turned off. It has become.

【0067】一方、図4の第1ゴミ回収部40は、関数
フレームの実行から独立してフリーリストが空になった
際に使用済みセルを回収しており、使用済みとなるセル
をリクレームリストに残しておくと、関数フレームの実
行終了で重複して回収される問題がある。
On the other hand, the first garbage collection unit 40 in FIG. 4 collects used cells when the free list becomes empty independently of execution of the function frame, and reclaims used cells. If it is left in the list, there is a problem that it will be collected twice at the end of execution of the function frame.

【0068】そこで第1ゴミ回収部40にあっては、使
用済みセルを回収してフリーリストにつなげるときに、
そのフリーフラグをオンしておく、このためリクレーム
リストに入れている使用中セルも、第1ゴミ回収部40
による回収の際にそのフリーフラグがオフからオンとな
る。
Therefore, in the first garbage collection unit 40, when collecting used cells and connecting them to the free list,
The in-use cell included in the reclaim list for which the free flag is set to ON is also used by the first garbage collection unit 40.
The free flag changes from off to on at the time of collection by.

【0069】そして、第1ゴミ回収部40は、その最終
フェーズでリクレームリストにつないでるセルにうち、
フリーフラグがオンとなっているフリーリストにつなげ
たセルを外す。これによって、第1ゴミ回収部40によ
り回収された使用済みセルが関数フレームの使用時に第
2ゴミ回収部42によって重複してフリーリストに回収
されることを防止する。
Then, the first garbage collection unit 40 stores the cells connected to the reclaim list in the final phase.
Remove the cell connected to the free list whose free flag is on. This prevents the used cell collected by the first dust collection unit 40 from being redundantly collected in the free list by the second dust collection unit 42 when the function frame is used.

【0070】図6は、関数呼出しで図3の共有メモリ2
0のスタック領域25に作成される関数フレーム26の
説明図である。このスタック領域に作成する関数フレー
ム26は、引数領域54、テンポラリ領域56、レジス
タセーブ領域58、フレームポインタセーブ領域62及
びリターンアドレス領域64を、通常の関数フレームと
同様に備えているが、本発明にあっては新たにリクレー
ムリスト領域60を設け、図3に示したリクレームリス
トの集合を参照できるようにしている。
FIG. 6 shows a function call to the shared memory 2 of FIG.
FIG. 4 is an explanatory diagram of a function frame 26 created in a stack area 25 of 0. The function frame 26 created in the stack area includes an argument area 54, a temporary area 56, a register save area 58, a frame pointer save area 62, and a return address area 64 in the same manner as a normal function frame. In the above, a reclaim list area 60 is newly provided so that a set of reclaim lists shown in FIG. 3 can be referred to.

【0071】図7は、リクレームリストを実現するため
のセルのデータ構造の説明図である。図7のセル44に
あっては、ヘッダ46に図5と同様、ポインタ領域50
及びフリーフラグ52が設けられており、データ48に
ついては新たにリクレームリスト用ポインタ領域66が
設けられている。
FIG. 7 is an explanatory diagram of a data structure of a cell for realizing a reclaim list. In the cell 44 shown in FIG. 7, the header 46 has the pointer area 50 as in FIG.
And a free flag 52, and a reclaim list pointer area 66 is newly provided for the data 48.

【0072】このセル44に割り当てられたデータは、
エスケープ解析により関数の実行終了で不要となるため
にリクレームリスト28に入れられることになるが、具
体的にはリクレームリスト用ポインタ領域66に図6の
関数フレーム26のリクレームリスト領域60につなが
るポインタを書き込む。これによってリクレームリスト
は、関数フレーム26のリクレームリスト領域60をル
ートとしてポインタ連鎖でなるリンク構造を持つことに
なる。
The data assigned to this cell 44 is
Since it becomes unnecessary at the end of execution of the function by escape analysis, it is put in the reclaim list 28. Specifically, it is stored in the reclaim list pointer area 66 in the reclaim list area 60 of the function frame 26 in FIG. Write the connected pointer. As a result, the reclaim list has a link structure consisting of a chain of pointers with the reclaim list area 60 of the function frame 26 as a root.

【0073】図8は本発明で使用するリクレームリスト
28の他のデータ構造の説明図であり、LISPのコン
ス(cons−cell)のデータ構造を用いたことを
特徴とする。即ちリクレームリスト28は、LISPの
コンスセル68−1,68−2,68−3を用いたリス
ト構造をとっている。コンスセル68−1〜68−3
は、関数実行後に使用済みとなるデータを示すデータポ
インタ70−1〜70−3と次のリンク先を示すリンク
ポインタ72−1〜72−3を組としたセル構造を持っ
ている。このLISPのコンスセルによるリスト構造を
利用した場合には、データそのものにアクセスすること
なくリクレームリスト28に入っているセルを判断する
ことができる利点がある。
FIG. 8 is an explanatory diagram of another data structure of the reclaim list 28 used in the present invention, which is characterized by using a cons-cell data structure of LISP. That is, the reclaim list 28 has a list structure using the LISP cons cells 68-1, 68-2, and 68-3. Cons cells 68-1 to 68-3
Has a cell structure in which data pointers 70-1 to 70-3 indicating used data after execution of a function and link pointers 72-1 to 72-3 indicating the next link destination are set. When the list structure using the cons cells of the LISP is used, there is an advantage that the cells included in the reclaim list 28 can be determined without accessing the data itself.

【0074】図9は、図4のメモリ管理部30−1に設
けているメモリ割付部38とメモリ割付けに伴うデータ
を使用した関数の実行に伴って動作する第2ゴミ回収部
42の処理を示したフローチャートである。
FIG. 9 shows the processing of the memory allocating section 38 provided in the memory managing section 30-1 of FIG. 4 and the processing of the second garbage collecting section 42 which operates in accordance with the execution of the function using the data associated with the memory allocation. It is a flowchart shown.

【0075】図9において、メモリ割付処理は関数フレ
ームの実行に伴う割付要求が生じた際に呼ばれ、ステッ
プS1でデータ量に対応したサイズの未使用セルを該当
するCPUのフリーリストから取り出し、データを割り
付ける。このときセルのフリーフラグをオフにする。
In FIG. 9, the memory allocation process is called when an allocation request is generated in accordance with the execution of a function frame. In step S1, an unused cell having a size corresponding to the data amount is extracted from the corresponding CPU free list. Assign data. At this time, the free flag of the cell is turned off.

【0076】続いてステップS2である関数Fの実行終
了後に使用済みセルとなるか否かのエスケープ解析を行
う。このエスケープ解析の結果、ステップS3で使用済
みとなるセルと判断された場合には、ステップS4に進
み、関数Fの関数フレームに設けているリクレームリス
トに使用済みとなるセルを入れる。使用済みとならなけ
れば、ステップS4の処理をスキップする。
Subsequently, escape analysis is performed to determine whether or not the cell becomes a used cell after the execution of the function F in step S2 is completed. As a result of the escape analysis, if it is determined in step S3 that the cell is a used cell, the process proceeds to step S4, and the used cell is put in the reclaim list provided in the function frame of the function F. If it is not used, the process of step S4 is skipped.

【0077】続いてステップS5で関数Fの終了の有無
をチェックしており、関数が終了するまで、ステップS
1〜S5を割付要求が生ずるごとに繰り返している。ス
テップS5で関数フレームの終了が判別されると、ステ
ップS6でリクレームリストに入っているセルを回収し
て各サイズに対応したフリーリストにつなげる。ここで
リクレームリストに入っているセルのフリーフラグは全
てオフとなっていることから、フリーリストにつなぐ際
にフリーフラグをオンとする。
Subsequently, in step S5, it is checked whether the function F has been completed.
Steps 1 to S5 are repeated each time an allocation request is issued. When the end of the function frame is determined in step S5, the cells included in the reclaim list are collected in step S6 and connected to a free list corresponding to each size. Here, since the free flags of the cells included in the reclaim list are all off, the free flags are turned on when connecting to the free list.

【0078】図10は図4のメモリ管理部に設けている
第1ゴミ回収部40による処理のフローチャートであ
る。第1ゴミ回収処理は、関数実行に伴ってフリーリス
トが空となった際に呼ばれて起動する。このゴミ回収処
理は、マーク・スイープ・アルゴリズムを例にとってい
る。まずステップS1でマーク処理を行う。
FIG. 10 is a flowchart of a process performed by the first dust collection unit 40 provided in the memory management unit of FIG. The first garbage collection process is called and activated when the free list becomes empty due to execution of a function. The garbage collection process uses a mark sweep algorithm as an example. First, mark processing is performed in step S1.

【0079】即ちCPUで常時参照可能なレジスタやス
タックのデータをルートとしてポインタを辿り、ポイン
タで辿れる使用中セルにマーク(印)を付ける。次にス
テップS2でスイープ処理を行う。スイープ処理はマー
ク処理の済んだヒープを順に調べ、マークのないセルを
使用済みセルとしてフリーリストに戻す。このときセル
のフリーフラグをオンにする。
That is, the pointer is traced by using the data of the register or the stack which can always be referred to by the CPU as a root, and a mark is put on the in-use cell traceable by the pointer. Next, sweep processing is performed in step S2. In the sweep processing, the heap that has been marked is checked in order, and unmarked cells are returned to the free list as used cells. At this time, the free flag of the cell is turned on.

【0080】続いてステップS3のゴミ回収処理の最終
フェーズで、リクレームリスト更新を行う。リクレーム
リストの更新は各関数フレームのリクレームリストを辿
り、フリーフラグがオンとなっているセル、即ちステッ
プS2のスイープ処理によってフリーリストに戻された
セルをリストから外す。
Subsequently, the reclaim list is updated in the final phase of the garbage collection process in step S3. The reclaim list is updated by tracing the reclaim list of each function frame, and excluding cells for which the free flag is turned on, that is, cells returned to the free list by the sweep processing in step S2, from the list.

【0081】この第1ゴミ回収処理におけるステップS
3の最終フレーズでのリクレームリスト更新により、図
3のスタック領域25の関数フレーム26−1〜26−
3に設けているリクレームリスト28−1〜28−3に
は、既に使用済みとなった使用済みセルは存在せず、そ
の後の関数実行で使用済みとなるセルのみが残ることと
なり、全体として関数の実行終了でフリーリストに戻す
使用済みセルを必要最小限に抑え、短時間で使用済みセ
ルをフリーリストに戻すことができる。
Step S in the first garbage collection process
3, the function frames 26-1 to 26- in the stack area 25 in FIG.
In the reclaim lists 28-1 to 28-3 provided in No. 3, there are no used cells that have already been used, and only the cells that have been used in the subsequent execution of the function remain. The used cells to be returned to the free list at the end of the execution of the function can be minimized, and the used cells can be returned to the free list in a short time.

【0082】図11は、図4のメモリ管理部における第
1ゴミ回収部40により使用済みセルを回収してフリー
リストにつなげる場合、回収するセルが存在するキャッ
シュ装置に対応したCPUのフリーリストにつなぐメモ
リ管理処理の実施形態の説明図である。
FIG. 11 shows a case where used cells are collected by the first garbage collection unit 40 in the memory management unit of FIG. 4 and are connected to a free list. FIG. 8 is an explanatory diagram of an embodiment of a memory management process to be connected;

【0083】いまCPU12−1がマーク・スイープ・
アルゴリズムによるゴミ回収処理を実行して、回収する
使用済みセルを見つけたとする。CPU12−1は回収
する使用済みセルの論理アドレスをオペランドとして、
フリーリスト作成命令(MKF命令:make-free-list 命
令)を実行する。
Now, the CPU 12-1 sets the mark sweep
Suppose that a used cell to be collected is found by executing garbage collection processing by an algorithm. The CPU 12-1 uses the logical address of the used cell to be recovered as an operand.
Execute a free list creation command (MKF command: make-free-list command).

【0084】このフリーリスト作成命令は、通常のロー
ド命令のように、論理アドレスを物理アドレスに変換し
てキャッシュ装置14−1にステップS1でキャッシュ
要求となるフリーリスト作成命令を発行する。CPU1
2−1からステップS1のフリーリスト作成命令を受け
たキャッシュ装置14−1は、フリーリスト作成命令の
識別子を付けて回収する使用済みセルの物理アドレスを
スヌープバス16に流すフリーリスト作成コマンドの発
行をステップS2で行う。
This free list creation instruction converts a logical address into a physical address like a normal load instruction, and issues a free list creation instruction to be a cache request in step S1 to the cache device 14-1. CPU1
The cache device 14-1 that has received the free list creation command in step S <b> 1 from 2-1 issues a free list creation command for passing the physical address of the used cell to be collected with the identifier of the free list creation command to the snoop bus 16. Is performed in step S2.

【0085】このキャッシュ装置14−1からのフリー
リスト作成コマンドに対し、CPU12−1が発見した
回収する使用済みセルをキャッシュ装置14−2とキャ
ッシュ装置14−nの2つが保持していたとすると、キ
ャッシュ装置14−2,と14−nはスヌープバス16
に対しフリーリスト作成応答を、ステップS3,S4で
発行する。
In response to the free list creation command from the cache device 14-1, assume that the cache device 14-2 and the cache device 14-n hold the used cells to be recovered found by the CPU 12-1. The cache devices 14-2 and 14-n are connected to the snoop bus 16
, A free list creation response is issued in steps S3 and S4.

【0086】キャッシュ装置14−2,14−nからの
フリーリスト作成応答はアービタ18で受信され、アー
ビタ18は通常のロード命令の場合と同様に、フリーリ
スト作成の識別子の付いた物理アドレスのキャッシュブ
ロックを持つキャッシュ装置14−2,14−n同士で
のアービトレーションを行い、アービトレーションに勝
ったキャッシュ装置例えばキャッシュ装置14−2に対
し、ステップS6でフリーリスト作成ウィン応答(MK
Lwin応答)を発行する。
The free list creation response from the cache devices 14-2 and 14-n is received by the arbiter 18, and the arbiter 18 caches the physical address with the free list creation identifier as in the case of the normal load instruction. Arbitration is performed between the cache devices 14-2 and 14-n having the blocks, and a free list creation win response (MK) is given to the cache device that has won the arbitration, for example, the cache device 14-2 in step S6.
(Lwin response).

【0087】アービタ18からのフリーリスト作成ウィ
ン応答を受けたキャッシュ装置14−2は、ステップS
7で自分のCPU12−2に対しフリーリスト作成割込
みを発行する。この割込みを受けてCPU12−2は、
キャッシュ装置14−2上に存在する回収対象となって
いる使用済みセルを同じくキャッシュ装置14−2上に
存在する自己のフリーリストにつなげる。
The cache device 14-2 that has received the free list creation win response from the arbiter 18 returns to step S
At 7, a free list creation interrupt is issued to its own CPU 12-2. Upon receiving this interrupt, the CPU 12-2
The used cells that are to be collected and exist on the cache device 14-2 are linked to their own free list that also exists on the cache device 14-2.

【0088】図12は、図11のステップS1〜S7に
示した回収対象となった使用済みセルが複数のキャッシ
ュ装置上に存在した場合の各部の処理機能を表わしてい
る。
FIG. 12 shows the processing function of each unit when the used cells to be collected shown in steps S1 to S7 of FIG. 11 exist on a plurality of cache devices.

【0089】図12において、CPU12−1は第1ゴ
ミ回収処理を実行することで、例えばキャッシュ装置1
4−2と14−nの両方に存在している物理アドレスの
キャッシュブロックに対応する使用済みセルa1を見つ
けたとする。
In FIG. 12, the CPU 12-1 executes the first garbage collection process, thereby, for example,
It is assumed that the used cell a1 corresponding to the cache block of the physical address existing in both 4-2 and 14-n is found.

【0090】この場合、CPU12−1は使用済みセル
の論理アドレスを物理アドレスに変換してキャッシュ装
置14−1にメークフリーリスト命令を発行し、キャッ
シュ装置14−1はスヌープバス16にメークフリーリ
ストの識別子を付した物理アドレスを発行する。
In this case, the CPU 12-1 converts the logical address of the used cell into a physical address and issues a make-free list instruction to the cache device 14-1, and the cache device 14-1 sends the make-free list instruction to the snoop bus 16. Issue a physical address with the identifier of

【0091】このメークフリーリストの識別子を付けた
物理アドレスに対し、その物理アドレスのキャッシュブ
ロックa2を保持しているキャッシュ装置14−2,1
4−nのそれぞれが、メークフリーリスト応答をスヌー
プバス16からアービタ18に発行する。
For the physical address to which the identifier of the make-free list is attached, the cache device 14-2, 1 holding the cache block a2 of the physical address
4-n each issue a make-free list response from the snoop bus 16 to the arbiter 18.

【0092】アービタ18は、通常のロード命令と同
様、キャッシュ装置14−2,14−nの2つについて
アービトレーションを実行し、例えばキャッシュ装置1
4−2に対しフリーリスト作成ウィン応答を発行する。
これを受けてキャッシュ装置14−2は、自分のCPU
12−2にメークフリーリスト割込みを発行し、CPU
12−2が物理アドレスのキャッシュブロックa2を使
用済みセルとして自分のフリーリスト34−2につなげ
る回収処理を実行する。
The arbiter 18 executes arbitration for two of the cache devices 14-2 and 14-n as in the case of a normal load instruction.
A free list creation win response is issued to 4-2.
In response, the cache device 14-2 has its own CPU.
Issue a make-free list interrupt to 12-2, and
12-2 executes a collection process of connecting the cache block a2 of the physical address as a used cell to its own free list 34-2.

【0093】このようなキャッシュ処理に対応して共有
メモリ20側には、ヒープ領域22のデータa1〜a3
の割付セル、フリーリスト領域24のフリーリスト24
−1〜24−nの各々についてオリジナルが存在してい
る。
In response to such a cache process, the data a1 to a3 of the heap area 22 are stored in the shared memory 20 side.
Cell, free list 24 in free list area 24
An original exists for each of -1 to 24-n.

【0094】図12のキャッシュ装置14−2とキャッ
シュ装置14−nに同じデータa2の割付セルが存在す
る状況は、例えば図13のようなリスト構造のデータ割
付けがヒープ領域22において行われた場合である。
The situation where the same cell a2 is allocated to the cache device 14-2 and the cache device 14-n in FIG. 12 is caused by the case where the data allocation of the list structure as shown in FIG. It is.

【0095】図13において、CPU12−1,12−
2,12−nは、それぞれレジスタやスタックなどの常
時参照可能なデータをルートとして、ヒープ領域22に
関数実行に必要となったデータの未使用セルの割付けで
得られた使用中セルをポインタでリンクしたリスト構造
のデータとして持っている。
In FIG. 13, CPUs 12-1 and 12-
Reference numerals 2, 12-n denote in-use cells obtained by allocating unused cells of data necessary for executing functions to the heap area 22 with pointers, using data that can always be referred to, such as registers and stacks, as roots. It has as data of linked list structure.

【0096】ここでCPU12−2にあっては、ルート
R21からデータa1,a2,a3とリンクした使用中
セルのリスト構造を持っており、一方、CPU12−n
にあってはルートRn2からデータn1にリンクし、続
いてCPU12−2で使用しているデータa2にリンク
した後に再び自分のデータn3に戻り、使用中セルのリ
スト構造を使用している。
Here, the CPU 12-2 has a list structure of cells in use linked from the route R21 to the data a1, a2 and a3, while the CPU 12-n
In this case, the data is linked from the route Rn2 to the data n1, and then linked to the data a2 used by the CPU 12-2, and then returns to its own data n3 to use the list structure of the used cells.

【0097】このような2つのCPU12−2,12−
nにおけるデータのリスト構造により、図2のキャッシ
ュ装置14−2,14−nのように、同じデータa2の
使用中セルが異なるキャッシュ上に存在することにな
る。
The two CPUs 12-2 and 12-
Due to the data list structure in n, the cells in use of the same data a2 exist in different caches, as in the cache devices 14-2 and 14-n in FIG.

【0098】そして、あるタイミングでCPU12−1
がフリーリスト34−2が空になったことに基づいて第
1ゴミ回収処理を実行して、データa2が使用済みセル
であると認識した場合、図12のようなデータa2の使
用済みセルが存在する2つのキャッシュ装置14−2と
キャッシュ装置14−nのうちのいずれか一方、例えば
キャッシュ装置14−2のフリーリスト34−2にデー
タa2の使用済みセルをつなげる回収処理を行うように
なる。
Then, at a certain timing, the CPU 12-1
Performs the first garbage collection process based on the fact that the free list 34-2 becomes empty, and recognizes that the data a2 is a used cell, the data a2 as shown in FIG. A collection process for connecting the used cell of the data a2 to one of the existing two cache devices 14-2 and 14-n, for example, the free list 34-2 of the cache device 14-2 is performed. .

【0099】このような使用済みセルの回収処理によっ
て、各CPU12−1〜12−nのフリーリスト34−
1〜34−nの未使用セルは、全てそれぞれのキャッシ
ュ装置の中に存在することとなり、あるキャッシュ装置
のフリーリストに繋がっている未使用セルが他のキャッ
シュ装置に分散して存在することを回避し、キャッシュ
間の処理を不要とすることで、データ割付時のキャッシ
ュミスを減らし、処理を高速化する。
By the process of collecting used cells as described above, the free list 34- of each of the CPUs 12-1 to 12-n is obtained.
Unused cells 1-34-n are all present in each cache device, and it is assumed that unused cells connected to the free list of a certain cache device are distributed and present in other cache devices. By avoiding this and eliminating the need for processing between caches, cache misses during data allocation are reduced, and processing is accelerated.

【0100】図14は、図11及び図12のCPU12
−1で回収しようとするデータの使用済みセルがキャッ
シュ装置14−2,14−nに存在した場合の処理の手
順を示したタイムチャートである。
FIG. 14 shows the CPU 12 of FIGS. 11 and 12.
11 is a time chart showing a procedure of processing when a used cell of data to be collected by -1 exists in the cache devices 14-2 and 14-n.

【0101】図14において、第1ゴミ回収処理により
回収する使用済みセルを見つけたCPU12−1は、ス
テップS1で回収しようとする使用済みセルの論理アド
レスを物理アドレスに変換してフリーリスト作成命令
(MKF命令)をキャッシュ装置14−1に発行する。
In FIG. 14, the CPU 12-1 having found the used cell to be collected by the first garbage collection process converts the logical address of the used cell to be collected in step S1 into a physical address, and issues a free list creation instruction. (MKF instruction) to the cache device 14-1.

【0102】これを受けてキャッシュ装置14−1は、
ステップS2でフリーリスト作成の識別子を付けた物理
アドレスをスヌープバス16に流すフリーリスト作成コ
マンド発行(MKFコマンド発行)を行う。このコマン
ド発行を受けて、回収する使用済みセルを保持している
キャッシュ装置14−2,14−nのそれぞれが、ステ
ップS3及びS4でスヌープバス16にメークフリーリ
スト応答(MFK応答)を発行する。この応答を受けた
アービタ18はステップS5でアービトレーションを実
行し、ステップS6で例えばキャッシュ装置14−2に
対しフリーリスト作成ウィン(MKFウィン)の応答を
発行する。
In response, the cache device 14-1
In step S2, a free list creation command (MKF command issuance) for causing a physical address to which a free list creation identifier is assigned to flow to the snoop bus 16 is issued. In response to this command issuance, each of the cache devices 14-2 and 14-n holding the used cells to be collected issues a make-free list response (MFK response) to the snoop bus 16 in steps S3 and S4. . The arbiter 18 having received this response executes arbitration in step S5, and issues a free list creation win (MKF win) response to the cache device 14-2 in step S6.

【0103】このため、キャッシュ装置14−2がステ
ップS7で自分のCPU12−2に対しフリーリスト作
成割込みを発行し、CPU12−2がステップS8で割
込処理によりフリーリスト作成の対象となった物理アド
レスのキャッシュブロック即ち使用済みセルを自分のフ
リーリストに繋げるセル回収を行う。
For this reason, the cache device 14-2 issues a free list creation interrupt to its own CPU 12-2 in step S7, and the CPU 12-2 in step S8 executes the free list creation process by the interrupt processing. A cell is collected to connect the cache block of the address, that is, the used cell to its own free list.

【0104】そしてステップS9でCPU12−2は正
常終了応答をキャッシュ装置14−2に発行し、これを
受けてキャッシュ装置14−2がスヌープバスに正常終
了応答のコマンドを発行し、ステップS11で要求元の
キャッシュ装置14−2,14−1が正常終了応答割込
みを命令発行元のCPU12−1に返し、一連の処理を
終了する。
In step S9, the CPU 12-2 issues a normal end response to the cache device 14-2. In response to this, the cache device 14-2 issues a normal end response command to the snoop bus. The original cache devices 14-2 and 14-1 return a normal end response interrupt to the instruction issuing CPU 12-1 and end a series of processing.

【0105】更にステップS10の正常終了応答はアー
ビトレーションに負けたキャッシュ装置14−nでも受
信され、この場合、キャッシュ装置14−nに存在する
回収対象となった使用済みセルがキャッシュブロックに
完全に含まれている場合には、回収した使用済みセルを
完全に含むキャッシュブロックの無効化を行う。
Further, the normal end response in step S10 is also received by the cache device 14-n that has lost the arbitration, and in this case, the used cells that are to be collected and exist in the cache device 14-n are completely included in the cache block. If so, invalidate the cache block completely including the collected used cells.

【0106】以上のキャッシュ処理は、あるCPUが回
収するデータを見つけた場合に他の複数のキャッシュ装
置上に回収対象となる使用済みセルのキャッシュブロッ
クが存在する場合、即ち共有状態におけるキャッシュ処
理を例にとるものであったが、図12において、回収し
ようとする使用済みセルのデータが例えばキャッシュ装
置14−2にのみ存在する状態、即ちエクスクルーシブ
状態の場合には、キャッシュ装置14−2はステップS
3のスヌープバス16に対するフリーリスト作成の応答
発行を行うことなく、直ちにステップS7のフリーリス
ト作成割込発行を自分のCPU12−2に対し行って、
使用済みセルをキャッシュ上のフリーリストに繋げる。
The cache processing described above is performed when a certain CPU finds data to be collected and a cache block of a used cell to be collected exists on a plurality of other cache devices. In FIG. 12, when the data of the used cell to be collected exists only in the cache device 14-2, for example, in the exclusive state in FIG. S
3 without issuing a free list creation response to the snoop bus 16 and immediately issuing a free list creation interrupt in step S7 to its own CPU 12-2.
Link used cells to a free list on the cache.

【0107】またCPU12−1のフリーリスト作成命
令に基づいてキャッシュ装置14−1からスヌープバス
16にフリーリスト作成コマンドを発行しても、回収し
ようとする使用済みセルがキャッシュ装置14−1〜1
4−nのいずれにも存在しない場合には、通常のロード
命令と同様に、共有メモリ20がフリーリスト作成コマ
ンドをスヌープバス16に発行したキャッシュ装置14
−1に対し、回収対象とする使用済みセルを送り、これ
に伴いキャッシュ装置14−1は自分のCPU14−1
にフリーリスト作成割込みを掛け、CPU12−1のフ
リーリスト34−1に共有メモリ20から読み込まれた
使用済みセルが繋がることになる。
Even if a free list creation command is issued from the cache device 14-1 to the snoop bus 16 based on the free list creation command of the CPU 12-1, the used cells to be collected are not cache devices 14-1 to 14-1.
4-n, the shared memory 20 issues the free list creation command to the snoop bus 16 in the same manner as a normal load instruction.
-1 and sends the used cell to be collected to the cache device 14-1.
Is interrupted, and the used cell read from the shared memory 20 is connected to the free list 34-1 of the CPU 12-1.

【0108】更に、回収対象とする使用済みセルがキャ
ッシュ装置14−1〜14−nのいずれにも存在しなか
った場合、共有メモリ20からランダムに選んだキャッ
シュ装置14−1〜14−nのいずれかに使用済みセル
のデータブロックを送り、これを受け取ったキャッシュ
装置が自分のCPUに割込みを掛けて、そのCPUのフ
リーリストに使用済みセルを繋げるようにしてもよい。
Further, when the used cell to be collected does not exist in any of the cache devices 14-1 to 14-n, the cache device 14-1 to 14-n selected at random from the shared memory 20 is used. The data block of the used cell may be sent to any of them, and the cache device receiving the data block may interrupt the own CPU and connect the used cell to the free list of the CPU.

【0109】このような処理によって、並列計算機の各
CPUに割り当てられたフリーリストの未使用セルは自
己のキャッシュ装置の中に存在することとなり、フリー
リストで管理している未使用セルがキャッシュ上に分散
してしまうことによるデータ割付り時のキャッシュミス
を減らし、高速化を図ることができる。
As a result of such processing, unused cells in the free list allocated to each CPU of the parallel computer exist in their own cache devices, and unused cells managed in the free list are stored in the cache. This reduces cache misses at the time of data allocation due to scattered data, and increases the speed.

【0110】なお、上記の実施形態は本発明の並列計算
機のメモリ管理を適用するプログラム言語としてJAV
AやLISPを例にとるものであったが、これらのプロ
グラム言語と同様なポインタの連鎖によりデータを繋げ
たリスト構造を持つプログラム言語につき同様に適用で
きる。例えばオブジェクト指向プログラミングを行って
いるC++のようなプログラム言語であっても、本発明の
メモリ管理を適用することが可能である。
The above-described embodiment uses JAVA as a program language for applying the memory management of the parallel computer of the present invention.
Although A and LISP are taken as examples, the present invention can be similarly applied to a programming language having a list structure in which data is linked by a chain of pointers similar to these programming languages. For example, the memory management of the present invention can be applied to a programming language such as C ++ that performs object-oriented programming.

【0111】また本発明は、その目的と利点を損なわな
い適宜の変形を含み、更に上記の実施形態に示した数値
による限定は受けない。
Further, the present invention includes appropriate modifications which do not impair the objects and advantages thereof, and is not limited by the numerical values shown in the above embodiments.

【0112】[0112]

【発明の効果】以上説明してきたように本発明によれ
ば、関数の実行終了後に不要となるデータを割付けたセ
ルにつき、関数の実行終了時に回収するだけでなく、関
数実行中のガーベジ・コレクションによっても回収でき
るようにして、データが不必要になってからデータを割
付けた使用済みセルを回収するまでの時間を短縮し、回
収のコストを低く抑えることができる。
As described above, according to the present invention, a cell to which unnecessary data is allocated after the execution of a function is not only collected at the end of execution of the function, but also garbage collected during execution of the function. In such a case, it is possible to shorten the time from when the data is no longer needed to when the used cell to which the data is allocated is collected, and to reduce the cost of collection.

【0113】また、各CPUごとに設けたフリーリスト
に繋がる未使用セルは全て自己のキャッシュ装置上に存
在するようにゴミ回収処理の際のキャッシュ処理を行う
ことで、各キャッシュ装置に繋がっている使用済みセル
が他のキャッシュ装置に分散するような状態を防ぎ、こ
れによってデータ割付要求が発生した際のキャッシュ間
での未使用セルのやり取りを不要にし、キャッシュミス
の低減と、より高速の未使用セルの割付けが実現でき
る。 (付記) (付記1)CPU及びキャッシュ装置を備えた複数のプ
ロセッサと共有メモリをバスを介して接続した並列計算
機のメモリ管理装置に於いて、データ割付け単位となる
セルに分離されたメモリ領域で構成されるヒープ領域
と、関数呼出しで前記共有メモリのスタック領域に作成
した関数フレームの実行に伴って必要なデータに前記ヒ
ープ領域の未使用セルを割付けるメモリ割付部と、ヒー
プ領域の未使用セルが空になったときに、ヒープ領域を
サーチして使用中セルと使用済みセルに分け、前記使用
済みセルを回収して未使用セルに戻す第1ゴミ回収部
と、使用中セルが関数フレームの実行後に使用済みセル
となるか否か解析し、関数フレームの実行終了時に、前
記第1ゴミ回収部で回収済みを除く使用済みセルを回収
して未使用セルに戻す第2ゴミ回収部と、を備えたこと
を特徴とする並列計算機のメモリ管理装置。(1) (付記2)付記1記載のメモリ管理装置に於いて、前記
ヒープ領域は未使用セルをポインタで繋げた第1リスト
(free-list) で管理し、前記第2ゴミ回収部は関数の実
行後に不要となる使用中セルを第2リスト(reclaim-lis
t)に登録して管理し、前記第1ゴミ回収部は、その最終
フェーズで回収済みセルを前記第2リストから外すこと
を特徴とするメモリ管理装置。(2) (付記3)付記2記載のメモリ管理装置に於いて、前記
ヒープ領域の各セルは、データ割付け時にオフし前記第
1リストに戻す時にオンするフラグ(free-flag) を備
え、前記第1ゴミ回収部は、その最終フェーズで前記フ
ラグがオンとなっている使用中セルを前記第2リストか
ら外すことを特徴とするメモリ管理装置。(3) (付記4)付記1記載のメモリ管理装置に於いて、前記
ヒープ領域の各セルは、前記第2リストとリンクするポ
インタを格納するポインタ領域を備えたことを特徴とす
るメモリ管理装置。 (付記5)付記1記載のメモリ管理装置に於いて、前記
第2リストは、関数の実行後に使用済みとなる使用中セ
ルを指し示すデータポインタと次のリンク先を指示すリ
ンクポインタを組とした1又は複数のセルをリンクでつ
なげたリスト構造を有することを特徴とするメモリ管理
装置。 (付記6)付記1記載のメモリ管理装置に於いて、前記
第1リストは、サイズの異なる複数種類の未使用セルを
前記CPU毎に準備し、前記メモリ割付部は、特定のC
PUによるデータの割付け要求を受けた際に、該CPU
に割付けられている第1リストからデータ量に見合った
サイズの未使用セルを選択して割付けることを特徴とす
るメモリ管理装置。 (付記7)付記1記載のメモリ管理装置に於いて、任意
のCPUが前記第1ゴミ回収部によるヒープ領域のサー
チを実行して使用済みセルを検索した場合、他のキッャ
シュ装置に回収可能な使用済みセルの保持を問い合わ
せ、複数のキャッシュ装置から応答があった場合、使用
済みセルを保持している特定のキャッシュ装置に回収動
作を指示してそのCPUに前記第1ゴミ回収部による回
収処理を実行させることを特徴とするメモリ管理装置。
(4) (付記8)付記1記載のメモリ管理装置に於いて、任意
のCPUが前記第1ゴミ回収部によるヒープ領域のサー
チを実行して使用済みセルを検索した場合、自己のキャ
ッシュ装置からスヌープバスを使用して他のキャッシュ
装置に回収可能な使用済みセルの保持を問い合わせ、複
数のキャッシュ装置からスヌープバスのアービタに応答
があった場合、前記アービタのアービトレーションによ
り使用済みセルを保持している特定のキャッシュ装置に
回収動作を指示し、該回収指示を受けたキャッシュ装置
が自己のCPUに割込みを掛けて前記第1ゴミ回収部に
よる回収処理を実行させることを特徴とするメモリ管理
装置。(5) (付記9)付記8記載のメモリ管理装置に於いて、前記
第1ゴミ回収部によるヒープ領域のサーチを実行して使
用済みセルを検索した前記CPUは、自己のキャッシュ
装置にフリーリスト作成命令(make-free-list 命令)を
発行し、前記フリーリスト作成命令を受けたキャッシュ
装置はフリーリスト作成コマンド(make-free-list コマ
ンド)をスヌープバスに発行することを特徴とするメモ
リ管理装置。(6) (付記10)付記8記載のメモリ管理装置に於いて、回
収された使用済みセルが1又は複数のキャッシュブロッ
クを完全に含んでいる場合、前記アービトレーションに
負けたキャッシュ装置は、該当するキャッシュブロック
を無効状態に遷移させることを特徴とするメモリ管理装
置。(7) (付記11)付記8記載のメモリ管理装置に於いて、回
収可能な使用済みセルの保持の問い合わせ対し特定のキ
ャッシュ装置のみからスヌープバスに応答があった場
合、応答を行ったキャッシュ装置が自己のCPUに割込
みを掛けて前記第1ゴミ回収部による回収処理を実行さ
せることを特徴とするメモリ管理装置。(8) (付記12)付記8記載のメモリ管理装置に於いて、ど
のキャッシュ装置も回収可能な使用済みセルを保持して
いない場合、回収可能と判断したCPUのキャッシュ装
置に前記共有メモリから使用済みセルを読込んで前記第
1ゴミ回収部による回収処理を実行させることを特徴と
するメモリ管理装置。 (付記13)付記8記載のメモリ管理装置に於いて、ど
のキャッシュ装置も回収可能な使用済みセルを保持して
いない場合、前記共有メモリ側でランダムに選んだCP
Uのキャッシュ装置に回収可能な使用済みセルを送って
前記第1ゴミ回収部による回収処理を実行させることを
特徴とするメモリ管理装置。(9) (付記14)CPU及びキャッシュ装置を備えた複数の
プロセッサと共有メモリをバスを介して接続した並列計
算機のメモリ管理方法に於いて、関数呼出しで共有メモ
リのスタック領域にに作成した関数フレームの実行に伴
って必要なデータに、セルに分離されたメモリ領域で構
成されるヒープ領域の未使用セルを割付けるメモリ割付
ステップと、ヒープ領域の未使用セルが空になったとき
に、ヒープ領域をサーチして使用中セルと使用済みセル
に分け、前記使用済みセルを回収して未使用セルに戻す
第1ゴミ回収ステップと、使用中セルが関数フレームの
実行後に使用済みセルとなるか否か解析し、関数フレー
ムの実行終了時に、前記第1回収ステップで回収済みを
除く使用済みセルを回収して未使用セルに戻す第2ゴミ
回収ステップと、を備えたことを特徴とする並列計算機
のメモリ管理方法。(10) (付記15)付記14記載のメモリ管理方法に於いて、
前記ヒープ領域は未使用セルをポインタで繋げた第1リ
ストで管理し、前記第2回収ステップは関数の実行後に
不要となる使用中セルを第2リスト(reclaim-list)に登
録して管理し、更に、前記第1ゴミ回収ステップは、そ
の最終フェーズで回収済みのセルを前記第2リストから
外すことを特徴とするメモリ管理方法。(11) (付記16)付記15記載のメモリ管理方法に於いて、
前記ヒープ領域の各セルは、データの割付けた時にオフ
し前記第1リストに戻す時にオンするフラグを備え、前
記第1ゴミ回収ステップは、その最終フェーズで前記フ
ラグがオンとなっている使用中セルを前記第2リストか
ら外すことを特徴とするメモリ管理方法。 (付記17)付記14記載のメモリ管理方法に於いて、
前記ヒープ領域の各セルは、前記第2リストにリンクす
るポインタを格納するポインタ領域を備えたことを特徴
とするメモリ管理方法。 (付記18)付記14記載のメモリ管理方法に於いて、
前記第2リストは、関数の実行後に使用済みとなる使用
中セルを指し示すデータポインタと次のリンク先を指示
すリンクポインタを組とした1又は複数のセルをリンク
でつなげたリスト構造を有することを特徴とするメモリ
管理方法。 (付記19)付記14記載のメモリ管理方法に於いて、
前記第1リストは、サイズの異なる複数種類の未使用セ
ルを前記CPU毎に準備し、前記メモリ割付ステップ
は、特定のCPUによるデータの割付け要求を受けた際
に、該CPUに割付けられている第1リストからデータ
量に見合ったサイズの未使用セルを選択して割付けるこ
とを特徴とするメモリ管理方法。 (付記20)付記14記載のメモリ管理方法に於いて、
任意のCPUが前記第1ゴミ回収ステップによるヒープ
領域のサーチを実行して使用済みセルを検索した場合、
他のキャッシュ装置に回収可能な使用済みセルの保持を
問い合わせ、複数のキャッシュ方法から応答があった場
合、使用済みセルをを保持している特定のキャッシュ方
法に回収動作を指示してそのCPUに前記第1ゴミ回収
ステップによる回収処理を実行させることを特徴とする
メモリ管理方法。(12) (付記21)付記14記載のメモリ管理方法に於いて、
任意のCPUが前記第1ゴミ回収ステップによるヒープ
領域のサーチを実行して使用済みセルを検索した場合、
自己のキャッシュ方法からスヌープバスを使用して他の
キャッシュ装置に回収可能な使用済みセルの保持を問い
合わせ、複数のキャッシュ方法からスヌープバスのアー
ビタに応答があった場合、前記アービタのアービトレー
ションにより使用済みセルを保持している特定のキャッ
シュ装置に回収動作を指示し、該回収指示を受けたキャ
ッシュ方法が自己のCPUに割込みを掛けて前記第1ゴ
ミ回収ステップによる回収処理を実行させることを特徴
とするメモリ管理方法。(13) (付記22)付記21記載のメモリ管理方法に於いて、
前記第1ゴミ回収ステップによるヒープ領域のサーチを
実行して使用済みセルを検索した前記CPUは、自己の
キャッシュ装置にフリーリスト作成命令(make-free-lis
t 命令)を発行し、前記フリーリスト作成命令を受けた
キャッシュ装置はフリーリスト作成コマンド(make-free
-list コマンド)をスヌープバスに発行することを特徴
とするメモリ管理方法。 (付記23)付記21記載のメモリ管理方法に於いて、
回収された使用済みセルが1又は複数のキャッシュブロ
ックを完全に含んでいる場合、前記アービトレーション
に負けたキャッシュ方法は、該当するキャッシュブロッ
クを無効状態に遷移させることを特徴とするメモリ管理
方法。 (付記24)付記21記載のメモリ管理方法に於いて、
回収可能な使用済みセルの保持の問い合わせ対し特定の
キャッシュ装置のみからスヌープバスに応答があった場
合、応答を行ったキャッシュ装置が自己のCPUに割込
みを掛けて前記第1ゴミ回収ステップによる回収処理を
実行させることを特徴とするメモリ管理方法。 (付記25)付記21記載のメモリ管理方法に於いて、
どのキャッシュ装置も回収可能な使用済みセルを保持し
ていない場合、回収可能と判断したCPUのキャッシュ
装置に前記共有メモリから使用済みセルを読込んで前記
第1ゴミ回収ステップによる回収処理を実行させること
を特徴とするメモリ管理方法。 (付記26)付記21記載のメモリ管理方法に於いて、
どのキャッシュ装置も回収可能な使用済みセルを保持し
ていない場合、前記共有メモリ側でランダムに選んだC
PUのキャッシュ装置に回収可能な使用済みセルを送っ
て前記第1ゴミ回収ステップによる回収処理を実行させ
ることを特徴とするメモリ管理方法。
Also, the unused cells connected to the free list provided for each CPU are connected to each cache device by performing a cache process at the time of dust collection processing so that all unused cells are present on the own cache device. This prevents a situation in which used cells are distributed to other cache devices, thereby eliminating the need for exchanging unused cells between caches when a data allocation request occurs, reducing cache misses and increasing the speed of unallocated cells. Allocation of cells to be used can be realized. (Supplementary note) (Supplementary note 1) In a memory management device of a parallel computer in which a plurality of processors each including a CPU and a cache device and a shared memory are connected via a bus, a memory area divided into cells serving as data allocation units. A heap area to be configured, a memory allocating unit that allocates unused cells of the heap area to data necessary for execution of a function frame created in the stack area of the shared memory by a function call, and an unused heap area. A first garbage collection unit that searches the heap area to divide into used cells and used cells when the cells are emptied, and collects the used cells and returns them to unused cells; After the execution of the frame, it is analyzed whether or not the cell becomes a used cell. At the end of the execution of the function frame, the first garbage collection unit collects the used cell except the collected cell and uses the unused cell. And a second garbage collection unit for returning to the memory. (1) (Supplementary note 2) In the memory management device according to Supplementary note 1, the heap area is a first list in which unused cells are connected by a pointer.
(free-list), and the second garbage collection unit lists the used cells that become unnecessary after the execution of the function in a second list (reclaim-lis).
The memory management device according to claim 1, wherein the first garbage collection unit removes collected cells from the second list in the final phase. (2) (Supplementary note 3) In the memory management device according to Supplementary note 2, each cell of the heap area includes a flag (free-flag) that is turned off when data is allocated and turned on when returning to the first list. The memory management device according to claim 1, wherein the first garbage collection unit removes, from the second list, the used cells whose flags are on in the final phase. (3) (Supplementary Note 4) In the memory management device according to Supplementary Note 1, each cell of the heap area includes a pointer area for storing a pointer linked to the second list. . (Supplementary Note 5) In the memory management device according to Supplementary Note 1, the second list includes a data pointer indicating a used cell which is used after execution of a function and a link pointer indicating a next link destination. A memory management device having a list structure in which one or a plurality of cells are connected by a link. (Supplementary Note 6) In the memory management device according to Supplementary Note 1, the first list prepares a plurality of types of unused cells having different sizes for each of the CPUs,
When a data allocation request is received by the PU,
A memory management device for selecting and allocating unused cells having a size corresponding to the data amount from a first list allocated to the memory management device. (Supplementary Note 7) In the memory management device according to Supplementary Note 1, when an arbitrary CPU searches for a used cell by executing a search of a heap area by the first trash collection unit, the CPU can be collected in another cache device. Inquiry of the use of the used cell is performed, and when there is a response from a plurality of cache devices, a specific cache device holding the used cell is instructed to perform a collection operation, and the CPU performs a collection process by the first dust collection unit. And a memory management device.
(4) (Supplementary Note 8) In the memory management device according to Supplementary Note 1, when an arbitrary CPU executes a search for a heap area by the first garbage collection unit and searches for a used cell, Using a snoop bus to inquire of other cache devices for the retention of used cells that can be collected, and if there is a response to the snoop bus arbiter from multiple cache devices, hold the used cells by arbitration of the arbiter. A memory management device which instructs a specific cache device to perform a collection operation, and the cache device which has received the collection instruction interrupts its own CPU and causes the first garbage collection unit to execute a collection process. (5) (Supplementary note 9) In the memory management device according to supplementary note 8, the CPU that searches the heap area by the first garbage collection unit to search for a used cell stores a free list in its own cache device. A memory management, which issues a create instruction (make-free-list instruction), and the cache device that receives the free list creation instruction issues a free list creation command (make-free-list command) to the snoop bus. apparatus. (6) (Supplementary Note 10) In the memory management device according to Supplementary Note 8, when the collected used cells completely include one or more cache blocks, the cache device that has lost the arbitration corresponds to the cache device. A memory management device for transitioning a cache block to an invalid state. (7) (Supplementary Note 11) In the memory management device according to Supplementary Note 8, when a response to an inquiry about retention of a used cell that can be collected is made only from a specific cache device to the snoop bus, the cache device that has made a response. Interrupts its own CPU and causes the first garbage collection unit to execute a collection process. (8) (Supplementary Note 12) In the memory management device according to Supplementary Note 8, when none of the cache devices holds a recoverable used cell, the shared memory is used for the cache device of the CPU determined to be recoverable. A memory management device for reading a used cell and executing a collection process by the first dust collection unit. (Supplementary note 13) In the memory management device according to Supplementary note 8, when none of the cache devices holds a recoverable used cell, a CP randomly selected on the shared memory side is used.
A memory management device for sending a used cell that can be collected to a U cache device and causing the first garbage collection unit to execute a collection process. (9) (Supplementary note 14) In a memory management method of a parallel computer in which a plurality of processors each having a CPU and a cache device and a shared memory are connected via a bus, a function created in a stack area of the shared memory by a function call A memory allocation step of allocating an unused cell of a heap area composed of a memory area separated into cells to necessary data along with execution of a frame, and when an unused cell of the heap area becomes empty, A first garbage collection step of searching the heap area to divide into used cells and used cells, collecting the used cells and returning them to unused cells, and the used cells become used cells after execution of the function frame The second garbage collection step collects used cells other than those collected in the first collection step and returns them to unused cells at the end of execution of the function frame. And a memory management method for a parallel computer. (10) (Supplementary note 15) In the memory management method according to supplementary note 14,
The heap area is managed by a first list in which unused cells are connected by a pointer, and the second collection step registers and manages used cells that become unnecessary after execution of a function in a second list (reclaim-list). The memory management method according to claim 1, wherein the first refuse collection step removes cells collected in the final phase from the second list. (11) (Supplementary note 16) In the memory management method according to supplementary note 15,
Each cell of the heap area has a flag that is turned off when data is allocated and turned on when returning to the first list, and the first garbage collection step is a process in which the flag is turned on in the final phase. A memory management method, wherein a cell is removed from the second list. (Supplementary note 17) In the memory management method according to supplementary note 14,
A memory management method, wherein each cell of the heap area has a pointer area for storing a pointer linked to the second list. (Supplementary note 18) In the memory management method according to supplementary note 14,
The second list has a list structure in which one or more cells are linked by a link in which a data pointer indicating a used cell which is used after execution of a function and a link pointer indicating a next link destination are set. A memory management method comprising: (Supplementary note 19) In the memory management method according to supplementary note 14,
The first list prepares a plurality of types of unused cells having different sizes for each of the CPUs, and the memory allocating step is allocated to the CPU when a data allocation request is received by a specific CPU. A memory management method comprising: selecting and allocating unused cells having a size corresponding to a data amount from a first list. (Supplementary note 20) In the memory management method according to supplementary note 14,
When an arbitrary CPU executes a search for a heap area in the first garbage collection step and searches for a used cell,
The other cache devices are inquired about the holding of the used cells that can be collected, and when there is a response from a plurality of cache methods, the specific cache method holding the used cells is instructed to perform the collection operation and the CPU is instructed. A memory management method, wherein a collection process in the first dust collection step is executed. (12) (Supplementary note 21) In the memory management method according to supplementary note 14,
When an arbitrary CPU executes a search for a heap area in the first garbage collection step and searches for a used cell,
Using the snoop bus from its own cache method, the other cache devices are inquired about the retention of the used cells that can be collected, and if there is a response to the snoop bus arbiter from a plurality of cache methods, it is used by the arbiter of the arbiter. A specific cache device holding cells is instructed to perform a collection operation, and the cache method receiving the collection instruction interrupts its own CPU to execute the collection process in the first garbage collection step. How to manage memory. (13) (Supplementary note 22) In the memory management method according to supplementary note 21,
The CPU, which has searched the used cell by executing the search of the heap area in the first garbage collection step, sends a free list creation instruction (make-free-lis) to its own cache device.
t command), and the cache device that has received the free list creation command issues a free list creation command (make-free
-list command) to the snoop bus. (Supplementary note 23) In the memory management method according to supplementary note 21,
When the collected used cell completely includes one or a plurality of cache blocks, the cache method losing the arbitration causes the corresponding cache block to transition to an invalid state. (Supplementary note 24) In the memory management method according to supplementary note 21,
When a response to the snoop bus from only a specific cache device in response to the inquiry about the retention of the used cells that can be collected is performed, the cache device that has responded interrupts its own CPU and performs the collection process in the first garbage collection step. A memory management method. (Supplementary note 25) In the memory management method according to supplementary note 21,
In a case where none of the cache devices holds the reusable used cells, the cache device of the CPU determined to be retrievable reads the used cells from the shared memory and executes the collection process in the first garbage collection step. A memory management method comprising: (Supplementary note 26) In the memory management method according to supplementary note 21,
If none of the cache devices holds a recoverable used cell, a C randomly selected on the shared memory side is used.
A memory management method, comprising: sending a reusable used cell to a PU cache device to execute a collection process in the first garbage collection step.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の原理説明図FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明による並列計算機のシステム構成の説明
FIG. 2 is an explanatory diagram of a system configuration of a parallel computer according to the present invention.

【図3】本発明の機能構成のブロック図FIG. 3 is a block diagram of a functional configuration of the present invention.

【図4】図3のメモリ管理部の機能構成のブロック図FIG. 4 is a block diagram of a functional configuration of a memory management unit in FIG. 3;

【図5】本発明のデータ割付けに使用するヒープに配置
されているセルの説明図
FIG. 5 is an explanatory diagram of cells arranged in a heap used for data allocation according to the present invention.

【図6】リクレームリスト領域を備えた関数フレームの
説明図
FIG. 6 is an explanatory diagram of a function frame having a reclaim list area.

【図7】リクレームリスト用ポインタ領域を備えたセル
の説明図
FIG. 7 is an explanatory diagram of a cell having a reclaim list pointer area.

【図8】コンスセルによるリスト構造を用いたリクレー
ムリストの説明図
FIG. 8 is an explanatory view of a reclaim list using a cons cell list structure.

【図9】最終フェーズに第2ゴミ回収処理を含む本発明
のメモリ割付け処理のフローチャート
FIG. 9 is a flowchart of a memory allocation process of the present invention including a second trash collection process in a final phase.

【図10】フリーリストが空になることで起動される本
発明の第1ゴミ回収処理のフローチャート
FIG. 10 is a flowchart of the first garbage collection process of the present invention activated when the free list becomes empty.

【図11】CPUが回収可能な使用済みセルを検索した
場合のキャッシュ装置のフリーリストに対する回収処理
の説明図
FIG. 11 is an explanatory diagram of a process of collecting a free list of a cache device when the CPU searches for a used cell that can be collected;

【図12】図11の回収処理における機能構成のブロッ
ク図
FIG. 12 is a block diagram of a functional configuration in the collection processing of FIG. 11;

【図13】図12で回収可能となった使用済みセルのリ
スト構造の説明図
FIG. 13 is an explanatory diagram of a list structure of used cells that can be collected in FIG. 12;

【図14】図12の回収処理の手順のタイムチャートFIG. 14 is a time chart of the procedure of the collection process in FIG. 12;

【図15】従来のシグレゲートメモリ管理方法の説明図FIG. 15 is a diagram illustrating a conventional method of managing a gate memory.

【図16】従来のガーベジ・コレクションの説明図FIG. 16 is an explanatory diagram of a conventional garbage collection.

【図17】エスケープ解析により関数終了後に不要とな
るデータをスタックに割付ける従来方法の説明図
FIG. 17 is an explanatory diagram of a conventional method of allocating unnecessary data to a stack after a function ends by escape analysis.

【図18】サンプルプログラムの実行中に回収可能とな
るデータの説明図
FIG. 18 is an explanatory diagram of data that can be collected during execution of a sample program.

【符号の説明】[Explanation of symbols]

10,10−1〜10−n:プロセッサモジュール 12,12−1〜12−n:CPU 14,14−1〜14−n:キャッシュ装置 16:スヌープバス 18:アービタ 20:共有メモリ 22:ヒープ領域 24:リスト領域 24−1〜24−n,34−1〜34−n:フリーリス
ト(第1リスト) 25:スタック領域 26,26−1〜26−3:関数フレーム 28−1〜28−3:リクレームリスト(第2リスト) 30−1〜30−n:メモリ管理部 32−1〜32−n:関数実行部 36−1〜36−n:セル群 38:メモリ割付部 40:第1ゴミ回収部 42:第2ゴミ回収部 44:セル 46:ヘッダ 48:データ 50:ポインタ領域 52:フリーフラグ 60:リクレームリスト領域 66:リクレームリスト用ポインタ領域 68−1〜68−3:コンスセル 70−1〜70−3:データポインタ 72−1〜72−3:セルポインタ
10, 10-1 to 10-n: Processor module 12, 12-1 to 12-n: CPU 14, 14-1 to 14-n: Cache device 16: Snoop bus 18: Arbiter 20: Shared memory 22: Heap area 24: List area 24-1 to 24-n, 34-1 to 34-n: Free list (first list) 25: Stack area 26, 26-1 to 26-3: Function frame 28-1 to 28-3 : Reclaim list (second list) 30-1 to 30-n: Memory management unit 32-1 to 32-n: Function execution unit 36-1 to 36-n: Cell group 38: Memory allocation unit 40: First Garbage collection unit 42: Second garbage collection unit 44: Cell 46: Header 48: Data 50: Pointer area 52: Free flag 60: Reclaim list area 66: Reclaim list pointer area 6 8-1 to 68-3: Cons cell 70-1 to 70-3: Data pointer 72-1 to 72-3: Cell pointer

Claims (13)

【特許請求の範囲】[Claims] 【請求項1】CPU及びキャッシュ装置を備えた複数の
プロセッサと共有メモリをバスを介して接続した並列計
算機のメモリ管理装置に於いて、 データ割付け単位となるセルに分離されたメモリ領域で
構成されるヒープ領域と、 関数呼出しで前記共有メモリのスタック領域に作成した
関数フレームの実行に伴って必要なデータに前記ヒープ
領域の未使用セルを割付けるメモリ割付部と、 ヒープ領域の未使用セルが空になったときに、ヒープ領
域をサーチして使用中セルと使用済みセルに分け、前記
使用済みセルを回収して未使用セルに戻す第1ゴミ回収
部と、 使用中セルが関数フレームの実行後に使用済みセルとな
るか否か解析し、関数フレームの実行終了時に、前記第
1ゴミ回収部で回収済みを除く使用済みセルを回収して
未使用セルに戻す第2ゴミ回収部と、を備えたことを特
徴とする並列計算機のメモリ管理装置。
In a memory management device of a parallel computer in which a plurality of processors each having a CPU and a cache device and a shared memory are connected via a bus, the memory management device is composed of a memory area divided into cells serving as data allocation units. A memory allocating unit that allocates unused cells of the heap area to data necessary for execution of a function frame created in the stack area of the shared memory by a function call, and an unused cell of the heap area. A first garbage collection unit which searches the heap area to divide into used cells and used cells when it becomes empty, and collects the used cells and returns them to unused cells; Analyze whether or not it becomes a used cell after the execution, and at the end of the execution of the function frame, collect the used cells except the collected by the first garbage collection unit and turn them into unused cells. A memory management device for a parallel computer, comprising: a second garbage collection unit for returning.
【請求項2】請求項1記載のメモリ管理装置に於いて、
前記ヒープ領域は未使用セルをポインタで繋げた第1リ
スト(free-list) で管理し、前記第2ゴミ回収部は関数
の実行後に不要となる使用中セルを第2リスト(reclaim
-list)に登録して管理し、前記第1ゴミ回収部は、その
最終フェーズで回収済みセルを前記第2リストから外す
ことを特徴とするメモリ管理装置。
2. The memory management device according to claim 1, wherein
The heap area is managed by a first list (free-list) in which unused cells are connected by a pointer, and the second garbage collection unit removes unused cells that become unnecessary after execution of the function by a second list (reclaim).
a memory management device, wherein the first trash collection unit removes collected cells from the second list in the final phase.
【請求項3】請求項2記載のメモリ管理装置に於いて、
前記ヒープ領域の各セルは、データ割付け時にオフし前
記第1リストに戻す時にオンするフラグ(free-flag) を
備え、前記第1ゴミ回収部は、その最終フェーズで前記
フラグがオンとなっている使用中セルを前記第2リスト
から外すことを特徴とするメモリ管理装置。
3. The memory management device according to claim 2, wherein:
Each cell in the heap area has a flag (free-flag) which is turned off when data is allocated and turned on when returning to the first list, and the first garbage collection unit turns on the flag in the final phase. A memory management device that removes a busy cell from the second list.
【請求項4】請求項1記載のメモリ管理装置に於いて、
任意のCPUが前記第1ゴミ回収部によるヒープ領域の
サーチを実行して使用済みセルを検索した場合、他のキ
ャシュ装置に回収可能な使用済みセルの保持を問い合わ
せ、複数のキャッシュ装置から応答があった場合、使用
済みセルを保持している特定のキャッシュ装置に回収動
作を指示してそのCPUに前記第1ゴミ回収部による回
収処理を実行させることを特徴とするメモリ管理装置。
4. The memory management device according to claim 1, wherein:
When an arbitrary CPU searches for a used cell by executing a search of the heap area by the first garbage collection unit, another cache device is inquired about holding of the used cell that can be collected, and responses from a plurality of cache devices are returned. A memory management device for instructing a specific cache device holding used cells to perform a collection operation and causing the CPU to execute a collection process by the first garbage collection unit.
【請求項5】請求項1記載のメモリ管理装置に於いて、
任意のCPUが前記第1ゴミ回収部によるヒープ領域の
サーチを実行して使用済みセルを検索した場合、自己の
キャッシュ装置からスヌープバスを使用して他のキャシ
ュ装置に回収可能な使用済みセルの保持を問い合わせ、
複数のキャッシュ装置からスヌープバスのアービタに応
答があった場合、前記アービタのアービトレーションに
より使用済みセルを保持している特定のキャッシュ装置
に回収動作を指示し、該回収指示を受けたキャッシュ装
置が自己のCPUに割込みを掛けて前記第1ゴミ回収部
による回収処理を実行させることを特徴とするメモリ管
理装置。
5. The memory management device according to claim 1, wherein:
When an arbitrary CPU searches for a used cell by executing a search of the heap area by the first garbage collecting unit, the used cell of the used cache that can be collected by another cache device from its own cache device using a snoop bus. Query retention,
When a response is received from the plurality of cache devices to the snoop bus arbiter, the arbiter of the arbiter instructs the specific cache device holding the used cell to perform a collection operation, and the cache device that has received the collection instruction issues a response to the request. A memory management device for causing the first garbage collection unit to execute a collection process by interrupting the CPU.
【請求項6】請求項5記載のメモリ管理装置に於いて、
前記第1ゴミ回収部によるヒープ領域のサーチを実行し
て使用済みセルを検索した前記CPUは、自己のキャシ
ュ装置にフリーリスト作成命令(make-free-list 命令)
を発行し、前記フリーリスト作成命令を受けたキャッシ
ュ装置はフリーリスト作成コマンド(make-free-listコ
マンド)をスヌープバスに発行することを特徴とするメ
モリ管理装置。
6. The memory management device according to claim 5, wherein:
The CPU, which has searched the used cell by executing the search of the heap area by the first garbage collection unit, sends a free list creation instruction (make-free-list instruction) to its own cache device.
And the cache device receiving the free list creation command issues a free list creation command (make-free-list command) to the snoop bus.
【請求項7】請求項5記載のメモリ管理装置に於いて、
回収された使用済みセルが1又は複数のキャッシュブロ
ックを完全に含んでいる場合、前記アービトレーション
に負けたキャッシュ装置は、該当するキャッシュブロッ
クを無効状態に遷移させることを特徴とするメモリ管理
装置。
7. The memory management device according to claim 5, wherein:
When the collected used cell completely includes one or a plurality of cache blocks, the cache device that has lost the arbitration causes the corresponding cache block to transition to an invalid state.
【請求項8】請求項5記載のメモリ管理装置に於いて、
回収可能な使用済みセルの保持の問い合わせ対し特定の
キャッシュ装置のみからスヌープバスに応答があった場
合、応答を行ったキャッシュ装置が自己のCPUに割込
みを掛けて前記第1ゴミ回収部による回収処理を実行さ
せることを特徴とするメモリ管理装置。
8. The memory management device according to claim 5, wherein:
If a response to the snoop bus is received from only a specific cache device in response to the inquiry about the retention of the used cells that can be collected, the cache device that has responded interrupts its own CPU and performs the collection process by the first garbage collection unit. A memory management device.
【請求項9】請求項4記載のメモリ管理装置に於いて、
どのキャッシュ装置も回収可能な使用済みセルを保持し
ていない場合、前記共有メモリ側でランダムに選んだC
PUのキャッシュ装置に回収可能な使用済みセルを送っ
て前記第1ゴミ回収部による回収処理を実行させること
を特徴とするメモリ管理装置。
9. The memory management device according to claim 4, wherein:
If none of the cache devices holds a recoverable used cell, a C randomly selected on the shared memory side is used.
A memory management device, comprising: sending a used cell that can be collected to a PU cache device and causing the first garbage collection unit to execute a collection process.
【請求項10】CPU及びキャッシュ装置を備えた複数
のプロセッサと共有メモリをバスを介して接続した並列
計算機のメモリ管理方法に於いて、 関数呼出しで共有メモリのスタック領域に作成した関数
フレームの実行に伴って必要なデータに、セルに分離さ
れたメモリ領域で構成されるヒープ領域の未使用セルを
割付けるメモリ割付ステップと、 ヒープ領域の未使用セルが空になったときに、ヒープ領
域をサーチして使用中セルと使用済みセルに分け、前記
使用済みセルを回収して未使用セルに戻す第1ゴミ回収
ステップと、 使用中セルが関数フレームの実行後に使用済みセルとな
るか否か解析し、関数フレームの実行終了時に、前記第
1回収ステップで回収済みを除く使用済みセルを回収し
て未使用セルに戻す第2ゴミ回収ステップと、を備えた
ことを特徴とする並列計算機のメモリ管理方法。
10. A memory management method for a parallel computer in which a plurality of processors each having a CPU and a cache device and a shared memory are connected via a bus, wherein execution of a function frame created in a stack area of the shared memory by a function call is executed. A memory allocation step of allocating unused cells of a heap area composed of memory areas separated into cells to necessary data according to the above, and the heap area is allocated when the unused cells of the heap area become empty. A first garbage collection step of searching and separating used cells and used cells, collecting the used cells and returning them to unused cells, and determining whether the used cells become used cells after execution of the function frame Analyzing, at the end of the execution of the function frame, collecting a used cell other than the collected cell in the first collecting step and returning it to an unused cell; Memory management method of a parallel computer, characterized in that it comprises a.
【請求項11】請求項10記載のメモリ管理方法に於い
て、前記ヒープ領域は未使用セルをポインタで繋げた第
1リストで管理し、前記第2回収ステップは関数の実行
後に不要となる使用中セルを第2リスト(reclaim-list)
に登録して管理し、更に、前記第1ゴミ回収ステップ
は、その最終フェーズで回収済みのセルを前記第2リス
トから外すことを特徴とするメモリ管理方法。
11. The memory management method according to claim 10, wherein said heap area is managed by a first list in which unused cells are linked by a pointer, and said second collection step becomes unnecessary after execution of a function. Medium cells in second list (reclaim-list)
The first garbage collection step removes the cells collected in the final phase from the second list.
【請求項12】請求項10記載のメモリ管理方法に於い
て、任意のCPUが前記第1ゴミ回収ステップによるヒ
ープ領域のサーチを実行して使用済みセルを検索した場
合、他のキャッシュ装置に回収可能な使用済みセルの保
持を問い合わせ、複数のキャッシュ方法から応答があっ
た場合、使用済みセルをを保持している特定のキャッシ
ュ方法に回収動作を指示してそのCPUに前記第1ゴミ
回収ステップによる回収処理を実行させることを特徴と
するメモリ管理方法。
12. The memory management method according to claim 10, wherein when an arbitrary CPU searches for a used cell by executing a search of a heap area in said first garbage collection step, the CPU collects the used cell in another cache device. Inquiring about possible used cell holding, and when receiving a response from a plurality of cache methods, instructing a specific cache method holding used cells to perform a collecting operation and instructing the CPU of the first garbage collecting step. A memory management method for causing a collection process to be executed.
【請求項13】請求項10記載のメモリ管理方法に於い
て、任意のCPUが前記第1ゴミ回収ステップによるヒ
ープ領域のサーチを実行して使用済みセルを検索した場
合、自己のキャッシュ装置からスヌープバスを使用して
他のキャシュ装置に回収可能な使用済みセルの保持を問
い合わせ、複数のキャッシュ装置からスヌープバスのア
ービタに応答があった場合、前記アービタのアービトレ
ーションにより使用済みセルを保持している特定のキャ
ッシュ装置に回収動作を指示し、該回収指示を受けたキ
ャッシュ装置が自己のCPUに割込みを掛けて前記第1
ゴミ回収ステップによる回収処理を実行させることを特
徴とするメモリ管理方法。
13. A memory management method according to claim 10, wherein when an arbitrary CPU executes a search for a heap area in said first garbage collection step to search for a used cell, a snoop is sent from its own cache device. Inquiry of another cache device using the bus for holding of the used cell that can be collected, and when there is a response to the snoop bus arbiter from a plurality of cache devices, the arbiter of the arbiter holds the used cell. A specific cache device is instructed to perform a collection operation, and the cache device that has received the collection instruction interrupts its own CPU, and
A memory management method, wherein a collection process is performed in a trash collection step.
JP2000341343A 2000-11-09 2000-11-09 Memory management device and method for parallel computer Withdrawn JP2002149481A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000341343A JP2002149481A (en) 2000-11-09 2000-11-09 Memory management device and method for parallel computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000341343A JP2002149481A (en) 2000-11-09 2000-11-09 Memory management device and method for parallel computer

Publications (1)

Publication Number Publication Date
JP2002149481A true JP2002149481A (en) 2002-05-24

Family

ID=18816101

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000341343A Withdrawn JP2002149481A (en) 2000-11-09 2000-11-09 Memory management device and method for parallel computer

Country Status (1)

Country Link
JP (1) JP2002149481A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010072790A (en) * 2008-09-17 2010-04-02 Toshiba Corp Processor device, information processing apparatus and memory management method
US8453132B2 (en) 2006-07-28 2013-05-28 Hewlett-Packard Development Company, L.P. System and method for recompiling code based on locality domain and thread affinity in NUMA computer systems

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8453132B2 (en) 2006-07-28 2013-05-28 Hewlett-Packard Development Company, L.P. System and method for recompiling code based on locality domain and thread affinity in NUMA computer systems
JP2010072790A (en) * 2008-09-17 2010-04-02 Toshiba Corp Processor device, information processing apparatus and memory management method

Similar Documents

Publication Publication Date Title
CN110209601B (en) Memory interface
JP5147280B2 (en) System and method for garbage collection in heterogeneous multiprocessor systems
US5560003A (en) System and hardware module for incremental real time garbage collection and memory management
US5819304A (en) Random access memory assembly
US5687368A (en) CPU-controlled garbage-collecting memory module
US6816947B1 (en) System and method for memory arbitration
US6862674B2 (en) Methods and apparatus for performing a memory management technique
US6526481B1 (en) Adaptive cache coherence protocols
US7069279B1 (en) Timely finalization of system resources
US7774564B2 (en) Multi-processor system, and method of distributing memory access load in multi-processor system
US20020087815A1 (en) Microprocessor reservation mechanism for a hashed address system
US20100223429A1 (en) Hybrid Caching Techniques and Garbage Collection Using Hybrid Caching Techniques
EP0150195A1 (en) Demand paging scheme for a multi-atb shared memory processing system.
CN103218208A (en) System and method for performing shaped memory access operations
EP1290560A2 (en) Distributed processing multi-processor computer
Fujimoto et al. Design and performance of special purpose hardware for Time Warp
EP0404560A2 (en) Improved multiprocessor system
JP2002149481A (en) Memory management device and method for parallel computer
CN111125070A (en) Data exchange method and platform
Oancea et al. A new approach to parallelising tracing algorithms
US7406554B1 (en) Queue circuit and method for memory arbitration employing same
Lin et al. Dynamic memory management for real-time embedded Java chips
Liu et al. High performance memory management for a multi-core architecture
Hughes Prefetching linked data structures in systems with merged dram-logic
EP0430668B1 (en) Method and system for reclaiming unreferenced computer memory space

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