JP6590403B2 - Communication device and backup control method - Google Patents
Communication device and backup control method Download PDFInfo
- Publication number
- JP6590403B2 JP6590403B2 JP2015226226A JP2015226226A JP6590403B2 JP 6590403 B2 JP6590403 B2 JP 6590403B2 JP 2015226226 A JP2015226226 A JP 2015226226A JP 2015226226 A JP2015226226 A JP 2015226226A JP 6590403 B2 JP6590403 B2 JP 6590403B2
- Authority
- JP
- Japan
- Prior art keywords
- backup
- memory
- backup process
- processing
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明はファイルのバックアップ技術に係り、特に携帯端末等の通信装置におけるバックアップ制御方法に関する。 The present invention relates to a file backup technique, and more particularly to a backup control method in a communication device such as a portable terminal.
ユーザが日常頻繁に使用する携帯端末等の通信装置では、限られたリソース内で信頼性の高いバックアップを行う必要があり、そのための技術がいくつか提案されている(たとえば特許文献1を参照)。 A communication device such as a portable terminal that is frequently used by a user needs to perform highly reliable backup within a limited resource, and several techniques have been proposed for that purpose (see, for example, Patent Document 1). .
また、並列処理を実行する情報処理装置では、複数のプロセスが同時に実行されている場合のメモリ不足に備えたリソース管理も必要である。たとえば特許文献2に開示されたデータ処理装置では、2つのプロセッサに割り当てられたメモリが閾値を超えた場合、一方のプロセッサがフォールバックを行い、余ったメモリを他方のプロセッサに割り当てるというメモリ管理を行うことでメモリ不足によるプロセスの停止を回避する。
An information processing apparatus that performs parallel processing also requires resource management in preparation for a memory shortage when a plurality of processes are executed simultaneously. For example, in the data processing apparatus disclosed in
しかしながら、実装メモリ量が限定的な通信装置では、呼制御処理などの他のプロセスが同時に実行されている状態でバックアップ処理が実行されると、バックアップのためにメモリが使用されてしまい、メモリ不足が発生する可能性が高くなる。メモリ不足が発生すると、メモリ管理を行っても呼制御処理に影響を及ぼして呼損が発生する可能性があり、通話が切断する場合もある。このような問題は、特に実装メモリ容量が小さい通信端末において、バックアップするファイルのサイズが大きい(バックアップ処理で使用されるメモリ容量が多い)場合、バックアップ実施時にバックアップ処理以外の処理が多くのメモリを使用している場合に顕著となる。 However, in a communication device with a limited amount of mounted memory, if backup processing is executed while other processes such as call control processing are being executed simultaneously, the memory is used for backup, resulting in insufficient memory. Is likely to occur. If a memory shortage occurs, even if memory management is performed, there is a possibility that the call control process is affected and a call loss may occur, and the call may be disconnected. Such a problem occurs especially when the size of the file to be backed up is large (a large amount of memory is used in the backup process) in a communication terminal with a small installed memory capacity. It becomes remarkable when using it.
このようなバックアップ処理に起因するメモリ不足の問題に対しては、オペレーティングシステム(OS)によりバックアップ処理に割り当てられるメモリ量を制限することで解決することもできる。たとえば、Linux(登録商標、以下同様。)では、バックアップ処理を行うプロセス群に対して、cgroup(CPU時間、メモリ、ネットワーク帯域幅などのリソースをユーザが定義したプロセスグループの間で割り当てる仕組み)のメモリ使用量に上限を設定することで、バックアップ処理を実行しても設定以上のメモリは使用されないようにすることができる。これにより、通信端末において呼制御処理等の他の処理への影響を回避することができる。 Such a memory shortage problem caused by the backup process can be solved by limiting the amount of memory allocated to the backup process by the operating system (OS). For example, in Linux (registered trademark, the same applies hereinafter), cgroup (a mechanism for allocating resources such as CPU time, memory, and network bandwidth among user-defined process groups) for a process group that performs backup processing By setting an upper limit on the memory usage, even if the backup process is executed, the memory exceeding the setting can be prevented from being used. Thereby, it is possible to avoid the influence on other processing such as call control processing in the communication terminal.
しかしながら、このようなOSによるメモリ使用量制限では、メモリ使用量が上限値になると、所定のプロセス強制終了機能(たとえば、LinuxにおけるOOM Killer)を設定している場合にはプロセスが強制終了し、プロセス強制終了機能を設定していない場合にはプロセスが停止することになるため、バックアップの処理が正常終了できないという問題があった。 However, in the memory usage limitation by such OS, when the memory usage reaches the upper limit value, the process is forcibly terminated when a predetermined process forcible termination function (for example, OOM Killer in Linux) is set, If the process forced termination function is not set, the process will stop, so there is a problem that backup processing cannot be terminated normally.
さらに、メモリ使用量制限によってバックアップ処理を一時停止させるだけでは、バックアップのためのメモリ使用量の増加が停止するというだけであり、その時点で使用されていたメモリ使用量は維持されたままである。これでは、通信端末において、メモリ不足の発生による呼制御処理等への影響を払拭することができない。 Furthermore, merely suspending the backup process due to the memory usage limit merely stops the increase in the memory usage for backup, and the memory usage used at that time remains maintained. This makes it impossible to eliminate the influence on the call control processing and the like due to the occurrence of memory shortage in the communication terminal.
そこで、本発明の目的は、バックアップ処理を正常終了させるとともに、他の処理(呼制御処理等)への影響をなくすことができる通信装置およびそのバックアップ制御方法を提供することにある。 SUMMARY OF THE INVENTION An object of the present invention is to provide a communication device and a backup control method thereof that can normally terminate backup processing and eliminate the influence on other processing (call control processing or the like).
本発明による通信装置は、ファイルのバックアップ機能を有する通信装置であって、バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視する監視手段と、前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する制御手段と、を有することを特徴とする。
本発明による通信装置は、ファイルのバックアップ機能を有する通信装置であって、バックアップ処理を実行するバックアップ実行手段と、バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えた時に前記バックアップ処理を一時停止させる一時停止指示手段と、前記一時停止指示に従って、前記バックアップ実行手段によるバックアップ処理を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する制御手段と、を有することを特徴とする。
本発明によるバックアップ制御方法は、ファイルのバックアップ機能を有する通信装置のバックアップ制御方法であって、監視手段が、バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視し、制御手段が、前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する、ことを特徴とする。
本発明によるプログラムは、コンピュータを、ファイルのバックアップ機能を有する通信装置として機能させるプログラムであって、バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視する第一機能と、制御手段が、前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する第二機能と、を前記コンピュータに実現することを特徴とする。
The communication device according to the present invention is a communication device having a file backup function, and whether or not the amount of memory used for backup processing exceeds a predetermined value smaller than a memory upper limit value assigned to the backup processing. Monitoring means for monitoring the backup processing, and control means for temporarily stopping execution of the backup processing and releasing a memory area related to the backup processing in the cache when the memory usage of the backup processing exceeds the predetermined value It is characterized by having.
A communication device according to the present invention is a communication device having a file backup function, and a backup execution means for executing backup processing, and a memory usage amount used for backup processing is a memory upper limit value assigned to the backup processing. A temporary stop instruction means for temporarily stopping the backup processing when a predetermined value smaller than the predetermined value, and according to the temporary stop instruction, the backup processing by the backup execution means is temporarily stopped and related to the backup processing in the cache And a control means for releasing the memory area.
A backup control method according to the present invention is a backup control method for a communication device having a file backup function, wherein the monitoring means uses a memory usage amount used for backup processing from a memory upper limit value assigned to the backup processing. And the control means suspends execution of the backup process when the memory usage of the backup process exceeds the predetermined value, and the backup process in the cache The memory area related to the is released.
The program according to the present invention is a program for causing a computer to function as a communication device having a file backup function, wherein a memory usage amount used for backup processing is smaller than a memory upper limit value assigned to the backup processing. A first function for monitoring whether or not a value has been exceeded, and a control means, when the memory usage of the backup process exceeds the predetermined value, temporarily stops the execution of the backup process, and the backup in the cache A second function of releasing a memory area related to processing is realized in the computer.
上述したように、本発明によれば、バックアップ処理を正常終了させるとともに、他の処理への影響を排除することができる。 As described above, according to the present invention, the backup process can be normally terminated and the influence on other processes can be eliminated.
<実施形態の概要>
本発明の実施形態によれば、バックアップ処理のメモリ使用量が所定値を上回ると、バックアップ処理の一時停止に加えて、キャッシュ中のバックアップ処理に関連するメモリ領域を解放する。これにより、メモリ不足の発生を未然に防ぐことができ、呼処理制御等に対するバックアップ処理の影響をなくすことが可能となる。
<Outline of Embodiment>
According to the embodiment of the present invention, when the memory usage of the backup process exceeds a predetermined value, the memory area related to the backup process in the cache is released in addition to the suspension of the backup process. Thereby, the occurrence of memory shortage can be prevented in advance, and the influence of backup processing on call processing control or the like can be eliminated.
以下、Linuxを一例として、本発明の実施形態について詳細に説明する。ただし、本発明は、Linuxに限定されるものではなく、他のOSであっても同等の機能を有するものであれば適用可能である。 Hereinafter, an embodiment of the present invention will be described in detail using Linux as an example. However, the present invention is not limited to Linux, and can be applied to other OSs as long as they have equivalent functions.
1.システム構成
図1に例示するように、携帯端末等の通信装置10のOSカーネル11がハードウエア12とアプリケーションとを結びつけ、複数のプロセスP1、P2・・・からなるプロセスグループ13とその他の複数のプロセスPx・・・が動作しているものとする。本実施形態によれば、プロセスグループ13はバックアップ処理を実行するプロセス群であり、その他のプロセスPx等は呼制御処理等を実行するプロセスあるいはプロセスグループである。OSカーネル11は、複数のプロセスの実行管理、バックアップ処理や呼制御処理等にそれぞれリソースを割り当てるリソース管理などを実行する。
1. System Configuration As illustrated in FIG. 1, the OS kernel 11 of the
本実施形態によれば、バックアップ処理を行うプロセスグループ13には以下の機能が実装される。
1)プロセスグループ13の一時停止機能(たとえば、Linuxにおけるcgroupのfreezerサブシステムで提供される);
2)プロセスグループ13の現在のメモリ総使用量確認機能(たとえば、Linuxにおけるcgroupのmemoryサブシステムで提供される);
3)プロセスグループ13の現在のメモリ総使用量が基準値TH1を超えた時にプロセスグループ13の一時停止を行う機能;
4)プロセスグループ13の現在のメモリ総使用量が基準値TH1を下回った時にプロセスグループ13の一時停止を解除する機能;
5)キャッシュ解放機能(たとえば、Linuxにおける関数posix_fadvise()によって提供される機能);および
6)キャッシュ解放の対象ファイルを特定するために、圧縮処理が行われるファイルの圧縮処理の順序、圧縮処理の完了状況がわかるようにバックアップ対象ファイル一覧を作成/更新する機能。
According to this embodiment, the following functions are implemented in the
1)
2) The current total memory usage confirmation function of the process group 13 (for example, provided by the cgroup memory subsystem in Linux);
3) A function of temporarily stopping the
4) A function for canceling the temporary stop of the
5) Cache release function (for example, the function provided by the function posix_fadvise () in Linux); and 6) The order of the compression processing of the files to be subjected to compression processing to specify the target file for cache release, the compression processing A function to create / update a list of files to be backed up so that the completion status can be seen.
上記OSカーネル11および複数のプロセスは、ハードウエア12におけるメモリに格納されたOSプログラムおよびアプリケーションプログラムを実行することにより実現することができる。以下、本実施形態によるバックアップ制御について、図面を参照しながら詳細に説明する。
The OS kernel 11 and the plurality of processes can be realized by executing an OS program and an application program stored in a memory in the
2.動作
2.1)バックアップ処理の実行
図2に示すように、バックアップ処理が実行されると、バックアップメインプロセス101からバックアップ対象ファイル一覧102、freeze指示プロセス103、キャッシュ解放指示プロセス104、およびバックアップ実行プロセス105がそれぞれ生成される。なお、バックアップ実行プロセス105は、cgroupのmemoryサブシステム(/cgroup/memory/test)およびfreezerサブシステム(/cgroup/freezer/test)に登録しておく。
2. Operation 2.1) Execution of Backup Process As shown in FIG. 2, when the backup process is executed, the backup
バックアップメインプロセ101は、各プロセスを生成した後、バックアップ実行プロセス105の終了を待つ。バックアップ実行プロセス105が終了すると、freeze指示プロセス103およびキャッシュ解放指示プロセス104にプロセス終了通知を出す。
The backup
バックアップ対象ファイル一覧102は、バックアップ処理が行われるファイルをバックアップ処理順に列挙したリストである。バックアップ対象の指定がファイル単位でなくディレクトリ単位で行われた場合、例えばファイル圧縮コマンド(tarコマンド)であれば、ディレクトリエントリを関数readdir()で取得することにより、そのディレクトリ中のファイル名がバックアップ処理の実施順に取得できる。このようにして、バックアップの処理が行われるファイルを、バックアップ処理順に、バックアップ対象ファイル一覧に記載しておくことが可能である。
The backup
2.2)バックアップ制御
図3は、バックアップ実行プロセス105が実行中に、キャッシュ解放指示プロセス104、freeze指示プロセス103と連携して動作することで、バックアップ実行プロセス105のメモリ使用量を抑える仕組みを示している。
2.2) Backup Control FIG. 3 shows a mechanism for reducing the memory usage of the
図3において、バックアップ実行プロセス105は、tarなどのファイル圧縮コマンドに、個々のファイル圧縮が終わる度に圧縮済ファイル名を表示するオプション(tarであれば-v)を指定し、個々のファイルの圧縮が終わる度に圧縮済ファイル名を圧縮済ファイル一覧110に出力していく(動作S201)。
In FIG. 3, the
キャッシュ解放指示プロセス104は、圧縮済ファイル一覧110に新たに記載されたファイル名を監視し(動作S202)、新たに記載されたファイル名があれば、バックアップ対象ファイル一覧102を更新する(動作S203)。また、キャッシュ解放指示プロセス104は、バックアップ対象ファイル一覧102を元にキャッシュ解放を指定するファイル名を決定し、カーネル11に対して、関数posix_fadvise()を用いて、指定されたファイルが使用するキャッシュの解放指示を行う(動作S204)。
The cache
freeze指示プロセス103は、メモリ使用量現在値ファイル111を監視し、メモリ使用量現在値が基準値TH1を超えている場合は、freeze状態ファイル112に、freeze(一時停止)実施指示を行う(FROZENと記述する)。メモリ使用量現在値が基準値を下回れば、freeze状態ファイル112に、freeze(一時停止)解除指示を行う(THAWEDと記述する)。
The
カーネル11は、キャッシュ解放指示プロセス104から、関数posix_fadvise()を受けると、指定されたファイルに対応するメモリの使用がキャッシュ113に発見されれば、キャッシュ1138から当該ファイルの使用するメモリの解放を行う(動作S207)。
When the kernel 11 receives the function posix_fadvise () from the cache
また、カーネル11は、freeze状態ファイル112を監視し(動作S208)、freeze指定がされた場合(FROZENが記述された場合)、バックアップ実行プロセス105のfreeze(一時停止)を実施し、freeze解除指定がされた場合(THAWEDが記述された場合)、バックアップ実行プロセス105のfreeze(一時停止)を解除する(動作S209)。
In addition, the kernel 11 monitors the freeze state file 112 (operation S208), and if freeze is specified (if FROZEN is described), the
2.3)各プロセスの動作
図4において、バックアップメインプロセス101は、上述したように、バックアップ対象ファイル一覧102、freeze指示プロセス103、キャッシュ解放指示プロセス104およびバックアップ実行プロセス105を生成し(動作S301〜S304)、その後、バックアップ処理プロセスが終了するまで所定時間(1秒)待ちを繰り返す(動作S305、S306)。バックアップ処理プロセスが終了すると(動作S306のYES)、バックアップメインプロセス101は、freeze指示プロセス103およびキャッシュ解放指示プロセス104に対して、それぞれfreeze指示プロセス終了通知およびキャッシュ解放指示プロセス終了通知を出力し(動作S307)、メインプロセスを終了する。
2.3) Operation of each process In FIG. 4, the backup
図5において、freeze指示プロセス103は、cgroupで指定されたプロセスグループ13のメモリ使用量現在値をメモリ使用量現在値ファイル111から取得し、基準値TH1と比較する(動作S401)。この基準値TH1は、freeze指示を行うか否かを決定するための閾値となる。この基準値TH1には、cgroupで指定されたプロセスグループ13が使用するメモリの上限値TH2よりも低い値が設定される。
In FIG. 5, the
メモリ使用量が基準値TH1以下である場合(動作S401のNO)、freezer状態ファイル112の値がFROZENまたはFREEZINGかどうかチェックする(動作S402)。freezer状態ファイル112の値がFROZENまたはFREEZINGであれば(動作S402のYES)、freeze解除指示を行う(動作S403)。ここで、freeze解除指示とは、freezer状態ファイル112に”THAWED”を書き込むことを云う。freezer状態ファイル112の値がFROZENでもFREEZINGでもなければ(動作S402のNO)、freeze解除指示(動作S403)は行わない。
When the memory usage is equal to or less than the reference value TH1 (NO in operation S401), it is checked whether the value in the
メモリ使用量が基準値TH1より大きい場合(動作S401のYES)、freezer状態ファイル112の値がTHAWEDかどうかチェックする(動作S404)。freezer状態ファイル112の値がTHAWEDであれば(動作S404のYES)、freeze指示を実行する(動作S405)。ここで、freeze指示4-5とは、freezer状態ファイルにFROZENを書き込むことである。freezer状態ファイル112の値がTHAWEDでなければ(動作S404のNO)、freeze指示(動作S405)は行わない。
When the memory usage is larger than the reference value TH1 (YES in operation S401), it is checked whether the value of the
その後(動作S402のNO、動作S403、動作S404のNO、動作S405の後)、freeze指示プロセス103は、所定時間(1秒)待ちを行い(動作S406)、freeze指示プロセス終了通知を受信したかどうか判別し(動作S407)、受信していない場合には動作S401からの処理を繰り返し(動作S407のNO)、freeze指示プロセス終了通知を受信していていればプロセスを終了する(動作S407のYES)。なお、freeze指示プロセスが終了となるのは、バックアップメインプロセス101から、freeze指示プロセス終了通知をうけたときである。この通知を受け取るのはバックアップ実行プロセス105が終了になった後なので、freeze指示プロセス終了通知をうけた後に、freeze解除の処理は必要ない。
Thereafter (NO in operation S402, NO in operation S403, NO in operation S404, and after operation S405), the
図6において、キャッシュ解放指示プロセス104は、圧縮済ファイル一覧110を読み込み(動作S501)、その中に新規追加ファイル出力があるか否かを確認する(動作S502)。新規追加ファイル出力があれば(動作S502のYES)、新規追加ファイルについて、バックアップ対象ファイル一覧102の圧縮済欄に、“compressed”を入れる(動作S503)。これ以降、動作S504〜S506で示すように、キャッシュ解放指示プロセス104は、動作S502で新規追加ファイル出力がない場合(動作S502のNO)でも、出力があった場合と同じ処理を実施する。
In FIG. 6, the cache
まず、キャッシュ解放指示プロセス104は、バックアップ対象ファイル一覧102をみて、以下条件AおよびBのいずれかに該当するファイル全てを対象として、キャッシュ解放指示をカーネル11に通知する(動作S504)。なお、バックアップ対象ファイル一覧102については図8(A)を参照されたい。
条件A:fadvise済欄に”advised”が入っているファイルのうち、一番下のファイル;
条件B:fadvise済欄に”advised”がなく、かつ、圧縮済欄に”compressed”があるファイル。
First, the cache
Condition A: The lowest file among the files that have "advised" in the fadvise completed column;
Condition B: A file which does not have “advised” in the fadvise completed column and has “compressed” in the compressed column.
キャッシュ解放指示は、関数posix_fadvise()によりカーネル11に通知されるが、これは、1回の関数実行で1ファイルのみ指定する形式のため、ファイルが複数の時は当該ファイルの数だけ関数を実行する必要がある。 The cache release instruction is notified to the kernel 11 by the function posix_fadvise (). Since this is a format in which only one file is specified by one function execution, the function is executed for the number of files when there are a plurality of files. There is a need to.
続いて、キャッシュ解放指示プロセス104は、バックアップ対象ファイル一覧102のfadvise済欄に”advised”がなく、かつ、圧縮済欄に”compressed”があるファイル全てに関して、fadvise済欄に“advised”を入れる(動作S505)。
Subsequently, the cache
その後、所定時間(1秒)だけ待機し(動作S506)、キャッシュ解放指示プロセス終了通知を受信したか否かを判別し(動作S507)、受信していなければ(動作S507のNO)、上述した動作S501へ戻り、動作S501〜S506の処理を繰り返す。
キャッシュ解放指示プロセス終了通知を受信していた場合は(動作S507のYES)、終了処理として上述いた動作S504およびS505の処理を実施して終了する(動作S508)。
Thereafter, it waits for a predetermined time (1 second) (operation S506), determines whether or not a cache release instruction process end notification has been received (operation S507), and if not received (NO in operation S507), described above. Returning to operation S501, the processing of operations S501 to S506 is repeated.
If the cache release instruction process end notification has been received (YES in operation S507), the processing of operations S504 and S505 described above is performed as the end processing, and the process ends (operation S508).
キャッシュ解放指示プロセスが終了となるのは、バックアップメインプロセス101から、キャッシュ解放指示プロセス終了通知をうけたときである。動作S508における終了処理で動作S504およびS505が実行される理由は、キャッシュ113上にバックアップ処理のファイルのメモリが確保されているものを即解放するためである。
The cache release instruction process ends when the backup
図7において、バックアップ実行プロセス105は、バックアップ対象ファイル全てについて以下の処理を実行する(動作S601)。すなわち、個々のファイルの圧縮処理の実行(動作S602)と、圧縮済ファイル一覧110に圧縮完了した個々のファイルのファイル名の出力(動作S603)である。これは、例えば、tarコマンドで-vオプションを指定した際、全てのファイルの圧縮処理が完了になる前に、個々のファイルの圧縮処理が完了になるごとに圧縮処理が完了になったファイル名がログとして出力されることを示している。
In FIG. 7, the
2.4)バックアップ処理の状況を示すファイル
図8(A)に例示するように、バックアップ対象ファイル一覧102は、バックアップメインプロセス101の起動直後に作成される。起動直後は、圧縮済欄およびfadvise済欄は空欄で、ファイル名が記載された状態である。図6の動作S503で説明したように、圧縮済ファイル一覧110に新規に追加されたファイルについて、バックアップ対象ファイル一覧102の圧縮済欄に“compressed”が記載される。また、図6の動作S505で説明したように、バックアップ対象ファイル一覧102のfadvise済欄に”advised”がなく、かつ、圧縮済欄に”compressed”があるファイル全てについて、fadvise済欄に“advised”が記載される。
2.4) Files Showing the Status of Backup Processing As illustrated in FIG. 8A, the backup
図8(B)に例示するように、メモリ使用量現在値ファイル111は、cgroupの memoryサブシステムで指定されたプロセスグループ(この例では、/cgroup/memory/test)のメモリ使用量現在値が記入されている。
As illustrated in FIG. 8B, the memory usage
図8(C)に例示するように、freezer状態ファイル112は、cgroupのfreezerサブシステムで指定されたプロセスグループ(この例では、/cgroup/freezer/test)の処理が、以下の状況のいずれかを示す。
・プロセスグループの処理が一時停止中(FROZEN)、
・システムがプロセスグループの一時停止処理を実施している最中(FREEZING)
・プロセスグループの一時停止はされていない(THAWED)
As illustrated in FIG. 8C, the
-Process group processing is suspended (FROZEN)
-While the system is executing process group suspension processing (FREEZING)
-Process group is not suspended (THAWED)
freezer状態ファイル112に書きこむことができる値は以下の2つである。
・FROZEN(プロセスグループの処理を一時停止するときに指定)
・THAWED(プロセスグループの処理を再開するときに指定)
The following two values can be written to the
-FROZEN (specified when suspending process group processing)
-THAWED (specified when resuming process group processing)
3.例
上述した本実施形態により、バックアップ処理で使用するメモリ量が上限値を超えないように制御される。すなわち、メモリ使用量が基準値TH1を超えると、バックアップ処理が停止するとともに、posix_fadvise()の実行により該当キャッシュが解放されメモリ使用量が減少する。メモリ使用量が基準値TH1を下回った後は、バックアップ処理が再開される。この動作を繰り返すことで、メモリ使用量がバックアップ処理のプロセスグループが利用可能なメモリ上限値を超えないように抑えることができる。以下、図9を参照しながら、具体的なメモリ使用量の変化について説明する。
3. Example According to the above-described embodiment, the amount of memory used in the backup process is controlled so as not to exceed the upper limit value. That is, when the memory usage exceeds the reference value TH1, the backup process is stopped, and the corresponding cache is released by executing posix_fadvise (), thereby reducing the memory usage. After the memory usage falls below the reference value TH1, the backup process is resumed. By repeating this operation, the memory usage can be suppressed so as not to exceed the memory upper limit value that can be used by the process group of the backup process. Hereinafter, specific changes in the memory usage will be described with reference to FIG.
図9において、バックアップ処理が開始されると、バックアップ実行プロセス105がファイル圧縮コマンド(例えばtarコマンド)を実行し、これによってバックアップ処理のプロセスグループ13が使用するメモリ量が増加していく(動作S701)。なお、ここでは、バックアップ処理のプロセスグループ13に登録しているプロセスがバックアップ実行プロセス105のみの場合を説明するが、バックアップ処理が複数のプロセスに分けて実装されている場合、単一のプロセスだけでなくプロセスグループ全体のメモリ使用量でメモリ制限を実施する。したがって、以下、プロセスグループ全体のメモリ使用量として記載する。
In FIG. 9, when the backup process is started, the
バックアップ処理のプロセスグループのメモリ使用量が基準値TH1を超えると、バックアップ実行プロセス105の動作を停止するfreeze指示がfreeze指示プロセス103から出される(動作S702)。具体的には、図8(C)に示すように、freezer状態ファイル112(/cgroup/freezer/test/freezer.state)にFROZENを書きこむと、カーネル11がバックアップ実行プロセス105の処理を一時停止させる。これにより、バックアップ実行プロセス105のメモリ使用量の増加は止まるが、バックアップ実行プロセス105が参照しているファイルの内容は、キャッシュメモリに確保されたままになってしまうため、この状態ではメモリ使用量は低下しない。
When the memory usage of the process group for backup processing exceeds the reference value TH1, a freeze instruction for stopping the operation of the
そこで、キャッシュ解放指示プロセス104がキャッシュメモリに確保されたままのファイルの内容をキャッシュ解放指示で解放する。具体的には、posix_fadvise()という関数を呼び出して、ファイル単位でキャッシュを解放していく(動作S703)。キャッシュを解放するファイルは、バックアップ対象ファイル一覧102に記載されているファイルのうち、上述した条件AおよびBのどちらかに当てはまるファイルである(図6の動作S504参照)。
Therefore, the cache
posix_fadvise()の実行により、キャッシュメモリに配置されていたバックアップ処理対象ファイルのメモリが解放され、バックアップ処理のプロセスグループのメモリ使用量が低下する(動作S704)。バックアップ処理のプロセスグループのメモリ使用量が基準値TH1を下回った場合は、バックアップ実行プロセス105がファイル圧縮コマンド(例 tarコマンド)を実行する処理が再開される(動作S701)。以降、バックアップ処理が終わるまでこれら処理(動作S701〜S704)を繰り返すことで、バックアップ処理のプロセスグループが利用可能なメモリ上限値TH2に達することを防ぐことができる。
By executing posix_fadvise (), the memory of the backup process target file that has been placed in the cache memory is released, and the memory usage of the process group of the backup process decreases (operation S704). When the memory usage of the process group for backup processing falls below the reference value TH1, the
バックアップ処理のプロセスグループが利用可能なメモリ上限値TH2は、物理的なメモリ容量からバックアップ処理以外の処理(例えば、呼制御処理)が使うメモリ容量を引いた残りのメモリ容量をどれくらいにするかにより、決定される。 The memory upper limit TH2 that can be used by the process group of the backup process depends on how much the remaining memory capacity is obtained by subtracting the memory capacity used by processes other than the backup process (for example, call control process) from the physical memory capacity. ,It is determined.
cgroupのmemoryサブシステムにおいて、memory.limit_in_bytes(ユーザーメモリの上限)とmemory.memsw.limit_in_bytes(ユーザーメモリ+スワップの上限)の値を設定する機能はすでに存在するが、すでに述べたように、これらの機能で制限値を設定するだけではメモリの上限値TH2に達したときにバックアップ実行プロセス105が停止したままになることや、OOM Killerによって強制終了されてしまうことがある。本実施形態によるバックアップ制御を実装すれば、memory.limit_in_bytes(ユーザーメモリの上限)とmemory.memsw.limit_in_bytes(ユーザーメモリ+スワップの上限)の値の指定は不要となる。
In cgroup's memory subsystem, there is already a function to set the values of memory.limit_in_bytes (user memory limit) and memory.memsw.limit_in_bytes (user memory + swap limit). If only the limit value is set by the function, the
なお、メモリ使用量の基準値TH1については、CPU性能やバックアップ処理のプロセスグループが利用可能なメモリ上限値によって変えるべきもので、バックアップ処理のプロセスグループが利用可能なメモリ上限値に達しないように複数回シミュレーションを行った後、適正な値を選択すればよい。 Note that the reference value TH1 of the memory usage should be changed according to the CPU performance and the memory upper limit value that can be used by the backup process group, so that the backup process group does not reach the upper memory limit value that can be used. An appropriate value may be selected after performing the simulation a plurality of times.
4.効果
上述したように、本発明の実施形態によれば、バックアップ処理のプロセスグループのメモリ使用量が上限値TH2を超えないように制御することが可能になる。これにより呼制御処理などの他の処理とバックアップ処理を同時実行するとき、呼制御処理などの他の処理を行うのに十分なメモリ容量を確保することが可能となる。
4). Effect As described above, according to the embodiment of the present invention, it is possible to control the memory usage of the process group for backup processing so as not to exceed the upper limit value TH2. As a result, when other processing such as call control processing and backup processing are executed simultaneously, it is possible to secure a sufficient memory capacity for performing other processing such as call control processing.
なお、上記説明ではプロセスグループにバックアップ実行プロセスだけが入っている場合を説明したが、本実施形態によれば、バックアップ処理機能を複数のプロセスで実装し、その複数のプロセス全体でメモリ使用量を制限する場合であってもプロセスグループでのメモリ使用量制限が可能となる。 In the above description, the case where only the backup execution process is included in the process group has been described, but according to the present embodiment, the backup processing function is implemented by a plurality of processes, and the memory usage is reduced by the plurality of processes as a whole. Even in the case of limiting, it is possible to limit the memory usage in the process group.
本発明は、複数プロセスを同時実行およびバックアップ処理を同時実行可能な情報処理装置に適用可能である。 The present invention can be applied to an information processing apparatus capable of simultaneously executing a plurality of processes and simultaneously executing backup processing.
10 通信装置
11 OSカーネル
12 ハードウエア
13 プロセスグループ
101 バックアップメインプロセス
102 バックアップ対象ファイル一覧
103 freeze指示プロセス
104 キャッシュ解放指示プロセス
105 バックアップ実行プロセス
110 圧縮済ファイル一覧
111 メモリ使用量現在値ファイル
112 freeze状態ファイル
113 キャッシュ
10 communication device 11
Claims (8)
バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視する監視手段と、
前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する制御手段と、
を有することを特徴とする通信装置。 A communication device having a file backup function,
Monitoring means for monitoring whether or not the amount of memory used for backup processing exceeds a predetermined value smaller than the memory upper limit value allocated to the backup processing;
When the memory usage of the backup process exceeds the predetermined value, control means for temporarily stopping the execution of the backup process and releasing a memory area related to the backup process in the cache;
A communication apparatus comprising:
バックアップ処理を実行するバックアップ実行手段と、
バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えた時に前記バックアップ処理を一時停止させる一時停止指示手段と、
前記一時停止指示に従って、前記バックアップ実行手段によるバックアップ処理を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する制御手段と、
を有することを特徴とする通信装置。 A communication device having a file backup function,
Backup execution means for executing backup processing;
A pause instruction means for pausing the backup process when the amount of memory used for the backup process exceeds a predetermined value smaller than a memory upper limit value allocated to the backup process;
In accordance with the suspension instruction, control means for temporarily suspending backup processing by the backup execution means and releasing a memory area related to the backup processing in the cache;
A communication apparatus comprising:
監視手段が、バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視し、
制御手段が、前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する、
ことを特徴とするバックアップ制御方法。 A backup control method for a communication device having a file backup function,
Monitoring means monitoring whether or not the amount of memory used for backup processing exceeds a predetermined value smaller than the memory upper limit value allocated to the backup processing;
When the memory usage of the backup process exceeds the predetermined value, the control unit temporarily stops the execution of the backup process and releases a memory area related to the backup process in the cache.
A backup control method characterized by that.
バックアップ処理に使用されるメモリ使用量が、前記バックアップ処理に割り当てられたメモリ上限値よりも小さい所定値を超えたか否かを監視する第一機能と、
制御手段が、前記バックアップ処理のメモリ使用量が前記所定値を超えると、前記バックアップ処理の実行を一時停止し、かつ、キャッシュ中の前記バックアップ処理に関連するメモリ領域を解放する第二機能と、
を前記コンピュータに実現することを特徴とするプログラム。 A program for causing a computer to function as a communication device having a file backup function,
A first function for monitoring whether or not the amount of memory used for backup processing exceeds a predetermined value smaller than the memory upper limit value allocated to the backup processing;
A second function of temporarily stopping execution of the backup process and releasing a memory area related to the backup process in the cache when the memory usage of the backup process exceeds the predetermined value;
Is implemented on the computer.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2015226226A JP6590403B2 (en) | 2015-11-19 | 2015-11-19 | Communication device and backup control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2015226226A JP6590403B2 (en) | 2015-11-19 | 2015-11-19 | Communication device and backup control method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2017097455A JP2017097455A (en) | 2017-06-01 |
| JP6590403B2 true JP6590403B2 (en) | 2019-10-16 |
Family
ID=58803903
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2015226226A Active JP6590403B2 (en) | 2015-11-19 | 2015-11-19 | Communication device and backup control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6590403B2 (en) |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004062256A (en) * | 2002-07-25 | 2004-02-26 | Hitachi Ltd | Database search processing method |
| JP5708049B2 (en) * | 2011-03-07 | 2015-04-30 | 株式会社リコー | Information processing apparatus, control method, control program, and recording medium |
| WO2015075803A1 (en) * | 2013-11-21 | 2015-05-28 | 富士通株式会社 | Information processing device, method, program, and storage medium |
-
2015
- 2015-11-19 JP JP2015226226A patent/JP6590403B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2017097455A (en) | 2017-06-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10776215B2 (en) | Snapshot generating method, system, and apparatus | |
| US9588789B2 (en) | Management apparatus and workload distribution management method | |
| US10838829B2 (en) | Method and apparatus for loading data from a mirror server and a non-transitory computer readable storage medium | |
| US9110806B2 (en) | Opportunistic page caching for virtualized servers | |
| US10949273B2 (en) | Shared memory usage tracking across multiple processes | |
| US9069465B2 (en) | Computer system, management method of computer resource and program | |
| US9875056B2 (en) | Information processing system, control program, and control method | |
| US9256464B2 (en) | Method and apparatus to replicate stateful virtual machines between clouds | |
| CN106959893B (en) | Accelerator, memory management method for accelerator and data processing system | |
| US20150324144A1 (en) | Virtual machine backup from storage snapshot | |
| US9292427B2 (en) | Modifying memory space allocation for inactive tasks | |
| JP6123626B2 (en) | Process resumption method, process resumption program, and information processing system | |
| US12164970B2 (en) | Scaling virtualization resource units of applications | |
| CN104021029A (en) | Spatial information cloud computing system and implementing method thereof | |
| CN109992373A (en) | Resource regulating method, approaches to IM and device and task deployment system | |
| CN111881476A (en) | Object storage control method and device, computer equipment and storage medium | |
| US20160103714A1 (en) | System, method of controlling a system including a load balancer and a plurality of apparatuses, and apparatus | |
| CN117290075A (en) | Process migration method, system, device, communication equipment and storage medium | |
| CN104268089A (en) | Information updating method, device and system | |
| US9769007B1 (en) | Passive data protection system migration | |
| JP6590403B2 (en) | Communication device and backup control method | |
| US20220398175A1 (en) | Storage system, failover control method, and recording medium | |
| US20130275693A1 (en) | Preferential block recycling in a redirect-on-write filesystem | |
| CN114995951B (en) | Bare metal resource management method, device, equipment and readable storage medium | |
| US20250291638A1 (en) | API Multiplexing of Multiple Pod Requests |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181005 |
|
| RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20181005 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20181005 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190729 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20190820 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190912 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6590403 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |