JP6080490B2 - Information processing apparatus, activation method, and program - Google Patents

Information processing apparatus, activation method, and program Download PDF

Info

Publication number
JP6080490B2
JP6080490B2 JP2012235481A JP2012235481A JP6080490B2 JP 6080490 B2 JP6080490 B2 JP 6080490B2 JP 2012235481 A JP2012235481 A JP 2012235481A JP 2012235481 A JP2012235481 A JP 2012235481A JP 6080490 B2 JP6080490 B2 JP 6080490B2
Authority
JP
Japan
Prior art keywords
data
initialization
kernel
volatile memory
area
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
Application number
JP2012235481A
Other languages
Japanese (ja)
Other versions
JP2014085907A (en
Inventor
加藤 謙介
謙介 加藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2012235481A priority Critical patent/JP6080490B2/en
Priority to US14/061,218 priority patent/US9904559B2/en
Publication of JP2014085907A publication Critical patent/JP2014085907A/en
Application granted granted Critical
Publication of JP6080490B2 publication Critical patent/JP6080490B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Power Sources (AREA)

Description

本発明は、ハイバネーション機構を有する情報処理装置を高速起動する技術に関する。   The present invention relates to a technique for rapidly starting an information processing apparatus having a hibernation mechanism.

近年、情報処理装置において待機状態の消費電力を低減することができるハイバネーションが注目されている。ハイバネーションとは、システム中断機構である。システムが起動している状態でメモリやCPUレジスタ、デバイスの情報(以下、ハイバネーションイメージと称す)をハードディスクなどの不揮発性記憶装置に退避する。その後電源を切っても、次回起動時は退避させたハイバネーションイメージを読み込むことで以前と同じ状態に復帰する(以下、ハイバネーション起動と称す)。ハイバネーションは、システムの起動時間の短縮を目的として用いられることもある。   In recent years, hibernation that can reduce power consumption in a standby state in an information processing apparatus has attracted attention. Hibernation is a system interruption mechanism. While the system is activated, memory, CPU register, and device information (hereinafter referred to as a hibernation image) is saved in a non-volatile storage device such as a hard disk. Even if the power is turned off, the hibernation image is restored to the same state as before by reading the saved hibernation image at the next startup (hereinafter referred to as hibernation startup). Hibernation is sometimes used for the purpose of shortening the startup time of the system.

ハイバネーションによるシステムの起動方式は大きく2種類に分類される。BIOS機能もしくはブートローダ機能により復帰を行う方式と、オペレーティングシステムのカーネル機能により復帰を行う方式が存在する。   There are two main types of system activation methods by hibernation. There are a method of performing recovery using a BIOS function or a boot loader function, and a method of performing recovery using a kernel function of an operating system.

カーネル機能によるハイバネーション起動では、カーネルの初期化を行った後に、予め不揮発性記憶装置に記憶されたハイバネーションイメージを読み込むことで、ハイバネーション移行前の状態を復元する。BIOSによるハイバネーションと比較すると、通常の起動シーケンスを実行することでデバイスの初期化を行う為、汎用性に優れている。   In the hibernation activation by the kernel function, after the kernel is initialized, the hibernation image stored in advance in the nonvolatile storage device is read to restore the state before the hibernation transition. Compared with BIOS hibernation, the device is initialized by executing a normal startup sequence, which is superior in versatility.

ここで、カーネル機能によるハイバネーションは、BIOSやブートローダによるハイバネーションと比較すると、起動シーケンスに伴う処理時間を要することから、起動時間が長い。そこで、特許文献1のように、ハイバネーションイメージ全体を圧縮して不揮発性記憶装置に退避させる手法がある。   Here, the hibernation by the kernel function requires a longer processing time than the hibernation by the BIOS or the boot loader, so that the startup time is long. Therefore, as in Patent Document 1, there is a method of compressing the entire hibernation image and saving it in a nonvolatile storage device.

特開2001−022464号公報JP 2001-022464 A

DMAコントローラ(ダイレクトメモリアクセスコントローラ)を用いると、CPUによる特定の処理と並行して記憶装置間で情報を読み書きすることができる。そこで、ハイバネーション起動にDMACを組み込むことができると、カーネル初期化と並行してハイバネーションイメージを読み込むことが可能となり、ハイバネーション起動時間を短縮することができる。ただし、Linux(登録商標)などの複雑なメモリ管理機構を備えたカーネル上では、DMAコントローラはカーネルが指定する不特定の領域やカーネルが管理する領域にアクセスし難いため、メモリ領域の任意のアドレスにデータを書き込むことが難しい。そのため、従来のハイバネーション起動方式では、カーネル初期化とDMACで並行してハイバネーションイメージを読み込むことが困難である。   When a DMA controller (direct memory access controller) is used, information can be read and written between storage devices in parallel with specific processing by the CPU. Therefore, if the DMAC can be incorporated in the hibernation activation, the hibernation image can be read in parallel with the kernel initialization, and the hibernation activation time can be shortened. However, on a kernel having a complicated memory management mechanism such as Linux (registered trademark), it is difficult for the DMA controller to access an unspecified area specified by the kernel or an area managed by the kernel. It is difficult to write data in Therefore, in the conventional hibernation activation method, it is difficult to read the hibernation image in parallel with kernel initialization and DMAC.

例えば、特許文献1のようにハイバネーションイメージを圧縮する技術を利用して、カーネル初期化と並行して圧縮データの読み込みを実現するには、読み込み先となる領域が必要になるが、この領域は、カーネル初期化時の空き領域から単純に確保することは難しい。なぜなら、伸張後のデータはハイバネーション移行前と同一のアドレスに配置する必要があり、この伸張先が圧縮データの読み込み先と衝突してしまう可能性があるためである。   For example, in order to realize the reading of compressed data in parallel with the kernel initialization using the technology for compressing the hibernation image as in Patent Document 1, an area to be read is necessary. It is difficult to simply secure from the free space at the time of kernel initialization. This is because the decompressed data must be arranged at the same address as before the hibernation transition, and this decompression destination may collide with the read destination of the compressed data.

また、マルチコア環境であれば、特定のコアが処理を行っている間に、他のコアに異なる処理を行わせることができる。ハイバネーション起動であれば、カーネル初期化と並行して圧縮イメージを伸張させることが有効であると考えられる。しかし、DMAコントローラと同様の理由で、特定のコアによりカーネル初期化が行われている間は、残りのコアが任意のメモリ領域へハイバネーションイメージを書き込むことが困難である。そのため、従来のハイバネーション起動方式では、カーネル初期化と並行して圧縮イメージを伸張することも困難である。   In a multi-core environment, another core can perform different processing while a specific core performs processing. If hibernation is activated, it is considered effective to decompress the compressed image in parallel with the kernel initialization. However, for the same reason as the DMA controller, it is difficult for the remaining cores to write the hibernation image to an arbitrary memory area while the kernel initialization is performed by a specific core. Therefore, with the conventional hibernation activation method, it is difficult to decompress the compressed image in parallel with the kernel initialization.

揮発性メモリと、前記揮発性メモリに保持されている少なくとも一部のデータを圧縮データに圧縮する圧縮手段と、前記圧縮手段で圧縮を行わなかった非圧縮データと前記圧縮データとをハイバネーションイメージとして保持する不揮発性メモリと、前記揮発性メモリの一部を利用して行われるカーネルの初期化と並行して、前記不揮発性メモリに保持されている前記圧縮データを、前記揮発性メモリの、前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に未使用だった未使用領域へ読み込む初期化時データ読み込み手段と、前記カーネルの初期化と並行して、前記揮発性メモリに読み込んだ圧縮データを、前記揮発性メモリの、前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に圧縮前のデータが存在していた領域に伸張する初期化時データ伸張手段と、前記初期化時データ伸張手段により伸張したデータを利用してシステムを起動させる起動手段とを有することを特徴とする。 A volatile memory, a compression unit that compresses at least a portion of data held in the volatile memory into compressed data, uncompressed data that has not been compressed by the compression unit, and the compressed data as a hibernation image The compressed data held in the nonvolatile memory is stored in the nonvolatile memory in parallel with the nonvolatile memory to be held and the initialization of the kernel performed using a part of the volatile memory. Initialization data reading means for reading into an unused area that was not used when generating the hibernation image in an area not used for kernel initialization, and compression read into the volatile memory in parallel with the initialization of the kernel data, the volatile memory, the hibernation image production in a region not used to initialize the kernel And when the data expansion means initialization of expanding to at data before compression was present region, and characterized in that it has a starting means for starting the system by using the decompressed data by the initialization time of data decompression means To do.

本発明によれば、マルチコアを効率的に利用してより高速な起動が可能になる。   According to the present invention, a multi-core can be efficiently used to enable faster startup.

情報処理装置の構成を示す概略図である。It is the schematic which shows the structure of information processing apparatus. 本発明のハイバネーション機構の機能構成を示す概略図である。It is the schematic which shows the function structure of the hibernation mechanism of this invention. ハイバネーションイメージの生成処理を示すフローチャートである。It is a flowchart which shows the production | generation process of a hibernation image. ハイバネーションイメージのフォーマットを示す図である。It is a figure which shows the format of a hibernation image. システムの起動処理を示すフローチャートである。It is a flowchart which shows the starting process of a system. カーネル初期化時のハイバネーションイメージの流れについて示す図である。It is a figure shown about the flow of the hibernation image at the time of kernel initialization. ハイバネーションイメージの復帰処理を示すフローチャートである。It is a flowchart which shows the return process of a hibernation image. ハイバネーション起動時の仮想メモリについて示す図である。It is a figure shown about the virtual memory at the time of hibernation starting.

図1に情報処理装置100の概略構成を示す。CPU101や、ダイレクトメモリアクセスコントローラ(以下、DMACと称す)102は、DRAM(DDRSDRAMなどを含む)を備える揮発性メモリ103に対してデータを読み書きする。入出力制御部(以下、I/Oコントローラと称す)104は、CPU101やDMAC102などの要求に基づいて、不揮発性メモリとしての不揮発性記憶装置(フラッシュメモリ、HDD、SSDなど)105に対する読み書きを行う。デバイス106は、CPU101によって初期化される周辺機器であって、PCI接続のグラフィックボードやUSB接続のスキャナ、プリンタなど様々な機器をデバイス106として用いることができる。デバイス106は其々、自身の状態を保持するステータスレジスタや処理に用いる値(画像処理のパラメータに対応する値や、処理モードを示す値)を保持するコンフィギュレーションレジスタを備える。なお、デバイス106は複数あってもよい。   FIG. 1 shows a schematic configuration of the information processing apparatus 100. The CPU 101 and the direct memory access controller (hereinafter referred to as DMAC) 102 read / write data from / to the volatile memory 103 including a DRAM (including a DDR SDRAM). An input / output control unit (hereinafter referred to as an I / O controller) 104 reads / writes data in / from a nonvolatile storage device (flash memory, HDD, SSD, etc.) 105 as a nonvolatile memory based on a request from the CPU 101 or the DMAC 102. . The device 106 is a peripheral device that is initialized by the CPU 101, and various devices such as a PCI-connected graphic board, a USB-connected scanner, and a printer can be used as the device 106. The device 106 includes a status register that holds its own state and a configuration register that holds values used for processing (values corresponding to image processing parameters and values indicating processing modes). Note that there may be a plurality of devices 106.

CPU101は複数のプロセッサコアを備え、不揮発性記憶装置105に含まれるプログラムをメモリ103に展開し、メモリ103からプログラムをフェッチして後述の処理を実行する。   The CPU 101 includes a plurality of processor cores, expands a program included in the nonvolatile storage device 105 to the memory 103, fetches the program from the memory 103, and executes processing described later.

カーネル初期化は、CPU101の特定のプロセッサコアを主に用いて行われる。このプロセッサコアを、以下の説明ではブートコアと称す。また、ブートコア以外のコアを、以下の説明ではスレーブコアと称す。   The kernel initialization is performed mainly using a specific processor core of the CPU 101. This processor core is referred to as a boot core in the following description. A core other than the boot core is referred to as a slave core in the following description.

ハイバネーションとは、システムの状態の保存と、保存したシステムの状態を復元する技術であり、保存・復元されるシステムの状態を示すデータをハイバネーションイメージと呼称する(ハイバネーションイメージのフォーマットは後述する)。なお、ハイバネーションイメージは、不揮発性記憶装置105に保存される。   Hibernation is a technique for saving the system state and restoring the saved system state, and data indicating the saved and restored system state is called a hibernation image (the format of the hibernation image will be described later). The hibernation image is stored in the nonvolatile storage device 105.

ここで、一般的なハイバネーション処理の流れを示す。ユーザ(又はユーザアプリケーション)がシステム中断を要求すると、メモリ103に書き込まれているデータ及び、その他のデバイス106の状態を表すデータ、CPU101のレジスタ値をもとにハイバネーションイメージが生成され、それが不揮発性記憶装置105へ書き込まれる。情報処理装置の電源を切り、再び起動すると、カーネルの初期化が開始される。カーネルの初期化直後に、ハイバネーションイメージが不揮発性記憶装置105からメモリ103へ読み込まれ、システム中断直前の状態に戻る。以下の説明では、ハイバネーションイメージを用いた起動シーケンスをハイバネーション起動と称す。   Here, the flow of a general hibernation process is shown. When a user (or user application) requests a system interruption, a hibernation image is generated based on the data written in the memory 103, the data indicating the state of the other device 106, and the register value of the CPU 101. Is written to the volatile storage device 105. When the information processing apparatus is turned off and restarted, kernel initialization is started. Immediately after the initialization of the kernel, the hibernation image is read from the nonvolatile storage device 105 to the memory 103, and the state immediately before the system interruption is restored. In the following description, the activation sequence using the hibernation image is referred to as hibernation activation.

本実施形態では、Linux(登録商標)のバージョン2.6.18を従来手法として、ハイバネーション起動の高速化について説明する。   In this embodiment, the speedup of hibernation activation will be described using Linux (registered trademark) version 2.6.18 as a conventional method.

Linux(登録商標)では、メモリ管理をページ単位で行う。以下で述べる領域は、ひとつまたは複数のページから構成されるメモリの範囲を意味する。   In Linux (registered trademark), memory management is performed in units of pages. The area described below means a memory range composed of one or a plurality of pages.

図2は、本実施形態のハイバネーション機構の構成を示す図である。(A)から(E)において、同一システムにおけるハイバネーションの各状態を示す。   FIG. 2 is a diagram illustrating a configuration of the hibernation mechanism according to the present embodiment. In (A) to (E), each state of hibernation in the same system is shown.

(A)ハイバネーションイメージ生成時について示す。203は圧縮部である。メモリ200における使用中領域をページごとに圧縮し、ハイバネーションイメージの一部として不揮発性記憶装置201へ出力する。ただし、ページによっては圧縮率が低く、圧縮を行わない方が望ましいページも存在する。そのため、圧縮率の低いページであれば、非圧縮のままハイバネーションイメージの一部として不揮発性記憶装置201へ出力する。ただし、ハイバネーション処理を行うための変数を格納する領域(以下、ハイバネーション処理用領域と称す)は、ハイバネーションイメージに含めない。ハイバネーション処理用領域は、システムが再起動されてもアドレス値が変わらないようにするため、ハイバネーション起動時にカーネル管理となる領域(後述)から静的に確保する。   (A) A case where a hibernation image is generated will be described. Reference numeral 203 denotes a compression unit. The in-use area in the memory 200 is compressed page by page and output to the nonvolatile storage device 201 as part of the hibernation image. However, some pages have a low compression ratio, and it is desirable that compression is not performed. Therefore, if the page has a low compression rate, it is output to the nonvolatile storage device 201 as a part of the hibernation image without being compressed. However, an area for storing a variable for performing hibernation processing (hereinafter referred to as a hibernation processing area) is not included in the hibernation image. In order to prevent the address value from changing even when the system is restarted, the hibernation processing area is statically secured from an area (described later) that is used for kernel management when hibernation starts.

202は作業領域データ生成部(領域情報生成部)である。本実施形態では、カーネル初期化中に全圧縮データの読み込みを試みるため、その読み込みのための領域をハイバネーションイメージ生成時に未使用領域から確保する。そこで、作業領域データ生成部202では、メモリ200における未使用領域のアドレスを収集し、この情報をページ変換テーブルにまとめ、ハイバネーションイメージの一部として不揮発性記憶装置201へ出力する。このページ変換テーブルのデータを作業領域データ(又は領域情報)と称し、そのデータが示す領域を作業領域と称す。   Reference numeral 202 denotes a work area data generation unit (area information generation unit). In this embodiment, since all compressed data is read during kernel initialization, an area for the reading is secured from an unused area when the hibernation image is generated. Therefore, the work area data generation unit 202 collects addresses of unused areas in the memory 200, collects this information in a page conversion table, and outputs the information to the nonvolatile storage device 201 as part of the hibernation image. The data of the page conversion table is called work area data (or area information), and the area indicated by the data is called a work area.

(B)カーネル初期化開始時について示す。204はメモリ制限部であり、205はメモリ初期化機構である。メモリ制限部204はメモリ初期化機構205に対してオペレーティングシステムが管理するメモリ領域の制限を指示し、メモリ初期化機構205はこの情報をもとにメモリ200の初期化を行う。この制限により、メモリ200はカーネル管理領域とカーネル管理外領域に分かれる。この制限の目的は、意図的にカーネル管理外領域を作りだすことで、ブートコアによるカーネルの初期化処理と並行して、カーネル管理外領域にデータの読み込み及び伸張を可能にすることにある。   (B) Shown at the start of kernel initialization. Reference numeral 204 denotes a memory restriction unit, and 205 denotes a memory initialization mechanism. The memory restriction unit 204 instructs the memory initialization mechanism 205 to restrict the memory area managed by the operating system, and the memory initialization mechanism 205 initializes the memory 200 based on this information. Due to this limitation, the memory 200 is divided into a kernel management area and a non-kernel management area. The purpose of this limitation is to intentionally create a non-kernel management area so that data can be read and decompressed in the non-kernel management area in parallel with the kernel initialization processing by the boot core.

206は作業領域有効化部である。まず、メモリ200のカーネル管理外領域に、作業領域データ生成部202で生成した作業領域データを読み込む。そして、この情報の一部を現在使用されているページ変換テーブルに上書きすることで、圧縮データを格納するための作業領域を使用可能にする。   Reference numeral 206 denotes a work area validation unit. First, the work area data generated by the work area data generation unit 202 is read into an area outside the kernel management in the memory 200. Then, by overwriting a part of this information on the currently used page conversion table, the work area for storing the compressed data can be used.

(C)カーネル初期化時について示す。207はカーネル初期化機構である。メモリ200のメモリ初期化機構205によって初期化されたカーネル管理領域の範囲で、ブートコアによってカーネルの初期化を行う。208は初期化時データ読み込み部であり、209はDMACである。初期化時データ読み込み部208は、DMAC209を用いることでカーネル初期化機構207による初期化処理と並行し、不揮発性記憶装置201に保存されたハイバネーションイメージを作業領域へ順に読み込む。ただし、非圧縮データはハイバネーションイメージ生成時にそのデータが元々存在していた領域に読み込む。210は初期化時データ伸張部(1次伸張部)である。初期化時データ読み込み部によってメモリ200に読み込まれた圧縮データを、さらにスレーブコアによってカーネル初期化と並行し、ハイバネーションイメージ生成時にそのデータが元々存在していたメモリ200の領域へ伸張する。   (C) Kernel initialization is shown. Reference numeral 207 denotes a kernel initialization mechanism. The kernel is initialized by the boot core within the range of the kernel management area initialized by the memory initialization mechanism 205 of the memory 200. Reference numeral 208 denotes an initialization data reading unit, and reference numeral 209 denotes a DMAC. The initialization data reading unit 208 uses the DMAC 209 to read hibernation images stored in the nonvolatile storage device 201 sequentially into the work area in parallel with the initialization process by the kernel initialization mechanism 207. However, uncompressed data is read into the area where the data originally existed when the hibernation image was generated. Reference numeral 210 denotes an initialization data decompression unit (primary decompression unit). The compressed data read into the memory 200 by the data reading unit at the time of initialization is further expanded in parallel with the kernel initialization by the slave core to the area of the memory 200 where the data originally existed when the hibernation image was generated.

(D)カーネル初期化後について示す。211は初期化後データ読み込み部である。まず、初期化時データ読み込み部208が非圧縮データ以外の読み込みを完了していない場合は、該当データの読み込みを完了させる。212は初期化後データ伸張部(2次伸張部)である。メモリ200に読み込まれた未伸張の圧縮データを、ハイバネーションイメージ生成時にそのデータが元々存在していたメモリ200の領域へ伸張する。この初期化後データ伸張部212による伸張と並行して、初期化後データ読み込み部211は、DMAC209を用いて、非圧縮データをハイバネーションイメージ生成時にそのデータが元々存在していたメモリ200の領域へ読み込む。初期化後データ読み込み部211では、カーネル管理領域及びカーネル管理外領域を区別する必要はない。   (D) Shown after kernel initialization. Reference numeral 211 denotes a data reading unit after initialization. First, when the initialization data reading unit 208 has not finished reading data other than uncompressed data, the data reading is completed. Reference numeral 212 denotes a post-initialization data decompression unit (secondary decompression unit). Uncompressed compressed data read into the memory 200 is expanded to the area of the memory 200 where the data originally existed when the hibernation image was generated. In parallel with the decompression by the post-initialization data decompression unit 212, the post-initialization data reading unit 211 uses the DMAC 209 to transfer the uncompressed data to the area of the memory 200 where the data originally existed when the hibernation image was generated. Read. The post-initialization data reading unit 211 need not distinguish between the kernel management area and the non-kernel management area.

(E)ハイバネーション起動後について示す。(B)から(D)の処理により、メモリ200はハイバネーション処理用領域を除き(A)と同様の状態に復帰される。以下の説明では、初期化後データ読み込み部211の処理を、メモリ復帰処理と称す。   (E) After the hibernation is started. By the processing from (B) to (D), the memory 200 is returned to the same state as in (A) except for the hibernation processing area. In the following description, the process of the post-initialization data reading unit 211 is referred to as a memory restoration process.

また、作業領域データ生成部202及び圧縮部203、メモリ制限部204、メモリ初期化機構205、カーネル初期化機構207、作業領域有効化部206、初期化時データ読み込み部208、初期化時データ伸張部210、初期化後データ読み込み部211、初期化後データ伸張部212は、不揮発性記憶装置に格納されているプログラムに基づいて処理される。   In addition, the work area data generation unit 202 and compression unit 203, the memory restriction unit 204, the memory initialization mechanism 205, the kernel initialization mechanism 207, the work area validation unit 206, the initialization data reading unit 208, and the initialization data decompression The unit 210, the post-initialization data reading unit 211, and the post-initialization data decompression unit 212 are processed based on a program stored in the nonvolatile storage device.

ここからは、本実施形態におけるハイバネーションイメージ生成の流れを示す。   From here, the flow of hibernation image generation in this embodiment is shown.

図3は、ユーザ(又はユーザアプリケーション)がシステム中断状態への移行を要求してからシステムが停止するまでのCPU101の処理の流れを示したフローチャートである。まず概略を説明すると、ステップS300でCPU101がプロセススケジューラを停止し、ステップS301でCPU101が各デバイスを停止しCPU101への割り込みを制限し、ステップS302でCPU101がCPUレジスタの退避を行う。そして、ステップS303でCPU101がハイバネーションイメージを生成して出力し、ステップS304でCPU101がシステムの停止を行う。   FIG. 3 is a flowchart showing the processing flow of the CPU 101 from when the user (or user application) requests to enter the system interruption state until the system stops. First, the outline will be described. In step S300, the CPU 101 stops the process scheduler. In step S301, the CPU 101 stops each device and restricts interrupts to the CPU 101. In step S302, the CPU 101 saves the CPU register. In step S303, the CPU 101 generates and outputs a hibernation image. In step S304, the CPU 101 stops the system.

以下の説明では、ステップS300及びステップS301、ステップS302をシステム中断処理と称して図3のフローチャートの詳細を説明する。ステップS300では、CPU101がすべてのプロセスを停止すると、これ以降はプロセスの処理によるメモリ内容の変更が発生しない。ステップS301では、CPU101が各デバイスの状態をメモリ内に保存し、これ以降のデバイスへのアクセスを無効にする。ステップS302では、CPU101がCPUレジスタの内容をメモリ上に保存する。このシステム中断処理により、システムの状態を表す全ての情報がメモリに保存される。よって、このメモリ内容を不揮発性記憶装置に保存しておき、必要に応じてこれをメモリに読み出し、保存した各デバイスやCPUレジスタの状態を再設定し、割り込み及びプロセススケジューラを再開することで、システムの状態を復元することができる。   In the following description, step S300, step S301, and step S302 are referred to as system interruption processing, and the details of the flowchart of FIG. 3 will be described. In step S300, when the CPU 101 stops all processes, the memory contents are not changed by process processing thereafter. In step S301, the CPU 101 stores the state of each device in the memory, and invalidates access to the subsequent devices. In step S302, the CPU 101 saves the contents of the CPU register on the memory. By this system interruption process, all information representing the system state is stored in the memory. Therefore, save this memory content in a nonvolatile storage device, read it to the memory as necessary, reset the state of each saved device and CPU register, restart the interrupt and process scheduler, The system state can be restored.

ステップS303では、CPU101がシステム中断処理によりシステムの状態が保持されているメモリ領域から、ハイバネーションイメージを生成し不揮発性記憶装置へ出力する。図4は、ハイバネーションイメージのフォーマットを示した図である。ヘッダ400は、ハイバネーションイメージに関する情報であり、有効なハイバネーションイメージであるかどうかを示す識別子及び非圧縮データのサイズ、圧縮データのサイズを含む。作業領域データ401は、ページ変換テーブルのデータを格納する。圧縮データ403は、圧縮したページ及び圧縮後のサイズ、伸張先アドレスを格納する。非圧縮データ404は非圧縮のページを格納し、非圧縮データアドレス402は非圧縮データ404の読み込み先アドレスを格納する。   In step S303, the CPU 101 generates a hibernation image from the memory area where the system state is held by the system interruption process, and outputs the hibernation image to the nonvolatile storage device. FIG. 4 is a diagram showing the format of the hibernation image. The header 400 is information regarding the hibernation image, and includes an identifier indicating whether the image is a valid hibernation image, the size of uncompressed data, and the size of compressed data. The work area data 401 stores page conversion table data. The compressed data 403 stores a compressed page, a size after compression, and an expansion destination address. Uncompressed data 404 stores an uncompressed page, and uncompressed data address 402 stores a read destination address of uncompressed data 404.

次に、作業領域データ401のフォーマットについて示す。   Next, the format of the work area data 401 is shown.

作業領域データ401は、ハイバネーション起動時にハイバネーションイメージの読み込み先となる作業領域を示すデータであり、ページ変換テーブルとして格納する。このように格納することで、物理メモリ上では不連続な未使用ページを、仮想メモリ上では連続した領域として扱うことが可能になる。ページ変換テーブルは、1個以上の変換用ページによって段階的に構成される。以下の説明では、1段階目の変換用ページをページグローバルディレクトリと称し、2段階目以降の変換用ページをページテーブルと称す。   The work area data 401 is data indicating a work area into which a hibernation image is read when hibernation is activated, and is stored as a page conversion table. By storing in this way, discontinuous unused pages on the physical memory can be handled as a continuous area on the virtual memory. The page conversion table is composed of one or more conversion pages in stages. In the following description, the first conversion page is referred to as a page global directory, and the second and subsequent conversion pages are referred to as page tables.

ページグローバルディレクトリ409の作業領域に該当する項目には、複数のページテーブル410の物理メモリアドレス及び状態フラグを記載する。そして、ページ変換テーブルとしての段階に応じ、1段階目の変換用ページから順に並べて連結する。   In an item corresponding to the work area of the page global directory 409, physical memory addresses and status flags of a plurality of page tables 410 are described. Then, according to the stage as the page conversion table, they are arranged and connected in order from the first stage conversion page.

さらに、作業領域データ401のページ変換テーブルは、ハイバネーションイメージ生成時のカーネル管理領域のマッピング情報も含める。この情報は、ハイバネーション起動時に、圧縮データの伸張先へアクセスするために用いる。   Furthermore, the page conversion table of the work area data 401 includes mapping information of the kernel management area when the hibernation image is generated. This information is used to access the decompression destination of the compressed data when hibernation is activated.

次に、非圧縮データアドレス402及び非圧縮データ406のフォーマットについて示す。   Next, the formats of the uncompressed data address 402 and the uncompressed data 406 are shown.

非圧縮データアドレス402と、非圧縮データ406は対応関係にあり、非圧縮データ406のN番目に格納されたデータの配置先は、非圧縮データアドレス402のN番目に格納されたアドレスとなる。N番目に格納された非圧縮ページアドレス411と、同じくN番目に格納された非圧縮ページ412は対応関係にある。非圧縮データアドレス402の情報の個数と、非圧縮データ406の情報の個数は、それぞれ等しい。   The non-compressed data address 402 and the non-compressed data 406 have a correspondence relationship, and the location where the Nth stored data of the uncompressed data 406 is arranged is the Nth stored address of the uncompressed data address 402. The non-compressed page address 411 stored in the Nth and the non-compressed page 412 stored in the Nth are in a correspondence relationship. The number of information of the uncompressed data address 402 is equal to the number of information of the uncompressed data 406.

非圧縮データ406は、カーネル管理外領域に復帰させる非圧縮データ407及び、カーネル管理領域に復帰させる非圧縮データ408の2種類のデータを含む。このように分割する理由は、カーネル初期化時に読み込み可能なハイバネーションイメージが、先頭のヘッダ400から非圧縮データ407までに限定され、非圧縮データ408はカーネル初期化後にしか読み込むことができないためである。そのため、非圧縮データ407は、非圧縮データ408より前方に配置する。そして、カーネル初期化が完了するまでは、ヘッダ400から非圧縮データ407までを読み込み対象とする。   The uncompressed data 406 includes two types of data: uncompressed data 407 to be restored to the non-kernel management area and uncompressed data 408 to be restored to the kernel management area. The reason for this division is that the hibernation image that can be read at the time of kernel initialization is limited to the header 400 to the uncompressed data 407, and the uncompressed data 408 can be read only after the kernel initialization. . Therefore, the non-compressed data 407 is arranged ahead of the non-compressed data 408. Until the kernel initialization is completed, the header 400 to the uncompressed data 407 are read.

最後に、圧縮データ403のフォーマットについて示す。   Finally, the format of the compressed data 403 will be described.

413は1ページ分のデータを圧縮した際に生成する情報を示しており、圧縮ページサイズ414及び圧縮ページアドレス415、圧縮ページ416を含む。圧縮はページ単位で行う。これらの情報をもとに、1ページ分のデータをメモリに復元することができる。   Reference numeral 413 denotes information generated when one page of data is compressed, and includes a compressed page size 414, a compressed page address 415, and a compressed page 416. Compression is performed in units of pages. Based on these pieces of information, data for one page can be restored to the memory.

例えば、アドレスサイズが32bitのCPUでは、圧縮ページサイズ414を12Bit、圧縮ページアドレス415を20bit(4GB分のページを指定可能なサイズ)とする。この場合、圧縮ページ416は、12bitで表現可能な4096byte未満でなければならない。圧縮後のサイズが4096byte以上のものは、圧縮前のページを非圧縮データ406に格納する。   For example, in a CPU having an address size of 32 bits, the compressed page size 414 is set to 12 bits, and the compressed page address 415 is set to 20 bits (a size capable of specifying a page of 4 GB). In this case, the compressed page 416 must be less than 4096 bytes that can be expressed in 12 bits. If the size after compression is 4096 bytes or more, the page before compression is stored in the uncompressed data 406.

次に、圧縮データ403及び非圧縮データ406へ格納するページについて示す。圧縮データ403のサイズは、上限となるサイズを予めユーザ(又はユーザアプリケーション)が指定してもよい。また、作業領域には、圧縮データ403だけでなく非圧縮データアドレス402及び、圧縮データ伸張時のスタックも格納する。そのため、圧縮データ403のサイズは、作業領域サイズからこれらのサイズを除いた値より小さくなければならない。圧縮データ403のサイズが上限に達しこれ以上ページを格納することができない場合、未格納のページを非圧縮データ406へ格納する。   Next, pages stored in the compressed data 403 and the uncompressed data 406 will be described. The size of the compressed data 403 may be specified in advance by the user (or user application) as an upper limit size. In the work area, not only the compressed data 403 but also the non-compressed data address 402 and the stack at the time of decompressing the compressed data are stored. Therefore, the size of the compressed data 403 must be smaller than the value obtained by removing these sizes from the work area size. When the size of the compressed data 403 reaches the upper limit and no more pages can be stored, an unstored page is stored in the uncompressed data 406.

圧縮データ403は、非圧縮データ406同様に、カーネル管理外領域に復帰させる圧縮データ404及び、カーネル管理領域に復帰させる圧縮データ405の2種類から構成される。このように分割する理由も、非圧縮データ406を分割する理由と同様である。そして、カーネル初期化が完了するまでは、圧縮データ405のみを伸張対象とする。   Similar to the non-compressed data 406, the compressed data 403 is composed of two types of compressed data 404 to be restored to the non-kernel management area and compressed data 405 to be restored to the kernel management area. The reason for dividing in this way is the same as the reason for dividing the non-compressed data 406. Until the kernel initialization is completed, only the compressed data 405 is targeted for decompression.

以上の処理により生成されるハイバネーションイメージは、不揮発性記憶装置を有効にした後、指定の領域へ、ファイルシステムに依存しない型式で、物理的に連続した状態で格納する。   The hibernation image generated by the above processing is stored in a physically continuous state in a format independent of the file system in a designated area after enabling the nonvolatile storage device.

次に、本実施形態におけるハイバネーション起動の流れを示す。情報処理装置がONになると、BIOS及び、必要に応じブートローダが処理を行い、カーネル初期化を開始する。   Next, the flow of hibernation activation in this embodiment is shown. When the information processing apparatus is turned on, the BIOS and the boot loader perform processing as necessary, and kernel initialization is started.

図5は、本実施形態における、カーネル初期化の開始からハイバネーションイメージを復帰するまでのフローチャートと、システム復帰処理の詳細を示したフローチャートである。まずは前者について示す。ステップS500では、DMAC102が不揮発性記憶装置の所定領域の情報を読み込み、CPU101が読み込まれた情報に不揮発性記憶装置の所定の領域に有効なハイバネーションイメージが存在することを確認する。ステップS501では、CPU101がメモリ管理機構の初期化を行う。ステップS502では、CPU101が割り込み機構の初期化を行う。ステップS503では、CPU101がスレーブコアの初期化を行う。ステップS504では、CPU101がハイバネーションイメージの並行読み込み及び、圧縮データの伸張を開始する。ステップS505では、CPU101がその他機能の初期化を行い、並行してDMAC102が非圧縮データアドレス402及び圧縮データ403、非圧縮データ407を順に読み込む。ステップS506では、CPU101とDMAC102がメモリ復帰処理及びその準備を行う。   FIG. 5 is a flowchart from the start of kernel initialization to the restoration of the hibernation image and a flowchart showing details of the system restoration process in the present embodiment. First, the former is shown. In step S500, the DMAC 102 reads information in a predetermined area of the non-volatile storage device, and the CPU 101 confirms that a valid hibernation image exists in the predetermined area of the non-volatile storage device in the read information. In step S501, the CPU 101 initializes the memory management mechanism. In step S502, the CPU 101 initializes the interrupt mechanism. In step S503, the CPU 101 initializes the slave core. In step S504, the CPU 101 starts parallel reading of the hibernation image and expansion of the compressed data. In step S505, the CPU 101 initializes other functions, and in parallel, the DMAC 102 reads the uncompressed data address 402, the compressed data 403, and the uncompressed data 407 in order. In step S506, the CPU 101 and the DMAC 102 perform memory restoration processing and preparation.

ステップS500では、CPU101がDMAC102及びI/Oコントローラ104を初期化し、DMAC102が不揮発性記憶装置の所定の領域に保存されたハイバネーションイメージのヘッダ400をメモリへ読み込む。ヘッダ400に含まれる識別子が有効であることをもって、ハイバネーションイメージが不揮発性記憶装置に格納されていることをCPU101によって判定する。図5は、不揮発性記憶装置にハイバネーションイメージが存在する場合を示すフローチャートである。なお、不揮発性記憶装置にハイバネーションイメージが格納されていないと判断した場合、システムを通常起動する。   In step S500, the CPU 101 initializes the DMAC 102 and the I / O controller 104, and the DMAC 102 reads the hibernation image header 400 stored in a predetermined area of the nonvolatile storage device into the memory. When the identifier included in the header 400 is valid, the CPU 101 determines that the hibernation image is stored in the nonvolatile storage device. FIG. 5 is a flowchart showing a case where a hibernation image exists in the nonvolatile storage device. When it is determined that the hibernation image is not stored in the nonvolatile storage device, the system is normally started.

ステップS501では、CPU101がカーネルの管理するメモリの範囲を指定の大きさに制限し、メモリ管理機構の初期化を行う。具体的には、メモリマップを変更することで、カーネル管理領域の範囲を制限する。カーネル初期化処理に要求される必要最低限のメモリの大きさから決定され、制限サイズは少なくともカーネル初期化に必要なサイズ以上を確保する。この処理により、カーネル管理領域とカーネル管理外領域の2種類の領域をメモリに確保する。この制限は、メモリ復帰処理を完了することで解除される。   In step S501, the CPU 101 limits the memory range managed by the kernel to a specified size, and initializes the memory management mechanism. Specifically, the range of the kernel management area is limited by changing the memory map. It is determined from the minimum necessary memory size required for the kernel initialization process, and the limit size is secured at least larger than the size necessary for kernel initialization. With this process, two types of areas, a kernel management area and a non-kernel management area, are secured in the memory. This restriction is removed by completing the memory restoration process.

さらにステップS501では、CPU101がカーネル管理領域へアクセスするためのページ変換テーブルを生成する。このページ変換テーブルのページグローバルディレクトリをカーネルPGD(Page Global Directory)と称す。また、作業領域データ401のページ変換テーブルをメモリに読み込む。このページ変換テーブルのページグローバルディレクトリをハイバネーションPGDと称す。そして、ハイバネーションPGDの作業領域に関する情報を、カーネルPGDのカーネル初期化では利用されない領域に上書きすることで、作業領域を使用可能に確保する。   In step S501, the CPU 101 generates a page conversion table for accessing the kernel management area. The page global directory of this page conversion table is referred to as a kernel PGD (Page Global Directory). Further, the page conversion table of the work area data 401 is read into the memory. The page global directory of this page conversion table is referred to as hibernation PGD. Then, the information regarding the work area of the hibernation PGD is overwritten on the area not used in the kernel initialization of the kernel PGD, thereby ensuring that the work area can be used.

ただし、メモリに読み込まれた作業領域データ401のページ変換テーブルは、カーネル初期化用のデータ及び圧縮データ、非圧縮データ、伸張後のデータによって上書きされてはならない。そこで、作業領域データ401におけるページグローバルディレクトリは常に1つであるため、ハイバネーション処理用領域に読み込む。これにより、上書きを防ぐことができる。しかし、作業領域データ401におけるページテーブルは、その数が固定ではないため保持するための領域をカーネル管理領域に予約しておくことが難しい。そこで、カーネル管理領域に各ページテーブルを読み込み、次に、カーネル管理外領域を一時的にカーネルから使用可能にし、カーネル管理外領域の予め決めてある領域に各ページテーブルを移動する。   However, the page conversion table of the work area data 401 read into the memory must not be overwritten with kernel initialization data, compressed data, uncompressed data, and decompressed data. Therefore, since there is always one page global directory in the work area data 401, it is read into the hibernation processing area. Thereby, overwriting can be prevented. However, since the number of page tables in the work area data 401 is not fixed, it is difficult to reserve an area for holding in the kernel management area. Therefore, each page table is read into the kernel management area, and then the non-kernel management area is temporarily made available from the kernel, and each page table is moved to a predetermined area of the kernel management area.

ステップS504では、ハイバネーションイメージの並行読み込み及び、圧縮データの伸張を開始する。まず、並行読み込みを行うための手段として、DMAC102ステップS502で初期化した割り込み機構を用いる。DMACでは、仮想アドレスではなく物理アドレスを指定する必要がある。そのため、ページ変換テーブルを用いて、作業領域の読み込み先となる仮想アドレスを物理アドレスに変換し、DMAC102に指定する。次に、伸張を行う手段として、S503で初期化したスレーブコアを用いる。DMAC102によって読み込まれたハイバネーションイメージの圧縮データ404を伸張する。   In step S504, parallel reading of the hibernation image and decompression of the compressed data are started. First, the interrupt mechanism initialized in step S502 of the DMAC 102 is used as means for performing parallel reading. In the DMAC, it is necessary to specify a physical address instead of a virtual address. Therefore, using the page conversion table, the virtual address that is the reading destination of the work area is converted into a physical address and specified in the DMAC 102. Next, the slave core initialized in S503 is used as a means for performing decompression. The compressed data 404 of the hibernation image read by the DMAC 102 is expanded.

図6は、カーネル初期化時のハイバネーションイメージの流れについて示した図である。600はメモリであり、カーネル管理領域601とカーネル管理外領域602を有する。603はブートコアであり、ブートコア603はカーネル管理領域601にのみアクセスする。このため、カーネル管理外領域602はブートコア603からアクセスされることはなく、独立した領域として利用することができる。604はDMAC、605は不揮発性記憶装置であり、DMAC604はブートコア603によるカーネルの初期化と並行して、非圧縮データアドレス402及び圧縮データ403を、カーネル管理外領域602の作業領域の先頭から順に読み込む。上記データを全て読み込んだ場合、次に非圧縮データ407を、非圧縮データアドレス402に従って読み込む。非圧縮データ407のページは、前述の通り、作業領域を除く領域及びカーネル管理外領域602へ復帰するため、作業領域及びカーネル管理領域を上書きすることはない。606はスレーブコアであり、さらにブートコア603によるカーネルの初期化と並行して、DMAC604によって読み込まれた圧縮データ404の伸張を行う。並行読み込み同様、この伸張処理によって作業領域及びカーネル管理領域を上書きすることはない。ただし、圧縮データ405の伸張先はカーネル管理領域601であり、カーネル初期化時に伸張を行うとカーネル管理領域601を上書きしてしまうため、まだ圧縮データ405の伸張を行うことはできない。スレーブコアが複数利用可能な場合は、伸張処理を多重に行ってもよい。   FIG. 6 is a diagram showing the flow of the hibernation image at the time of kernel initialization. Reference numeral 600 denotes a memory having a kernel management area 601 and a non-kernel management area 602. Reference numeral 603 denotes a boot core, and the boot core 603 accesses only the kernel management area 601. Therefore, the non-kernel management area 602 is not accessed from the boot core 603 and can be used as an independent area. Reference numeral 604 denotes a DMAC, and reference numeral 605 denotes a nonvolatile storage device. The DMAC 604 stores the uncompressed data address 402 and the compressed data 403 in order from the head of the work area of the kernel non-management area 602 in parallel with the initialization of the kernel by the boot core 603. Read. When all the data has been read, the uncompressed data 407 is then read according to the uncompressed data address 402. As described above, the page of the non-compressed data 407 returns to the area excluding the work area and the non-kernel management area 602, so that the work area and the kernel management area are not overwritten. A slave core 606 further decompresses the compressed data 404 read by the DMAC 604 in parallel with the initialization of the kernel by the boot core 603. Similar to the parallel reading, the decompression process does not overwrite the work area and the kernel management area. However, the decompression destination of the compressed data 405 is the kernel management area 601, and if decompression is performed at the time of kernel initialization, the kernel management area 601 is overwritten, so the decompression of the compressed data 405 cannot be performed yet. When a plurality of slave cores are available, the decompression process may be performed in multiple.

一般的にDMACは、データ転送に用いるパラメータ(転送元アドレス、転送先アドレス、データサイズ)をCPUにより指定すると、不揮発性記憶装置からメモリへCPUとは非同期に転送を行う。また、DMACは一度に転送可能なサイズが決められているため、特定サイズの転送ごとに、CPUにより再び新たなパラメータを指定する必要がある。そこで本実施形態では、DMAC102による転送完了を通知する割り込み通知を利用し、次に読むべきデータを指定して新たな読み込みを実行する。また、タイマを利用して一定時間ごとに割り込みを発生させ、CPU101がDMAC102の読み込み状況を確認し、読み込みが完了していれば次に読むべきデータを指定して新たな読み込みを実行するようにしてもよい。他にも、スレーブコアを利用して、DMAC102の読み込み状況を逐次確認し続けてもよい。   In general, when a DMA specifies parameters (transfer source address, transfer destination address, data size) used for data transfer, the DMAC performs transfer from the nonvolatile storage device to the memory asynchronously with the CPU. In addition, since the DMAC has a size that can be transferred at a time, it is necessary to designate a new parameter again by the CPU for each transfer of a specific size. Therefore, in the present embodiment, an interrupt notification for notifying the completion of transfer by the DMAC 102 is used, and data to be read next is designated and new reading is executed. In addition, an interrupt is generated at regular intervals using a timer, and the CPU 101 confirms the reading status of the DMAC 102, and if reading is completed, designates data to be read next and executes a new reading. May be. In addition, the reading status of the DMAC 102 may be continuously confirmed using a slave core.

圧縮ページ416の伸張は、圧縮ページサイズ414及び圧縮ページアドレス415に応じて行う。圧縮ページアドレス415は、作業領域以外を指し示すため、未伸張の圧縮データを上書きすることはない。   The compressed page 416 is decompressed according to the compressed page size 414 and the compressed page address 415. Since the compressed page address 415 indicates an area other than the work area, the undecompressed compressed data is not overwritten.

DMAC102によるカーネル初期化時の並行読み込みは、非圧縮データアドレス402及び圧縮データ403、非圧縮データ407を読み込み終えるか、カーネル管理領域のメモリ復帰の準備が完了するまで継続して行う。スレーブコアによる並行伸張も、圧縮データ404の伸張が完了するか、カーネル管理領域のメモリ復帰の準備が完了するまで継続して行う。   The parallel reading at the time of kernel initialization by the DMAC 102 is continuously performed until the uncompressed data address 402, the compressed data 403, and the uncompressed data 407 are completely read or the preparation for restoring the memory in the kernel management area is completed. Parallel decompression by the slave core is also continued until decompression of the compressed data 404 is completed or preparation for restoring the memory in the kernel management area is completed.

図7は、システム復帰処理の詳細を示したフローチャートである。ステップS707でCPU101がプロセススケジューラを停止し、ステップS708でCPU101が各デバイスを停止し割り込みを制限する。さらに、ステップS709でCPU101が仮想メモリをカーネルPGDからハイバネーションPGDへ切り替え、ステップS710でCPU101がスタックを切り替え、ステップS711でCPU101がDMAC102による並行読み込みを停止させ、ステップS712でCPU101とDMAC102がメモリの復帰を行う。   FIG. 7 is a flowchart showing details of the system recovery process. In step S707, the CPU 101 stops the process scheduler, and in step S708, the CPU 101 stops each device and restricts interrupts. In step S709, the CPU 101 switches the virtual memory from the kernel PGD to the hibernation PGD. In step S710, the CPU 101 switches the stack. In step S711, the CPU 101 stops parallel reading by the DMAC 102. In step S712, the CPU 101 and the DMAC 102 restore the memory. I do.

ステップS709では、CPU101がページ変換テーブルの切り替えを行う。x86環境では、CPUレジスタCR3の値をカーネルPGDのアドレスからハイバネーションPGDのアドレスに書き換えることで、切り替えが完了する。この処理を行う理由は2点ある。1点目は、カーネルPGDはメモリ制限が反映されたマッピングであり、伸張先へアクセスするには不十分なためである。ハイバネーションPGDはメモリ制限前のマッピングであるため、このページ変換テーブルに切り替えることで全ての伸張先へアクセスすることができるようになる。2点目は、メモリ復帰処理時にカーネルPGDが書き変わるためである。前述の通り、ハイバネーションPGDはハイバネーション処理用領域に確保するため、メモリ復帰処理時に書き変わることはない。   In step S709, the CPU 101 switches the page conversion table. In the x86 environment, the switching is completed by rewriting the value of the CPU register CR3 from the address of the kernel PGD to the address of the hibernation PGD. There are two reasons for this process. The first point is that the kernel PGD is a mapping that reflects memory limitations and is insufficient for accessing the decompression destination. Since the hibernation PGD is a mapping before the memory limit, it is possible to access all the expansion destinations by switching to this page conversion table. The second point is that the kernel PGD is rewritten during the memory restoration process. As described above, the hibernation PGD is secured in the hibernation processing area, so that it is not rewritten during the memory restoration process.

図8は、本実施形態をx86環境に適用した場合の、ハイバネーション起動時の仮想メモリの一例を示した図である。800はCPUレジスタCR3であり、801はカーネルPGD、804はハイバネーションPGDである。802はメモリ制限されたカーネル管理領域のマッピング情報であり、805はメモリ制限されていないカーネル管理領域のマッピング情報、803及び806は作業領域マッピング情報である。作業領域マッピング情報803と作業領域マッピング情報806の情報は、それぞれ同一である。ステップS708以前におけるCPUレジスタCR3である800はカーネルPGD801を示し、ステップS709によりCPUレジスタCR3である800はハイバネーションPGD804を示すようになる。   FIG. 8 is a diagram showing an example of a virtual memory at the time of hibernation activation when the present embodiment is applied to an x86 environment. Reference numeral 800 denotes a CPU register CR3, reference numeral 801 denotes a kernel PGD, and reference numeral 804 denotes a hibernation PGD. Reference numeral 802 denotes memory management-limited mapping information of the kernel management area, reference numeral 805 denotes kernel management area mapping information that is not memory-limited, and reference numerals 803 and 806 denote work area mapping information. The work area mapping information 803 and the work area mapping information 806 are the same. The CPU register CR3 800 before step S708 indicates the kernel PGD 801, and the CPU register CR3 800 indicates the hibernation PGD 804 by step S709.

ステップS710では、CPU101がスタックの使用先を切り替える。これは、メモリ復帰処理時に従来のスタックの内容が書き換えられてしまうためである。また、切り替え先のスタックも上書きを防ぐ必要があるため、作業領域の末尾を指定する。なお、スタックの復帰はS1006で行う。   In step S710, the CPU 101 switches the stack usage destination. This is because the contents of the conventional stack are rewritten during the memory restoration process. In addition, since the stack at the switching destination needs to be prevented from being overwritten, the end of the work area is designated. Note that the stack is restored in S1006.

ステップS711では、CPU101はDMAC102が停止するまで待機を行う。ただし、既にDMAC102による並行読み込み処理が完了している場合は、CPU101は待機しない。   In step S711, the CPU 101 stands by until the DMAC 102 stops. However, if the parallel reading process by the DMAC 102 has already been completed, the CPU 101 does not wait.

ステップS712では、圧縮データの伸張と並行して、DMAC102がハイバネーションイメージを読み込む。伸張処理は、ブートコア及びスレーブコアによって、ページごとに行う。並行読み込みは、割り込みではなく、ブートコアのポーリングによって実現する。ブートコアが、各ページを伸張するループ処理の中でDMAC102の完了を逐次チェックし、DMAC102に新たなデータ転送パラメータを指定する。この処理は、ブートコアではなくスレーブコアで行ってもよい。ステップS712では、カーネル処理は行われない為、カーネル管理領域及びカーネル管理外領域の両方のデータを書き換えることができる。以上の処理を、全ての圧縮データの伸張と全ての非圧縮データの読み込みの両方が完了するまで繰り返す。   In step S712, the DMAC 102 reads the hibernation image in parallel with the decompression of the compressed data. The decompression process is performed for each page by the boot core and the slave core. Parallel reads are realized by polling the boot core, not by interrupts. The boot core sequentially checks the completion of the DMAC 102 in a loop process for expanding each page, and designates a new data transfer parameter for the DMAC 102. This processing may be performed by the slave core instead of the boot core. In step S712, since kernel processing is not performed, data in both the kernel management area and the non-kernel management area can be rewritten. The above processing is repeated until both decompression of all compressed data and reading of all uncompressed data are completed.

以上の処理により、メモリは、ハイバネーション処理用領域を除き、ステップS301直後と同様の状態へ復帰される。また、メモリを復帰した後は、CPU101の処理によって一般的なハイバネーション起動のようにCPUレジスタ値の復帰及び、各デバイス情報の復帰、割り込みの再開、プロセススケジューラの再開を行い、ハイバネーション起動を完了させる。   With the above processing, the memory is returned to the same state as that immediately after step S301 except for the hibernation processing area. After the memory is restored, the CPU register value is restored, each device information is restored, the interrupt is resumed, and the process scheduler is resumed by the processing of the CPU 101 to complete the hibernation activation. .

以上のように本実施形態では、ハイバネーションイメージを利用してシステムを再び起動する際に、カーネル初期化と並行してハイバネーションイメージの読み込み、さらにカーネル初期化と並行して圧縮されたハイバネーションイメージを伸張し、カーネル初期化後の伸張と並行して非圧縮データを読み込むことにより、従来の方法と比べて高速にシステムを復元することができる。   As described above, in this embodiment, when the system is restarted using the hibernation image, the hibernation image is read in parallel with the kernel initialization and the compressed hibernation image is expanded in parallel with the kernel initialization. In addition, by reading uncompressed data in parallel with the decompression after the kernel initialization, the system can be restored at a higher speed than the conventional method.

なお、初期化時データ読み込み部(第1読み込み部)209と初期化後データ読み込み部(第2読み込み部)211とは一体的な構成であってもよい、その場合はDMACとして一体的に構成することが好ましい。   Note that the initialization data reading unit (first reading unit) 209 and the post-initialization data reading unit (second reading unit) 211 may be integrated, in which case the DMAC is configured integrally. It is preferable to do.

また、本発明は、以下の処理を実行することによっても実現される。即ち、上述した実施形態の機能を実現するソフトウェア(プログラム)を、ネットワーク又は各種記憶媒体を介してシステム或いは装置に供給し、そのシステム或いは装置のコンピュータ(またはCPUやMPU等)が、コンピュータが読み取り可能なプログラムを読み出して実行する処理である。
The present invention can also be realized by executing the following processing. That is, software (program) that realizes the functions of the above-described embodiments is supplied to a system or apparatus via a network or various storage media, and the computer (or CPU, MPU, etc.) of the system or apparatus reads the computer. This is a process of reading and executing a possible program.

Claims (14)

揮発性メモリと、
前記揮発性メモリに保持されている少なくとも一部のデータを圧縮データに圧縮する圧縮手段と、
前記圧縮手段で圧縮を行わなかった非圧縮データと前記圧縮データとをハイバネーションイメージとして保持する不揮発性メモリと、
前記揮発性メモリの一部を利用して行われるカーネルの初期化と並行して、前記不揮発性メモリに保持されている前記圧縮データを、前記揮発性メモリの、前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に未使用だった未使用領域へ読み込む初期化時データ読み込み手段と、
前記カーネルの初期化と並行して、前記揮発性メモリに読み込んだ圧縮データを、前記揮発性メモリの、前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に圧縮前のデータが存在していた領域に伸張する初期化時データ伸張手段と、
前記初期化時データ伸張手段により伸張したデータを利用してシステムを起動させる起
動手段とを有することを特徴とする情報処理装置。
Volatile memory,
Compression means for compressing at least a portion of data held in the volatile memory into compressed data;
A non-volatile memory that holds uncompressed data that has not been compressed by the compression means and the compressed data as a hibernation image;
In parallel with the initialization of the kernel performed using a part of the volatile memory, the compressed data stored in the nonvolatile memory is not used for the initialization of the kernel of the volatile memory. Initialization data reading means for reading into an unused area that was unused when the hibernation image was generated in the area ;
In parallel with the initialization of the kernel, there is pre-compression data when the hibernation image is generated in an area of the volatile memory where the compressed data read into the volatile memory is not used for initialization of the kernel. Initializing data decompression means for decompressing to the area that was
An information processing apparatus comprising: an activation unit that activates the system using the data expanded by the initialization data expansion unit.
前記カーネルの初期化の後に前記揮発性メモリに読み込んだ圧縮データを伸張する初期化後データ伸張手段と、前記初期化後データ伸張手段と並行して、前記不揮発性メモリに保持されている前記非圧縮データを前記揮発性メモリに読み込む初期化後データ読み込み手段と、をさらに有し、前記起動手段は前記初期化後データ伸張手段により伸張したデータと前記初期化後データ読み込み手段によって前記揮発性メモリに読み込んだ非圧縮データとに基づいてシステムを起動させることを特徴とする請求項1に記載の情報処理装置。   A post-initialization data decompression unit that decompresses compressed data read into the volatile memory after the kernel initialization, and the non-initialization data decompression unit held in the nonvolatile memory in parallel with the post-initialization data decompression unit And a post-initialization data reading means for reading compressed data into the volatile memory, and the start-up means uses the data expanded by the post-initialization data expansion means and the volatile memory by the post-initialization data read means. The information processing apparatus according to claim 1, wherein the system is started based on the uncompressed data read into the system. 前記揮発性メモリに、前記カーネルの初期化に利用するカーネル管理領域と前記カーネルの初期化に利用しないカーネル管理外領域とを割り当てるメモリ管理手段をさらに有することを特徴とする請求項1に記載の情報処理装置。   2. The memory management unit according to claim 1, further comprising: a memory management unit that allocates a kernel management area used for initialization of the kernel and a non-kernel management area not used for initialization of the kernel to the volatile memory. Information processing device. 前記起動手段は、前記不揮発性メモリに前記ハイバネーションイメージが退避されていない場合は前記ハイバネーションイメージを使わない通常起動を行うことを特徴とする請求項1乃至3のいずれか1項に記載の情報処理装置。   4. The information processing according to claim 1, wherein the activation unit performs normal activation without using the hibernation image when the hibernation image is not saved in the nonvolatile memory. 5. apparatus. 前記不揮発性メモリに前記ハイバネーションイメージを退避させる退避手段をさらに有することを特徴とする請求項1乃至4のいずれか1項に記載の情報処理装置。   The information processing apparatus according to claim 1, further comprising a saving unit that saves the hibernation image in the nonvolatile memory. 前記退避手段は、ファイルシステムに依存しない型式のファイルのハイバネーションイメージを前記不揮発性メモリに退避することを特徴とする請求項5に記載の情報処理装置。   The information processing apparatus according to claim 5, wherein the saving unit saves a hibernation image of a file type independent of a file system in the nonvolatile memory. 前記圧縮手段は、前記揮発性メモリに保持されているデータを所定のサイズごとに圧縮し、圧縮率に応じて圧縮データとして保持するかどうかを判断することを特徴とする請求項1乃至6のいずれか1項に記載の情報処理装置。   The said compression means compresses the data currently hold | maintained in the said volatile memory for every predetermined size, and it is judged whether it hold | maintains as compressed data according to a compression rate. The information processing apparatus according to any one of claims. 前記メモリ管理手段は、前記カーネル管理領域のサイズを、前記カーネルの初期化に必要なサイズ以上とすることを特徴とする請求項3に記載の情報処理装置。   The information processing apparatus according to claim 3, wherein the memory management unit sets the size of the kernel management area to be equal to or larger than a size necessary for initialization of the kernel. 前記初期化時データ読み込み手段は、DMACを用いて前記不揮発性メモリに保持されている前記圧縮データを前記カーネル管理外領域へ読み込み、
前記不揮発性メモリに保持されている全ての前記圧縮データの読み込みが完了した場合は、前記非圧縮データを前記カーネル管理外領域へ読み込むことを特徴とする請求項に記載の情報処理装置。
The initialization data reading means reads the compressed data held in the nonvolatile memory using the DMAC into the non-kernel management area,
4. The information processing apparatus according to claim 3 , wherein when reading of all the compressed data held in the nonvolatile memory is completed, the non-compressed data is read into the non-kernel management area.
前記初期化時データ伸張手段は、前記カーネルの初期化で用いられていないスレーブコアを用い、前記揮発性メモリに読み込まれた前記圧縮データを前記カーネルの管理外の領域へ伸張することを特徴とする請求項1乃至9のいずれか1項に記載の情報処理装置。   The initialization data decompression means uses a slave core that is not used in the initialization of the kernel, and decompresses the compressed data read into the volatile memory to an area outside the management of the kernel. The information processing apparatus according to any one of claims 1 to 9. 前記初期化時データ伸張手段と前記初期化後データ伸張手段とは、伸張後のデータが未伸張の前記圧縮データを上書きしないよう前記揮発性メモリに伸張することを特徴とする請求項2に記載の情報処理装置。   3. The initialization data decompression unit and the post-initialization data decompression unit decompress the data after decompression into the volatile memory so as not to overwrite uncompressed compressed data. Information processing device. 前記初期化後データ読み込み手段は、DMACを用い、前記不揮発性メモリに保持されている前記非圧縮データを前記揮発性メモリへ読み込むことを特徴とする請求項2に記載の情報処理装置。   3. The information processing apparatus according to claim 2, wherein the post-initialization data reading means uses the DMAC to read the uncompressed data held in the nonvolatile memory into the volatile memory. 揮発性メモリと、圧縮データと非圧縮データとを含むハイバネーションイメージを保持する不揮発性メモリと、を備える情報処理装置の起動方法であって、
前記揮発性メモリに展開するカーネルの初期化と並行して、前記不揮発性メモリに保持されている前記圧縮データを前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に未使用だった未使用領域へ読み込み、読み込んだ圧縮データを前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に圧縮前のデータが存在していた領域へ伸張する1次伸張工程と、
前記カーネルの初期化の後に、前記不揮発性メモリに保持されている非圧縮データを前記揮発性メモリに読み込みつつ、前記1次伸張工程で未伸張の圧縮データを前記揮発性メモリに伸張する2次伸張工程と、
前記1次伸張工程と前記2次伸張工程で伸張したデータを利用してシステムを起動させる起動工程を有することを特徴とする起動方法。
An information processing apparatus activation method comprising: a volatile memory; and a non-volatile memory that holds a hibernation image including compressed data and non-compressed data.
In parallel with the initialization of the kernel to be expanded in the volatile memory, the compressed data held in the nonvolatile memory is not used when the hibernation image is generated in an area not used for initialization of the kernel. A primary expansion step of reading into a use area and expanding the read compressed data to an area where data before compression existed when the hibernation image was generated in an area not used for initialization of the kernel;
After the initialization of the kernel, secondary data that decompresses uncompressed compressed data in the primary decompression process to the volatile memory while reading uncompressed data held in the nonvolatile memory into the volatile memory. Stretching process;
An activation method comprising an activation step of activating a system using data expanded in the primary expansion step and the secondary expansion step.
揮発性メモリと、圧縮データと非圧縮データとを含むハイバネーションイメージを保持する不揮発性メモリと、を備えるコンピュータに、
前記揮発性メモリに展開するカーネルの初期化と並行して、前記不揮発性メモリに保持されている前記圧縮データを前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に未使用だった未使用領域へ読み込み、読み込んだ圧縮データを前記カーネルの初期化に利用しない領域中で前記ハイバネーションイメージ生成時に圧縮前のデータが存在していた領域へ伸張する1次伸張工程と、
前記カーネルの初期化の後に、前記不揮発性メモリに保持されている非圧縮データを前記揮発性メモリに読み込みつつ、前記1次伸張工程で未伸張の圧縮データを前記揮発性メモリに伸張する2次伸張工程と、
前記1次伸張工程と前記2次伸張工程で伸張したデータを利用してシステムを起動させる起動工程とを実行させることを特徴とするプログラム。
A computer comprising: a volatile memory; and a nonvolatile memory that holds a hibernation image including compressed data and non-compressed data.
In parallel with the initialization of the kernel to be expanded in the volatile memory, the compressed data held in the nonvolatile memory is not used when the hibernation image is generated in an area not used for initialization of the kernel. A primary expansion step of reading into a use area and expanding the read compressed data to an area where data before compression existed when the hibernation image was generated in an area not used for initialization of the kernel;
After the initialization of the kernel, secondary data that decompresses uncompressed compressed data in the primary decompression process to the volatile memory while reading uncompressed data held in the nonvolatile memory into the volatile memory. Stretching process;
A program for executing a startup process for starting a system using the data expanded in the primary expansion process and the secondary expansion process.
JP2012235481A 2012-10-25 2012-10-25 Information processing apparatus, activation method, and program Active JP6080490B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2012235481A JP6080490B2 (en) 2012-10-25 2012-10-25 Information processing apparatus, activation method, and program
US14/061,218 US9904559B2 (en) 2012-10-25 2013-10-23 Information processing apparatus and activation method therefor for processing data of a hibernation image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012235481A JP6080490B2 (en) 2012-10-25 2012-10-25 Information processing apparatus, activation method, and program

Publications (2)

Publication Number Publication Date
JP2014085907A JP2014085907A (en) 2014-05-12
JP6080490B2 true JP6080490B2 (en) 2017-02-15

Family

ID=50788899

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012235481A Active JP6080490B2 (en) 2012-10-25 2012-10-25 Information processing apparatus, activation method, and program

Country Status (1)

Country Link
JP (1) JP6080490B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6883037B2 (en) * 2001-03-21 2005-04-19 Microsoft Corporation Fast data decoder that operates with reduced output buffer bounds checking
JP2005258642A (en) * 2004-03-10 2005-09-22 Yamaha Corp Embedded information processor
US20110107020A1 (en) * 2009-10-30 2011-05-05 Duan Binghua Hibernation solution for embedded devices and systems
JP5683186B2 (en) * 2010-09-22 2015-03-11 キヤノン株式会社 Start-up acceleration method, information processing apparatus, and program
JP5783809B2 (en) * 2011-06-03 2015-09-24 キヤノン株式会社 Information processing apparatus, activation method, and program

Also Published As

Publication number Publication date
JP2014085907A (en) 2014-05-12

Similar Documents

Publication Publication Date Title
JP6399916B2 (en) Information processing apparatus and control method thereof
JP5783809B2 (en) Information processing apparatus, activation method, and program
KR101636870B1 (en) Method and apparatus for generating minimal boot image
KR101562973B1 (en) Memory apparatus and method for operating thereof
TWI436199B (en) Method and controller for power management
JP5860543B2 (en) Boot data loading
CN110704161B (en) Virtual machine creation method and device and computer equipment
JP2011175632A (en) Semiconductor storage device, and method for controlling the same
JP5683186B2 (en) Start-up acceleration method, information processing apparatus, and program
JP2006268377A (en) Program start-up controller and program start-up control method
WO2014100954A1 (en) Method and system for data controlling
US9934100B2 (en) Method of controlling memory swap operation and data processing system using same
KR20180044095A (en) Electronic systems and methods of operating thereof
US9904559B2 (en) Information processing apparatus and activation method therefor for processing data of a hibernation image
JP6080492B2 (en) Information processing apparatus, activation method, and program
KR100994723B1 (en) selective suspend resume method of reducing initial driving time in system, and computer readable medium thereof
WO2018057039A1 (en) Update memory management information to boot an electronic device from a reduced power mode
JP6080490B2 (en) Information processing apparatus, activation method, and program
JP2005258642A (en) Embedded information processor
JP2009258925A (en) Computer system and memory management method of computer system
JP6080491B2 (en) Information processing apparatus, activation method, and program
JP2011175666A (en) Semiconductor storage device, and method for controlling the same
JP2004078604A (en) Information processing method and program for executing the same method and recording medium
KR101888781B1 (en) Persistent dynamic random access memory storage using non-volatile ram and operating method therefof
JP2013246646A (en) Information processor and data reading method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151026

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160809

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161007

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170117

R151 Written notification of patent or utility model registration

Ref document number: 6080490

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151