WO2018127948A1 - Computer system - Google Patents

Computer system Download PDF

Info

Publication number
WO2018127948A1
WO2018127948A1 PCT/JP2017/000054 JP2017000054W WO2018127948A1 WO 2018127948 A1 WO2018127948 A1 WO 2018127948A1 JP 2017000054 W JP2017000054 W JP 2017000054W WO 2018127948 A1 WO2018127948 A1 WO 2018127948A1
Authority
WO
WIPO (PCT)
Prior art keywords
heap
area
nvram
memory
computer system
Prior art date
Application number
PCT/JP2017/000054
Other languages
French (fr)
Japanese (ja)
Inventor
明男 島田
アビシェク ジョーリ
光雄 早坂
Original Assignee
株式会社日立製作所
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 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2017/000054 priority Critical patent/WO2018127948A1/en
Publication of WO2018127948A1 publication Critical patent/WO2018127948A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Abstract

Provided is a computer system that includes a processor and a non-volatile random-access memory. The processor: secures a first heap for a program to use a memory region of the non-volatile random-access memory; executes allocation and release of use regions in the first heap; executes processing to consolidate separated use regions into a single continuous region, in the first heap; updates first management information indicating the relationship between a use region in the first heap and a key which identifies the memory region allocated to the use region, such update being in accordance with the allocation, the release, and the processing; and searches the first heap for the address of a target memory region by using the key for the target memory region in the first management information.

Description

計算機システムComputer system
 本発明は、不揮発ランダムアクセスメモリのヒープ管理に関する。 The present invention relates to heap management of nonvolatile random access memory.
 NVRAM(Non-volatile Random access memory)は不揮発性のメモリ装置であり、HDD(Hard Disk Drive)やSSD(Solid State Drive)といったディスクドライブよりも高いI/O性能を持つ。例えば、NVRAMメモリにホストからのWriteデータをキャッシュすることで、低レイテンシかつ高スループットなストレージ装置を実現することができる。NVRAMの管理手法の例は、例えば、特許文献1に開示されている。 NVRAM (Non-volatile Random access memory) is a nonvolatile memory device, and has higher I / O performance than disk drives such as HDD (Hard Disk Drive) and SSD (Solid State Drive). For example, by caching the write data from the host in the NVRAM memory, a storage device with low latency and high throughput can be realized. An example of the NVRAM management technique is disclosed in Patent Document 1, for example.
米国特許出願公開2007/0156998号US Patent Application Publication No. 2007/0156998
 NVRAMを管理する手法として、NVRAMヒープが考えられる。NVRAMヒープは、NVRAMの物理メモリ領域がマッピングされる仮想アドレス空間である。コンピュータ上で実行されるプログラムは、NVRAMヒープを介して、NVRAMメモリ領域の取得と解放を行う。 NVRAM heap can be considered as a method for managing NVRAM. The NVRAM heap is a virtual address space to which the NVRAM physical memory area is mapped. A program executed on the computer acquires and releases the NVRAM memory area via the NVRAM heap.
 しかし、プログラムがNVRAMヒープからのメモリ領域の取得と解放を繰り返すと、NVRAMヒープのフラグメンテーションが発生する。NVRAMヒープ内に不連続の空き領域が存在することになり、メモリ領域の取得時に、取得すべきメモリ領域サイズに適した空き領域をNVRAMヒープにおいて検索するのに時間が掛かってしまう。また、連続した大きなサイズのメモリ領域を取得することができなくなり、NVRAMの使用効率が低下する。 However, when the program repeatedly acquires and releases the memory area from the NVRAM heap, fragmentation of the NVRAM heap occurs. Since there are discontinuous free areas in the NVRAM heap, it takes time to search the NVRAM heap for a free area suitable for the memory area size to be acquired when acquiring the memory area. Further, it becomes impossible to acquire a continuous large-sized memory area, and the use efficiency of the NVRAM is lowered.
 これを回避するため、NVRAMヒープのデフラグ処理を実行することが考えられる。ヒープ内の不連続な使用領域を移動して連続使用領域を構成し、NVRAMヒープにおいて連続した大きな空き領域を作成する。これにより、NVRAMヒープのフラグメンテーションを解消する。 To avoid this, it is conceivable to execute the NVRAM heap defragmentation process. A discontinuous use area in the heap is moved to form a continuous use area, and a continuous large free area is created in the NVRAM heap. This eliminates the fragmentation of the NVRAM heap.
 しかし、デフラグ処理の後、プログラムが使用しているメモリ領域に対するNVRAMヒープのアドレスが変化する。従って、NVRAMヒープのデフラグ処理の後、プログラムが所望のNVRAMメモリ領域にアクセスすることができる手法が必要とされる。 However, after the defragmentation process, the NVRAM heap address for the memory area used by the program changes. Therefore, there is a need for a technique that allows a program to access a desired NVRAM memory area after NVRAM heap defragmentation processing.
 本発明の代表的な一例は、プロセッサと、不揮発ランダムアクセスメモリと、を含む計算機システムであって、前記プロセッサは、プログラムが前記不揮発ランダムアクセスメモリのメモリ領域を使用するための、第1のヒープを確保し、前記第1のヒープにおいて使用領域の割り当てと開放とを実行し、前記第1のヒープにおいて、離間した使用領域を一つの連続した領域に纏める処理を実行し、前記第1のヒープにおける使用領域と前記使用領域に割り当てられているメモリ領域を同定するキーとの関係を示す第1の管理情報を、前記割り当て、前記開放、及び前記処理に応じて更新し、前記第1の管理情報において、目的メモリ領域のキーにより前記目的メモリ領域の前記第1のヒープにおけるアドレスの検索を実行する。 A typical example of the present invention is a computer system including a processor and a nonvolatile random access memory, wherein the processor uses a first heap for a program to use a memory area of the nonvolatile random access memory. , Allocate and release the used area in the first heap, execute a process of collecting the separated used areas into one continuous area in the first heap, and The first management information indicating the relationship between the used area and the key for identifying the memory area allocated to the used area is updated according to the allocation, the release, and the processing, and the first management In the information, a search for an address in the first heap of the target memory area is executed by a key of the target memory area.
 本発明の一態様によれば、NVRAMヒープのデフラグ処理の後、プログラムが所望のNVRAMメモリ領域にアクセスすることができる。 According to one aspect of the present invention, after the NVRAM heap defragmentation process, the program can access a desired NVRAM memory area.
図1は、実施例1に係るストレージ装置のハードウェア構成を示す。FIG. 1 illustrates a hardware configuration of the storage apparatus according to the first embodiment. 図2は、実施例1に係るストレージ装置の論理構成を示す。FIG. 2 illustrates a logical configuration of the storage apparatus according to the first embodiment. 図3Aは、実施例1に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープの構造を示す。FIG. 3A illustrates the structure of the NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図3Bは、実施例1に係るストレージ装置においてメモリ管理ライブラリがNVRAMヒープを構築する方法を示す。FIG. 3B illustrates a method in which the memory management library constructs the NVRAM heap in the storage apparatus according to the first embodiment. 図4は、実施例1に係るストレージ装置においてメモリ管理ライブラリが提供するAPI(Apprication Programmable Interface)を示す。FIG. 4 illustrates an API (Application Programmable Interface) provided by the memory management library in the storage apparatus according to the first embodiment. 図5は、実施例1に係るストレージ装置においてメモリ管理ライブラリを経由したNVRAMヒープからのメモリ取得と解放処理の概念図を示す。FIG. 5 is a conceptual diagram of memory acquisition and release processing from the NVRAM heap via the memory management library in the storage apparatus according to the first embodiment. 図6は、実施例1に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープのデータ構造を示す。FIG. 6 illustrates a data structure of the NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図7は、実施例1に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ内のチャンク管理領域の構造を示す。FIG. 7 shows a structure of a chunk management area in the NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図8は、実施例1に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ内の検索インデックスの構造を示す。FIG. 8 shows the structure of the search index in the NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図9Aは、実施例1に係るストレージ装置におけるメモリ取得処理を示す。FIG. 9A illustrates a memory acquisition process in the storage apparatus according to the first embodiment. 図9Bは、実施例1に係るストレージ装置におけるメモリ解放処理を示す。FIG. 9B illustrates a memory release process in the storage apparatus according to the first embodiment. 図9Cは、実施例1に係るストレージ装置におけるメモリ検索処理を示す。FIG. 9C illustrates a memory search process in the storage apparatus according to the first embodiment. 図10Aは、実施例1に係るストレージ装置のWrite処理を示す。FIG. 10A illustrates a write process of the storage apparatus according to the first embodiment. 図10Bは、実施例1に係るストレージ装置のRead処理を示す。FIG. 10B illustrates a read process of the storage apparatus according to the first embodiment. 図11Aは、実施例1に係るストレージ装置において、メモリ管理ライブラリが、待機NVRAMヒープの後半部分にNVRAMのメモリページを割り当てる方法を示す。FIG. 11A illustrates a method in which the memory management library allocates NVRAM memory pages to the second half of the standby NVRAM heap in the storage apparatus according to the first embodiment. メモリ管理ライブラリがNVRAMヒープと待機NVRAMヒープにマッピングしているチャンクファイルの領域を管理するテーブルを示す。The table which manages the area | region of the chunk file which the memory management library maps to the NVRAM heap and the standby NVRAM heap is shown. 図12は、実施例1に係るストレージ装置においてメモリ管理ライブラが管理する待機NVRAMヒープのデータ構造を示す。FIG. 12 illustrates a data structure of a standby NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図13は、実施例1に係るストレージ装置においてメモリ管理ライブラリが管理する待機NVRAMヒープ内の検索インデックスの構造を示す。FIG. 13 shows the structure of the search index in the standby NVRAM heap managed by the memory management library in the storage apparatus according to the first embodiment. 図14は、NVRAMヒープと待機NVRAMヒープの切り替え処理を示す。FIG. 14 shows the switching process between the NVRAM heap and the standby NVRAM heap. 図15は、実施例2に係るシステムのハードウェア構成を示す。FIG. 15 illustrates a hardware configuration of a system according to the second embodiment. 図16は、実施例2に係るシステムの論理構成を示す。FIG. 16 illustrates a logical configuration of the system according to the second embodiment. 図17は、実施例2に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープのデータ構造を示す。FIG. 17 illustrates a data structure of the NVRAM heap managed by the memory management library in the storage apparatus according to the second embodiment. 図18は、実施例2に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ内のチャンク管理領域の構造を示す。FIG. 18 illustrates a structure of a chunk management area in the NVRAM heap managed by the memory management library in the storage apparatus according to the second embodiment. 実施例2に係るストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ用の検索インデックスの構造を示す。The structure of the search index for NVRAM heap which a memory management library manages in the storage apparatus which concerns on Example 2 is shown. 図20は、実施例2に係る待機ストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープのデータ構造を示す。FIG. 20 illustrates a data structure of the NVRAM heap managed by the memory management library in the standby storage apparatus according to the second embodiment. 図21は、実施例2に係る待機ストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ内のチャンク管理領域の構造を示す。FIG. 21 illustrates a structure of a chunk management area in the NVRAM heap managed by the memory management library in the standby storage apparatus according to the second embodiment. 図22は、実施例2に係る待機ストレージ装置においてメモリ管理ライブラリが管理するNVRAMヒープ用の検索インデックスの構造を示す。FIG. 22 shows a structure of a search index for NVRAM heap managed by the memory management library in the standby storage apparatus according to the second embodiment. 図23は、実施例2に係るストレージ装置においてメモリ管理ライブラリが提供するミラーリング機能のAPIを示す。FIG. 23 illustrates an API of a mirroring function provided by the memory management library in the storage apparatus according to the second embodiment. 図24は、実施例2に係るストレージ装置及び待機ストレージ装置におけるミラーリング処理を示す。FIG. 24 illustrates mirroring processing in the storage apparatus and standby storage apparatus according to the second embodiment. 図25は、実施例2に係るストレージ装置が起動されてから、ストレージプログラムが、ストレージサービスの提供を開始するまでの処理を示す。FIG. 25 illustrates processing from when the storage apparatus according to the second embodiment is activated until the storage program starts providing the storage service. 図26は、実施例2に係るストレージ装置においてメモリ管理ライブラリがNVRAMヒープ上の使用領域を連続領域に移動する方法を示す。FIG. 26 illustrates a method by which the memory management library moves the used area on the NVRAM heap to a continuous area in the storage apparatus according to the second embodiment. 図27は、実施例2に係るストレージ装置におけるチャンク管理領域のデータ移動前の状態とデータ移動後の状態を示す。FIG. 27 shows a state before data movement in the chunk management area and a state after data movement in the storage apparatus according to the second embodiment. 図28は、実施例2に係るストレージ装置における検索インデックスのデータ移動前の状態とデータ移動後の状態を示す。FIG. 28 illustrates a state before the data movement of the search index and a state after the data movement in the storage apparatus according to the second embodiment.
 以下では、幾つかの実施例を、図面を参照して説明する。なお、以下に説明する実施例は特許請求の範囲にかかる発明を限定するものではなく、また実施例で説明されている諸要素及びその組み合わせの全てが発明の解決手段に必須であるとは限らない。 Hereinafter, some embodiments will be described with reference to the drawings. The embodiments described below do not limit the invention according to the claims, and all the elements and combinations described in the embodiments are not necessarily essential to the solution of the invention. Absent.
 なお、以下の説明では、「プログラム」を主語として処理を説明する場合があるが、プログラムは、プロセッサ(例えばCPU(Central Processing Unit))によって実行されることで、定められた処理を、適宜に記憶資源(例えばメモリ)及び/又は通信インターフェースデバイス(例えばポート)を用いながら行うため、処理の主語がプログラムとされてもよい。 In the following description, the process may be described with “program” as the subject, but the program is executed by a processor (for example, a CPU (Central Processing Unit)), so that a predetermined process can be appropriately performed. Since the processing is performed using a storage resource (for example, a memory) and / or a communication interface device (for example, a port), the subject of processing may be a program.
 プログラムを主語として説明された処理は、プロセッサ或いはそのプロセッサを有する計算機(例えば、管理計算機、ホスト計算機、ストレージ装置等)が行う処理としても良い。また、「ライブラリ」はプログラムと同様にプロセッサによって実行される。よって、ライブラリを主語として処理を説明する場合がある。ライブラリは、プログラムの実行時にプログラムの一部として、プログラムと結合されるプログラムコードである。 The processing described with the program as the subject may be processing performed by a processor or a computer having the processor (for example, a management computer, a host computer, a storage device, etc.). A “library” is executed by a processor in the same way as a program. Therefore, the process may be described using the library as the subject. A library is program code that is combined with a program as part of the program when the program is executed.
 本開示は、NVRAM(Non-volatile Random access memory)のメモリ領域を取得するためのNVRAMヒープを効率的に管理する手法に関する。NVRAMヒープは、NVRAMのメモリ領域に対する仮想アドレス空間である。本開示の一例において、プログラムは、NVRAMヒープを介してNVRAMメモリ領域を取得する際に、取得したメモリ領域にkeyを割り当てる。 This disclosure relates to a technique for efficiently managing an NVRAM heap for acquiring a memory area of NVRAM (Non-volatile Random access memory). The NVRAM heap is a virtual address space for the NVRAM memory area. In an example of the present disclosure, the program allocates a key to the acquired memory area when the NVRAM memory area is acquired via the NVRAM heap.
 プログラムは、keyとNVRAMヒープのアドレスとを関連付ける情報を参照し、keyを使用して、NVRAMの取得したメモリ領域に割り当てられた(マッピングされた)、NVRAMヒープのアドレスを検索する。これにより、デフラグ処理によって取得したメモリ領域のNVRAMヒープにおけるアドレスが変更された場合でも、プログラムが、変更後のアドレスを検索することができる。 The program refers to information associating the key with the address of the NVRAM heap, and uses the key to search for the address of the NVRAM heap assigned (mapped) to the memory area acquired by the NVRAM. Thereby, even when the address in the NVRAM heap of the memory area acquired by the defragmentation process is changed, the program can search for the changed address.
 以下において一つの実施例を説明する。本実施例は、NVRAMを利用する計算機システムを開示する。計算機システムの一例であるストレージ装置は、ストレージサービスを提供するプログラム(以降ストレージプログラム)を実行する。ストレージプログラムは、NVRAMヒープを使用して、NVRAMのメモリ領域を取得及び解放する。 One example will be described below. The present embodiment discloses a computer system using NVRAM. A storage apparatus, which is an example of a computer system, executes a program that provides a storage service (hereinafter, a storage program). The storage program uses the NVRAM heap to acquire and release the NVRAM memory area.
 本実施例は、ストレージプログラムが使用するNVRAMヒープ(現用NVRAMヒープ)とは別に、待機NVRAMヒープ(待機モードにおけるNVRAMヒープ)を用意する。現用NVRAMヒープにおいて使用されているアドレス領域(使用領域)は、待機NVRAMヒープに反映される。待機NVRAMヒープにおける不連続の(離間した)使用領域は、所定時に、一つの連続する使用領域に纏められる(デフラグされる)。NVRAMメモリにおいてストレージプログラムが使用しているメモリ領域は、待機NVRAMヒープの新たな連続領域にマッピングされる。 In this embodiment, a standby NVRAM heap (NVRAM heap in standby mode) is prepared separately from the NVRAM heap (current NVRAM heap) used by the storage program. The address area (use area) used in the current NVRAM heap is reflected in the standby NVRAM heap. The discontinuous (separated) use areas in the standby NVRAM heap are combined (defragmented) into one continuous use area at a predetermined time. The memory area used by the storage program in the NVRAM memory is mapped to a new continuous area of the standby NVRAM heap.
 例えば、待機NVRAMヒープのデフラグは、待機NVRAMヒープにおいて、単一の使用領域と単一の空き領域を形成する。これは、断片化が最も小さい状態である。待機NVRAMヒープの断片化が低減されれば、複数の使用領域及び/又は複数の空き領域が存在してもよい。 For example, defragmentation of the standby NVRAM heap forms a single used area and a single free area in the standby NVRAM heap. This is the state with the least fragmentation. If fragmentation of the standby NVRAM heap is reduced, a plurality of used areas and / or a plurality of free areas may exist.
 例えば、待機NVRAMヒープは、複数の離間した使用領域及び/又は複数の離間した空き領域が形成される毎にデフラグされる。不連続の使用領域又は不連続の空き領域は、ストレージプログラムが、現用NVRAMヒープ(現用モードにおけるNVRAMヒープ)を介して、NVRAMメモリ領域の取得又は解放を行うことで、形成され得る。 For example, the standby NVRAM heap is defragmented each time a plurality of spaced use areas and / or a plurality of spaced free areas are formed. The discontinuous use area or the discontinuous free area can be formed by the storage program acquiring or releasing the NVRAM memory area via the current NVRAM heap (the NVRAM heap in the current mode).
 ストレージプログラムは、所定タイミングで、現用NVRAMヒープと待機NVRAMヒープとを切り替える。これにより、NVRAMヒープのデフラグ処理を実行するために、NVRAMヒープを使用しているストレージプログラムの実行を一時的に停止する必要をなくすことができ、デフラグ処理によるストレージプログラムが提供するサービスへの影響を低減できる。 The storage program switches between the active NVRAM heap and the standby NVRAM heap at a predetermined timing. This eliminates the need to temporarily stop the execution of the storage program that uses the NVRAM heap in order to execute the defragmentation process of the NVRAM heap, and the influence of the defragmentation process on the service provided by the storage program Can be reduced.
 図1は、実施例1に係るストレージ装置100を含むシステムのハードウェア構成例を示す。ストレージ装置100は、本開示のNVRAMヒープを使用する計算機システムの一例である。ストレージ装置100は、複数のホスト110に対して、ストレージサービスを提供する。 FIG. 1 illustrates a hardware configuration example of a system including the storage apparatus 100 according to the first embodiment. The storage apparatus 100 is an example of a computer system that uses the NVRAM heap of the present disclosure. The storage apparatus 100 provides a storage service to a plurality of hosts 110.
 ホスト110は、通信ケーブル121を介してネットワーク130に接続されており、ネットワーク130を介してストレージ装置100に接続されている。ホスト110は、ストレージ装置100に対してI/O要求を発行する。ネットワーク130は、ネットワークスイッチ120及び通信ケーブル121、122を含んで構成される。 The host 110 is connected to the network 130 via the communication cable 121, and is connected to the storage apparatus 100 via the network 130. The host 110 issues an I / O request to the storage apparatus 100. The network 130 includes a network switch 120 and communication cables 121 and 122.
 ストレージ装置100は、プロセッサであるCPU101、VRAM(Volatile Random access memory)102、NVRAM103、ディスク装置104、及びこれらを相互に接続するバス107を含んで構成されている。 The storage apparatus 100 includes a CPU 101 that is a processor, a VRAM (Volatile Random access memory) 102, an NVRAM 103, a disk device 104, and a bus 107 that interconnects them.
 CPU101は、ストレージ装置100上でプログラムを実行することで所定の機能部として動作する。CPU101は、1又は複数のチップ又はモジュールで構成される。VRAM102は、揮発性データを格納するために用いられる。CPU101に実行されるプログラム、プログラムが使用するデータは、VRAM102に格納される。
VRAM102は、1又は複数のチップ又はモジュールで構成される。
The CPU 101 operates as a predetermined functional unit by executing a program on the storage apparatus 100. The CPU 101 is composed of one or a plurality of chips or modules. The VRAM 102 is used for storing volatile data. A program executed by the CPU 101 and data used by the program are stored in the VRAM 102.
The VRAM 102 is composed of one or a plurality of chips or modules.
 NVRAM103は、不揮発データを格納するために用いられる。本例において、ストレージ装置100に対してホスト110から発行されたWriteデータは、NVRAM103に格納される(キャッシュされる)。NVRAM103は、1又は複数のチップ又はモジュールで構成される。NVRAM103にホスト110からのWriteデータをキャッシュすることで、高障害耐性、低レイテンシ、高スループットを実現できる。 NVRAM 103 is used for storing non-volatile data. In this example, Write data issued from the host 110 to the storage apparatus 100 is stored (cached) in the NVRAM 103. The NVRAM 103 is composed of one or a plurality of chips or modules. By caching the write data from the host 110 in the NVRAM 103, high fault tolerance, low latency, and high throughput can be realized.
 ディスク装置104は、不揮発データを格納するために用いられる。NVRAM103上のデータが、ディスク装置104に移動され、NVRAM103に空き領域が作られる。ディスク装置104は、1又は複数のストレージドライブで構成され、ストレージドライブは、例えば、HDD(Hard Disk Drive)又はSSD(Solid State Drive)である。 The disk device 104 is used for storing nonvolatile data. The data on the NVRAM 103 is moved to the disk device 104, and an empty area is created in the NVRAM 103. The disk device 104 is configured by one or a plurality of storage drives, and the storage drive is, for example, an HDD (Hard Disk Drive) or an SSD (Solid State Drive).
 ストレージ装置100は、NIC(Network Interface Card)105によってホスト110に接続される。ストレージ装置100は、NIC105のポート106からケーブル122を介してネットワーク130に接続され、ネットワーク130を介してホスト110に接続される。NIC105の数は設計に依存する。 The storage apparatus 100 is connected to the host 110 by a NIC (Network Interface Card) 105. The storage apparatus 100 is connected to the network 130 from the port 106 of the NIC 105 via the cable 122 and is connected to the host 110 via the network 130. The number of NICs 105 depends on the design.
 図2は、実施例1に係るシステムの論理構成を示す。OS(Operating System)210は、ストレージ装置100のCPU101に実行されるプログラムである。OS210は、ストレージ装置100で実行されるストレージプログラム200へのハードウェア資源の割り当てを管理する。 FIG. 2 shows a logical configuration of the system according to the first embodiment. An OS (Operating System) 210 is a program executed by the CPU 101 of the storage apparatus 100. The OS 210 manages the allocation of hardware resources to the storage program 200 executed by the storage apparatus 100.
 メモリ管理ライブラリ201は、ストレージ装置100で実行されるストレージプログラム200が使用するメモリを、管理するプログラムである。メモリ管理ライブラリ201は、OS210を介して、ストレージプログラム200のアドレス空間においてVRAMヒープ202用の領域を確保する。メモリ管理ライブラリ201は、OS210を介して、VRAMヒープ202にVRAM102のメモリ領域を割り当てる。ストレージプログラム200は、メモリ管理ライブラリ201を介して、VRAMのメモリ領域をVRAMヒープ202から取得する。 The memory management library 201 is a program for managing the memory used by the storage program 200 executed by the storage apparatus 100. The memory management library 201 reserves an area for the VRAM heap 202 in the address space of the storage program 200 via the OS 210. The memory management library 201 allocates the memory area of the VRAM 102 to the VRAM heap 202 via the OS 210. The storage program 200 acquires the VRAM memory area from the VRAM heap 202 via the memory management library 201.
 メモリ管理ライブラリ201は、OS210を介して、ストレージプログラム200のアドレス空間において、現用NVRAMヒープ203と待機NVRAMヒープ204の領域を確保する。メモリ管理ライブラリ201は、OS210を介して、現用NVRAMヒープ203と待機NVRAMヒープ204とに、NVRAM103のメモリ領域を割り当てる。ストレージプログラム200は、メモリ管理ライブラリ201を介して、NVRAMメモリ領域を、NVRAMヒープ203から取得する。 The memory management library 201 reserves areas for the current NVRAM heap 203 and the standby NVRAM heap 204 in the address space of the storage program 200 via the OS 210. The memory management library 201 allocates the memory area of the NVRAM 103 to the active NVRAM heap 203 and the standby NVRAM heap 204 via the OS 210. The storage program 200 acquires the NVRAM memory area from the NVRAM heap 203 via the memory management library 201.
 ストレージプログラム200は、ホスト110からストレージ装置100に発行されたI/O要求を処理する。ホスト110からWrite要求が発行された場合、ストレージプログラム200は、メモリ管理ライブラリ201を介して、NVRAMヒープ203からNVRAMメモリ領域を取得し、ホスト110から受領したWriteデータを当該NVRAMメモリ領域に格納する。ストレージプログラム200は、I/O処理の完了を、ホスト110に通知する。 The storage program 200 processes an I / O request issued from the host 110 to the storage apparatus 100. When a write request is issued from the host 110, the storage program 200 acquires the NVRAM memory area from the NVRAM heap 203 via the memory management library 201, and stores the write data received from the host 110 in the NVRAM memory area. . The storage program 200 notifies the host 110 of completion of the I / O processing.
 ストレージプログラム200は、NVRAMメモリ領域に格納されているデータを、定期的に、ディスク装置104に移動する。ストレージプログラム200は、ディスク装置104に移動されたデータを格納していたNVRAMメモリ領域を、メモリ管理ライブラリ201を介して解放する。 The storage program 200 periodically moves the data stored in the NVRAM memory area to the disk device 104. The storage program 200 releases the NVRAM memory area storing the data moved to the disk device 104 via the memory management library 201.
 図3Aは、実施例1に係るストレージ装置において、現用NVRAMヒープ203の構造例を示す。現用NVRAMヒープ203は、メモリ管理ライブラリ201により管理される。OS210は、NVRAM103の記憶領域を固定サイズのブロック(以降メモリページと記述)に分割して管理する。メモリ管理ライブラリ210は、OS210を介して、ストレージプログラム200のアドレス空間にNVRAMヒープ203用の領域を確保する。 FIG. 3A shows an example of the structure of the active NVRAM heap 203 in the storage apparatus according to the first embodiment. The working NVRAM heap 203 is managed by the memory management library 201. The OS 210 manages the storage area of the NVRAM 103 by dividing it into fixed-size blocks (hereinafter referred to as memory pages). The memory management library 210 secures an area for the NVRAM heap 203 in the address space of the storage program 200 via the OS 210.
 メモリ管理ライブラリ210は、OS210を介して、現用NVRAMヒープ203の領域にメモリページを割り当てる。図は省略するが、待機NVRAMヒープ204も、NVRAMヒープ203と同様の方法で、メモリ管理ライブラリ201によって、メモリページが割り当てられる。 The memory management library 210 allocates memory pages to the area of the current NVRAM heap 203 via the OS 210. Although not shown, the standby NVRAM heap 204 is also assigned memory pages by the memory management library 201 in the same manner as the NVRAM heap 203.
 図3Bは、実施例1に係るストレージ装置において、メモリ管理ライブラリ201が、OS210を介して、現用NVRAMヒープ203及び待機NVRAMヒープ204に、メモリページを割り当てる方法を示す。メモリ管理ライブラリ201は、OS210の提供する機能を用いて、NVRAM Ramdisk300上に、ファイルシステム301を構築する。NVRAM Ramdisk300は、NVRAM103のメモリページによって構成される。NVRAM Ramdisk300は、ストレージ装置100の起動時に、OS210によって作成される。 FIG. 3B illustrates a method in which the memory management library 201 allocates memory pages to the active NVRAM heap 203 and the standby NVRAM heap 204 via the OS 210 in the storage apparatus according to the first embodiment. The memory management library 201 uses the functions provided by the OS 210 to construct the file system 301 on the NVRAM Ramdisk 300. The NVRAM Ramdisk 300 is configured by the memory pages of the NVRAM 103. The NVRAM Ramdisk 300 is created by the OS 210 when the storage apparatus 100 is activated.
 メモリ管理ライブラリ201は、OS210の機能を用いて、ファイルシステム301上に、管理ファイル302、管理ファイル303、チャンクファイル304を作成する。メモリ管理ライブラリ201は、OS210の提供する機能を用いて、NVRAM Ramdisk300を構成するメモリページを、管理ファイル302、管理ファイル303、チャンクファイル304に書き込まれたデータを格納するデバイスとして登録する。 The memory management library 201 creates a management file 302, a management file 303, and a chunk file 304 on the file system 301 by using the function of the OS 210. The memory management library 201 registers a memory page constituting the NVRAM Ramdisk 300 as a device for storing data written in the management file 302, the management file 303, and the chunk file 304 using the function provided by the OS 210.
 メモリ管理ライブラリ201は、OS210の提供する機能を用いて、管理ファイル302をNVRAMヒープ203のアドレス空間の前半部分に、チャンクファイル304を後半部分にマッピングする。これにより、管理ファイル302及びチャンクファイル304に書き込まれたデータを格納するデバイスとして登録されたメモリページが、NVRAMヒープ203に割り当てられる。 The memory management library 201 uses the function provided by the OS 210 to map the management file 302 to the first half of the address space of the NVRAM heap 203 and the chunk file 304 to the second half. As a result, a memory page registered as a device for storing data written in the management file 302 and the chunk file 304 is allocated to the NVRAM heap 203.
 また、メモリ管理ライブラリ201は、OS210の提供する機能を用いて、管理ファイル303を待機NVRAMヒープ204のアドレス空間の前半部分にマッピングする。これにより、管理ファイル303に書き込まれたデータを格納するデバイスとして登録されたメモリページが、待機NVRAMヒープ204に割り当てられる。管理ファイル303をNVRAM103に格納することで、管理ファイルデータをチャンクファイルデータと同様に不揮発データとして保持することができ、管理ファイル303への高速アクセスが可能である。 Also, the memory management library 201 maps the management file 303 to the first half of the address space of the standby NVRAM heap 204 using the function provided by the OS 210. As a result, a memory page registered as a device for storing data written in the management file 303 is allocated to the standby NVRAM heap 204. By storing the management file 303 in the NVRAM 103, the management file data can be held as non-volatile data like the chunk file data, and high-speed access to the management file 303 is possible.
 図4は、実施例1に係るストレージ装置において、メモリ管理ライブラリ201がストレージプログラム200に提供する、API(Apprication Programmable Interface)400の例を示す。図4は、API400をC言語の関数として示すが、API400は別の言語であってもよい。 FIG. 4 illustrates an example of an API (Application Programmable Interface) 400 provided by the memory management library 201 to the storage program 200 in the storage apparatus according to the first embodiment. Although FIG. 4 shows the API 400 as a C language function, the API 400 may be in another language.
 メモリ管理ライブラリ201は、メモリ領域取得用の関数として、nvmallocを提供する。nvmallocは、取得するメモリ領域のサイズと、取得したメモリに関連づけられるkeyとを、引数としてとる。keyは数値であり、NVRAMメモリ領域(又はそこに格納されているデータ)を同定できれば、どのような数値でもよい。ストレージプログラム200がnvmallocを呼び出すと、メモリ管理ライブラリ201は、指定されたサイズのメモリ領域をNVRAMヒープ203から確保し、当該メモリの先頭アドレスをnvmallocの返り値として、ストレージプログラム200に渡す。 The memory management library 201 provides nvmalloc as a function for acquiring a memory area. nvmalloc takes the size of the memory area to be acquired and the key associated with the acquired memory as arguments. The key is a numerical value and may be any numerical value as long as the NVRAM memory area (or data stored therein) can be identified. When the storage program 200 calls nvmalloc, the memory management library 201 secures a memory area of the specified size from the NVRAM heap 203 and passes the start address of the memory to the storage program 200 as a return value of nvmalloc.
 メモリ管理ライブラリ201は、メモリ領域解放用の関数として、nvfreeを提供する。nvfreeは、解放するメモリ領域と関連づけられたkeyを引数としてとる。メモリ管理ライブラリ201は、ストレージプログラム200がnvfreeを呼び出したら、keyに関連づけられたメモリをNVRAMヒープ203上の空き領域とする。 The memory management library 201 provides nvfree as a function for releasing the memory area. nvfree takes a key associated with a memory area to be released as an argument. When the storage program 200 calls nvfree, the memory management library 201 sets the memory associated with the key as a free area on the NVRAM heap 203.
 メモリ管理ライブラリ201はメモリ領域検索用の関数としてnvlookupを提供する。nvlookupは、検索するメモリ領域に関連づけられたkey、検索するメモリ領域の先頭アドレスを格納する変数のポインタ、及び、検索するメモリ領域のサイズを格納する変数のポインタを引数としてとる。 The memory management library 201 provides nvlookup as a memory area search function. nvlookup takes as arguments a key associated with the memory area to be searched, a pointer to a variable that stores the start address of the memory area to be searched, and a pointer to a variable that stores the size of the memory area to be searched.
 ストレージプログラム200がnvlookupを呼び出すと、メモリ管理ライブラリ201は、引数として渡されたkeyに関連づけられたメモリ領域を検索し、そのアドレスとサイズを、引数として渡されたポインタが示す変数に格納する。メモリ管理ライブラリ201がkeyと関連付けられたメモリ領域を検索する方法は後述する。 When the storage program 200 calls nvlookup, the memory management library 201 searches the memory area associated with the key passed as an argument, and stores its address and size in the variable indicated by the pointer passed as the argument. A method for searching the memory area associated with the key by the memory management library 201 will be described later.
 図5は、実施例1に係るストレージ装置において、メモリ管理ライブラリ201を経由した、現用NVRAMヒープ203からのメモリ領域の取得及び解放の概念図を示す。メモリ管理ライブラリ201は、NVRAMヒープ203、204を固定サイズのブロック(以降チャンクと記述)205に分割して管理する。所定サイズの領域単位で管理することで、NVRAMヒープ203、204を効率的に管理できる。チャンクサイズは、メモリページのサイズの倍数(1でもよい)である。図5は、現用NVRAMヒープ203においてストレージプログラム200によって使用されているチャンク205を、斜線で表現している。 FIG. 5 is a conceptual diagram of acquisition and release of a memory area from the working NVRAM heap 203 via the memory management library 201 in the storage apparatus according to the first embodiment. The memory management library 201 manages the NVRAM heaps 203 and 204 by dividing them into fixed-size blocks (hereinafter referred to as chunks) 205. The NVRAM heaps 203 and 204 can be efficiently managed by managing in units of areas of a predetermined size. The chunk size is a multiple of the size of the memory page (may be 1). In FIG. 5, the chunk 205 used by the storage program 200 in the working NVRAM heap 203 is represented by diagonal lines.
 ストレージプログラム200がnvmallocを呼び出すと、メモリ管理ライブラリ201は、要求メモリサイズに適した数の連続したチャンクを、ストレージプログラム200に割り当てる。例えば、チャンクサイズが64Byte、要求サイズが112Byteである場合、メモリ管理ライブラリ201は、二つの連続したチャンクを、ストレージプログラム200に割り当てる。 When the storage program 200 calls nvmalloc, the memory management library 201 allocates a number of consecutive chunks suitable for the requested memory size to the storage program 200. For example, when the chunk size is 64 bytes and the request size is 112 bytes, the memory management library 201 allocates two consecutive chunks to the storage program 200.
 ストレージプログラム200に割り当てられたチャンクは、使用中のチャンクとして、メモリ管理ライブラリ201に管理される。メモリ管理ライブラリ201は、割り当てた連続チャンクの一つ目のチャンクの先頭アドレスを、割り当てたNVRAMメモリ領域の先頭アドレスとし、nvmallocの返り値として、ストレージプログラム200に渡す。 The chunk assigned to the storage program 200 is managed by the memory management library 201 as a chunk in use. The memory management library 201 uses the start address of the first chunk of the allocated continuous chunk as the start address of the allocated NVRAM memory area, and passes it to the storage program 200 as a return value of nvmalloc.
 ストレージプログラム200がnvfreeを呼び出すと、解放対象のNVRAMメモリ領域に割り当てられているチャンクが、現用NVRAMヒープ203に返還され、未使用のチャンクとして、メモリ管理ライブラリ201に管理される。 When the storage program 200 calls nvfree, the chunk assigned to the NVRAM memory area to be released is returned to the current NVRAM heap 203 and managed by the memory management library 201 as an unused chunk.
 図6は、実施例1に係るストレージ装置において、メモリ管理ライブラリ201が管理する現用NVRAMヒープ203のデータ構造例を示す。上述のように、現用NVRAMヒープ203の前半部分には、管理ファイル302がマッピングされている。前半部分は、フラグ603、チャンク管理領域600、検索インデックス領域601、ポインタ(PTR)602から構成される。 FIG. 6 shows an example of the data structure of the working NVRAM heap 203 managed by the memory management library 201 in the storage apparatus according to the first embodiment. As described above, the management file 302 is mapped to the first half of the working NVRAM heap 203. The first half part includes a flag 603, a chunk management area 600, a search index area 601, and a pointer (PTR) 602.
 上述のように、NVRAMヒープ203の後半部分には、チャンクファイル304がマッピングされている。後半部分は、固定サイズのチャンク605に分割され、ストレージプログラム200へのNVRAMメモリ領域の割り当てに用いられる。 As described above, the chunk file 304 is mapped to the latter half of the NVRAM heap 203. The latter half is divided into fixed-size chunks 605 and used for allocation of NVRAM memory areas to the storage program 200.
 図7は、実施例1に係るストレージ装置において、メモリ管理ライブラリ201が管理するNVRAMヒープ203内の、チャンク管理領域600の構造例を示す。チャンク管理領域600は、NVRAMヒープ203内のチャンクを管理するための情報を格納する。 FIG. 7 shows a structural example of the chunk management area 600 in the NVRAM heap 203 managed by the memory management library 201 in the storage apparatus according to the first embodiment. The chunk management area 600 stores information for managing chunks in the NVRAM heap 203.
 チャンク管理領域600には、NVRAMヒープ203内に存在するチャンクの数だけ、チャンク情報を管理するためのエントリが存在する。例えば、N個のチャンクがNVRAMヒープ203内に存在する場合、N個のエントリがチャンク管理領域600に存在する。チャンク管理領域600の各エントリは、対応するチャンクに関する情報を管理する。各エントリは、管理するチャンクの、チャンク番号、状態、及びチャンクインデックスを、フィールドとして持つ。 There are as many entries in the chunk management area 600 for managing chunk information as the number of chunks existing in the NVRAM heap 203. For example, when N chunks exist in the NVRAM heap 203, N entries exist in the chunk management area 600. Each entry in the chunk management area 600 manages information related to the corresponding chunk. Each entry has a chunk number, a state, and a chunk index of a chunk to be managed as fields.
 チャンク番号フィールドは、当該エントリが管理するチャンクのチャンク番号を格納する。チャンクの番号は、NVRAMヒープ203内でのチャンクの位置よって決定され、NVRAMヒープ203のアドレスを示す一例である。ポインタ602に隣接するチャンクのチャンク番号が0と決定され、以降チャンク番号は1ずつ増加する。 The chunk number field stores the chunk number of the chunk managed by the entry. The chunk number is an example showing the address of the NVRAM heap 203, which is determined by the position of the chunk in the NVRAM heap 203. The chunk number of the chunk adjacent to the pointer 602 is determined to be 0, and thereafter the chunk number is incremented by 1.
 状態フィールドは、エントリに対応するチャンクの状態を示す値を格納する。チャンクがnvmallocによってストレージプログラム200に使用されている場合、チャンクの状態フィールドは「USED」を示す。チャンクがストレージプログラム200に使用されていない場合、チャンクの状態フィールドは、「FREE」を示す。 The status field stores a value indicating the status of the chunk corresponding to the entry. When a chunk is used by the storage program 200 by nvmalloc, the chunk status field indicates “USED”. When the chunk is not used in the storage program 200, the chunk status field indicates “FREE”.
 チャンクインデックスフィールドは、ストレージプログラム200に割り当てた連続チャンクにおいて、当該エントリが管理するチャンクが何番目の要素かを示すインデックスを格納する。例えば、チャンク番号2、3、4、の連続したチャンクをストレージプログラム200に割り当てた場合、各チャンクのエントリのチャンクインデックスフィールドは、それぞれ0、1、2を示す。状態フィールドが「FREE」のチャンクのチャンクフィールドは、空欄とする。 The chunk index field stores an index indicating the element number of the chunk managed by the entry in the continuous chunk assigned to the storage program 200. For example, when consecutive chunks having chunk numbers 2, 3, 4 are allocated to the storage program 200, the chunk index fields of the entries of each chunk indicate 0, 1, 2 respectively. The chunk field of the chunk whose status field is “FREE” is blank.
 keyフィールドは、ストレージプログラム200がNVRAMメモリ領域(又は格納データ)に割り当てたkeyを格納する。例えば、nvmallocの引数keyの値が100で、チャンク番号2、3、4の連続したチャンクがストレージプログラム200に割り当てられている場合、各チャンクのエントリのチャンクインデックスフィールドは、それぞれ100、100、100を示す。 The key field stores a key assigned by the storage program 200 to the NVRAM memory area (or stored data). For example, when the value of the argument key of nvmalloc is 100 and consecutive chunks with chunk numbers 2, 3, and 4 are allocated to the storage program 200, the chunk index fields of the entries of each chunk are 100, 100, and 100, respectively. Indicates.
 図8は、実施例1に係るストレージ装置において、メモリ管理ライブラリ201が管理するNVRAMヒープ203用の検索インデックス800の構造例を示す。検索インデックス800は、ストレージプログラム200が取得したNVRAMメモリ領域を検索するために用いられる。検索インデックス800を構成する各エレメント(例として、ルートエレメントのみ801で指示)は、ストレージプログラム200が取得したNVRAMメモリ領域の情報を格納する。 FIG. 8 shows a structural example of the search index 800 for the NVRAM heap 203 managed by the memory management library 201 in the storage apparatus according to the first embodiment. The search index 800 is used for searching the NVRAM memory area acquired by the storage program 200. Each element constituting the search index 800 (for example, only the root element is indicated by 801) stores information on the NVRAM memory area acquired by the storage program 200.
 具体的には、各エレメントは、NVRAMメモリ領域にストレージプログラム200が割り当てたkey、並びに、当該NVRAMメモリ領域のNVRAMヒープ203における先頭アドレス及びサイズを格納する。メモリ管理ライブラリ201は、keyをもとに検索インデックス800を検索し、NVRAMヒープ203当該keyに関連付けられているNVRAMメモリ領域のアドレスを検索できる。図8の検索インデックス例は、keyの数値をもとにソートされる2分木の構造を有しているが、検索インデックスは、keyによってソートすることが可能ならば、別の構造を有してもよい。 Specifically, each element stores the key assigned by the storage program 200 to the NVRAM memory area, and the head address and size in the NVRAM heap 203 of the NVRAM memory area. The memory management library 201 searches the search index 800 based on the key, and can search the NVRAM heap 203 for the address of the NVRAM memory area associated with the key. The search index example of FIG. 8 has a binary tree structure that is sorted based on the numerical value of the key. However, if the search index can be sorted by the key, the search index has another structure. May be.
 図8の例において、メモリ管理ライブラリ201が検索インデックス800を検索することを可能にするため、検索インデックス800の各エレメント801は、左右のリーフエレメントへのポインタを格納する。左のリーフエレメントは、当該エレメントのkeyよりも小さい値のkeyを持つ。右のリーフエレメントには、当該エレメントのkeyよりも大きい値のkeyを持つ。メモリ管理ライブラリ201が検索インデックスの検索を開始するルートエレメント801のkeyの値は、検索インデックスに登録されているエレメントのkeyの中央値である。 In the example of FIG. 8, in order to enable the memory management library 201 to search the search index 800, each element 801 of the search index 800 stores pointers to the left and right leaf elements. The left leaf element has a key whose value is smaller than the key of the element. The right leaf element has a key whose value is larger than the key of the element. The key value of the root element 801 from which the memory management library 201 starts searching the search index is the median value of the key of the element registered in the search index.
 メモリ管理ライブラリ201が検索インデックス800を用いて特定のNVRAMメモリ領域を検索する場合、メモリ管理ライブラリ201は、まず、検索インデックス800のルートエレメント801を参照する。 When the memory management library 201 searches for a specific NVRAM memory area using the search index 800, the memory management library 201 first refers to the root element 801 of the search index 800.
 検索対象のNVRAMメモリ領域のkeyの数値が、当該エレメントに登録されているkeyの数値よりも小さければ、メモリ管理ライブラリ201は、次に左のリーフエレメントを参照する。検索対象のNVRAMメモリのkeyの数値が、当該エレメントに登録されているkeyの数値よりも大きければ、メモリ管理ライブラリ201は、次に右のリーフエレメントを参照する。この処理を、メモリ管理ライブラリ201は、検索対処のNVRAMメモリのkeyの数値と一致するkeyを持つエレメントを発見するまで繰り返す。 If the key value of the NVRAM memory area to be searched is smaller than the key value registered in the element, the memory management library 201 next refers to the left leaf element. If the key value of the NVRAM memory to be searched is larger than the key value registered in the element, the memory management library 201 next refers to the right leaf element. This process is repeated until the memory management library 201 finds an element having a key that matches the numeric value of the key of the NVRAM memory to be searched.
 メモリ管理ライブラリ201が検索インデックス800の位置を特定し、検索すること可能にするため、検索インデックス800のルートエレメント801へのポインタは、NVRAMヒープ203内のポインタ602に格納される。検索インデックス800の各エレメントのための領域は、NVRAMヒープ203内の検索インデックス領域601から取得される。よって、検索インデックス800のサイズは、検索インデックス領域601のサイズにより制限される。検索インデックス領域601からのメモリ領域の割り当ては、どのようなアルゴリズムを用いてもよい。 In order to enable the memory management library 201 to identify and search the position of the search index 800, the pointer to the root element 801 of the search index 800 is stored in the pointer 602 in the NVRAM heap 203. The area for each element of the search index 800 is obtained from the search index area 601 in the NVRAM heap 203. Therefore, the size of the search index 800 is limited by the size of the search index area 601. Any algorithm may be used for allocation of the memory area from the search index area 601.
 図9Aは、実施例1に係るストレージ装置100における、NVRAMメモリ領域取得処理(nvmalloc処理)を示す。ストレージプログラム200がnvmallocを呼び出した場合、メモリ管理ライブラリ201は、チャンク管理領域600を参照して、状態フィールドが「FREE」を示す未使用のチャンクを検索する(S101)。 FIG. 9A shows NVRAM memory area acquisition processing (nvmalloc processing) in the storage apparatus 100 according to the first embodiment. When the storage program 200 calls nvmalloc, the memory management library 201 refers to the chunk management area 600 and searches for an unused chunk whose status field indicates “FREE” (S101).
 ストレージプログラム200から要求されたメモリサイズに適した未使用の連続したチャンクが見つかった場合(S102:YES)、メモリ管理ライブラリ201は、当該チャンクの状態フィールドの値を「USED」に、チャンクインデックスフィールドの値を適切な値に、更新する。さらに、keyフィールドに、ストレージプログラム200から渡されたkeyの値を格納する(S103)。 When an unused continuous chunk suitable for the memory size requested from the storage program 200 is found (S102: YES), the memory management library 201 sets the value of the status field of the chunk to “USED” and the chunk index field. Update the value of to an appropriate value. Further, the key value passed from the storage program 200 is stored in the key field (S103).
 連続したチャンク内の一つ目のチャンクの先頭アドレスが、ストレージプログラム200に割り当てるNVRAMメモリ領域の現用NVRAMヒープ203における先頭アドレスである。チャンクの先頭アドレスは、当該チャンクのチャンク番号から計算できる。現用NVRAMヒープ203の先頭アドレスに、フラグ603のサイズとチャンク管理領域600のサイズと検索インデックス領域601のサイズを加算し、さらにその値に、当該チャンクのチャンク番号とチャンクサイズを乗算した値を加算した値が、当該チャンクの先頭アドレスである。 The head address of the first chunk in the continuous chunk is the head address in the current NVRAM heap 203 of the NVRAM memory area allocated to the storage program 200. The start address of a chunk can be calculated from the chunk number of the chunk. Add the size of the flag 603, the size of the chunk management area 600, and the size of the search index area 601 to the start address of the working NVRAM heap 203, and add the value obtained by multiplying the chunk number and the chunk size of the chunk to that value. The value obtained is the start address of the chunk.
 ストレージプログラム200から要求されたメモリサイズに適した未使用の連続したチャンクが見つからない場合(S102:NO)、メモリ管理ライブラリ201は、nvmallocの返り値として、アドレスNULLをストレージプログラム200に渡し、nvmallocに係る処理を終了する。 When an unused continuous chunk suitable for the memory size requested by the storage program 200 is not found (S102: NO), the memory management library 201 passes the address NULL to the storage program 200 as a return value of nvmalloc, and nvmallloc The process related to is terminated.
 エレメント用のメモリ領域を検索インデックス領域601から取得できる場合(S104:YES)、メモリ管理ライブラリ201は、検索インデックス800に登録するエレメントを作成し、検索インデックス800に挿入する(S105)。 If the memory area for the element can be acquired from the search index area 601 (S104: YES), the memory management library 201 creates an element to be registered in the search index 800 and inserts it in the search index 800 (S105).
 具体的には、メモリ管理ライブラリ201は、ストレージプログラム200に割り当てるNVRAMメモリ領域の先頭アドレス、ストレージプログラム200から要求されたメモリサイズ、ストレージプログラム200から渡されたkeyを登録する。エレメントを挿入する位置は、そのエレメントのkeyの値によって決まる。このとき、必要ならばポインタ602の内容を更新する。 Specifically, the memory management library 201 registers the head address of the NVRAM memory area allocated to the storage program 200, the memory size requested from the storage program 200, and the key passed from the storage program 200. The position where the element is inserted is determined by the value of the key of the element. At this time, the contents of the pointer 602 are updated if necessary.
 メモリ管理ライブラリ201は、nvmallocの返り値として、ストレージプログラム200に割り当てるNVRAMメモリ領域の先頭アドレスを、ストレージプログラム200に渡し、nvmallocに係る処理を終了する。 The memory management library 201 passes the head address of the NVRAM memory area to be assigned to the storage program 200 to the storage program 200 as a return value of nvmalloc, and ends the processing related to nvmalloc.
 エレメント用のメモリ領域を検索インデックス領域601から取得できなければ(S104:NO)、メモリ管理ライブラリ201は、チャンク管理領域600を、ストレージプログラム200がnvmallocを呼び出す前の状態に戻し(S106)、nvmallocの返り値として、アドレスNULLをストレージプログラム200に渡し、nvmallocに係る処理を終了する。 If the memory area for the element cannot be acquired from the search index area 601 (S104: NO), the memory management library 201 returns the chunk management area 600 to the state before the storage program 200 calls nvmalloc (S106), and nvmmalloc As the return value, the address NULL is passed to the storage program 200, and the process related to nvmalloc is terminated.
 図9Bは、ストレージ装置100におけるNVRAMメモリ領域解放処理(nvfree処理)を示す。ストレージプログラム200がnvfreeを呼び出すと、メモリ管理ライブラリ201は、引数として渡されたkeyをもとに、解放対象のNVRAMメモリ領域の先頭アドレスを、検索インデックス800において検索する(S131)。 FIG. 9B shows NVRAM memory area release processing (nvfree processing) in the storage apparatus 100. When the storage program 200 calls nvfree, the memory management library 201 searches the search index 800 for the start address of the NVRAM memory area to be released based on the key passed as an argument (S131).
 当該NVRAMメモリ領域の先頭アドレスが見つからない場合(S132:NO)、メモリ管理ライブラリ201は、nvfreeに係る処理を終了する。当該NVRAMメモリ領域の先頭アドレスが見つかると(S132:YES)、メモリ管理ライブラリ201は、当該NVRAMメモリの先頭アドレスが格納されているエレメントを検索インデックス800から削除する(S133)。このとき、必要ならば要素のポインタ602の値を更新する。 When the head address of the NVRAM memory area is not found (S132: NO), the memory management library 201 ends the process related to nvfree. When the head address of the NVRAM memory area is found (S132: YES), the memory management library 201 deletes the element storing the head address of the NVRAM memory from the search index 800 (S133). At this time, the value of the element pointer 602 is updated if necessary.
 メモリ管理ライブラリ201は、検索インデックス800を検索して取得した解放対象のNVRAMメモリ領域の現用NVRAMヒープ203における先頭アドレスを、チャンク番号に変換し、チャンク管理領域600内にある当該チャンクのエントリを参照する。チャンク番号は、取得したアドレスからフラグ603、チャンク管理領域600、及び検索インデックス領域601のサイズを減算し、その値をチャンクサイズで割算することで、得られる。 The memory management library 201 converts the start address in the current NVRAM heap 203 of the NVRAM memory area to be released obtained by searching the search index 800 into a chunk number, and refers to the entry of the chunk in the chunk management area 600 To do. The chunk number is obtained by subtracting the sizes of the flag 603, the chunk management area 600, and the search index area 601 from the acquired address and dividing the value by the chunk size.
 メモリ管理ライブラリ201は、当該チャンクのエントリの状態フィールドの値を「FREE」に変更する。また、当該エントリのチャンクインデックスフィールドとkeyフィールドを空欄にする。そして、チャンク管理領域600内の次のエントリを参照する。 The memory management library 201 changes the value of the status field of the entry of the chunk to “FREE”. Also, the chunk index field and key field of the entry are left blank. Then, the next entry in the chunk management area 600 is referred to.
 次のエントリのチャンクインデックスフィールドが0以外の値を示す場合、メモリ管理ライブラリ201は、そのエントリの状態フィールドの値を「FREE」に、チャンクインデックスフィールド及びkeyフィールドを空欄にし、その次のエントリに対して同様の処理を行う。この処理を、チャンクインデックスフィールドの値が0又は空欄のエントリを発見するまで繰り返す(S134)。 When the chunk index field of the next entry indicates a value other than 0, the memory management library 201 sets the status field value of the entry to “FREE”, sets the chunk index field and the key field to blank, and sets the next entry to the next entry. The same processing is performed for the above. This process is repeated until an entry having a chunk index field value of 0 or blank is found (S134).
 チャンクインデックスフィールドの値が0又は空欄のエントリを発見すると、メモリ管理ライブラリ201は、解放対象のNVRAMメモリ領域に対応する要素を、検索インデックス800から削除する(S135)。このとき、必要ならば要素のポインタ602の値を更新する。そして、NVRAMメモリ領域解放処理(nvfree処理)が終了する。 When the entry having the chunk index field value 0 or blank is found, the memory management library 201 deletes the element corresponding to the NVRAM memory area to be released from the search index 800 (S135). At this time, the value of the element pointer 602 is updated if necessary. Then, the NVRAM memory area release process (nvfree process) ends.
 図9Cは、ストレージ装置100におけるメモリ検索処理(nvlookup処理)を示す。ストレージプログラム200がnvlookupを呼び出すと、メモリ管理ライブラリ201は、引数として渡されたkeyをもとに、検索対象のNVRAMメモリ領域の先頭アドレスを、検索インデックス800において検索する(S151)。 FIG. 9C shows a memory search process (nvlookup process) in the storage apparatus 100. When the storage program 200 calls nvlookup, the memory management library 201 searches the search index 800 for the start address of the NVRAM memory area to be searched based on the key passed as an argument (S151).
 メモリ管理ライブラリ201は、そのアドレスをnvlookupの返り値として、ストレージプログラム200に渡し、nvlookupに係る処理を終了する。検索インデックスに800を検索してもkeyに該当するNVRAMメモリ領域が見つからなかった場合、メモリ管理ライブラリ201はNULLを返す。 The memory management library 201 passes the address as a return value of nvlookup to the storage program 200 and ends the processing related to nvlookup. If the NVRAM memory area corresponding to the key is not found even after searching 800 in the search index, the memory management library 201 returns NULL.
 図10Aは、ストレージ装置100のI/O処理(Write処理)を示す。ストレージ装置100上で動作するストレージプログラム200は、ホスト110からWrite要求とWriteデータを受信する(S201)。ストレージプログラム200は、NVRAMヒープ203から、メモリ管理ライブラリ201を介して(nvmallocを使呼び出して)、WriteデータをコピーするためのNVRAMメモリ領域を取得する(S202)。 FIG. 10A shows I / O processing (Write processing) of the storage apparatus 100. The storage program 200 operating on the storage apparatus 100 receives a write request and write data from the host 110 (S201). The storage program 200 acquires an NVRAM memory area for copying Write data from the NVRAM heap 203 via the memory management library 201 (using nvmalloc) (S202).
 例えば、keyは、Writeデータを格納するディスク装置104上のアドレスである。Writeデータを格納するディスク装置104上のアドレスは、ホスト110が発行したWrite要求に含まれているものとする。Writeデータを格納するディスク装置104上のアドレスは、ストレージ装置100のいずれか(例えばディスク装置104上の領域)に記録される。ストレージプログラム200は、取得したNVRAMメモリ領域にWriteデータをコピーし(S203)、ホスト110にI/O処理が完了したことを通知する(S204)。 For example, key is an address on the disk device 104 that stores Write data. It is assumed that the address on the disk device 104 that stores the write data is included in the write request issued by the host 110. The address on the disk device 104 that stores the write data is recorded in one of the storage devices 100 (for example, an area on the disk device 104). The storage program 200 copies the write data to the acquired NVRAM memory area (S203), and notifies the host 110 that the I / O processing has been completed (S204).
 ストレージプログラム200は、NVRAM103に格納したデータをディスク装置104に定期的に格納する。ストレージ装置100のいずれか(ディスク装置104等)に記録されているWriteデータのディスク装置104上のアドレスをkeyとして、メモリ管理ライブラリ201を介して(nvlookupを呼び出して)、NVRAMメモリを検索する。 The storage program 200 periodically stores the data stored in the NVRAM 103 in the disk device 104. The NVRAM memory is searched through the memory management library 201 (calling nvlookup) using the address on the disk device 104 of the write data recorded in any one of the storage devices 100 (such as the disk device 104) as the key.
 ストレージプログラム200は、取得したNVRAM103上のデータを、ディスク装置104に書き込む。データを書き込むアドレスは、記録しておいたWriteデータのディスク装置104上のアドレスである。データをディスク装置104に書き込んだ後、ストレージプログラム200は、メモリ管理ライブラリ201を介して(nvfreeを呼び出して)、当該NVRAMメモリ領域を解放する。NVRAMメモリ領域の開放は、ディスク装置104への書き込みの後、適時実行される。 The storage program 200 writes the acquired data on the NVRAM 103 to the disk device 104. The address at which data is written is the address of the recorded write data on the disk device 104. After writing the data to the disk device 104, the storage program 200 releases the NVRAM memory area via the memory management library 201 (calling nvfree). The release of the NVRAM memory area is executed in a timely manner after writing to the disk device 104.
 図10Bは、実施例1に係るストレージ装置100のI/O処理(Read処理)を示す。ストレージプログラム200は、ホスト110からRead要求を受け取る(S231)。ストレージプログラム200は、メモリ管理ライブラリ201を介して(nvlookupを呼び出して)、Readデータを格納するディスク装置104上のアドレスをkeyとして、NVRAMメモリ領域を検索する(S232)。 FIG. 10B illustrates an I / O process (Read process) of the storage apparatus 100 according to the first embodiment. The storage program 200 receives a Read request from the host 110 (S231). The storage program 200 searches the NVRAM memory area via the memory management library 201 (by calling nvlookup), using the address on the disk device 104 storing Read data as the key (S232).
 該当するNVRAMメモリ領域が見つかれば(S233:YES)、ストレージプログラム200は、そのNVRAMメモリ領域のデータを、Readデータとして、ホスト110に返す(S234)。Readデータを格納するディスク装置104上のアドレスは、ホスト110が発行したRead要求に含まれているものとする。 If the corresponding NVRAM memory area is found (S233: YES), the storage program 200 returns the NVRAM memory area data to the host 110 as Read data (S234). It is assumed that the address on the disk device 104 that stores the Read data is included in the Read request issued by the host 110.
 該当するNVRAMメモリ領域が見つからなければ(S233:NO)、ストレージプログラム200は、ディスク装置104からデータを読み出し(S235)、それをReadデータとしてホスト110に返し(S236)、I/O処理を終了する。データを読み出すアドレスは、Read要求に含まれているReadデータを格納するディスク装置104上のアドレスである。 If the corresponding NVRAM memory area is not found (S233: NO), the storage program 200 reads data from the disk device 104 (S235), returns it to the host 110 as Read data (S236), and ends the I / O processing. To do. The address from which data is read is the address on the disk device 104 that stores the Read data included in the Read request.
 図11Aは、メモリ管理ライブラリ201が、待機NVRAMヒープ204の後半部分に、NVRAM103のメモリページを割り当てる方法例を模式的に示す。図11Aは、現用NVRAMヒープ203、待機NVRAMヒープ204、及びNVRAM Ramdisk300において、対応する使用領域1(UA1)、使用領域2(UA2)を示している。 FIG. 11A schematically shows an example of a method in which the memory management library 201 allocates the memory page of the NVRAM 103 to the latter half of the standby NVRAM heap 204. FIG. 11A shows the corresponding use area 1 (UA1) and use area 2 (UA2) in the working NVRAM heap 203, the standby NVRAM heap 204, and the NVRAM Ramdisk 300.
 図11Aに示すように、メモリ管理ライブラリ201は、OS210を介して、現用NVRAMヒープ203に割り当てられているメモリページのうち、ストレージプログラム200によって使用されている領域UA1、UA2を、待機NVRAMヒープ204の後半部分(チャンクからなる領域)の連続領域にマッピングする。 As shown in FIG. 11A, the memory management library 201 uses the standby NVRAM heap 204 to store the areas UA1 and UA2 used by the storage program 200 among the memory pages allocated to the current NVRAM heap 203 via the OS 210. It maps to the continuous area of the latter half part (area consisting of chunks).
 メモリ管理ライブラリ201は、現用NVRAMヒープ203に割り当てられているメモリページのうち、ストレージプログラム200によって使用されていない領域を、待機NVRAMヒープ204の後半部分の残りの領域にマッピングする。これにより、待機NVRAMヒープ204において、連続する不使用領域を形成できる。現用NVRAMヒープ203において、ストレージプログラム200に使用されている領域と使用されていない領域とは、チャンク管理領域600を参照して確認できる。 The memory management library 201 maps an area that is not used by the storage program 200 among the memory pages allocated to the current NVRAM heap 203 to the remaining area in the second half of the standby NVRAM heap 204. Thereby, a continuous unused area can be formed in the standby NVRAM heap 204. In the current NVRAM heap 203, the area used for the storage program 200 and the area not used can be confirmed with reference to the chunk management area 600.
 メモリ管理ライブラリ201は、現用NVRAMヒープ203上において使用されている領域(又は使用されていない領域)に対応するチャンクファイル304上の領域を、待機NVRAMヒープ204の領域にマッピングする。これにより、ストレージプログラム200に使用されている(又は使用されていない)メモリページを、待機NVRAMヒープ204の領域にマッピングする。 The memory management library 201 maps the area on the chunk file 304 corresponding to the area used (or not used) on the current NVRAM heap 203 to the area of the standby NVRAM heap 204. As a result, the memory page used (or not used) in the storage program 200 is mapped to the area of the standby NVRAM heap 204.
 メモリ管理ライブラリ201は、現用NVRAMヒープ203及び待機NVRAMヒープ204にマッピングされているチャンクファイル304の領域を、図11Bに示すマッピング管理テーブル1100を使用して管理する。現用NVRAMヒープ203と待機NVRAMヒープ204に対して、1つずつ用意される。テーブル1100は、チャンクファイル内のアドレス(オフセット)と、NVRAMヒープ内のアドレスとの間のマッピングを管理する。 The memory management library 201 manages the area of the chunk file 304 mapped to the active NVRAM heap 203 and the standby NVRAM heap 204 using the mapping management table 1100 shown in FIG. 11B. One is prepared for each of the active NVRAM heap 203 and the standby NVRAM heap 204. The table 1100 manages the mapping between addresses (offsets) in the chunk file and addresses in the NVRAM heap.
 テーブル1100のオフセットフィールドは、NVRAMヒープにマッピングされているチャンクファイル304の領域のオフセットを示す。サイズフィールドは、当該領域のサイズを示す。アドレスフィールドは、当該領域をマッピングしたNVRAMヒープ上の領域の先頭アドレスを示す。テーブル1100は、ファイルシステム301上のファイルとしてNVRAM103格納されてもよく、ディスク装置104に格納されてもよい。 The offset field of the table 1100 indicates the offset of the area of the chunk file 304 that is mapped to the NVRAM heap. The size field indicates the size of the area. The address field indicates the start address of the area on the NVRAM heap to which the area is mapped. The table 1100 may be stored in the NVRAM 103 as a file on the file system 301 or may be stored in the disk device 104.
 テーブル1100は、チャンクファイル304上の領域をNVRAMヒープの領域にマッピングするたびに、メモリ管理ライブラリ201によって更新される。メモリ管理ライブラリ201は、テーブル1100を参照して、NVRAMヒープ上の領域とチャンクファイル304上の領域の対応を特定する。 The table 1100 is updated by the memory management library 201 every time the area on the chunk file 304 is mapped to the NVRAM heap area. The memory management library 201 refers to the table 1100 and identifies the correspondence between the area on the NVRAM heap and the area on the chunk file 304.
 ストレージプログラム200がnvmallocとnvfreeを繰り返すと、現用NVRAMヒープ203上の使用領域が変化する。メモリ管理ライブラリ201は、現用NVRAMヒープ203に対するnvmalloc及びnvfreeが実行されるたびに、待機NVRAMヒープ204とNVMAR203との間のマッピングを更新する。 When the storage program 200 repeats nvmalloc and nvfree, the used area on the current NVRAM heap 203 changes. The memory management library 201 updates the mapping between the standby NVRAM heap 204 and the NVMAR 203 each time nvmalloc and nvfree for the current NVRAM heap 203 are executed.
 メモリ管理ライブラリ201は、nvmallocの実行に応じて、現用NVRAMヒープ203において新たに割り当てられた使用領域にマッピングされているメモリページを、待機NVRAMヒープ204の後半部分に新たにマッピングする。上述のように、メモリページはkeyで同定される。メモリ管理ライブラリ201は、現用NVRAMヒープ203のマッピング管理テーブル1100に追加又は削除されたメモリページ(のキー)を、待機NVRAMヒープ204のマッピング管理テーブル1100に追加又は削除する。 The memory management library 201 newly maps the memory page mapped to the use area newly allocated in the current NVRAM heap 203 to the second half of the standby NVRAM heap 204 according to the execution of nvmalloc. As described above, a memory page is identified with a key. The memory management library 201 adds or deletes the memory page (or its key) added to or deleted from the mapping management table 1100 of the current NVRAM heap 203 to the mapping management table 1100 of the standby NVRAM heap 204.
 例えば、メモリ管理ライブラリ201は、待機NVRAMヒープ204における最後の使用領域の直後の領域にマッピングする。メモリ管理ライブラリ201は、メモリページのサイズを有する任意位置の不使用領域に、メモリページをマッピングしてもよい。 For example, the memory management library 201 maps to the area immediately after the last used area in the standby NVRAM heap 204. The memory management library 201 may map the memory page to an unused area at an arbitrary position having the size of the memory page.
 同様に、メモリ管理ライブラリ201は、nvfreeの実行に応じて、現用NVRAMヒープ203から新たに開放された領域に対応する待機NVRAMヒープ204における使用領域を開放する。具体的には、メモリ管理ライブラリ201は、NVRAMヒープ203から新たに開放された領域にマッピングされていたメモリページに対して、待機NVRAMヒープ204においてマッピングされていた領域を開放する。 Similarly, the memory management library 201 releases the used area in the standby NVRAM heap 204 corresponding to the area newly released from the current NVRAM heap 203 in accordance with the execution of nvfree. Specifically, the memory management library 201 releases the area mapped in the standby NVRAM heap 204 to the memory page mapped in the area newly released from the NVRAM heap 203.
 メモリ管理ライブラリ201は、所定タイミングで、待機NVRAMヒープ204のデフラグを実行する。デフラグのアルゴリズムは任意である。例えば、メモリ管理ライブラリ201は、各使用領域の前の不使用領域をなくすように使用領域を詰めて、一つの領域を形成する。 The memory management library 201 executes defragmentation of the standby NVRAM heap 204 at a predetermined timing. The defragmentation algorithm is arbitrary. For example, the memory management library 201 forms one area by packing the used areas so as to eliminate the unused area before each used area.
 メモリ管理ライブラリ201は、デフラグにおいて、データをNVRAM103において移動することなく、チャンク管理領域600及び検索インデックス800の更新のみ実行する。メモリ管理ライブラリ201は、チャンク管理領域600においてエントリを移動し、検索インデックス800においてエレメント内のアドレス及びサイズを変更する。待機NVRAMヒープ204はストレージプログラム200により使用されていないので、デフラグによりストレージプログラム200の処理に影響を及ぼすことはない。 The memory management library 201 executes only the update of the chunk management area 600 and the search index 800 without moving the data in the NVRAM 103 during the defragmentation. The memory management library 201 moves the entry in the chunk management area 600 and changes the address and size in the element in the search index 800. Since the standby NVRAM heap 204 is not used by the storage program 200, defragmentation does not affect the processing of the storage program 200.
 例えば、メモリ管理ライブラリ201は、待機NVRAMヒープ204において領域を開放(nvfreeを実行)し、不連続の空き領域が形成されるたびに、デフラグを実行する。メモリ管理ライブラリ201は、不連続の使用領域が形成されるたびに、デフラグを実行してもよい。 For example, the memory management library 201 releases an area in the standby NVRAM heap 204 (executes nvfree) and executes defragmentation whenever a discontinuous free area is formed. The memory management library 201 may perform defragmentation whenever a discontinuous use area is formed.
 例えば、メモリ管理ライブラリ201は、形成された空き領域を埋めるように、解放された領域の後続の使用領域を前方に移動する。例えば、新たにNVRAMメモリ領域にマッピングされる領域を使用領域の直後に配置することで、待機NVRAMヒープ204を断片化されてない状態に維持できる。 For example, the memory management library 201 moves the used area subsequent to the released area forward so as to fill the formed empty area. For example, the standby NVRAM heap 204 can be maintained in a non-fragmented state by newly placing an area mapped to the NVRAM memory area immediately after the use area.
 メモリ管理ライブラリ201は、より少ない頻度で、デフラグを実行してもよい。例えば、現用NVRAMヒープ203に対する所定回数のnvfreeの実行毎に、待機NVRAMヒープ204のデフラグを実行してもよい。メモリ管理ライブラリ201は、待機NVRAMヒープ204の断片化状態に基づいて、デフラグ実行の時を決定してもよい。例えば、不使用領域最大サイズが閾値未満となったとき、又は、閾値未満のサイズの不使用領域の数が閾値に達したときに、デフラグを実行してもよい。 The memory management library 201 may perform defragmentation with less frequency. For example, the defragmentation of the standby NVRAM heap 204 may be executed every time nvfree is executed a predetermined number of times for the current NVRAM heap 203. The memory management library 201 may determine the time of defragmentation based on the fragmentation state of the standby NVRAM heap 204. For example, defragmentation may be executed when the maximum unused area size is less than the threshold value or when the number of unused areas having a size less than the threshold value reaches the threshold value.
 図12は、メモリ管理ライブラリ201が管理する待機NVRAMヒープ204のデータ構造例を示す。待機NVRAMヒープ204の前半部分には、管理ファイル303がマッピングされている。前半部分は、フラグ1203、チャンク管理領域1200、検索インデックス領域1201、ポインタ(PTR)1202から構成される。 FIG. 12 shows an example of the data structure of the standby NVRAM heap 204 managed by the memory management library 201. A management file 303 is mapped to the first half of the standby NVRAM heap 204. The first half includes a flag 1203, a chunk management area 1200, a search index area 1201, and a pointer (PTR) 1202.
 上述のように、待機NVRAMヒープ204の後半部分には、チャンクファイル304がマッピングされている。後半部分は、固定サイズのチャンク1205に分割され、ストレージプログラム200へのNVRAMメモリ領域の割り当てに用いられる。 As described above, the chunk file 304 is mapped to the second half of the standby NVRAM heap 204. The latter half is divided into fixed-size chunks 1205 and used for allocation of NVRAM memory areas to the storage program 200.
 図13は、実施例1に係るストレージ装置100において、メモリ管理ライブラリ201が管理する待機NVRAMヒープ204内の検索インデックス1300の構造例を示す。検索インデックス1300は、ストレージプログラム200が取得したNVRAMメモリ領域を検索するために用いられる。 FIG. 13 shows a structural example of the search index 1300 in the standby NVRAM heap 204 managed by the memory management library 201 in the storage apparatus 100 according to the first embodiment. The search index 1300 is used for searching the NVRAM memory area acquired by the storage program 200.
 検索インデックス1300の構造は、検索インデックス800の構造と同様である。検索インデックス1300のルートエレメント1301へのポインタは、ポインタ1202に格納される。検索インデックス1300を構成する各エレメント用のメモリ領域は、検索インデックス領域1201から取得される。検索インデックス領域1201からのメモリ領域の割り当ては、どのようなアルゴリズムを用いてもよい。 The structure of the search index 1300 is the same as the structure of the search index 800. A pointer to the root element 1301 of the search index 1300 is stored in the pointer 1202. The memory area for each element constituting the search index 1300 is acquired from the search index area 1201. Any algorithm may be used for allocation of the memory area from the search index area 1201.
 待機NVRAMヒープ204の後半部分(チャンクファイル304をマッピングしている部分)は、固定サイズのチャンク1205に分割され、管理される。チャンク1205の管理は、チャンク管理領域1200を用いる。メモリ管理ライブラリ201は、NVRAM103のメモリページを、チャンクファイル304のマッピングを通じて、待機NVRAMヒープ204にマッピングする際、チャンク管理領域1200において、マッピング領域に対応するチャンクのエントリを更新する。 The latter half of the standby NVRAM heap 204 (the portion mapping the chunk file 304) is divided into fixed-size chunks 1205 and managed. The chunk management area 1200 is used for management of the chunk 1205. When mapping the memory page of the NVRAM 103 to the standby NVRAM heap 204 through the mapping of the chunk file 304, the memory management library 201 updates the chunk entry corresponding to the mapping area in the chunk management area 1200.
 メモリ管理ライブラリ201は、現用NVRAMヒープ203において新たな使用領域が割り当てられる、又は、使用領域が開放されると、チャンク管理領域600における当該使用領域の情報を、チャンク管理領域1200にコピーする。 The memory management library 201 copies information on the used area in the chunk management area 600 to the chunk management area 1200 when a new used area is allocated in the current NVRAM heap 203 or when the used area is released.
 具体的には、メモリ管理ライブラリ201は、新たな使用領域又は不使用領域を構成するチャンクに対応するチャンク管理領域600のエントリの内容(状態、インデックス、key)を、待機NVRAMヒープ204上の使用領域又は不使用領域を構成するチャンクに対応するチャンク管理領域1200のエントリに、コピーする。 Specifically, the memory management library 201 uses the contents (state, index, key) of the entry in the chunk management area 600 corresponding to the chunks that constitute a new used area or a non-used area, on the standby NVRAM heap 204. Copy to the entry of the chunk management area 1200 corresponding to the chunk constituting the area or the unused area.
 メモリ管理ライブラリ201が、NVRAM103のメモリページを、チャンクファイル304のマッピングを通じて待機NVRAMヒープ204にマッピングする際、検索インデックス1300を更新する必要がある。同様に、メモリ管理ライブラリ201が、NVRAM103のメモリページに対する待機NVRAMヒープ204のマッピングを解消する際、検索インデックス1300を更新する必要がある。 When the memory management library 201 maps the memory page of the NVRAM 103 to the standby NVRAM heap 204 through the mapping of the chunk file 304, the search index 1300 needs to be updated. Similarly, when the memory management library 201 cancels the mapping of the standby NVRAM heap 204 to the memory page of the NVRAM 103, it is necessary to update the search index 1300.
 メモリ管理ライブラリ201は、チャンク管理領域1200の更新したエントリを参照し、連続領域に移動した使用中のNVRAMメモリ領域の先頭アドレス、サイズ、keyの値を調べる。そして、keyから対応する検索インデックス1300内のエレメントを探索し、対応するエレメントのアドレスフィールドを移動先のアドレスに書き換える。 The memory management library 201 refers to the updated entry in the chunk management area 1200, and examines the start address, size, and key value of the NVRAM memory area in use that has been moved to the continuous area. Then, the element in the corresponding search index 1300 is searched from the key, and the address field of the corresponding element is rewritten with the destination address.
 メモリ管理ライブラリ201は、メモリを取得するNVRAMヒープ203と待機NVRAMヒープ204を任意のタイミングで切り替える機能をストレージプログラム200に提供する。図14は、NVRAMヒープの切り替え処理を示す。メモリ管理ライブラリ201は、新たな現用NVRAMヒープ204のフラグ1203を0に書き換え(S301)、新たな待機NVRAMヒープ203のフラグ603を1に書き換える(S302)。 The memory management library 201 provides the storage program 200 with a function of switching the NVRAM heap 203 for acquiring memory and the standby NVRAM heap 204 at an arbitrary timing. FIG. 14 shows NVRAM heap switching processing. The memory management library 201 rewrites the flag 1203 of the new working NVRAM heap 204 to 0 (S301), and rewrites the flag 603 of the new standby NVRAM heap 203 to 1 (S302).
 ストレージプログラム200がこの機能を用いてNVRAMヒープの切り替えを行った場合、以降のNVRAMメモリ領域の取得、解放、検索処理は、新たな現用NVRAMヒープ204(フラグが0のNVRAMヒープ)を対象にして行われる。 When the storage program 200 uses this function to switch the NVRAM heap, the subsequent NVRAM memory area acquisition, release, and search processes target the new current NVRAM heap 204 (the NVRAM heap with the flag 0). Done.
 切り替え前にメモリの取得、解放、検索処理の対象だったNVRAMヒープ203は、待機NVRAMヒープに変化する。NVRAMヒープが待機NVRAMヒープか否かは、NVRAMヒープの先頭のフラグ領域(フラグ603及びフラグ1203)に格納された値で判定される。この値が0のNVRAMヒープが、メモリの取得、解放、検索処理の対象の現用NVRAMヒープとして使用され、1の値のNVRAMヒープが待機NVRAMヒープとして使用される。 The NVRAM heap 203 that was the target of memory acquisition, release, and search processing before switching is changed to a standby NVRAM heap. Whether or not the NVRAM heap is a standby NVRAM heap is determined by the value stored in the flag area (flag 603 and flag 1203) at the head of the NVRAM heap. The NVRAM heap having a value of 0 is used as the current NVRAM heap to be acquired, released, and searched, and the NVRAM heap having a value of 1 is used as the standby NVRAM heap.
 以上のように、本実施例によれば、NVRAMメモリ領域を識別するためのkeyとNVRAMヒープのアドレスとを関連付けることで、デフラグ処理によって、NVRAMメモリ領域にマッピングされたNVRAMヒープにおけるアドレスが変更された場合でも、NVRAMヒープにおける変更後のアドレスを検索することができる。 As described above, according to this embodiment, by associating the key for identifying the NVRAM memory area with the address of the NVRAM heap, the address in the NVRAM heap mapped to the NVRAM memory area is changed by the defragmentation process. Even in this case, it is possible to retrieve the changed address in the NVRAM heap.
 待機NVRAMヒープを現用NVRAMヒープと別に用意し、現用NVRAMヒープとデフラグされた待機NVRAMとの間で切り替えを行うことで、デフラグ処理によるストレージプログラムが提供するサービスへの影響を低減できる。なお、本実施例のNVRAMヒープ及び関連する処理は、ストレージサービスと異なるサービスを提供する計算機システムに適用できる。 By preparing the standby NVRAM heap separately from the current NVRAM heap and switching between the current NVRAM heap and the defragmented standby NVRAM, it is possible to reduce the influence of the defragmentation process on the service provided by the storage program. Note that the NVRAM heap and related processing of this embodiment can be applied to a computer system that provides a service different from the storage service.
 本実施例は、装置のサービス停止中に、デフラグ処理を実行する。具体的には、ストレージプログラム200は、NVRAMヒープのデフラグ処理を、ホストへのサービスの停止中に実行する。サービス停止中にNVRAMヒープのデフラグ処理を実行することで、デフラグによるサービスへの影響を避けることができる。 In this embodiment, the defragmentation process is executed while the service of the apparatus is stopped. Specifically, the storage program 200 executes the NVRAM heap defragmentation process while the service to the host is stopped. By executing the NVRAM heap defragmentation process while the service is stopped, the influence of the defragmentation on the service can be avoided.
 サービス停止中の期間の一例は、ストレージ装置が起動されてから、サービスを開始するまでの期間である。サービス停止中の期間の他の例は、2ノードクラスタ構成のストレージシステムにおいて、待機ノード上で動作しているストレージプログラムが待機している期間である。 An example of a period during which the service is stopped is a period from when the storage device is activated to when the service is started. Another example of the period during which the service is stopped is a period in which a storage program operating on the standby node is waiting in a storage system having a two-node cluster configuration.
 図15は、実施例2に係るシステムのハードウェア構成例を示す。現用ストレージ装置1500は、複数のホスト1510に対して、ストレージサービスを提供する。待機ストレージ装置1540は、現用ストレージ装置1500に障害が発生した際に、現用ストレージ装置1500に代わって、ホスト1510にストレージサービスを提供する。 FIG. 15 illustrates a hardware configuration example of the system according to the second embodiment. The active storage device 1500 provides a storage service to a plurality of hosts 1510. The standby storage device 1540 provides a storage service to the host 1510 in place of the active storage device 1500 when a failure occurs in the active storage device 1500.
 ホスト1510は、通信ケーブル1521を介してネットワーク1530に接続されており、ネットワーク1530を介して現用ストレージ装置1500に接続されている。ホスト1510は現用ストレージ装置1500に対してI/O要求を発行する。現用ストレージ装置1500が障害で動作していない場合、ホスト1510は、待機ストレージ装置1540に対してI/O要求を発行する。 The host 1510 is connected to the network 1530 via the communication cable 1521, and is connected to the active storage device 1500 via the network 1530. The host 1510 issues an I / O request to the active storage apparatus 1500. When the active storage device 1500 is not operating due to a failure, the host 1510 issues an I / O request to the standby storage device 1540.
 ネットワーク1530はネットワークスイッチ1520及び通信ケーブル1521と通信ケーブル1522、通信ケーブル1523、通信ケーブル1524を含んで構成されている。 The network 1530 includes a network switch 1520, a communication cable 1521, a communication cable 1522, a communication cable 1523, and a communication cable 1524.
 現用ストレージ装置1500は、プロセッサであるCPU1501、VRAM1502、NVRAM1503、ディスク装置1504、及びこれらを相互に接続するバス1508を含んで構成されている。 The active storage device 1500 includes a CPU 1501, which is a processor, a VRAM 1502, an NVRAM 1503, a disk device 1504, and a bus 1508 that interconnects them.
 CPU1501は、現用ストレージ装置1500上でプログラムを実行することで所定の機能部として動作する。CPU1501は、1又は複数のチップ又はモジュールで構成される。VRAM1502は、揮発性データを格納するために用いられる。CPU1501に実行されるプログラム、プログラムが使用するデータは、VRAM1502に格納される。VRAM1502は、1又は複数のチップ又はモジュールで構成される。 The CPU 1501 operates as a predetermined functional unit by executing a program on the active storage device 1500. The CPU 1501 is composed of one or a plurality of chips or modules. VRAM 1502 is used to store volatile data. A program executed by the CPU 1501 and data used by the program are stored in the VRAM 1502. The VRAM 1502 is composed of one or a plurality of chips or modules.
 NVRAM1503は、不揮発データを格納するために用いられる。本例において、現用ストレージ装置1500に対してホスト1510から発行されたWriteデータは、NVRAM1503に格納される。NVRAM1503は、1又は複数のチップ又はモジュールで構成される。 NVRAM 1503 is used for storing non-volatile data. In this example, Write data issued from the host 1510 to the active storage device 1500 is stored in the NVRAM 1503. The NVRAM 1503 is composed of one or a plurality of chips or modules.
 ディスク装置1504は、不揮発データを格納するために用いられる。NVRAM1503上のデータが、ディスク装置1504に移動され、NVRAM1503に空き領域が作られる。ディスク装置1504は、1又は複数のストレージドライブで構成され、ストレージドライブは、例えば、HDD又はSSDである。 The disk device 1504 is used for storing nonvolatile data. The data on the NVRAM 1503 is moved to the disk device 1504, and an empty area is created in the NVRAM 1503. The disk device 1504 is configured by one or a plurality of storage drives, and the storage drive is, for example, an HDD or an SSD.
 現用ストレージ装置1500は、NIC1505によってホスト1510に接続される。現用ストレージ装置1500は、NIC1505のポート1506からケーブル1522を介してネットワーク1530に接続され、ネットワーク1530を介してホスト1510に接続される。また、ポート1507からケーブル1524を介して待機ストレージ装置1540に接続される。NIC1505の数は設計に依存する。 The active storage device 1500 is connected to the host 1510 by the NIC 1505. The active storage apparatus 1500 is connected from the port 1506 of the NIC 1505 to the network 1530 via the cable 1522 and is connected to the host 1510 via the network 1530. Further, the standby storage apparatus 1540 is connected from the port 1507 via the cable 1524. The number of NICs 1505 depends on the design.
 待機ストレージ装置1540は、プロセッサであるCPU1541、VRAM1542、NVRAM1543、ディスク装置1544、及びこれらを相互に接続するバス1548を含んで構成されている。 The standby storage device 1540 includes a CPU 1541 as a processor, a VRAM 1542, an NVRAM 1543, a disk device 1544, and a bus 1548 that interconnects them.
 CPU1541は、待機ストレージ装置1540上でプログラムを実行することで所定の機能部として動作する。CPU1541は、1又は複数のチップ又はモジュールで構成される。VRAM1542は、揮発性データを格納するために用いられる。CPU1541に実行されるプログラム、プログラムが使用するデータは、VRAM1542に格納される。VRAM1542は、1又は複数のチップ又はモジュールで構成される。 The CPU 1541 operates as a predetermined functional unit by executing a program on the standby storage device 1540. The CPU 1541 is composed of one or a plurality of chips or modules. VRAM 1542 is used to store volatile data. A program executed by the CPU 1541 and data used by the program are stored in the VRAM 1542. The VRAM 1542 is composed of one or a plurality of chips or modules.
 NVRAM1543は、不揮発データを格納するために用いられる。本例において、ストレージ装置1540に対してホスト1510から発行されたWriteデータは、NVRAM1543に格納される。NVRAM1543は、1又は複数のチップ又はモジュールで構成される。 NVRAM 1543 is used for storing nonvolatile data. In this example, Write data issued from the host 1510 to the storage apparatus 1540 is stored in the NVRAM 1543. The NVRAM 1543 is composed of one or a plurality of chips or modules.
 ディスク装置1544は、不揮発データを格納するために用いられる。NVRAM1543上のデータが、ディスク装置1544に移動され、NVRAM1543に空き領域が作られる。ディスク装置1544は、1又は複数のストレージドライブで構成され、ストレージドライブは、例えば、HDD又はSSDである。 The disk device 1544 is used for storing nonvolatile data. The data on the NVRAM 1543 is moved to the disk device 1544, and an empty area is created in the NVRAM 1543. The disk device 1544 is configured by one or a plurality of storage drives, and the storage drive is, for example, an HDD or an SSD.
 待機ストレージ装置1540は、NIC1545によってホスト1510に接続される。待機ストレージ装置1540は、NIC1545のポート1546からケーブル1522を介してネットワーク1530に接続され、ネットワーク1530を介してホスト1510に接続される。また、ポート1547からケーブル1524を介して現用ストレージ装置1500に接続される。NIC1545の数は設計に依存する。 The standby storage device 1540 is connected to the host 1510 by the NIC 1545. The standby storage device 1540 is connected from the port 1546 of the NIC 1545 to the network 1530 via the cable 1522, and is connected to the host 1510 via the network 1530. The port 1547 is connected to the active storage apparatus 1500 via the cable 1524. The number of NICs 1545 depends on the design.
 図16は、実施例2に係るシステムの論理構成例を示す。OS1610は、ストレージ装置1500のCPU1501で実行されるプログラムである。OS1610は、ストレージ装置1500で実行されるストレージプログラム1600へのハードウェア資源の割り当てを管理する。 FIG. 16 illustrates a logical configuration example of the system according to the second embodiment. The OS 1610 is a program executed by the CPU 1501 of the storage apparatus 1500. The OS 1610 manages allocation of hardware resources to the storage program 1600 executed by the storage apparatus 1500.
 メモリ管理ライブラリ1601は、ストレージ装置1540で実行されるストレージプログラム1600が使用するメモリの管理を行う。メモリ管理ライブラリ1601は、OS1610を介して、ストレージプログラム1600のアドレス空間にVRAMヒープ1602の領域を確保する。メモリ管理ライブラリ1601は、OS1610を介して、VRAMヒープ1602にVRAM1502のメモリ領域を割り当てる。ストレージプログラム1600は、メモリ管理ライブラリ1601を介して、VRAMメモリ領域をVRAMヒープ1602から取得する。 The memory management library 1601 manages the memory used by the storage program 1600 executed by the storage device 1540. The memory management library 1601 reserves an area of the VRAM heap 1602 in the address space of the storage program 1600 via the OS 1610. The memory management library 1601 allocates the memory area of the VRAM 1502 to the VRAM heap 1602 via the OS 1610. The storage program 1600 acquires the VRAM memory area from the VRAM heap 1602 via the memory management library 1601.
 メモリ管理ライブラリ1601は、OS1610を介して、ストレージプログラム1600のアドレス空間にNVRAMヒープ1603の領域を確保する。メモリ管理ライブラリ1601は、OS1610を介して、NVRAMヒープ1603にNVRAM1503のメモリ領域を割り当てる。ストレージプログラム1600は、メモリ管理ライブラリ1601を介して、NVRAMメモリ領域をNVRAMヒープ1603から取得する。 The memory management library 1601 reserves an area of the NVRAM heap 1603 in the address space of the storage program 1600 via the OS 1610. The memory management library 1601 allocates the memory area of the NVRAM 1503 to the NVRAM heap 1603 via the OS 1610. The storage program 1600 acquires the NVRAM memory area from the NVRAM heap 1603 via the memory management library 1601.
 ストレージプログラム1600は、ホスト1510からストレージ装置1500に発行されたI/O要求を処理する。ホスト1510からWrite要求が発行された場合、ストレージプログラム1600は、メモリ管理ライブラリ1601を介して、NVRAMヒープ1603からNVRAMメモリ領域を取得し、ホスト1510から受領したWriteデータを当該NVRAMメモリ領域に格納する。そしてI/O処理が完了したことをホスト1510に通知する。 The storage program 1600 processes an I / O request issued from the host 1510 to the storage apparatus 1500. When a write request is issued from the host 1510, the storage program 1600 acquires the NVRAM memory area from the NVRAM heap 1603 via the memory management library 1601, and stores the write data received from the host 1510 in the NVRAM memory area. . Then, the host 1510 is notified that the I / O processing has been completed.
 OS1630は、待機ストレージ装置1540のCPU1541で実行されるプログラムである。OS1630は、待機ストレージ装置1640で実行されるストレージプログラム1620へのハードウェア資源の割り当てを管理する。 The OS 1630 is a program executed by the CPU 1541 of the standby storage apparatus 1540. The OS 1630 manages the allocation of hardware resources to the storage program 1620 executed by the standby storage device 1640.
 メモリ管理ライブラリ1621は、待機ストレージ装置1640で実行されるストレージプログラム1620が使用するメモリを管理する。メモリ管理ライブラリ1621は、OS1630を介してストレージプログラム1620のアドレス空間にVRAMヒープ1622の領域を確保する。メモリ管理ライブラリ1621は、OS1640を介して、VRAMヒープ1622にVRAM1542のメモリ領域を割り当てる。ストレージプログラム1620は、メモリ管理ライブラリ1621を介して、VRAMメモリ領域をVRAMヒープ1622から取得する。 The memory management library 1621 manages the memory used by the storage program 1620 executed by the standby storage device 1640. The memory management library 1621 reserves an area of the VRAM heap 1622 in the address space of the storage program 1620 via the OS 1630. The memory management library 1621 allocates the memory area of the VRAM 1542 to the VRAM heap 1622 via the OS 1640. The storage program 1620 acquires the VRAM memory area from the VRAM heap 1622 via the memory management library 1621.
 メモリ管理ライブラリ1621は、OS1630を介してストレージプログラム1620のアドレス空間にNVRAMヒープ1623の領域を確保する。メモリ管理ライブラリ1621は、OS1630を介して、NVRAMヒープ1633に、NVRAM1543のメモリ領域を割り当てる。 The memory management library 1621 reserves an NVRAM heap 1623 area in the address space of the storage program 1620 via the OS 1630. The memory management library 1621 allocates the memory area of the NVRAM 1543 to the NVRAM heap 1633 via the OS 1630.
 ストレージプログラム1620は、メモリ管理ライブラリ1621を介して、NVRAMメモリ領域をNVRAMヒープ1623から取得する。ストレージプログラム1620は、ストレージ装置1500が障害によって停止している場合、ホスト1510からストレージ装置1540に発行されたI/O要求を処理する。 The storage program 1620 acquires the NVRAM memory area from the NVRAM heap 1623 via the memory management library 1621. The storage program 1620 processes an I / O request issued from the host 1510 to the storage apparatus 1540 when the storage apparatus 1500 is stopped due to a failure.
 ホスト1510からWrite要求が発行された場合、ストレージプログラム1620は、メモリ管理ライブラリ1621を介して、NVRAMヒープ1623からNVRAMメモリ領域を取得し、ホスト1510から受信したWriteデータを、当該NVRAMメモリ領域に格納する。そしてI/O処理が完了したことをホスト1510に通知する。 When a write request is issued from the host 1510, the storage program 1620 acquires the NVRAM memory area from the NVRAM heap 1623 via the memory management library 1621, and stores the write data received from the host 1510 in the NVRAM memory area. To do. Then, the host 1510 is notified that the I / O processing has been completed.
 クラスタプログラム1624は、クラスタプログラム1604と協調し、ストレージプログラム1620を待機モードからサービスモードに切り替える。クラスタプログラム1624は、クラスタプログラム1604に定期的にハートビートを送信する。 The cluster program 1624 cooperates with the cluster program 1604 to switch the storage program 1620 from the standby mode to the service mode. The cluster program 1624 periodically transmits a heartbeat to the cluster program 1604.
 ハートビートに対する応答が、クラスタプログラム1604から所定時間返ってこない場合、クラスタプログラム1624は、ストレージ装置1500で障害が発生していると判定し、ストレージプログラム1620を待機モードからサービスモードに切り替える。サービスモードに切り替わると、ストレージプログラム1620は、ホスト1510に対するストレージサービスの提供を開始する(フェイルオーバ)。 If the response to the heartbeat does not return from the cluster program 1604 for a predetermined time, the cluster program 1624 determines that a failure has occurred in the storage apparatus 1500 and switches the storage program 1620 from the standby mode to the service mode. When the mode is switched to the service mode, the storage program 1620 starts providing a storage service to the host 1510 (failover).
 メモリ管理ライブラリ1601は、実施例1のメモリ管理ライブラリ201と同様の方法で、NVRAM1503のメモリページをNVRAMヒープ1603に割り当てる。メモリ管理ライブラリ1621は、実施例1のメモリ管理ライブラリ201と同様の方法で、NVRAM1543のメモリページをNVRAMヒープ1623に割り当てる。 The memory management library 1601 allocates the memory page of the NVRAM 1503 to the NVRAM heap 1603 in the same manner as the memory management library 201 of the first embodiment. The memory management library 1621 allocates the memory page of the NVRAM 1543 to the NVRAM heap 1623 in the same manner as the memory management library 201 of the first embodiment.
 メモリ管理ライブラリ1601は、実施例1のメモリ管理ライブラリ201と同様のAPIをストレージプログラム1600に提供する。メモリ管理ライブラリ1621は、実施例1のメモリ管理ライブラリ201と同様のAPIを、ストレージプログラム1620に提供する。 The memory management library 1601 provides the storage program 1600 with the same API as the memory management library 201 of the first embodiment. The memory management library 1621 provides the storage program 1620 with the same API as the memory management library 201 of the first embodiment.
 メモリ管理ライブラリ1601は、実施例1のメモリ管理ライブラリ201と同様に、NVRAMヒープ1603をチャンク(図17におけるチャック1705参照)に分割して、ストレージプログラム1600に対するメモリ領域の割り当てと解放を管理する。メモリ管理ライブラリ1621は、実施例1のメモリ管理ライブラリ201と同様に、NVRAMヒープ1623をチャンクに分割して、ストレージプログラム1620に対するメモリ領域の割り当てと解放を管理する。 The memory management library 1601, like the memory management library 201 of the first embodiment, divides the NVRAM heap 1603 into chunks (see chuck 1705 in FIG. 17), and manages allocation and release of memory areas for the storage program 1600. Similar to the memory management library 201 of the first embodiment, the memory management library 1621 divides the NVRAM heap 1623 into chunks, and manages allocation and release of memory areas to the storage program 1620.
 図17は、実施例2に係るストレージ装置1500においてメモリ管理ライブラリ1601が管理するNVRAMヒープ1603のデータ構造例を示す。NVRAMヒープ1603は、先頭にフラグ領域が無いことを除いて、実施例1のNVRAMヒープ203と同様の構造を持つ。 FIG. 17 shows an example of the data structure of the NVRAM heap 1603 managed by the memory management library 1601 in the storage apparatus 1500 according to the second embodiment. The NVRAM heap 1603 has the same structure as the NVRAM heap 203 of the first embodiment except that there is no flag area at the head.
 図18は、実施例2に係るストレージ装置1500においてメモリ管理ライブラリ1601が管理するNVRAMヒープ1603内のチャンク管理領域1700の構造例を示す。チャンク管理領域1700は、実施例1のチャンク管理領域600と同様の構造を持つ。 FIG. 18 shows a structural example of the chunk management area 1700 in the NVRAM heap 1603 managed by the memory management library 1601 in the storage apparatus 1500 according to the second embodiment. The chunk management area 1700 has the same structure as the chunk management area 600 of the first embodiment.
 図19は、実施例2に係るストレージ装置1500においてメモリ管理ライブラリ1601が管理するNVRAMヒープ1603の検索インデックス1900の構造例を示す。検索インデックス1900は、実施例1における検索インデックス800と同様の構造を持つ。検索インデックス1900のルートエレメント1901へのポインタは、ポインタ1702に格納される。検索インデックス1900の各エレメント用のメモリは、検索インデックス領域1701から取得される。 FIG. 19 shows a structural example of the search index 1900 of the NVRAM heap 1603 managed by the memory management library 1601 in the storage apparatus 1500 according to the second embodiment. The search index 1900 has the same structure as the search index 800 in the first embodiment. A pointer to the root element 1901 of the search index 1900 is stored in the pointer 1702. The memory for each element of the search index 1900 is acquired from the search index area 1701.
 メモリ管理ライブラリ1601は、ストレージプログラム1600が、nvmallocを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、チャンク管理領域1700を更新し、同様の方法で検索インデックス1900にエレメントを挿入する。 When the storage program 1600 executes nvmalloc, the memory management library 1601 updates the chunk management area 1700 in the same manner as the memory management library 201 in the first embodiment, and adds elements to the search index 1900 in the same manner. insert.
 メモリ管理ライブラリ1601は、ストレージプログラム1600がnvfreeを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、チャンク管理領域1700を更新し、同様の方法で検索インデックス1900からエレメントを削除する。 When the storage program 1600 executes nvfree, the memory management library 1601 updates the chunk management area 1700 in the same manner as the memory management library 201 in the first embodiment, and deletes elements from the search index 1900 in the same manner. To do.
 メモリ管理ライブラリ1601は、ストレージプログラム1600がnvlookupを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、検索インデックス1900において、NVRAMメモリ領域を検索する。 The memory management library 1601 searches the NVRAM memory area in the search index 1900 in the same manner as the memory management library 201 in the first embodiment when the storage program 1600 executes nvlookup.
 図20は、実施例2に係る待機ストレージ装置1540においてメモリ管理ライブラリ1621が管理するNVRAMヒープ1623のデータ構造例を示す。NVRAMヒープ1623は複数のチャンク2005を含む。NVRAMヒープ1623は、先頭にフラグ領域が無いことを除いて、実施例1のNVRAMヒープ203と同様の構造を持つ。 FIG. 20 shows an example of the data structure of the NVRAM heap 1623 managed by the memory management library 1621 in the standby storage device 1540 according to the second embodiment. The NVRAM heap 1623 includes a plurality of chunks 2005. The NVRAM heap 1623 has the same structure as the NVRAM heap 203 of the first embodiment except that there is no flag area at the head.
 図21は、実施例2に係る待機ストレージ装置1540においてメモリ管理ライブラリ1621が管理するNVRAMヒープ1623内のチャンク管理領域2000の構造例を示す。チャンク管理領域2000は、実施例1のチャンク管理領域600と同様の構造を持つ。 FIG. 21 shows a structural example of the chunk management area 2000 in the NVRAM heap 1623 managed by the memory management library 1621 in the standby storage apparatus 1540 according to the second embodiment. The chunk management area 2000 has the same structure as the chunk management area 600 of the first embodiment.
 図22は、実施例2に係る待機ストレージ装置1540においてメモリ管理ライブラリ1621が管理するNVRAMヒープ1623用の検索インデックス2200の構造例を示す。検索インデックス2200は、実施例1における検索インデックス800と同様の構造を持つ。検索インデックス2200のルートエレメント2201へのポインタはポインタ2002に格納される。また、検索インデックス2200の各エレメント用のメモリは、検索インデックス領域2001から取得される。 FIG. 22 shows a structure example of the search index 2200 for the NVRAM heap 1623 managed by the memory management library 1621 in the standby storage device 1540 according to the second embodiment. The search index 2200 has the same structure as the search index 800 in the first embodiment. A pointer to the root element 2201 of the search index 2200 is stored in the pointer 2002. Also, the memory for each element of the search index 2200 is acquired from the search index area 2001.
 メモリ管理ライブラリ1621は、ストレージプログラム1620が、nvmallocを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、チャンク管理領域2000を更新し、同様の方法で検索インデックス2200にエレメントを挿入する。 When the storage program 1620 executes nvmalloc, the memory management library 1621 updates the chunk management area 2000 by the same method as the memory management library 201 in the first embodiment, and adds elements to the search index 2200 by the same method. insert.
 メモリ管理ライブラリ1621は、ストレージプログラム1620がnvfreeを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、チャンク管理領域2000を更新し、同様の方法で検索インデックス2200からエレメントを削除する。 When the storage program 1620 executes nvfree, the memory management library 1621 updates the chunk management area 2000 in the same manner as the memory management library 201 in the first embodiment, and deletes elements from the search index 2200 in the same manner. To do.
 メモリ管理ライブラリ1621は、ストレージプログラム1620がnvlookupを実行した際に、実施例1におけるメモリ管理ライブラリ201と同様の方法で、検索インデックス2200において、NVRAMメモリ領域を検索する。ストレージプログラム1600とストレージプログラム1620は、実施例1におけるストレージプログラム200と同様の方法で、ホスト1510からのI/O要求を処理する。 The memory management library 1621 searches the NVRAM memory area in the search index 2200 by the same method as the memory management library 201 in the first embodiment when the storage program 1620 executes nvlookup. The storage program 1600 and the storage program 1620 process I / O requests from the host 1510 in the same manner as the storage program 200 in the first embodiment.
 メモリ管理ライブラリ1601は、メモリ管理ライブラリ1621と協調し、NVRAMヒープ1603上のデータをNVRAMヒープ1623にミラーリングする機能を、ストレージプログラム1600に提供する。 The memory management library 1601 provides the storage program 1600 with a function of mirroring the data on the NVRAM heap 1603 to the NVRAM heap 1623 in cooperation with the memory management library 1621.
 図23は、実施例2に係るストレージ装置1500においてメモリ管理ライブラリ1601が提供するミラーリング機能のAPIを示す。図24は、実施例2に係る現用ストレージ装置1500及び待機ストレージ装置1540におけるミラーリング処理を示す。ミラーリング処理は、ホスト1510から受信した全てのWriteデータに対して実行され、例えば、Writeデータをホスト1510から受信するたびに実行される。 FIG. 23 shows an API of a mirroring function provided by the memory management library 1601 in the storage apparatus 1500 according to the second embodiment. FIG. 24 shows mirroring processing in the active storage device 1500 and the standby storage device 1540 according to the second embodiment. The mirroring process is executed for all the write data received from the host 1510, for example, every time the write data is received from the host 1510.
 現用ストレージ装置1500のメモリ管理ライブラリ1601は、nvmirrorの引数として渡されたkeyに対応するNVRAMメモリ領域を、検索インデックス1900において検索する(S401)。該当するNVRAMメモリ領域が見つからない場合(S402:NO)、メモリ管理ライブラリ1601は、本処理を終了する。 The memory management library 1601 of the active storage device 1500 searches the search index 1900 for the NVRAM memory area corresponding to the key passed as an argument of nvmirror (S401). If the corresponding NVRAM memory area is not found (S402: NO), the memory management library 1601 ends this process.
 該当するNVRAMメモリが見つかった場合(S402:YES)、メモリ管理ライブラリ1601は、そのNVRAMメモリ領域のデータ、そのNVRAMメモリ領域のサイズ、そのNVRAMメモリ領域のkeyを、待機ストレージ装置1540のメモリ管理ライブラリ1621に送信する(S403)。 When the corresponding NVRAM memory is found (S402: YES), the memory management library 1601 displays the data of the NVRAM memory area, the size of the NVRAM memory area, the key of the NVRAM memory area, and the memory management library of the standby storage device 1540. 1621 (S403).
 待機ストレージ装置1540において、メモリ管理ライブラリ1621は、NVRAMヒープ1623のチャンク管理領域2000を参照し、受信したデータを格納できる連続空きチャンクを検索する。メモリ管理ライブラリ1621は、受信したデータを、NVRAMヒープ1623において見付けた連続空きチャンクに書き込む(S404)。 In the standby storage device 1540, the memory management library 1621 refers to the chunk management area 2000 of the NVRAM heap 1623 and searches for a continuous free chunk that can store the received data. The memory management library 1621 writes the received data in continuous empty chunks found in the NVRAM heap 1623 (S404).
 メモリ管理ライブラリ1621は、実施例1において説明したnvmalloc処理と同様の方法で、データを書き込んだ連続チャンクのチャンク管理領域2000のエントリを更新し、当該連続チャンクを使用領域に設定する(S405)。 The memory management library 1621 updates the entry of the chunk management area 2000 of the continuous chunk into which the data has been written, and sets the continuous chunk as a use area by the same method as the nvmalloc processing described in the first embodiment (S405).
 メモリ管理ライブラリ1621は、検索インデックス2200に登録するエレメントを作成し、連続チャンクの1つめのチャンクの先頭アドレス、受領したメモリサイズ、受領したkeyを登録する。メモリ管理ライブラリ1621は、作成したエレメントを検索インデックス2200に挿入する(S406)。以上により、ミラーリング処理が終了する。 The memory management library 1621 creates an element to be registered in the search index 2200, and registers the first address of the first chunk of consecutive chunks, the received memory size, and the received key. The memory management library 1621 inserts the created element into the search index 2200 (S406). Thus, the mirroring process ends.
 待機ストレージ装置1540において、待機モードのストレージプログラム1620は、所定タイミング、例えば定期的に、NVRAM1543に格納されているデータをディスク装置1544に、格納する。ストレージプログラム1620は、データをディスク装置1544に書き込んだ後、メモリ管理ライブラリ1621を介して、当該NVRAMメモリ領域を解放する。解放は、ディスク装置1544に書き込んだ後、適時に実行される。待機ストレージ装置1540は、例えば、NVRAM1543に格納されているWriteデータのトータルサイズが規定値を超えると、最も古いWriteデータをディスク装置1544に格納してもよい。 In the standby storage device 1540, the standby mode storage program 1620 stores the data stored in the NVRAM 1543 in the disk device 1544 at a predetermined timing, for example, periodically. The storage program 1620 writes the data to the disk device 1544 and then releases the NVRAM memory area via the memory management library 1621. Release is performed in a timely manner after writing to the disk device 1544. For example, when the total size of the write data stored in the NVRAM 1543 exceeds a specified value, the standby storage device 1540 may store the oldest write data in the disk device 1544.
 待機ストレージ装置1540は、現用ストレージ装置1500からの指示に従って、NVRAM1543に格納されているデータをディスク装置1544に格納してもよい。例えば、現用のストレージプログラム1600は、NVRMA1503からディスク装置1504へのデータ格納に応じて、そのデータを示す指示を待機ストレージ装置1540に送信する。待機ストレージプログラム1620は、指示されたデータをディスク装置1544に格納する。 The standby storage device 1540 may store the data stored in the NVRAM 1543 in the disk device 1544 in accordance with an instruction from the active storage device 1500. For example, the current storage program 1600 transmits an instruction indicating the data to the standby storage device 1540 in accordance with the data storage from the NVRMA 1503 to the disk device 1504. The standby storage program 1620 stores the instructed data in the disk device 1544.
 待機モードのメモリ管理ライブラリ1621は、所定タイミングで、NVRAMヒープ1623のデフラグを実行する。本実施例において、NVRAMヒープ1623のデフラグは、チャンク管理領域2000及び検索インデックス2200の更新と共に、NVRAM1543におけるデータを格納する。例えば、メモリ管理ライブラリ1621は、実施例1と同様の方法で、デフラグを実行できる。メモリ管理ライブラリ1621は、定期的にデフラグを実行してもよい。 The memory management library 1621 in the standby mode executes the defragmentation of the NVRAM heap 1623 at a predetermined timing. In this embodiment, the defragmentation of the NVRAM heap 1623 stores the data in the NVRAM 1543 together with the update of the chunk management area 2000 and the search index 2200. For example, the memory management library 1621 can execute defragmentation by the same method as in the first embodiment. The memory management library 1621 may periodically perform defragmentation.
 例えば、メモリ管理ライブラリ1621は、NVRAMヒープ1623において領域を開放して、不連続の空き領域を形成するたびに、デフラグを実行する。これにより、ストレージ装置1500からストレージ装置1540へのフェイルオーバにおいて、常に、最適化されたNVRAMヒープ1623を提供できる。メモリ管理ライブラリ1621は、不連続の使用領域が形成されるたびに、デフラグを実行してもよい。 For example, the memory management library 1621 performs defragmentation each time a region is released in the NVRAM heap 1623 and a discontinuous free region is formed. Thereby, the optimized NVRAM heap 1623 can always be provided in the failover from the storage apparatus 1500 to the storage apparatus 1540. The memory management library 1621 may perform defragmentation whenever a discontinuous use area is formed.
 例えば、メモリ管理ライブラリ1621は、解放された領域の後続の使用領域を前方に移動する。例えば、メモリ管理ライブラリ1621は、新たにNVRAMメモリ領域にマッピングされる領域を連続している使用領域の直後に配置する。これにより、NVRAMヒープ1623を断片化されてない状態に維持できる。 For example, the memory management library 1621 moves the used area subsequent to the released area forward. For example, the memory management library 1621 arranges an area that is newly mapped in the NVRAM memory area immediately after the continuous use area. Thereby, the NVRAM heap 1623 can be maintained in an unfragmented state.
 図25は、ストレージ装置1500からストレージ装置1540へのフェイルオーバの後、ストレージ装置1500が起動(再起動)されてから、ストレージプログラム1600が、ストレージサービスの提供を開始するまでの処理(フェイルバック)を示す。 FIG. 25 illustrates processing (failback) from when the storage apparatus 1500 is started (restarted) after the failover from the storage apparatus 1500 to the storage apparatus 1540 until the storage program 1600 starts providing the storage service. Show.
 ストレージ装置1500がOS1610を実行し(S451)、ストレージプログラム1600がOS1610によって実行される(S452)。OS1610は、メモリ管理ライブラリ1601を、ストレージプログラム1600にリンクする(S453)。メモリ管理ライブラリ1601は、NVRAMヒープ1603上の使用領域を連続領域に移動する処理(デフラグ)を行う(S454)。 The storage device 1500 executes the OS 1610 (S451), and the storage program 1600 is executed by the OS 1610 (S452). The OS 1610 links the memory management library 1601 to the storage program 1600 (S453). The memory management library 1601 performs processing (defragmentation) for moving the used area on the NVRAM heap 1603 to a continuous area (S454).
 例えば、ストレージプログラム1600は、フェイルバックにおいて、ストレージ装置1540から、ディスク装置1544内のフェイルオーバ後の更新データを受信し、ディスク装置1504に格納する。メモリ管理ライブラリ1601は、例えば、ストレージ装置1540から、NVRAM1543上の全更新データを受信した後、NVRAMヒープ1603上の使用領域を連続領域に移動する処理を行う。 For example, the storage program 1600 receives update data after failover in the disk device 1544 from the storage device 1540 and stores it in the disk device 1504 in failback. For example, after receiving all the update data on the NVRAM 1543 from the storage device 1540, the memory management library 1601 performs a process of moving the used area on the NVRAM heap 1603 to a continuous area.
 図26は、NVRAMヒープ1603上の使用領域を連続領域に移動する、つまり、使用領域を移動して一つの連続領域を構成する方法(デフラグ方法)を示す。NVRAMヒープ1623上の使用領域を連続領域に移動する方法も同様である。 FIG. 26 shows a method (defragmentation method) of moving the used area on the NVRAM heap 1603 to the continuous area, that is, moving the used area to form one continuous area. The same applies to the method of moving the used area on the NVRAM heap 1623 to the continuous area.
 メモリ管理ライブラリ1601は、図26のように、使用されているNVRAMメモリ領域2600領域とNVRAMメモリ領域2601領域とを連続領域に移動する。メモリ管理ライブラリ1601は、VRAMヒープ1603から確保した中間バッファ2602、2603に、データを一時的にコピーし、各中間バッファから、NVRAMヒープ1603上の連続領域にデータをコピーする。 As shown in FIG. 26, the memory management library 1601 moves the NVRAM memory area 2600 area and the NVRAM memory area 2601 area used to continuous areas. The memory management library 1601 temporarily copies data to the intermediate buffers 2602 and 2603 secured from the VRAM heap 1603, and copies the data from each intermediate buffer to a continuous area on the NVRAM heap 1603.
 メモリ管理ライブラリ1601は、チャンク管理領域1700の各エントリをデータの移動に併せて更新する。図27は、チャンク管理領域1700のデータ移動前の状態とデータ移動後の状態を示す。メモリ管理ライブラリ1601は、移動前チャンク領域2700の状態から、移動後チャンク領域2701の状態に、チャンク管理領域1700を更新する。 The memory management library 1601 updates each entry in the chunk management area 1700 as the data moves. FIG. 27 shows a state of the chunk management area 1700 before the data movement and a state after the data movement. The memory management library 1601 updates the chunk management area 1700 from the state of the chunk area 2700 before movement to the state of the chunk area 2701 after movement.
 メモリ管理ライブラリ1601は、データの移動にあわせて、検索インデックス1900のエレメントのアドレスフィールドも更新する。図28は、検索インデックス1900のデータ移動前の状態とデータ移動後の状態を示す。メモリ管理ライブラリ1601は、移動前検索インデックス2800の状態から、移動後検索インデックス2801の状態に、検索インデックス1900を更新する。 The memory management library 1601 updates the address field of the element of the search index 1900 as the data moves. FIG. 28 shows a state of the search index 1900 before data movement and a state after data movement. The memory management library 1601 updates the search index 1900 from the state of the search index 2800 before movement to the state of the search index 2801 after movement.
 本実施例によれば、NVRAMヒープのデフラグ処理による、ホストのサービスへの影響を回避できる。なお、ストレージ装置1500、1540は、実施例1において説明した待機NVRAMヒープを使用してもよい。本実施例のNVRAMヒープ及び関連する処理は、ストレージサービスと異なるサービスを提供する計算機システムに適用できる。 According to this embodiment, it is possible to avoid the influence on the host service due to the NVRAM heap defragmentation process. The storage apparatuses 1500 and 1540 may use the standby NVRAM heap described in the first embodiment. The NVRAM heap and related processing of this embodiment can be applied to a computer system that provides a service different from the storage service.
 上記例は、フェイルバックにおけるストレージ装置の再起動において、NVRAMヒープのデフラグを実行する。これと異なり、ストレージ装置は、フェイルバックを伴わない再起動において、NVRAMヒープのデフラグを実行してもよい。この場合、対向ストレージ装置からのデータコピーは不要であり、ストレージ装置は、起動時のNVRAMヒープの離散使用領域を移動して一つの連続使用領域を形成する。 In the above example, the NVRAM heap is defragmented when the storage device is restarted in failback. In contrast to this, the storage apparatus may perform defragmentation of the NVRAM heap in restart without failback. In this case, data copy from the opposite storage device is not necessary, and the storage device moves the discrete use area of the NVRAM heap at the time of startup to form one continuous use area.
 サービスモードのクラスタプログラムは、NVRAMヒープの断片化状態に基づいて、サービスを提供するストレージ装置の切替を決定してもよい。クラスタプログラムは、NVRAMヒープの状態(断片化状態)を監視し、断片化状態が規定の条件を満たす場合に、自ストレージ装置のサービスを停止し、他方の待機モードのストレージ装置にサービスの開始を指示する。断片化状態の判定方法は、実施例1と同様でよい。 The cluster program in the service mode may decide to switch the storage device that provides the service based on the fragmented state of the NVRAM heap. The cluster program monitors the NVRAM heap state (fragmentation state), and when the fragmentation state satisfies a specified condition, stops the service of the own storage device and starts the service to the storage device in the other standby mode. Instruct. The method for determining the fragmentation state may be the same as in the first embodiment.
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明したすべての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加・削除・置換をすることが可能である。 In addition, this invention is not limited to the above-mentioned Example, Various modifications are included. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described. Further, a part of the configuration of one embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of one embodiment. Further, it is possible to add, delete, and replace other configurations for a part of the configuration of each embodiment.
 また、上記の各構成・機能・処理部等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード等の記録媒体に置くことができる。 In addition, each of the above-described configurations, functions, processing units, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit. Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor. Information such as programs, tables, and files for realizing each function can be stored in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card or an SD card.
 また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしもすべての制御線や情報線を示しているとは限らない。実際には殆どすべての構成が相互に接続されていると考えてもよい。 In addition, the control lines and information lines indicate what is considered necessary for the explanation, and not all control lines and information lines on the product are necessarily shown. In practice, it may be considered that almost all the components are connected to each other.

Claims (14)

  1.  プロセッサと、
     不揮発ランダムアクセスメモリと、を含む計算機システムであって、
     前記プロセッサは、
     プログラムが前記不揮発ランダムアクセスメモリのメモリ領域を使用するための、第1のヒープを確保し、
     前記第1のヒープにおいて使用領域の割り当てと開放とを実行し、
     前記第1のヒープにおいて、離間した使用領域を一つの連続した領域に纏める処理を実行し、
     前記第1のヒープにおける使用領域と前記使用領域に割り当てられているメモリ領域を同定するキーとの関係を示す第1の管理情報を、前記割り当て、前記開放、及び前記処理に応じて更新し、
     前記第1の管理情報において、目的メモリ領域のキーにより前記目的メモリ領域の前記第1のヒープにおけるアドレスの検索を実行する、計算機システム。
    A processor;
    A non-volatile random access memory, a computer system comprising:
    The processor is
    A first heap is reserved for the program to use the memory area of the non-volatile random access memory;
    Allocating and releasing the used area in the first heap,
    In the first heap, a process of collecting the separated use areas into one continuous area,
    Updating the first management information indicating a relationship between a used area in the first heap and a key for identifying a memory area allocated to the used area according to the allocation, the release, and the processing;
    A computer system that executes a search for an address in the first heap of the target memory area by using a key of the target memory area in the first management information.
  2.  請求項1に記載の計算機システムであって、
     前記プロセッサは、
     前記プログラムが前記不揮発ランダムアクセスメモリのメモリ領域を使用するための、第2のヒープを確保し、
     前記第1のヒープ及び前記第2のヒープの一方が現用モードであり他方が待機モードであるように、前記第1のヒープ及び前記第2のヒープを前記現用モード及び前記待機モードにおいて切り替えて使用し、
     前記現用モードのヒープにおいて、前記第1のヒープにおける使用領域の割り当て及び開放、並びに、前記第1の管理情報において目的データのキーにより前記目的データの前記第1のヒープにおけるアドレスの検索を、実行し、
     前記待機モードのヒープにおいて、前記第1のヒープにおける、使用領域の割り当て及び開放、並びに、離間した使用領域を一つの連続した領域に纏める処理を、実行する、計算機システム。
    The computer system according to claim 1,
    The processor is
    Securing a second heap for the program to use the memory area of the non-volatile random access memory;
    The first heap and the second heap are switched in the active mode and the standby mode so that one of the first heap and the second heap is in the active mode and the other is in the standby mode. And
    In the working mode heap, the allocation and release of the used area in the first heap, and the search of the address of the target data in the first heap by the key of the target data in the first management information are executed. And
    A computer system that executes, in the standby mode heap, a process of allocating and releasing used areas in the first heap and collecting separated used areas into one continuous area.
  3.  請求項1に記載の計算機システムであって、
     前記プロセッサは、前記計算機システムのサービスの停止中に前記処理を実行する、計算機システム。
    The computer system according to claim 1,
    The computer system, wherein the processor executes the processing while the service of the computer system is stopped.
  4.  請求項3に記載の計算機システムであって、
     前記計算機システムは、
     待機モードにおいて、サービスを提供する現用モードの他の計算機システムからデータを受信し、前記データを前記不揮発ランダムアクセスメモリに格納し、
     前記現用モードの計算機システムの障害発生に応じて、前記待機モードから前記現用モードに切り替わり、
     前記プロセッサは、
     前記待機モードにおいて、前記第1のヒープにおける、使用領域の割り当て及び開放、並びに、離間した使用領域を一つの連続した領域に纏める処理を、実行し、
     前記現用モードにおいて、前記第1のヒープにおける使用領域の割り当て及び開放、並びに、前記第1の管理情報において目的データのキーによる前記目的データの前記第1のヒープにおけるアドレスの検索を、実行する、計算機システム。
    The computer system according to claim 3,
    The computer system is
    In standby mode, data is received from another computer system in active mode that provides services, and the data is stored in the nonvolatile random access memory;
    In response to a failure in the working mode computer system, the standby mode is switched to the working mode,
    The processor is
    In the standby mode, in the first heap, the allocation and release of the used area, and the process of collecting the separated used areas into one continuous area,
    In the current mode, the allocation and release of the use area in the first heap, and the search of the address of the target data in the first heap by the key of the target data in the first management information are executed. Computer system.
  5.  請求項3に記載の計算機システムであって、
     前記プロセッサは、前記計算機システムの起動から前記サービスの開始までの間に、前記処理を実行する、計算機システム。
    The computer system according to claim 3,
    The computer system, wherein the processor executes the processing between the start of the computer system and the start of the service.
  6.  請求項1に記載の計算機システムであって、
     前記プログラムはホストからのI/O要求を処理するストレージプログラムであり、
     前記不揮発ランダムアクセスメモリは、前記ホストのためのキャッシュデータを格納する、計算機システム。
    The computer system according to claim 1,
    The program is a storage program that processes I / O requests from the host,
    The non-volatile random access memory is a computer system that stores cache data for the host.
  7.  請求項1に記載の計算機システムであって、
     前記プログラムを格納する揮発ランダムアクセスメモリをさらに含み、
     前記プロセッサは、前記第1のヒープから、所定サイズの領域単位で使用領域を割り当て、
     前記不揮発ランダムアクセスメモリは、前記第1の管理情報を格納する、計算機システム。
    The computer system according to claim 1,
    A volatile random access memory for storing the program;
    The processor allocates a use area in units of a predetermined size from the first heap,
    The non-volatile random access memory is a computer system that stores the first management information.
  8.  プロセッサと、不揮発ランダムアクセスメモリと、を含む計算機システムにおいて、であって、前記不揮発ランダムアクセスメモリに対するヒープを管理する方法であって、
     前記プロセッサが、プログラムが前記不揮発ランダムアクセスメモリのメモリ領域を使用するための、第1のヒープを確保し、
     前記プロセッサが、前記第1のヒープにおいて使用領域の割り当てと開放とを実行し、
     前記プロセッサが、前記第1のヒープにおいて、離間した使用領域を一つの連続した領域に纏める処理を実行し、
     前記プロセッサが、前記第1のヒープにおける使用領域と前記使用領域に割り当てられているメモリ領域を同定するキーとの関係を示す第1の管理情報を、前記割り当て、前記開放、及び前記処理に応じて更新し、
     前記プロセッサが、前記第1の管理情報において、目的メモリ領域のキーにより前記目的メモリ領域の前記第1のヒープにおけるアドレスの検索を実行する、方法。
    In a computer system including a processor and a nonvolatile random access memory, a method for managing a heap for the nonvolatile random access memory,
    The processor reserves a first heap for the program to use the memory area of the non-volatile random access memory;
    The processor performs allocation and release of a used area in the first heap;
    The processor executes a process of grouping separated use areas into one continuous area in the first heap;
    First management information indicating a relationship between a used area in the first heap and a key for identifying a memory area allocated to the used area, according to the allocation, the release, and the processing. Update
    The method, wherein the processor performs a search for an address in the first heap of the target memory area by a key of the target memory area in the first management information.
  9.  請求項8に記載の方法であって、
     前記プロセッサが、前記プログラムが前記不揮発ランダムアクセスメモリのメモリ領域を使用するための、第2のヒープを確保し、
     前記プロセッサが、前記第1のヒープ及び前記第2のヒープの一方が現用モードであり他方が待機モードであるように、前記第1のヒープ及び前記第2のヒープを前記現用モード及び前記待機モードにおいて切り替えて使用し、
     前記プロセッサが、前記現用モードのヒープにおいて、使用領域の割り当て及び開放、並びに、前記第1の管理情報において目的データのキーにより前記目的データの前記第1のヒープにおけるアドレスの検索を、実行し、
     前記プロセッサが、前記待機モードのヒープにおいて、使用領域の割り当て及び開放、並びに、離間した使用領域を一つの連続した領域に纏める処理を、実行する、方法。
    The method according to claim 8, comprising:
    The processor reserves a second heap for the program to use a memory area of the non-volatile random access memory;
    The processor sets the first heap and the second heap to the active mode and the standby mode so that one of the first heap and the second heap is in the active mode and the other is in the standby mode. To switch between and use
    The processor executes allocation and release of a use area in the heap in the working mode, and search for an address in the first heap of the target data by a key of the target data in the first management information;
    A method in which the processor executes a process of allocating and releasing used areas and collecting separated used areas into one continuous area in the standby mode heap.
  10.  請求項8に記載の方法であって、
     前記プロセッサが、前記計算機システムのサービスの停止中に前記処理を実行する、方法。
    The method according to claim 8, comprising:
    A method in which the processor executes the processing while a service of the computer system is stopped.
  11.  請求項10に記載の方法であって、
     前記計算機システムが、待機モードにおいて、サービスを提供する現用モードの他の計算機システムからデータを受信し、前記データを前記不揮発ランダムアクセスメモリに格納し、
     前記計算機システムが、前記現用モードの計算機システムの障害発生に応じて、前記待機モードから前記現用モードに切り替わり、
     前記プロセッサが、前記待機モードにおいて、前記第1のヒープにおける、使用領域の割り当て及び開放、並びに、離間した使用領域を一つの連続した領域に纏める処理を、実行し、
     前記プロセッサが、前記現用モードにおいて、前記第1のヒープにおける使用領域の割り当て及び開放、並びに、前記第1の管理情報において目的データのキーによる前記目的データの前記第1のヒープにおけるアドレスの検索を、実行する、方法。
    The method of claim 10, comprising:
    In the standby mode, the computer system receives data from another computer system in the active mode that provides the service, and stores the data in the nonvolatile random access memory;
    The computer system is switched from the standby mode to the active mode in response to a failure of the active mode computer system,
    In the standby mode, the processor executes the process of allocating and releasing used areas in the first heap, and collecting separated used areas into one continuous area,
    In the current mode, the processor allocates and releases a use area in the first heap, and searches for an address in the first heap of the target data by using a key of target data in the first management information. How to run.
  12.  請求項10に記載の方法であって、
     前記プロセッサが、前記計算機システムの起動から前記サービスの開始までの間に、前記処理を実行する、方法。
    The method of claim 10, comprising:
    A method in which the processor executes the processing between the startup of the computer system and the start of the service.
  13.  請求項8に記載の方法であって、
     前記プログラムはホストからのI/O要求を処理するストレージプログラムであり、
     前記ホストのためのキャッシュデータが前記不揮発ランダムアクセスメモリに格納される、方法。
    The method according to claim 8, comprising:
    The program is a storage program that processes I / O requests from the host,
    The cache data for the host is stored in the non-volatile random access memory.
  14.  請求項8に記載の方法であって、
     前記計算機システムは、前記プログラムを格納する揮発ランダムアクセスメモリをさらに含み、
     前記第1のヒープの使用領域は、所定サイズの領域単位で割り当て及び解放され、
     前記第1の管理情報は前記不揮発ランダムアクセスメモリに格納されている、方法。
    The method according to claim 8, comprising:
    The computer system further includes a volatile random access memory for storing the program,
    The used area of the first heap is allocated and released in units of a predetermined size area,
    The method, wherein the first management information is stored in the nonvolatile random access memory.
PCT/JP2017/000054 2017-01-04 2017-01-04 Computer system WO2018127948A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/000054 WO2018127948A1 (en) 2017-01-04 2017-01-04 Computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/000054 WO2018127948A1 (en) 2017-01-04 2017-01-04 Computer system

Publications (1)

Publication Number Publication Date
WO2018127948A1 true WO2018127948A1 (en) 2018-07-12

Family

ID=62789225

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/000054 WO2018127948A1 (en) 2017-01-04 2017-01-04 Computer system

Country Status (1)

Country Link
WO (1) WO2018127948A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11436256B2 (en) 2020-01-20 2022-09-06 Fujitsu Limited Information processing apparatus and information processing system
US11846003B2 (en) 2018-10-31 2023-12-19 Jfe Steel Corporation High-strength steel sheet and method for manufacturing the same

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6282605B1 (en) * 1999-04-26 2001-08-28 Moore Computer Consultants, Inc. File system for non-volatile computer memory
JP2010277268A (en) * 2009-05-27 2010-12-09 Kyocera Mita Corp Memory management device and one-chip microcomputer equipped with the same and integrated system
JP2013222310A (en) * 2012-04-17 2013-10-28 Hitachi Ltd Task continuation method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6282605B1 (en) * 1999-04-26 2001-08-28 Moore Computer Consultants, Inc. File system for non-volatile computer memory
JP2010277268A (en) * 2009-05-27 2010-12-09 Kyocera Mita Corp Memory management device and one-chip microcomputer equipped with the same and integrated system
JP2013222310A (en) * 2012-04-17 2013-10-28 Hitachi Ltd Task continuation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11846003B2 (en) 2018-10-31 2023-12-19 Jfe Steel Corporation High-strength steel sheet and method for manufacturing the same
US11436256B2 (en) 2020-01-20 2022-09-06 Fujitsu Limited Information processing apparatus and information processing system

Similar Documents

Publication Publication Date Title
CN109542332B (en) Memory system and control method for controlling nonvolatile memory
US10852959B2 (en) Data storage system, process and computer program for such data storage system for reducing read and write amplifications
US10133511B2 (en) Optimized segment cleaning technique
US9367241B2 (en) Clustered RAID assimilation management
US10678452B2 (en) Distributed deletion of a file and directory hierarchy
CN111587428B (en) Metadata journaling in distributed storage systems
EP3036616B1 (en) Management of extent based metadata with dense tree structures within a distributed storage architecture
US9135123B1 (en) Managing global data caches for file system
US20160070644A1 (en) Offset range operation striping to improve concurrency of execution and reduce contention among resources
US11029862B2 (en) Systems and methods for reducing write tax, memory usage, and trapped capacity in metadata storage
US20120011340A1 (en) Apparatus, System, and Method for a Virtual Storage Layer
US8856443B2 (en) Avoiding duplication of data units in a cache memory of a storage system
WO2015105666A1 (en) Flash optimized, log-structured layer of a file system
US9307024B2 (en) Efficient storage of small random changes to data on disk
JP2019079113A (en) Storage device, data management method, and data management program
WO2018154667A1 (en) Scale-out type storage system
US11409454B1 (en) Container ownership protocol for independent node flushing
CN107728935B (en) Re-partitioning data in a distributed computing system
US10394484B2 (en) Storage system
US20220334726A1 (en) Distributed storage system and storage control method
US11366700B1 (en) Hierarchical workload allocation in a storage system
WO2018127948A1 (en) Computer system
JP5334048B2 (en) Memory device and computer
KR20220006458A (en) Key-value storage device and method for sorting key
US11886427B1 (en) Techniques for efficient journal space handling and recovery processing with multiple logs

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17890448

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17890448

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP