JP2010170210A - Virtual machine management mechanism, virtual machine system having the same and paging processing method in the system - Google Patents

Virtual machine management mechanism, virtual machine system having the same and paging processing method in the system Download PDF

Info

Publication number
JP2010170210A
JP2010170210A JP2009010085A JP2009010085A JP2010170210A JP 2010170210 A JP2010170210 A JP 2010170210A JP 2009010085 A JP2009010085 A JP 2009010085A JP 2009010085 A JP2009010085 A JP 2009010085A JP 2010170210 A JP2010170210 A JP 2010170210A
Authority
JP
Japan
Prior art keywords
page
guest
vmm
paging
virtual machine
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.)
Granted
Application number
JP2009010085A
Other languages
Japanese (ja)
Other versions
JP4769308B2 (en
Inventor
Satoshi Mizuno
聡 水野
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.)
Toshiba Corp
Toshiba Digital Solutions Corp
Original Assignee
Toshiba Corp
Toshiba Solutions Corp
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 Toshiba Corp, Toshiba Solutions Corp filed Critical Toshiba Corp
Priority to JP2009010085A priority Critical patent/JP4769308B2/en
Publication of JP2010170210A publication Critical patent/JP2010170210A/en
Application granted granted Critical
Publication of JP4769308B2 publication Critical patent/JP4769308B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To prevent that a guest OS is blocked even if a page fault occurs due to access from a guest OS to a page paged-out by a VMM (virtual machine manager/monitor). <P>SOLUTION: A VMM page-out memory management table 116 of this VMM 11 holds page-out management information related to the page paged-out by a VMM paging module 114 of the VMM 11. When the page fault occurs by the access of the guest OS to the paged-out page, the VMM paging module 114 decides, by the holding of the page-out management information related to the page in the table 116, that a factor of the page fault is the access to the page paged-out by the paging module 114, notifies the guest OS about the effect, and distributes a page fault trap to the guest OS. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、仮想的に計算機実行環境を提供する仮想計算機システムにおけるページフォルト処理に好適な、仮想計算機管理機構、同管理機構を有する仮想計算機システム及び同システムにおけるページング処理方法に関する。   The present invention relates to a virtual machine management mechanism suitable for page fault processing in a virtual machine system that virtually provides a computer execution environment, a virtual machine system having the management mechanism, and a paging processing method in the system.

古くから、メインフレームにおいてハードウェア(HW)による仮想計算機(Virtual Machine: VM)支援機構を使った仮想計算機システムが知られている。また、近年は、パーソナルコンピュータ(PC)に搭載されているプロセッサが同様のVM支援機構をHWでサポートしてきたこともあり、PCの世界でも計算機の仮想化技術が活用されるようになってきている。今後は個人用のPCや、PCを用いて実現されるサーバ(いわゆるPCサーバ)等においても、仮想計算機の技術が広く利用されることが予測される。   For a long time, a virtual machine system using a virtual machine (VM) support mechanism by hardware (HW) in a mainframe has been known. In recent years, a processor mounted on a personal computer (PC) has supported a similar VM support mechanism by HW, and computer virtualization technology has come to be used in the PC world. Yes. In the future, it is predicted that the technology of virtual machines will be widely used in personal PCs and servers (so-called PC servers) realized using PCs.

典型的な仮想計算機システムでは、計算機(実計算機)のハードウェア上に仮想計算機管理機構(virtual machine manager/monitor: VMM)が存在する。実計算機のハードウェアは、CPU(実CPU)、メモリ(実メモリ)、各種入出力装置(実入出力装置)等で構成されている。VMMは一般にソフトウェアモジュールを用いて構成される。VMMは、ハードウェアを直接管理し、それを仮想化して仮想計算機(仮想マシン)を構築する。仮想計算機は、仮想CPU、仮想入出力(I/O)装置等から構成される。つまりVMMは、仮想CPU、仮想I/O装置のイメージを作り、実CPUや実I/O装置、実メモリ等のHWリソースを時間的、領域的に仮想CPU、仮想I/O装置、仮想計算機のメモリとして割り当てる。このようにしてVMMは仮想計算機を構築する。仮想計算機にはゲストOSと呼ばれるオペレーティングシステム(OS)がロードされる。このゲストOSは、仮想CPUにより実行される。   In a typical virtual machine system, a virtual machine management mechanism (virtual machine manager / monitor: VMM) exists on the hardware of a computer (real machine). The hardware of the real computer is composed of a CPU (real CPU), a memory (real memory), various input / output devices (real input / output devices), and the like. The VMM is generally configured using software modules. The VMM directly manages hardware and virtualizes it to construct a virtual machine (virtual machine). The virtual machine is composed of a virtual CPU, a virtual input / output (I / O) device, and the like. In other words, the VMM creates an image of a virtual CPU and a virtual I / O device, and HW resources such as a real CPU, a real I / O device, and a real memory are temporally and regionally virtual CPUs, virtual I / O devices, and virtual computers. Allocate as memory. In this way, the VMM constructs a virtual machine. An operating system (OS) called a guest OS is loaded on the virtual machine. This guest OS is executed by a virtual CPU.

このような仮想計算機システムでは、目的に合わせて複数のゲストOSを稼動させることができる。これは、通常の計算機システム(非仮想計算機システム)にはない、仮想計算機システムの利点である。   In such a virtual machine system, a plurality of guest OSs can be operated in accordance with the purpose. This is an advantage of the virtual computer system that is not found in a normal computer system (non-virtual computer system).

ところで、一般にOSは十分な大きさ(記憶容量)の主メモリを必要とする。主メモリの記憶容量が少ないとページング処理が多発し処理効率(処理性能)が落ちる。仮想計算機システムにおいては、実計算機に搭載される主メモリを各ゲストOSで分け合って使う必要がある。このため、ゲストOSの数が多くなるほど各ゲストOSに割り当てられる記憶容量(の平均値)は少なくなる。そこで、例えば非特許文献1では、VMMによるオンデマンドページングと、共通のデータを有するページをゲストOS間で共有する技術とが提案されている。   By the way, the OS generally requires a sufficiently large (storage capacity) main memory. If the storage capacity of the main memory is small, paging processing occurs frequently, and processing efficiency (processing performance) decreases. In the virtual machine system, it is necessary to share the main memory installed in the real machine with each guest OS. For this reason, as the number of guest OSs increases, the storage capacity (average value) assigned to each guest OS decreases. Therefore, for example, Non-Patent Document 1 proposes on-demand paging by VMM and a technique for sharing a page having common data between guest OSes.

ここで例に取り上げる仮想計算機システムにおけるVMMも、ゲストOSに割り当てられたメモリ(メモリ領域、メモリ空間)に対してデマンドページング処理を行うものとする。VMMのメモリマネージャは、ページアウトしてもペナルティが少ないページを、適切なアルゴリズムによってページアウト対象として選択し、ページアウト処理を行う。適切なアルゴリズムには、通常はLRU(Least Recently Used)アルゴリズムが用いられることが多い。このアルゴリズムによれば、最近の使用頻度が少ないページがページアウト対象として選択される。ページアウト対象のページ(メモリページ)は、CPUに内蔵されているメモリ管理ユニット(MMU)の管理テーブル上でVMMによって「無効」として登録され、当該ページ(内のデータ)が外部記憶装置に書き出される。このページの書き出し(つまりページアウト)が終わり次第、そのページは他の目的で使用される。   The VMM in the virtual machine system taken as an example here also performs demand paging processing on the memory (memory area, memory space) allocated to the guest OS. The memory manager of the VMM selects a page with a small penalty even if it is paged out as a page-out target by an appropriate algorithm, and performs a page-out process. Usually, an LRU (Least Recently Used) algorithm is often used as an appropriate algorithm. According to this algorithm, a page with a low recent use frequency is selected as a page-out target. The page to be paged out (memory page) is registered as “invalid” by the VMM on the management table of the memory management unit (MMU) built in the CPU, and the page (internal data) is written to the external storage device. It is. As soon as this page is written (ie, paged out), it is used for other purposes.

その後、ゲストOSがページアウトされているページにアクセスすると、当該ページはMMUの管理テーブル上で「無効」として登録されているので、当該MMUによってページフォルトトラップが発生される。するとVMMに制御が渡り、VMMは、ページフォルトトラップが発生したページを対象とするページインの処理を行う。このページにアクセスしようとしたゲストOSは通常「ブロック状態」となり動作することができず、VMMによるページイン処理が終わるまで当該VMMによって実行を待たされる。   Thereafter, when the guest OS accesses a page that has been paged out, the page is registered as “invalid” in the management table of the MMU, and therefore a page fault trap is generated by the MMU. Then, control is passed to the VMM, and the VMM performs page-in processing for the page where the page fault trap has occurred. The guest OS trying to access this page is normally in a “blocked state” and cannot operate, and the VMM waits for execution until the page-in processing by the VMM is completed.

このように、VMMによってゲストOSのメモリ領域にデマンドページングを実施することにより、実メモリよりも見かけ上多くのメモリを各ゲストOSが使用できるようになる。しかしながら、VMMによるデマンドページングでは、以下に述べるような不具合が発生する可能性がある。   Thus, by performing demand paging on the memory area of the guest OS by the VMM, each guest OS can use an apparently larger amount of memory than the real memory. However, the demand paging by VMM may cause the following problems.

まず、VMMによるデマンドページングを説明する前に、通常の計算機システムにおける典型的なOSのページング処理について説明する。典型的なOSは、当該OSのカーネル内のメモリ領域(カーネル領域、カーネル空間)を対象とするデマンドページング処理を行わないことが多い。一方、OS上で実行されるユーザプロセスに割り当てられるメモリの管理には仮想記憶方式が採用されおり、当該メモリはカーネルによるデマンドページング処理の対象されることが多い。   First, before explaining demand paging by VMM, typical OS paging processing in a normal computer system will be explained. A typical OS often does not perform demand paging processing for a memory area (kernel area, kernel space) in the kernel of the OS. On the other hand, a virtual storage system is adopted for managing the memory allocated to the user process executed on the OS, and the memory is often subjected to demand paging processing by the kernel.

このようなOSにおいては、ユーザプロセスのメモリ空間(仮想アドレス空間)の全てに実メモリ内のページ(実ページ)が割り当てられているとは限らない。このため、アクセス頻度が低い仮想アドレス空間内のページ(仮想ページ)はページアウトの対象となり、カーネルにより外部記憶装置にページ(内のデータ)が書き出された(データの退避)後、そのページは開放されて他の用途に使用される。ユーザプロセスが再びそのページ(を指定する仮想アドレス)にアクセスすると、そのページには実ページが割り当てられていない(つまりMMUに無効なページとして登録されている)のでページフォルトトラップが発生する。   In such an OS, a page (real page) in the real memory is not always allocated to the entire memory space (virtual address space) of the user process. For this reason, a page (virtual page) in the virtual address space with low access frequency is subject to page-out, and after the page (internal data) is written to the external storage device by the kernel (data is saved), the page is deleted. Is opened and used for other purposes. When the user process accesses the page again (the virtual address that designates it), a page fault trap occurs because a real page is not assigned to the page (that is, it is registered as an invalid page in the MMU).

カーネル(OSのカーネル)は、ページフォルトトラップ発生を機にユーザプロセスからCPUを奪う。そしてカーネルは、当該カーネルによるページイン処理として、ページフォルトトラップが発生したページ(仮想アドレス空間内のページ)への新たな実ページの割り当てと、そのページに対する外部記憶装置からの退避データの読み込みとを行う。この処理にはI/O処理が伴い、比較的長い時間がかかる。このため、ページフォルトを起こしたユーザプロセスは、その処理の間ブロックされる(つまりページイン待ち状態として待機状態になる)。そこでカーネルは、他の実行可能なユーザプロセスを選択し、この選択されたユーザプロセスにCPUを割り当てる。その後、ページインのためのI/O処理が完了すると、I/O完了割り込みが発生する。   The kernel (OS kernel) takes the CPU from the user process when a page fault trap occurs. Then, as a page-in process by the kernel, the kernel allocates a new real page to the page (page in the virtual address space) in which the page fault trap has occurred, reads the saved data from the external storage device, and I do. This process involves I / O processing and takes a relatively long time. For this reason, the user process that has caused the page fault is blocked during the process (that is, the page enters a waiting state as a page-in waiting state). The kernel then selects another executable user process and assigns a CPU to the selected user process. Thereafter, when the I / O processing for page-in is completed, an I / O completion interrupt is generated.

I/O完了割り込みが発生すると、カーネルは、その割り込みを受けて処理を開始する。するとカーネルは、ページイン待ちでブロックされていたユーザプロセスを実行可能状態にして再スケジューリングする。その後、実行可能状態にされたユーザプロセスに、しかるべきタイミングでCPUが割り当てられる。これにより、CPUが割り当てられたユーザプロセスでは、ページフォルトを起こした状態から処理が再開される。   When an I / O completion interrupt occurs, the kernel receives the interrupt and starts processing. The kernel then reschedules the user process that was blocked waiting for page-in to an executable state. Thereafter, the CPU is assigned to the user process that has been made executable at an appropriate timing. Thereby, in the user process to which the CPU is assigned, the processing is resumed from the state where the page fault has occurred.

上述の典型的なOSの説明では、カーネル内のページフォルトは起こらないものとしている。しかし、例えばマイクロソフト社のWindows(登録商標)など、カーネル内でのページングを実現しているOSもある。このようなOSにおいても、ユーザプロセスの場合と同様に、ページフォルトを起こしたカーネル内のスレッド(処理の流れ)は一時的にページイン処理待ちとなってブロックされる。そして、ユーザプロセスの場合と同様に、カーネルにより、他の実行可能なカーネル内のスレッド(カーネルスレッド)にCPUが渡される。これにより、システム全体としてはCPUを使い続けることができる。   In the above description of the typical OS, a page fault in the kernel does not occur. However, there are OSs that realize paging in the kernel, such as Windows (registered trademark) of Microsoft Corporation. Even in such an OS, as in the case of the user process, the thread (processing flow) in the kernel that has caused the page fault is temporarily blocked waiting for page-in processing. As in the case of the user process, the CPU passes the CPU to a thread (kernel thread) in another executable kernel. As a result, the entire system can continue to use the CPU.

なお、ページングを行うカーネルを「ページャブルなカーネル」と呼ぶことがある。ページャブルなカーネルにおいても、全ての領域がページング可能であることは少ない。つまり、特定領域はページング管理の対象外であり、常にページを貼り付けておかなければいけない領域が存在していることが多い。このような特定領域として、例えばページフォルト処理をするためのメモリ領域等が知られている。   Note that a paging kernel may be referred to as a “pageable kernel”. Even in a pageable kernel, the entire area is rarely pageable. In other words, the specific area is not subject to paging management, and there are often areas where pages must always be pasted. As such a specific area, for example, a memory area for performing page fault processing is known.

OS(のカーネル)は、VMMと同様にメモリマネージャを有している。OSのメモリマネージャは、当該OS上で実行されるユーザプロセス(のメモリ空間)に割り当てられているページを必要に応じてページアウトする。このページアウトされているページにユーザプロセスがアクセスしようとすると、メモリフォールトトラップが発生する。すると、OSのメモリマネージャによりページインの処理が行われる。   The OS (the kernel) has a memory manager as in the VMM. The OS memory manager pages out pages allocated to a user process (memory space) executed on the OS as necessary. When a user process tries to access the page that has been paged out, a memory fault trap occurs. Then, page-in processing is performed by the OS memory manager.

トラップを起こしたユーザプロセス(より詳細には、トラップ発生の要因となった、ページアウトされているページにアクセスしたユーザプロセス)は、OS(のカーネル)によって「ページイン待ち状態(ブロック状態)」に設定される。そしてOSによって、他の実行可能なユーザプロセスが選択されて、その選択されたプロセスにCPUがディスパッチされる。ここでOSが、カーネル内のメモリ領域(カーネル空間)でのページングもサポートしているものとする。つまり、カーネル内でページング可能なメモリ領域があり、そのメモリ領域はページング対象になるものとする。このページング可能なメモリ領域内のページがページアウトされると、カーネル内で、このページアウトされたページにアクセスしようとしたカーネルスレッドは、やはりページフォルトラップを起こす。すると、ページフォルトラップを起こしたカーネルスレッドは、ページイン処理が完了するまでブロックされる。この場合、他の実行可能なカーネルスレッドが選択されて制御が切り替わることで、システム全体としては処理が進む。   The user process that caused the trap (more specifically, the user process that accessed the page that was paged out that caused the trap occurrence) is “waiting for page-in (block state)” by the OS (kernel). Set to Then, another executable user process is selected by the OS, and the CPU is dispatched to the selected process. Here, it is assumed that the OS also supports paging in a memory area (kernel space) in the kernel. In other words, it is assumed that there is a memory area that can be paged in the kernel, and that memory area becomes a page target. When a page in this pageable memory area is paged out, kernel threads that attempt to access the paged-out page in the kernel will also cause a page fault wrap. Then, the kernel thread that caused the page fault wrapping is blocked until the page-in process is completed. In this case, when another executable kernel thread is selected and the control is switched, the processing of the entire system proceeds.

このように、通常のOSにおいて、ユーザプロセスあるいはカーネルスレッドのいずれも、ページアウトに起因するページフォルトにより、そのプロセスあるいはカーネルスレッドはページインの処理に伴って一時的に実行がブロックされる。その一方、OS内の他の実行可能なユーザプロセスあるいはカーネルスレッドが実行されるためにCPUは継続して利用され続け、システム全体とすれば有効にCPUが使用される。つまり、ページフォルトの度に、OS内に実行できる処理が存在しなくなるということはない。   As described above, in a normal OS, a user process or a kernel thread is temporarily blocked from executing due to a page-in process due to a page fault caused by a page-out. On the other hand, the CPU continues to be used because other executable user processes or kernel threads in the OS are executed, and the CPU is effectively used for the entire system. That is, there is no possibility that there is no process that can be executed in the OS every time a page fault occurs.

次に、上述のようなOSがゲストOSとして仮想計算機上で実行される状態を想定する。ここではVMMがゲストOSのメモリ領域に対してデマンドページングを行うことにより、実メモリが有するよりも多くのページ(メモリページ)を仮想的な「ページ」としてゲストOSに割り当てるものとする。このとき、上述のような、通常のOS(カーネル)がその上で実行されるユーザプロセスに対して行うページング処理と同様の処理を、VMMがゲストOSに対して行うならば、効率が悪い。この点について、以下で説明する。   Next, it is assumed that the OS as described above is executed on the virtual machine as a guest OS. Here, the VMM performs demand paging on the memory area of the guest OS, so that more pages (memory pages) than the real memory has are allocated to the guest OS as virtual “pages”. At this time, if the VMM performs the same process as the paging process performed on the user process executed by the normal OS (kernel) on the guest OS, the efficiency is low. This point will be described below.

VMMは、各ゲストOSに割り当てられているページの中から、適切な戦略(メモリスケジューリングのポリシ)に基づいて使用頻度の低いページを選別してページアウトする。このページアウトされたページをゲストOSがアクセスすると、VMMのメモリ管理によってページフォルトが発生する。この場合、ページアウトされたページがVMMによってページインされるまで、当該ページにアクセスしたゲストOSはブロックされる。   The VMM screens out pages that are used infrequently from pages assigned to each guest OS based on an appropriate strategy (memory scheduling policy). When the guest OS accesses the page that has been paged out, a page fault occurs due to the memory management of the VMM. In this case, the guest OS accessing the page is blocked until the page-out page is paged in by the VMM.

つまり、ゲストOS自身によりページアウトされたページへのアクセスの場合には、上述の通り、当該ゲストOSが他の実行可能なユーザプロセスにCPUを割り当てることにより、ゲストOSとして継続して動作可能である。これに対して、VMMがページアウトしたページへのアクセスに起因するページフォルトでは、VMMは当該ページにアクセスしたゲストOS(つまりページフォルトを起こしたゲストOS)をブロックせざるを得ない。この結果、ページフォルトを起こしたゲストOSは継続して動作することができなくなる。   That is, in the case of accessing a page paged out by the guest OS itself, as described above, the guest OS can continuously operate as the guest OS by assigning the CPU to another executable user process. is there. On the other hand, in the case of a page fault caused by access to a page paged out by the VMM, the VMM must block the guest OS that accesses the page (that is, the guest OS that caused the page fault). As a result, the guest OS that has caused the page fault cannot continue to operate.

各ゲストOSのカーネルはVMMから割り当てられたたページを「(なくなることの無い)物理ページ」、つまり常に存在しCPUから常にアクセスできるページとして扱うのが一般的である。しかしながら、VMMによりページアウトされているページが存在すると、そのページにゲストOSがアクセスした瞬間にページフォルトが発生し、VMMによるページインの処理が発生する。すると、ページアウトされているページにアクセスしたゲストOS(第1のゲストOS)は、VMMによるページインの処理が完了するまで制御を奪われる。つまり、他の実行可能なゲストOS(第2のゲストOS)にCPUが割り当てられ、第1のゲストOSの実行は待たされる。   The kernel of each guest OS generally treats a page allocated from the VMM as a “(physical page that will never disappear)”, that is, a page that always exists and is always accessible from the CPU. However, if there is a page paged out by the VMM, a page fault occurs at the moment when the guest OS accesses the page, and a page-in process by the VMM occurs. Then, the guest OS (first guest OS) that has accessed the page that has been paged out is deprived of control until the page-in processing by the VMM is completed. That is, the CPU is allocated to another executable guest OS (second guest OS), and the execution of the first guest OS is awaited.

このような従来技術の不具合について以下に詳述する。
まず、仮想計算機システムが、計算機本体と外部記憶装置とから構成されるものとする。外部記憶装置は、VMM及び複数のゲストOSそれぞれのページング領域、つまりVMMページング領域及びゲストOS毎のゲストOSページング領域を含んでいる。
Such problems of the prior art will be described in detail below.
First, it is assumed that the virtual computer system is composed of a computer main body and an external storage device. The external storage device includes a paging area for each of the VMM and the plurality of guest OSs, that is, a VMM paging area and a guest OS paging area for each guest OS.

VMMは、内部にメモリマネージャを有している。VMMは、仮想計算機を構築する。この仮想計算機上で複数のゲストOSが実行される。複数のゲストOSには、VMMにより実メモリが割り当てられている。ここでは、複数のゲストOSに割り当てられた実メモリ内のページ(メモリページ)のうち、使用頻度の少ないページがページアウト処理の対象としてVMMによって選択される。   The VMM has a memory manager inside. The VMM constructs a virtual machine. A plurality of guest OSs are executed on this virtual machine. A plurality of guest OSs are allocated real memory by the VMM. Here, of the pages (memory pages) in the real memory allocated to a plurality of guest OSs, a page with a low usage frequency is selected by the VMM as a page-out process target.

[VMMによるページアウト処理]
ここで、VMMによるページアウト処理について説明する。VMMのメモリマネージャは常にシステム内の実メモリの使用状態を監視している。VMMのメモリマネージャは、システム内の実メモリの空き領域(空きページ)が逼迫してきたなら、各ゲストOSが使用する仮想アドレス空間内のページに割り当てられている実メモリ内のページの中から使用頻度の低いページを選択し、選択されたページをゲストOSから回収する。VMMのメモリマネージャは、回収されたページ内のデータを、外部記憶装置内のVMMページング領域に退避する。しかる後にVMMのメモリマネージャは、データが退避されたページを、当該ページを必要とするシステム内の他の処理(ページを必要としているゲストOS等)に割り当てる。
[Page-out processing by VMM]
Here, page-out processing by the VMM will be described. The VMM memory manager constantly monitors the usage of real memory in the system. The VMM memory manager uses a page in the real memory allocated to a page in the virtual address space used by each guest OS if the free area (empty page) of the real memory in the system becomes tight. A page with low frequency is selected, and the selected page is collected from the guest OS. The memory manager of the VMM saves the collected data in the page in the VMM paging area in the external storage device. Thereafter, the memory manager of the VMM allocates the page where the data has been saved to another process (such as a guest OS that requires the page) in the system that requires the page.

このように、ページアウトの対象となるページは、ゲストOSが使用する仮想アドレス空間内のページである。このページに元々格納されていたデータは、ページアウト処理の結果、VMMページング領域に保存される。ページアウト処理の際、VMMが有するVMMページアウトメモリ管理テーブルに、ページアウトの対象となったページの情報が記録される。この情報は、一般に、ページアウトの対象となったページを使用していたゲストOS(のID)、当該ページの仮想アドレス空間内のアドレス(仮想アドレス)、及び当該ページのデータが退避されたVMMページング領域内のアドレスを含む。   Thus, the page to be paged out is a page in the virtual address space used by the guest OS. The data originally stored in this page is saved in the VMM paging area as a result of the page-out process. During the page-out process, information on the page that is the page-out target is recorded in the VMM page-out memory management table of the VMM. This information generally includes the guest OS (ID) that used the page that was the page-out target, the address (virtual address) in the virtual address space of the page, and the VMM in which the data of the page was saved Contains the address in the paging area.

[VMMによるページイン処理]
次に、VMMによるページイン処理について説明する。VMMによってページアウトされたページにゲストOSがアクセスすると、CPUに内蔵されているMMUはページフォルトトラップを発生する。例えば、ゲストOS上で動作するユーザプロセスが、当該ゲストOSの使用するメモリ(仮想アドレス空間)内のある仮想アドレスで指定されるページにアクセスしようとすると、ページフォルトトラップが生じてVMMに制御が渡る。
[Page-in processing by VMM]
Next, page-in processing by the VMM will be described. When the guest OS accesses a page paged out by the VMM, the MMU built in the CPU generates a page fault trap. For example, when a user process operating on a guest OS tries to access a page specified by a certain virtual address in a memory (virtual address space) used by the guest OS, a page fault trap occurs and the VMM is controlled. Cross.

VMMのメモリマネージャは、VMMページアウトメモリ管理テーブルを参照して、ページフォルトの要因となったページ(VMMによってページアウトされたページ)へのアクセスを試みた(ユーザプロセスが動作する)ゲストOS(のID)と当該ページの仮想アドレス(ターゲットの仮想アドレス)とを含む情報を検索する。もし、この情報が検索できたならば、VMMのメモリマネージャは、ターゲットの仮想アドレスで指定されるページは、VMMによりページアウトされたと判断する。逆に、ページフォルト時にそのページの情報が検索できなかったならば、VMMのメモリマネージャは、そのページはVMMによりページアウトされているページではないと判断する。   The VMM memory manager refers to the VMM page-out memory management table, and attempts to access a page that has caused a page fault (a page paged out by the VMM) (a guest OS in which a user process operates) ( ID) and the virtual address (target virtual address) of the page. If this information can be retrieved, the memory manager of the VMM determines that the page specified by the target virtual address has been paged out by the VMM. On the other hand, if the page information cannot be retrieved at the time of a page fault, the memory manager of the VMM determines that the page is not a page that has been paged out by the VMM.

VMMのメモリマネージャは、ターゲットの仮想アドレスで指定されるページがVMMによりページアウトされたと判断した場合には「ページイン処理」を実行する。この「ページイン処理」において、ページフォルトの要因となったアクセスが試みられたページに実ページを割り当てる処理と、そのページに(ページング領域から)データを復帰する処理とが行われる。「ページイン処理」はI/O処理を伴い、完了するまで比較的長い時間を要する。   If the memory manager of the VMM determines that the page specified by the target virtual address has been paged out by the VMM, it executes “page-in processing”. In this “page-in process”, a process of assigning a real page to a page that has been attempted to be accessed causing a page fault and a process of returning data (from the paging area) to that page are performed. “Page-in processing” involves I / O processing and takes a relatively long time to complete.

そこで、VMMのメモリマネージャは、ページフォルトの要因となったページへのアクセスを試みたユーザプロセスが動作するゲストOSを「ページイン待ち状態(ブロック状態)」に設定する。するとVMMが有するゲストOS実行管理機構は、「ページイン待ち状態」に設定されたゲストOSからCPUを奪い、他の実行可能なゲストOSに当該CPUを割り当てる。   Therefore, the memory manager of the VMM sets the guest OS on which the user process that attempted to access the page that has caused the page fault is in “page-in wait state (block state)”. Then, the guest OS execution management mechanism of the VMM takes the CPU from the guest OS set in the “page-in wait state” and assigns the CPU to another executable guest OS.

その後、VMMのメモリマネージャによるページイン処理が完了すると、VMMが有するページイン完了時処理モジュールは、ページインされたページに関して、VMMページアウトメモリ管理テーブルから該当する登録情報を削除する。   Thereafter, when the page-in process by the memory manager of the VMM is completed, the page-in completion processing module of the VMM deletes corresponding registration information from the VMM page-out memory management table for the page-in page.

するとVMMのメモリマネージャは、ページインされたページを有するゲストOSを「ページイン待ち状態(ブロック状態)」から「実行可能状態」に変える。「実行可能状態」に変えられたゲストOSは、その後のVMMのゲストOS実行管理機構によるスケジューリングでCPUディスパッチの対象になり、ディスパッチャによってCPUが割り当てられた時点から動作を再開する。   Then, the memory manager of the VMM changes the guest OS having the page-in page from the “page-in wait state (block state)” to the “executable state”. The guest OS changed to the “executable state” becomes a target of CPU dispatch by scheduling by the guest OS execution management mechanism of the VMM thereafter, and resumes the operation from the time when the CPU is assigned by the dispatcher.

以上、ゲストOS上で動作するユーザプロセスが使用するメモリ領域に関するVMMによるページング処理について説明した。しかし、VMMによるページングの対象はユーザプロセスが使用するメモリ領域だけに限らない。例えば、ゲストOSのカーネルが使用するメモリ領域がページングの対象になる場合もある。   The paging process by the VMM related to the memory area used by the user process operating on the guest OS has been described above. However, the target of paging by the VMM is not limited to the memory area used by the user process. For example, the memory area used by the guest OS kernel may be the target of paging.

ここで、注意しなければならないことは、次の点である。
まず、通常の計算機システムにおける典型的なOSのページング処理を想定する。この典型的なOSのページング処理では、前述したように、OSによりページアウトされたページにユーザプロセスがアクセスしたためにページフォルトトラップが発生しても、他の実行可能なユーザプロセスに制御が切り替えられる。これにより、システムとしてはCPUを有効に使い続けることができる。
Here, it is necessary to pay attention to the following points.
First, a typical OS paging process in a normal computer system is assumed. In this typical OS paging process, as described above, even when a page fault trap occurs because a user process accesses a page paged out by the OS, control is switched to another executable user process. . As a result, the system can continue to use the CPU effectively.

しかしながら、仮想計算機システムでは、VMMによりページアウトされたページにゲストOS上で動作するユーザプロセス(またはカーネルスレッド)がアクセスしたためにページフォルトトラップが発生した場合、通常の計算機システムと異なって、そのゲストOS内の他の実行可能なユーザプロセス(またはカーネルスレッド)に制御を切り替えることができない。その理由は、次の通りである。   However, in the virtual computer system, when a page fault trap occurs because a user process (or kernel thread) operating on the guest OS accesses a page paged out by the VMM, the guest computer is different from the normal computer system. Control cannot be switched to another executable user process (or kernel thread) in the OS. The reason is as follows.

第1の理由は、VMMによりページングが管理されているため、ページフォルトトラップ発生をきっかけとする通常のゲストOS内のメモリマネージャによるページングの処理を行うことができない点にある。第2の理由は、ページアウトされたページのデータが退避されるページング領域はVMM内のメモリマネージャが管理しているため、ゲストOS内のメモリマネージャはVMMのページングに関与できない点にある。   The first reason is that since paging is managed by the VMM, paging processing cannot be performed by a memory manager in a normal guest OS triggered by occurrence of a page fault trap. The second reason is that the memory manager in the VMM manages the paging area where the page-out page data is saved, so that the memory manager in the guest OS cannot participate in the VMM paging.

このため、仮想計算機システムでは、ゲストOSを切り替えることでCPUを使い続けようとする。しかし、ページフォルトトラップを起こしたゲストOS内に実行可能なプロセス(またはスレッド)が存在しているならば、システムの効率は低下する。   For this reason, the virtual machine system tries to continue using the CPU by switching the guest OS. However, if there is an executable process (or thread) in the guest OS that has caused the page fault trap, the efficiency of the system is reduced.

一方、ゲストOS内でのページングによりページアウトされたページへのアクセスでページフォルトトラップが発生した場合には、通常の計算機システムにおけるのと同様のページング処理が行われる。この場合、CPUは、ページフォルトトラップを起こしたゲストOS内で実行可能な処理に割り当て直されて継続して使われる。ところが、VMMによりページアウトされたページへのアクセスでページフォルトトラップが発生した状況でCPUを使い続けるには、上述のように、ゲストOS自体を切り替えるしかない。   On the other hand, when a page fault trap occurs when accessing a page paged out by paging in the guest OS, the same paging processing as in a normal computer system is performed. In this case, the CPU is reassigned to a process that can be executed in the guest OS that has caused the page fault trap and is used continuously. However, in order to continue using the CPU in a situation where a page fault trap has occurred when accessing a page paged out by the VMM, the guest OS itself must be switched as described above.

これまでの説明から理解されるように、ゲストOSは、自身が管理するページに関して、自身が行うメモリ管理の一環としてデマンドページングを行っている。このため、たとえゲストOS上で実行されるプロセスからのページアウトされているページへのアクセスに起因してページフォルトが発生しても、当該ゲストOS内の他の実行可能なプロセスにスイッチすることができる。これにより、仮想計算機システム全体としてCPUを効率よく利用することができる。   As can be understood from the above description, the guest OS performs demand paging as a part of memory management performed by the guest OS regarding pages managed by the guest OS. Therefore, even if a page fault occurs due to access to a page that is paged out from a process executed on the guest OS, the process is switched to another executable process in the guest OS. Can do. Thereby, the CPU can be efficiently used as the entire virtual computer system.

しかし、ゲストOSが使用するメモリページのVMMによる管理に関しては、VMMがページアウトしたページに対してゲストOSがアクセスすることによってページフォルトが発生すると、他のゲストOSにスイッチするしかない。このため、せっかく、ゲストOS内で効率よくページング処理を行っていたとしても、VMMによるページング処理によりゲストOSがブロックされてしまう状況が発生し、効率が悪かった。   However, regarding the management by the VMM of the memory page used by the guest OS, when a page fault occurs when the guest OS accesses a page paged out by the VMM, there is no choice but to switch to another guest OS. For this reason, even if the paging process is efficiently performed in the guest OS, a situation in which the guest OS is blocked by the paging process by the VMM occurs and the efficiency is low.

そこで、上記非特許文献1は、バルーンと呼ばれる方法を提案している。この方法では、ゲストOS内で特別なアプリケーションプログラムが実行される。この特別なアプリケーションプログラムの実行により、ゲストOS内のメモリ使用状況を含むシステムの状態が監視されて、当該システムに悪影響を及ぼさない範囲内で、ゲストOSで使用可能ななるべく多くのページ(メモリ領域)が、当該ゲストOSによるページングの対象にされない状態で確保される。確保されたページのページアウトは、そのページをゲストOSからVMMにこっそり通知することにより、VMMによって行われる。   Therefore, Non-Patent Document 1 proposes a method called a balloon. In this method, a special application program is executed in the guest OS. By executing this special application program, the state of the system including the memory usage status in the guest OS is monitored, and as many pages (memory area) as can be used by the guest OS within a range that does not adversely affect the system. ) Is secured in a state where it is not subject to paging by the guest OS. The reserved page is paged out by the VMM by notifying the VMM of the page from the guest OS.

この確保されたページをゲストOS内で取り扱うプロセスはなく、且つカーネルもページングの対象にしないので、安全にVMMによるページング処理の対象にできる。つまり、ゲストOS内で何らかの処理(プロセスまたはスレッド)がページアウトされたページにアクセスしても、当該処理(プロセスまたはスレッド)を含むゲストOSがブロックされる事態は生じない。
"Memory Resource Management in VMware ESX Server", Carl A. Waldspurger, VMware, Inc., In Proc. Fifth Symposium on Operating Systems Design and Implementation (OSDI '02), Dec. 2002、[2007年9月30日検索]、インターネット<URL: http://www.waldspurger.org/carl/papers/esx-mem-osdi02.pdf>
There is no process that handles the reserved page in the guest OS, and the kernel is not targeted for paging, so that it can be safely targeted for paging by the VMM. That is, even if a certain process (process or thread) accesses a page that has been paged out within the guest OS, the guest OS including the process (process or thread) does not block.
"Memory Resource Management in VMware ESX Server", Carl A. Waldspurger, VMware, Inc., In Proc. Fifth Symposium on Operating Systems Design and Implementation (OSDI '02), Dec. 2002, [searched September 30, 2007] Internet <URL: http://www.waldspurger.org/carl/papers/esx-mem-osdi02.pdf>

上述した通り、仮想計算機上で動作するゲストOSが使用可能なメモリページに対するVMMによるページングでは、一般のOS、或いはゲストOS自身で行っているデマンドページングに比べると、ページアウトされているページへのアクセスに起因してページフォルトが発生した場合に、ページフォルトを起こしたゲストOSは継続して動作することができなくなるという問題があった。特に、VMMからはゲストOS内のプロセス管理やスレッド管理ができないため、ゲストOS単位でCPUの割り当てを変えるしかなく、ゲストOSにとって効率の悪い状況となっていた。   As described above, paging by VMM for a memory page that can be used by a guest OS operating on a virtual machine is performed on pages that are paged out compared to demand paging performed by a general OS or the guest OS itself. When a page fault occurs due to access, the guest OS that has caused the page fault cannot operate continuously. In particular, since process management and thread management in the guest OS cannot be performed from the VMM, there is no choice but to change the CPU allocation for each guest OS, which is inefficient for the guest OS.

一方、非特許文献1に記載された方法では、アプリケーションプログラムから指定されたページに関しては、そのページがVMMによってページアウトされて、そのページアウトされたページに、ゲストOS内のプロセスまたはスレッドがアクセスしても、当該プロセスまたはスレッド(を含むゲストOS)がブロックされるのを防止できる。   On the other hand, in the method described in Non-Patent Document 1, for a page specified by an application program, the page is paged out by the VMM, and a process or thread in the guest OS accesses the page-out page. Even so, the process or thread (including the guest OS) can be prevented from being blocked.

しかし、非特許文献1に記載された方法では、アプリケーションプログラムから指定されたページのみしか効率よくVMMがページアウトすることができない。また、アプリケーションプログラムによってゲストOS内のメモリ使用状況を正確に把握することには限界があり、精度の良いページングは難しい。要するに、非特許文献1に記載された方法は、柔軟性に乏しい。   However, according to the method described in Non-Patent Document 1, the VMM can efficiently page out only the page specified by the application program. In addition, there is a limit to accurately grasping the memory usage status in the guest OS by the application program, and accurate paging is difficult. In short, the method described in Non-Patent Document 1 is poor in flexibility.

本発明は上記事情を考慮してなされたものでその目的は、仮想計算機管理機構によるページングを実現しながら、当該仮想計算機管理機構によってページアウトされたページへのゲストOSからのアクセスに起因してページフォルトが発生しても、当該ゲストOSがブロックされるのを防止できる、仮想計算機管理機構、同管理機構を有する仮想計算機システム及び同システムにおけるページング処理方法を提供することにある。   The present invention has been made in view of the above circumstances, and its purpose is to realize paging by the virtual machine management mechanism and to access from the guest OS to a page paged out by the virtual machine management mechanism. To provide a virtual machine management mechanism, a virtual machine system having the management mechanism, and a paging processing method in the system, which can prevent the guest OS from being blocked even if a page fault occurs.

本発明の1つの観点によれば、CPUを含むハードウェアを仮想化することによって複数の仮想計算機を構築し、当該複数の仮想計算機で複数のゲストOSを実行させるための管理を行う仮想計算機管理機構が提供される。前記仮想計算機管理機構は、前記複数のゲストOSに割り当てられたメモリ領域に対してページを単位にページアウト処理を含むデマンドページング処理を行うページング手段と、前記ページング手段によってページアウトされたページに関するページアウト管理情報を保持するページアウト管理情報保持手段とを具備する。前記ページング手段は、ページアウトされたページに対してゲストOSがアクセスしたことによりページフォルトが発生した際に、当該ページフォルトが発生したページに関するページアウト管理情報が前記ページアウト管理情報保持手段に保持されていることをもって、当該ページフォルトの要因が前記ページング手段によってページアウトされたページへのアクセスにあると判定して、その旨を当該ページフォルトが発生したページにアクセスした前記ゲストOSに通知すると共に当該ゲストOSにページフォルトトラップを配信し、且つ当該ページアウトされたページにデータを復帰するためのページイン処理を実行する。   According to one aspect of the present invention, virtual computer management is performed by constructing a plurality of virtual computers by virtualizing hardware including a CPU and performing execution of a plurality of guest OSes on the plurality of virtual computers. A mechanism is provided. The virtual machine management mechanism includes a paging unit that performs a demand paging process including a page-out process on a page basis for a memory area allocated to the plurality of guest OSes, and a page related to a page paged out by the paging unit. Page out management information holding means for holding out management information. When a page fault occurs due to a guest OS accessing a page that has been paged out, the paging means holds page-out management information related to the page where the page fault has occurred in the page-out management information holding means. Therefore, it is determined that the cause of the page fault is an access to the page paged out by the paging means, and that is notified to the guest OS that has accessed the page where the page fault has occurred. At the same time, a page fault trap is delivered to the guest OS, and a page-in process for returning data to the page-out page is executed.

本発明によれば、ゲストOSが起こしたページフォルトの要因が、VMMのページング手段)によってページアウトされたページへのアクセスにあることが、当該VMMのページング手段から当該ゲストOSに通知される構成とすることにより、従来技術では当該ゲストOSの実行をブロックするしかなかったページフォルト(つまりVMMによってページアウトされたページへのアクセスに起因して当該ゲストOSが起こしたページフォルト)に関して、VMMのページング手段からの上記通知を受けたゲストOSが、ページフォルトを起こした処理をVMMのページング手段によるページイン処理の完了待ちの状態に設定することが可能となり、当該ゲストOS自体がブロックされるのを防止することができる。これにより、ページフォルトを起こした処理を実行していたゲストOSにおいて、他の処理(つまり他のユーザプロセスまたはカーネル内スレッド)の実行に切り替えて当該ゲストOS自体は動作を継続することができ、VMMによるページングを実現しながら、効率のよいゲストOS内スケジューリングを可能とする。   According to the present invention, the guest OS is notified from the VMM paging means that the cause of the page fault caused by the guest OS is access to a page paged out by the VMM paging means). Thus, with respect to a page fault (that is, a page fault caused by the guest OS due to access to a page paged out by the VMM) that could only block the execution of the guest OS in the prior art, the VMM The guest OS that has received the notification from the paging means can set the process causing the page fault to a state waiting for the completion of the page-in process by the paging means of the VMM, and the guest OS itself is blocked. Can be prevented. As a result, in the guest OS that was executing the process that caused the page fault, the guest OS itself can continue to operate by switching to the execution of another process (that is, another user process or a thread in the kernel) Efficient scheduling within the guest OS is possible while realizing paging by VMM.

以下、本発明の実施の形態につき図面を参照して説明する。
図1は本発明の一実施形態に係る仮想計算機システムの構成を示すブロック図である。図1に示される仮想計算機システムは、計算機本体10と外部記憶装置20とから構成される。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a virtual machine system according to an embodiment of the present invention. The virtual computer system shown in FIG. 1 includes a computer main body 10 and an external storage device 20.

計算機本体10は、例えば、PC(パーソナルコンピュータ)やPCサーバのような実計算機を用いて実現される。実計算機は、CPU(実CPU)、メモリ(実メモリ)、各種I/O装置(実I/O装置)等で構成されるハードウェア(HW)を有している。図1では、このHWは省略されている。   The computer main body 10 is realized by using a real computer such as a PC (personal computer) or a PC server. The real computer has hardware (HW) including a CPU (real CPU), a memory (real memory), various I / O devices (real I / O devices), and the like. In FIG. 1, this HW is omitted.

計算機本体10は、仮想計算機管理機構(virtual machine manager/monitor:VMM)11を含む。VMM11は、周知のように、計算機本体10が有するHWを構成するHWリソース(CPUを含むHWリソース)を管理する。VMM11は、このHWリソースの管理によって、当該HWリソースを、時間的、領域的に割り当てる(配分する)ことにより、例えばn台の仮想計算機(仮想マシン)12-1〜12-nを構築する。仮想計算機12-1〜12-nは、VMM11上で動作する。図1では、仮想計算機12-1〜12-nを構成する、仮想CPU等は省略されている。   The computer main body 10 includes a virtual machine manager / monitor (VMM) 11. As is well known, the VMM 11 manages the HW resources (HW resources including the CPU) constituting the HW included in the computer main body 10. The VMM 11 constructs, for example, n virtual computers (virtual machines) 12-1 to 12-n by allocating (distributing) the HW resources in terms of time and area by managing the HW resources. The virtual machines 12-1 to 12-n operate on the VMM 11. In FIG. 1, virtual CPUs and the like constituting the virtual machines 12-1 to 12-n are omitted.

仮想計算機12-1〜12-n上では、それぞれゲストOS13-1(#1)〜13-n(#n)が動作する。本実施形態においてゲストOS13-1〜13-nは、いわゆる「パラ・バーチャライゼーション」と呼ばれるゲストOS実装(実行)方式を適用することを前提としている。すなわち、ゲストOS13-1〜13-nは初めからVMM11上で動作することを前提とした実装がなされている。   On the virtual machines 12-1 to 12-n, guest OSs 13-1 (# 1) to 13-n (#n) operate, respectively. In the present embodiment, it is assumed that the guest OSs 13-1 to 13-n apply a guest OS mounting (execution) method called “para-virtualization”. That is, the guest OSs 13-1 to 13-n are mounted on the assumption that they operate on the VMM 11 from the beginning.

なお、「パラ・バーチャライゼーション」に対して「フル・バーチャライゼーション」と呼ばれるゲストOSの実装方式も知られている。「フル・バーチャライゼーション」では、通常の実計算機(物理計算機)で実行されるOSと同じ構造のOSを仮想計算機上でゲストOSとして動作させることを前提としている。つまり、フル・バーチャライゼーション」は、カーネルを特別にゲストOS向けに修正(VMM上でゲストOSが動くことを前提にゲストOSそのものを修正)しないという方針の実装方式である。   A guest OS implementation method called “full virtualization” with respect to “para-virtualization” is also known. In “full virtualization”, it is assumed that an OS having the same structure as an OS executed on a normal real computer (physical computer) is operated as a guest OS on the virtual computer. In other words, “full virtualization” is an implementation method in which the kernel is not modified specifically for the guest OS (the guest OS itself is modified on the assumption that the guest OS runs on the VMM).

フル・バーチャライゼーションでは、通常の実計算機で動いているOSが、何の修正もなくそのままゲストOSとして仮想計算機上で動くことが可能である。このためフル・バーチャライゼーションの適用によって実装されるゲストOSは、移植性が高く使いやすい反面、VMMと密に連携できずに効率が悪い部分が多々ある。また、フル・バーチャライゼーションを実現するVMMを実装するためには、VMMが生成する仮想計算機は実計算機と全く同じ見せ方をする必要があるので、実装コストは一般的に大きい。   In full virtualization, an OS running on a normal real computer can run on a virtual computer as a guest OS without modification. For this reason, the guest OS mounted by applying full virtualization has high portability and is easy to use, but there are many inefficient portions because it cannot be closely linked with the VMM. Also, in order to implement a VMM that realizes full virtualization, the virtual machine generated by the VMM needs to look exactly the same as a real machine, so the implementation cost is generally high.

これに対し、パラ・バーチャライゼーションはゲストOSを修正する必要がある。しかし、パラ・バーチャライゼーションの適用によって実装されるゲストOSは、VMMと協調して動作し、互いに効率よく動作できる可能性がある。このため、最近パラ・バーチャライゼーションが注目されている。   In contrast, para-virtualization requires modification of the guest OS. However, there is a possibility that the guest OS implemented by applying para-virtualization operates in cooperation with the VMM and can operate efficiently with each other. For this reason, para-virtualization has recently attracted attention.

ゲストOS13-1〜13-n上では、それぞれ1つ以上のユーザプロセス14が動作可能であるものとする。ゲストOS13-1〜13-nは、それぞれ当該ゲストOS13-1〜13-nの中枢をなすカーネル(ゲストOSカーネル)15-1〜15-nを含む。   It is assumed that one or more user processes 14 can operate on the guest OSs 13-1 to 13-n. The guest OSs 13-1 to 13-n include kernels (guest OS kernels) 15-1 to 15-n that form the center of the guest OSs 13-1 to 13-n, respectively.

ゲストOSカーネル15-1〜15-nは、それぞれ当該ゲストOSカーネル15-1〜15-n(内で動作するカーネルスレッド)によってアクセス可能なメモリ領域(カーネル内メモリ領域)16-1〜16-nを含む。   The guest OS kernels 15-1 to 15-n are memory areas (in-kernel memory areas) 16-1 to 16- accessible by the guest OS kernels 15-1 to 15-n (kernel threads operating therein), respectively. Contains n.

カーネル内メモリ領域16-1は、ゲストOSカーネル15-1内の後述するメモリマネージャ17によるページングの対象となる1つ以上の仮想アドレス領域を含むものとする。ゲストOS13-1上で動作するユーザプロセス14が使用するページもゲストOSカーネル15-1内のメモリマネージャ17によるページングの対象となる。一方、カーネル内メモリ領域16-1〜16-nのうち、カーネル内メモリ領域16-1以外のカーネル内メモリ領域も、メモリマネージャ17と同様のメモリマネージャによるページングの対象となる1つ以上の仮想アドレス領域を含むものとする。また、ゲストOS13-1〜13-nのうち、ゲストOS13-1以外のゲストOS上で動作するユーザプロセス14が使用するページも、そのゲストOSのゲストOSカーネル内のメモリマネージャによるページングの対象となる。   The in-kernel memory area 16-1 includes one or more virtual address areas to be paged by a memory manager 17 (to be described later) in the guest OS kernel 15-1. Pages used by the user process 14 operating on the guest OS 13-1 are also subject to paging by the memory manager 17 in the guest OS kernel 15-1. On the other hand, among the in-kernel memory areas 16-1 to 16-n, the in-kernel memory area other than the in-kernel memory area 16-1 is also one or more virtual objects to be paged by the memory manager similar to the memory manager 17. It shall include the address area. Of the guest OSs 13-1 to 13-n, pages used by the user process 14 operating on the guest OS other than the guest OS 13-1 are also subject to paging by the memory manager in the guest OS kernel of the guest OS. Become.

図1には、ゲストOS13-1〜13-n上で動作するユーザプロセス14によって使用(アクセス)されたページ及びゲストOSカーネル15-1〜15-nによって使用(アクセス)されたカーネル内メモリ領域16-1〜16-nのページのうち、VMM11によってページアウトされたページPVMM1〜PVMM8が示されている。また、図1には、上述のページのうち、ゲストOS13-1,13-nによってページアウトされたページPOS1〜POS6も示されている。 FIG. 1 shows pages used (accessed) by the user process 14 operating on the guest OSs 13-1 to 13-n and in-kernel memory areas used (accessed) by the guest OS kernels 15-1 to 15-n. Of the pages 16-1 to 16-n, pages P VMM 1 to P VMM 8 paged out by the VMM 11 are shown. FIG. 1 also shows pages P OS 1 to P OS 6 that are paged out by the guest OSs 13-1 and 13-n among the above-described pages.

ゲストOSカーネル15-1は、カーネル内メモリ領域16-1を管理するメモリマネージャ17を含む。メモリマネージャ17は、ページングモジュール171、ページイン完了時処理モジュール172及び図示せぬページアウトメモリ管理テーブルから構成される。これらページングモジュール171、ページイン完了時処理モジュール172及びページアウトメモリ管理テーブルは従来からよく知られているため、説明を省略する。   The guest OS kernel 15-1 includes a memory manager 17 that manages the in-kernel memory area 16-1. The memory manager 17 includes a paging module 171, a page-in completion processing module 172, and a page-out memory management table (not shown). Since the paging module 171, the page-in completion processing module 172, and the page-out memory management table are well known in the art, description thereof will be omitted.

VMM11は、ゲストOSインターフェイス機構111、ゲストOS実行管理機構112及びメモリマネージャ113を含む。   The VMM 11 includes a guest OS interface mechanism 111, a guest OS execution management mechanism 112, and a memory manager 113.

ゲストOSインターフェイス機構111は、VMM11が提供する種々のサービスを利用するためのゲストOS13-1〜13-nからの要求を当該VMM11に通知するのに用いられる、いわゆるシステムコール機構である。ゲストOS13-1〜13-nは、ゲストOSインターフェイス機構111を使うことにより、VMM11に種々のサービスを要求することができる。これらの要求は、例えば、(1)メモリ割り当ての要求、(2)CPU割り当て量の増減の要求、(3)MMU操作の要求、(4)割り込みマスク操作の要求、(5)割り込みステータス取得の要求等が一般的である。   The guest OS interface mechanism 111 is a so-called system call mechanism that is used to notify the VMM 11 of requests from the guest OSs 13-1 to 13-n for using various services provided by the VMM 11. The guest OSs 13-1 to 13-n can request various services from the VMM 11 by using the guest OS interface mechanism 111. These requests include, for example, (1) memory allocation request, (2) CPU allocation increase / decrease request, (3) MMU operation request, (4) interrupt mask operation request, and (5) interrupt status acquisition. Requests are common.

本実施形態では、ゲストOS13-1〜13-nはパラ・バーチャライゼーションを前提としている。このため、ゲストOSインターフェイス機構111を使用することでVMM11が提供する種々のサービスを要求するための機能を、ゲストOS13-1〜13-nに持たせることができる。つまりゲストOS13-1〜13-nのカーネル(ゲストOSカーネル)15-1〜15-nは、VMM11によって管理されるHWリソースの操作を、ゲストOSインターフェイス機構111を用いてVMM11に要求するように構成されている。これに対し、実計算機(物理計算機)上で動作するOSは、直接HWリソースにアクセスして操作するのが一般的である。   In the present embodiment, the guest OSs 13-1 to 13-n are premised on para-virtualization. Therefore, by using the guest OS interface mechanism 111, the guest OSs 13-1 to 13-n can be provided with a function for requesting various services provided by the VMM 11. In other words, the guest OS 13-1 to 13-n kernel (guest OS kernel) 15-1 to 15-n requests the VMM 11 to operate the HW resource managed by the VMM 11 using the guest OS interface mechanism 111. It is configured. On the other hand, an OS operating on a real computer (physical computer) generally accesses and operates HW resources directly.

ゲストOS実行管理機構112は、VMM11が管理するゲストOS13-1〜13-nの各々にどの程度の時間の割合でCPUを割り当てるかを計算し決定するスケジューラとしての機能を有するモジュールである。つまりゲストOS実行管理機構112は、ゲストOS13-1〜13-nの実行スケジュールを計算し決定するためのスケジューリング処理を行う。   The guest OS execution management mechanism 112 is a module having a function as a scheduler that calculates and determines how much time the CPU is allocated to each of the guest OSs 13-1 to 13-n managed by the VMM 11. That is, the guest OS execution management mechanism 112 performs a scheduling process for calculating and determining the execution schedule of the guest OSs 13-1 to 13-n.

ゲストOS実行管理機構112はまた、ディスパッチャとしての機能をも有する。つまりゲストOS実行管理機構112は、当該ゲストOS実行管理機構112のスケジューリング処理によって決定されたスケジュールに従って、ゲストOS13-1〜13-nにCPUを割り当てるディスパッチ処理も行う。   The guest OS execution management mechanism 112 also has a function as a dispatcher. That is, the guest OS execution management mechanism 112 also performs dispatch processing for assigning CPUs to the guest OSs 13-1 to 13-n according to the schedule determined by the scheduling processing of the guest OS execution management mechanism 112.

メモリマネージャ113は、ゲストOS13-1上で実行されるユーザプロセス14が使用するページ及びカーネル内メモリ領域16-1内のページのVMM11によるページング処理を管理する。メモリマネージャ113は、VMMページングモジュール114、VMMページイン完了時処理モジュール115、VMMページアウトメモリ管理テーブル116及びVMMメモリ管理テーブル117から構成される。   The memory manager 113 manages paging processing by the VMM 11 for pages used by the user process 14 executed on the guest OS 13-1 and pages in the in-kernel memory area 16-1. The memory manager 113 includes a VMM paging module 114, a VMM page-in completion processing module 115, a VMM page-out memory management table 116, and a VMM memory management table 117.

VMMページングモジュール114は、ゲストOS13-1〜13-n上でそれぞれ実行されるユーザプロセス14が使用するページ及びカーネル内メモリ領域16-1〜16-n内のページを必要に応じて外部記憶装置20にページアウトするためのページアウト処理を行う。VMMページングモジュール114は、ページアウトされたページにゲストOS13-1〜13-nがアクセスしたためにページフォルトが発生した場合に、必要に応じて当該ゲストOS13-1〜13-nにページフォルトトラップを配信するトラップ配信モジュールを含む。VMMページングモジュール114はまた、ページフォルトの要因となったアクセス(ページアクセス)が試みられたページに実ページを割り当て、そのページに外部記憶装置20からデータを復帰するページイン処理を行う。   The VMM paging module 114 externally stores pages used by the user processes 14 executed on the guest OSes 13-1 to 13-n and pages in the in-kernel memory areas 16-1 to 16-n as necessary. A page-out process for page-out to 20 is performed. When a page fault occurs because the guest OS 13-1 to 13-n accesses a page that has been paged out, the VMM paging module 114 sends a page fault trap to the guest OS 13-1 to 13-n as necessary. Includes a trap delivery module to deliver. The VMM paging module 114 also performs a page-in process in which a real page is assigned to a page to which an access (page access) that has caused a page fault is attempted, and data is restored from the external storage device 20 to the page.

VMMページイン完了時処理モジュール115は、VMMページングモジュール114によるページイン処理(VMMページイン処理)が完了した際に動作して、当該VMMページイン処理の完了時の処理を行う。この処理においてVMMページイン完了時処理モジュール115は、VMMページイン処理の完了を、ページフォルトの要因(当該ページイン処理の要因)となったアクセス(ページアクセス)を試みたゲストOSに通知するための割り込み(VMMページイン完了通知割り込み)を発行する。   The VMM page-in completion processing module 115 operates when the page-in processing (VMM page-in processing) by the VMM paging module 114 is completed, and performs processing upon completion of the VMM page-in processing. In this process, the VMM page-in completion processing module 115 notifies the guest OS that attempted the access (page access) that caused the page fault (factor of the page-in process) of the completion of the VMM page-in process. Is issued (VMM page-in completion notification interrupt).

VMMページアウトメモリ管理テーブル116は、VMM11に割り当てられているメモリ(図示せず)に格納される。VMMページアウトメモリ管理テーブル116は、VMMページングモジュール114によるページアウトの対象となったページの情報(ページアウト管理情報)を保持する保持手段(ページアウト管理情報保持手段)として用いられる。このVMMページアウトメモリ管理テーブル116に保持(登録)されるページアウト管理情報は、ページアウトの対象となったページを使用していたゲストOSのID(ゲストOS ID)、当該ページの仮想アドレス空間内のアドレス(仮想アドレス)、及び当該ページのデータが退避された後述するVMMページング領域21内のアドレス(VMMページング領域アドレス)を含む。   The VMM page-out memory management table 116 is stored in a memory (not shown) assigned to the VMM 11. The VMM page-out memory management table 116 is used as a holding unit (page-out management information holding unit) that holds information (page-out management information) of a page that is a page-out target by the VMM paging module 114. The page-out management information held (registered) in the VMM page-out memory management table 116 includes the guest OS ID (guest OS ID) that used the page that is the page-out target, and the virtual address space of the page. Address (virtual address) and an address (VMM paging area address) in a VMM paging area 21 (to be described later) where the data of the page is saved.

図2は、VMMページアウトメモリ管理テーブル116のデータ構造例を示す。図2の例では、ページアウトの対象となったページのページアウト管理情報として、ゲストOS ID=2、仮想アドレス=0x80003000、VMMページング領域アドレス=0x4003802からなる情報が、VMMページアウトメモリ管理テーブル116に登録されていることが示されている。   FIG. 2 shows an example of the data structure of the VMM page-out memory management table 116. In the example of FIG. 2, as page-out management information of a page that is a page-out target, information including guest OS ID = 2, virtual address = 0x80003000, and VMM paging area address = 0x4400302 is the VMM page-out memory management table 116. Is registered.

VMMメモリ管理テーブル117は、VMMページアウトメモリ管理テーブル116と同様にVMM11に割り当てられているメモリに格納される。VMMメモリ管理テーブル117は、ゲストOS13-i(i=1〜n)のID(ゲストOS ID)と、当該ゲストOS13-iのゲストOSカーネル15-iがページャブル(ページャブルカーネル)であるか否かを示すフラグとを含む情報(サービス要求情報)を保持する保持手段(サービス要求情報保持手段)として用いられる。このサービス要求情報は、当該サービス要求情報中のフラグによってゲストOSカーネル15-iがページャブルことが示されている場合に、当該ゲストOSカーネル15-iのページング対象メモリ領域を示すメモリ領域情報を含む。   The VMM memory management table 117 is stored in the memory allocated to the VMM 11 as with the VMM page-out memory management table 116. The VMM memory management table 117 indicates whether the guest OS 13-i (i = 1 to n) ID (guest OS ID) and the guest OS kernel 15-i of the guest OS 13-i are pageable (pageable kernel). It is used as a holding means (service request information holding means) for holding information (service request information) including a flag indicating such. This service request information includes memory area information indicating a paging target memory area of the guest OS kernel 15-i when the flag in the service request information indicates that the guest OS kernel 15-i is pageable. .

ゲストOS13-iのゲストOSカーネル15-iがページャブルであるとは、当該ゲストOSカーネル15-i(を含むゲストOS13-i)が本来、カーネルモードにおいてページングをサポートしていることを意味する。つまりゲストOS13-iのゲストOSカーネル15-iは、ページャブルなメモリ領域でのページフォルトトラップ発生時に、カーネルスレッドをスイッチして(切り替えて)処理を継続できるカーネルである。   The guest OS kernel 15-i of the guest OS 13-i being pageable means that the guest OS kernel 15-i (including the guest OS 13-i) originally supports paging in the kernel mode. That is, the guest OS kernel 15-i of the guest OS 13-i is a kernel that can switch (switch) the kernel thread and continue processing when a page fault trap occurs in a pageable memory area.

図3は、VMMメモリ管理テーブル117のデータ構造例を示す。図3の例では、ページング対象メモリ領域を示すメモリ領域情報として、当該メモリ領域(仮想アドレス領域)の開始位置及び終了位置を示す情報、つまり開始仮想アドレス及び終了仮想アドレスの対が用いられる。   FIG. 3 shows an example of the data structure of the VMM memory management table 117. In the example of FIG. 3, information indicating the start position and end position of the memory area (virtual address area), that is, a pair of start virtual address and end virtual address is used as the memory area information indicating the paging target memory area.

外部記憶装置20は、VMMページング領域21と、ゲストOSページング領域22-1〜22-nを有する。VMMページング領域21は、VMM11内のVMMページングモジュール114によるページアウトの対象となったページのデータを退避するのに用いられる。図1の例では、VMMページング領域21に、ページPVMM1〜PVMM8のデータが退避されている。 The external storage device 20 has a VMM paging area 21 and guest OS paging areas 22-1 to 22-n. The VMM paging area 21 is used to save the data of the page that is a page-out target by the VMM paging module 114 in the VMM 11. In the example of FIG. 1, data of pages P VMM 1 to P VMM 8 is saved in the VMM paging area 21.

ゲストOSページング領域22-1〜22-nは、それぞれ、ゲストOSカーネル15-1〜15-n内のページングモジュールによるページアウトの対象となったページのデータを退避するのに用いられる。図1の例では、ゲストOSページング領域22-1にページPOS1〜POS4のデータが退避され、ゲストOSページング領域22-nにページPOS5,POS6のデータが退避されている。 The guest OS paging areas 22-1 to 22-n are used to save the data of pages that have been paged out by the paging modules in the guest OS kernels 15-1 to 15-n, respectively. In the example of FIG. 1, the guest OS paging area 22-1 on page P OS 1 to P OS 4 data is saved, the page P OS 5 to the guest OS paging area 22-n, data of P OS 6 is retracted Yes.

次に、本実施形態の動作について説明する。
まず、ゲストOS13-i(i=1〜n)内のゲストOSカーネル15-iは、
(1)ページャブルカーネルであるか否か
(2)ページャブルカーネルであるならば、ページャブルなメモリ領域
をVMM11に予め通知する。この通知によってゲストOSカーネル15-iは、VMM11に対して特定のサービスを要求する。この特定のサービスとは、VMM11内のVMMページングモジュール114がページアウトしたページに対してゲストOS13-iがアクセスしたことを要因としてページフォルトが発生した場合に、VMM11が、その旨を当該ゲストOS13-iに通知し、且つページフォルトトラップを当該ゲストOS13-iに配信するサービスを意味する。
Next, the operation of this embodiment will be described.
First, the guest OS kernel 15-i in the guest OS 13-i (i = 1 to n)
(1) Whether it is a pageable kernel (2) If it is a pageable kernel, the VMM 11 is notified in advance of a pageable memory area. With this notification, the guest OS kernel 15-i requests the VMM 11 for a specific service. This specific service means that when a page fault occurs due to the guest OS 13-i accessing a page paged out by the VMM paging module 114 in the VMM 11, the VMM 11 informs the guest OS 13 -i means a service for notifying i and delivering a page fault trap to the guest OS 13-i.

そのためVMM11内のゲストOSインターフェイス機構111は、ゲストOSカーネル15-iがページャブルカーネルであるか否かを当該ゲストOSカーネル15-iからVMM11に通知するのに用いられる第1のゲストOSインターフェイスを含む。この第1のゲストOSインターフェイスは、例えば
VMM_Interface_If_This_GuestOS_is_Pagable_Kernel(True or False);
のような、関数(インターフェイス関数)を用いて実現される。括弧内には引数が設定される。この引数に「True」または「False」を指定することで、該当するゲストOS13-i内のゲストOSカーネル15-iがページャブルカーネルであるか否かがVMM11に通知される。
Therefore, the guest OS interface mechanism 111 in the VMM 11 has a first guest OS interface used to notify the VMM 11 from the guest OS kernel 15-i whether or not the guest OS kernel 15-i is a pageable kernel. Including. The first guest OS interface is, for example,
VMM_Interface_If_This_GuestOS_is_Pagable_Kernel (True or False);
This is realized using a function (interface function). An argument is set in parentheses. By specifying “True” or “False” for this argument, the VMM 11 is notified whether or not the guest OS kernel 15-i in the corresponding guest OS 13-i is a pageable kernel.

またゲストOSインターフェイス機構111は、ゲストOS13-iのゲストOSカーネル15-iがページャブルカーネルである場合に、ページャブルなメモリ領域(仮想アドレス領域)を当該ゲストOSカーネル15-iからVMM11に通知するのに用いられる第2のゲストOSインターフェイスを含む。   In addition, when the guest OS kernel 15-i of the guest OS 13-i is a pageable kernel, the guest OS interface mechanism 111 notifies the VMM 11 of the pageable memory area (virtual address area) from the guest OS kernel 15-i. A second guest OS interface used for

第2のゲストOSインターフェイスは、例えば
VMM_Interface_Regstration_Pagable_Kernel_Area(StartAddress, EndAddress);
のような、関数(インターフェイス関数)を用いて実現される。括弧内には引数が設定される。この引数によりページャブルなメモリ領域の開始仮想アドレス(StartAddress)及び終了仮想アドレス(EndAddress)の対が指定される。もし、複数のページャブルな領域をVMM11に通知する必要があるときには、ゲストOS13-iのゲストOSカーネル15-iは、それぞれの領域毎に第2のゲストOSインターフェイスを用いる。
The second guest OS interface is, for example,
VMM_Interface_Regstration_Pagable_Kernel_Area (StartAddress, EndAddress);
This is realized using a function (interface function). An argument is set in parentheses. This argument specifies a pair of a start virtual address (StartAddress) and an end virtual address (EndAddress) of the pageable memory area. If it is necessary to notify the VMM 11 of a plurality of pageable areas, the guest OS kernel 15-i of the guest OS 13-i uses the second guest OS interface for each area.

ここで、ゲストOS13-iがゲストOS13-1(i=1)であり、当該ゲストOS13-1のゲストOSカーネル15-1が、ページャブルカーネルであるものとする。この場合、ゲストOS13-1のゲストOSカーネル15-1は、上述の第1のゲストOSインターフェイスを使って、当該ゲストOSカーネル15-1がページャブルカーネルであることを予めVMM11に通知しておく。本実施形態では、この第1のゲストOSインターフェイスを用いたゲストOS13-1からVMM11への通知により、VMM11のVMMページングモジュール114によってページアウトされたページに対してゲストOS13-1がアクセスしたことを要因としてページフォルトが発生した場合に、VMM11が、その旨を当該ゲストOS13-1に通知し、且つページフォルトトラップを当該ゲストOS13-1に配信する特定のサービスが、当該VMM11に要求される。   Here, it is assumed that the guest OS 13-i is the guest OS 13-1 (i = 1), and the guest OS kernel 15-1 of the guest OS 13-1 is a pageable kernel. In this case, the guest OS kernel 15-1 of the guest OS 13-1 notifies the VMM 11 in advance that the guest OS kernel 15-1 is a pageable kernel using the first guest OS interface described above. . In this embodiment, the guest OS 13-1 accesses the page paged out by the VMM paging module 114 of the VMM 11 by the notification from the guest OS 13-1 to the VMM 11 using the first guest OS interface. When a page fault occurs as a factor, the VMM 11 notifies the guest OS 13-1 to that effect, and a specific service for delivering a page fault trap to the guest OS 13-1 is requested from the VMM 11.

またゲストOSカーネル15-1は、上述の第2のゲストOSインターフェイスを使って、ページャブルなメモリ領域(仮想アドレス領域)を、当該領域の開始位置及び終了位置を示す情報(つまり開始仮想アドレス及び終了仮想アドレスの対)により予めVMM11に通知しておく。   In addition, the guest OS kernel 15-1 uses the second guest OS interface described above to convert the pageable memory area (virtual address area) into information indicating the start position and end position of the area (that is, the start virtual address and end address). The VMM 11 is notified in advance by a virtual address pair).

ゲストOS13-1のゲストOSカーネル15-1からの第1のインターフェイス、更には第2のゲストOSインターフェイスを用いた通知は、VMM11のゲストOSインターフェイス機構111で受け付けられる。   The notification using the first interface from the guest OS kernel 15-1 of the guest OS 13-1 and further using the second guest OS interface is received by the guest OS interface mechanism 111 of the VMM 11.

VMM11のメモリマネージャ113は、ゲストOS13-1のゲストOSカーネル15-1からの第1のインターフェイスを用いた通知に応じて、VMMメモリ管理テーブル117に、当該ゲストOS13-1のIDとページャブルカーネルであるか否かを示すフラグ(ここでは、ページャブルカーネルであることを示すフラグ)とを含むエントリ情報(サービス要求情報)を追加する。メモリマネージャ113はまた、ゲストOS13-1のゲストOSカーネル15-1からの第2のインターフェイスを用いた通知に応じて、VMMメモリ管理テーブル117内の当該ゲストOS13-1のIDを含むエントリ情報(サービス要求情報)に、通知されたページャブルなメモリ領域を示す情報(開始仮想アドレス及び終了仮想アドレスの対)を追加する。   In response to the notification using the first interface from the guest OS kernel 15-1 of the guest OS 13-1, the memory manager 113 of the VMM 11 stores the ID of the guest OS 13-1 and the pageable kernel in the VMM memory management table 117. Entry information (service request information) including a flag indicating whether or not (here, a flag indicating a pageable kernel) is added. In response to the notification using the second interface from the guest OS kernel 15-1 of the guest OS 13-1, the memory manager 113 also includes entry information including the ID of the guest OS 13-1 in the VMM memory management table 117 ( Information (a pair of start virtual address and end virtual address) indicating the notified pageable memory area is added to the service request information.

次に、ゲストOS13-1〜13-nのうちの例えばゲストOS13-1によるページアクセスでページフォルトが発生した場合にVMM11によって実行される処理について、図4のフローチャートを参照して説明する。なお、ゲストOS13-1以外のゲストOSによるページアクセスでページフォルトが発生した場合も同様の処理が行われる。   Next, processing executed by the VMM 11 when a page fault occurs in a page access by the guest OS 13-1 among the guest OSs 13-1 to 13-n will be described with reference to the flowchart of FIG. Note that the same processing is performed when a page fault occurs in a page access by a guest OS other than the guest OS 13-1.

今、ゲストOS13-1(更に詳細には、ゲストOS13-1上で動作するユーザプロセスまたはカーネルスレッド)が、ページアウトされているページにアクセスした結果、ページフォルトが発生したものとする。つまりゲストOS13-1に割り当てられたCPU(実CPU)に内蔵のMMUによってページフォルトが発生されたものとする。このページフォルトの発生(ページフォルトトラップ)により、VMM11内のメモリマネージャ113に含まれているVMMページングモジュール114に制御が渡る。すると、VMMページングモジュール114を始めとする、VMM11内の各モジュールにより、次のような処理(ページフォルト発生時の処理)が行われる。   It is assumed that a page fault has occurred as a result of the guest OS 13-1 (more specifically, a user process or kernel thread operating on the guest OS 13-1) accessing a page that has been paged out. In other words, it is assumed that a page fault is generated by the MMU built in the CPU (real CPU) assigned to the guest OS 13-1. When this page fault occurs (page fault trap), control is passed to the VMM paging module 114 included in the memory manager 113 in the VMM 11. Then, the following processing (processing when a page fault occurs) is performed by each module in the VMM 11 including the VMM paging module 114.

まずVMMページングモジュール114は、VMMページアウトメモリ管理テーブル116を参照する(ステップ401)。そしてVMMページングモジュール114は、ページフォルトを起こしたゲストOS13-1のID及びページフォルトとなったページの仮想アドレスの対を含むページアウト管理情報がVMMページアウトメモリ管理テーブル116に登録されているかにより、当該ページフォルトの要因が、VMM11内のVMMページングモジュール114によってページアウトされたページへのアクセスにあるかを判定する(ステップ402)。   First, the VMM paging module 114 refers to the VMM page-out memory management table 116 (step 401). Then, the VMM paging module 114 determines whether page-out management information including the pair of the guest OS 13-1 ID causing the page fault and the virtual address of the page causing the page fault is registered in the VMM page-out memory management table 116. It is determined whether the cause of the page fault is an access to a page paged out by the VMM paging module 114 in the VMM 11 (step 402).

もし、ゲストOS13-1のID及びページフォルトとなったページの仮想アドレスの対を含むページアウト管理情報がVMMページアウトメモリ管理テーブル116に登録されていないならば、VMMページングモジュール114は、ゲストOS13-1におけるページフォルトの要因がVMM11内の当該VMMページングモジュール114自身によってページアウトされたページへのアクセス以外にあると判定する(ステップ402がNo)。つまりVMMページングモジュール114は、ゲストOS13-1におけるページフォルトの要因が、ゲストOS13-1内のメモリマネージャ17によって管理されているページングによるページフォルト(またはエラーによる不正アドレスへのアクセス)にあると判定する。この場合、VMMページングモジュール114(のトラップ配信モジュール)はゲストOS13-1にページフォルトトラップを配信する(ステップ403)。これにより、ページフォルト発生時のVMM11による処理は終了する。   If the page-out management information including the pair of the guest OS 13-1 ID and the virtual address of the page that has caused the page fault is not registered in the VMM page-out memory management table 116, the VMM paging module 114 executes the guest OS 13 It is determined that the cause of the page fault at -1 is other than the access to the page paged out by the VMM paging module 114 itself in the VMM 11 (No in Step 402). That is, the VMM paging module 114 determines that the cause of the page fault in the guest OS 13-1 is a page fault due to paging (or access to an illegal address due to an error) managed by the memory manager 17 in the guest OS 13-1. To do. In this case, the VMM paging module 114 (its trap delivery module) delivers a page fault trap to the guest OS 13-1 (step 403). Thereby, the processing by the VMM 11 when the page fault occurs is completed.

ゲストOS13-1は、VMMページングモジュール114からのページフォルトトラップを受けて、当該ゲストOS13-1が起こしたページフォルトを、後述するように通常のページフォルトとして処理する(ステップ505)。   Upon receiving the page fault trap from the VMM paging module 114, the guest OS 13-1 processes the page fault caused by the guest OS 13-1 as a normal page fault as described later (step 505).

これに対し、ゲストOS13-1のID及びページフォルトとなったページの仮想アドレスの対を含むページアウト管理情報がVMMページアウトメモリ管理テーブル116に登録されているならば、VMMページングモジュール114は、ゲストOS13-1におけるページフォルトの要因が当該VMMページングモジュール114自身によってページアウトされたページへのアクセスにあると判定する(ステップ402がYes)。このとき、外部記憶装置20のVMMページング領域21には、ページフォルトとなったページのデータが退避されている。   On the other hand, if the page-out management information including the pair of the guest OS 13-1 ID and the page virtual address of the page fault is registered in the VMM page-out memory management table 116, the VMM paging module 114 It is determined that the cause of the page fault in the guest OS 13-1 is access to a page paged out by the VMM paging module 114 itself (Yes in step 402). At this time, the data of the page that caused the page fault is saved in the VMM paging area 21 of the external storage device 20.

ステップ402の判定がYesの場合、VMMページングモジュール114はは、ページフォルトとなったページのデータをページインするためのI/O処理(ページイン処理)を開始する(ステップ404)。つまりVMMページングモジュール114は、ページフォルトの要因となったアクセスが試みられたページに実ページを割り当て、外部記憶装置20のVMMページング領域21に退避(ページアウト)されていたデータを読み込んで、当該読み込まれたデータを、そのページに復帰するページイン処理を開始する。   When the determination in step 402 is Yes, the VMM paging module 114 starts an I / O process (page-in process) for page-in the data of the page that has caused the page fault (step 404). In other words, the VMM paging module 114 allocates a real page to the page where the access that has caused the page fault is attempted, reads the data saved (paged out) in the VMM paging area 21 of the external storage device 20, and A page-in process for returning the read data to the page is started.

次にVMMページングモジュール114は、ゲストOS13-1がページフォルトを起こした際に、当該ゲストOS13-1がカーネルモードであったか否か(ユーザモードであったか)を判定する(ステップ405)。つまり、VMMページングモジュール114はステップ405において、ゲストOS13-1がカーネルモードのときに発生したページフォルトであるかを判定する。このステップ405の判定は、ページフォルト発生時(ページフォルトトラップ時)のプロセッサの特権モードの情報(ここではゲストOS13-1がカーネルモードであるかユーザモードであるかを示す情報)を参照することで簡単に実現される。   Next, when the guest OS 13-1 causes a page fault, the VMM paging module 114 determines whether the guest OS 13-1 is in the kernel mode (whether it is in the user mode) (step 405). That is, in step 405, the VMM paging module 114 determines whether a page fault has occurred when the guest OS 13-1 is in the kernel mode. The determination in step 405 refers to information on the privileged mode of the processor when a page fault occurs (at the time of a page fault trap) (in this case, information indicating whether the guest OS 13-1 is in the kernel mode or the user mode). This is easily realized.

もし、カーネルモードでないならば(ステップ405がNo)、VMMページングモジュール114は、ゲストOS13-1がユーザモードのときに発生したページフォルトであると判定する。この場合、VMMページングモジュール114(のトラップ配信モジュール)は、ゲストOS13-1にページフォルトトラップを配信する(ステップ406)。このステップ406において、VMMページングモジュール114は、ゲストOS13-1でのページフォルトの要因がVMM11がページアウトしたページへのアクセスにあることと、そのページのアドレス(ページフォルト発生アドレス)とを、当該ゲストOS13-1に通知する。ステップ406が実行されると、ページフォルト発生時のVMM11による処理は終了する。   If not in the kernel mode (No in step 405), the VMM paging module 114 determines that the page fault has occurred when the guest OS 13-1 is in the user mode. In this case, the VMM paging module 114 (its trap delivery module) delivers a page fault trap to the guest OS 13-1 (step 406). In this step 406, the VMM paging module 114 determines that the cause of the page fault in the guest OS 13-1 is the access to the page that the VMM 11 paged out, and the address of the page (page fault occurrence address). The guest OS 13-1 is notified. When step 406 is executed, the processing by the VMM 11 when the page fault occurs is finished.

ステップ406での上述の要因の通知は、高々1ビットで実現可能である。例えば、元々用意されているべき、VMM11からゲストOSに情報を渡すためのCPUのレジスタ中の空きビット(1ビット)を用いればよい。もし、空きビットがなければ、トラップ時に利用可能なレジスタの中にVMMページングモジュール114が特定の値を設定することにより、当該レジスタを介して上述の要因を通知してもよい。   The notification of the above-described factors in step 406 can be realized with at most 1 bit. For example, an empty bit (1 bit) in the CPU register for passing information from the VMM 11 to the guest OS, which should be prepared originally, may be used. If there is no empty bit, the VMM paging module 114 may set a specific value in a register that can be used at the time of trapping, thereby notifying the above-described factor via the register.

一方、ゲストOS13-1がカーネルモードのときに発生したページフォルトであるならば(ステップ405がYes)、VMMページングモジュール114は、当該ゲストOS13-1のIDに基づいてVMMメモリ管理テーブル117を参照する(ステップ407)。そしてVMMページングモジュール114は、ゲストOS13-1のIDを含むサービス要求情報がVMMメモリ管理テーブル117に格納され、当該サービス要求情報に含まれているフラグによって当該ゲストOS13-1のゲストOSカーネル13-1がページャブルであることが示され、且つ当該サービス要求情報に当該ゲストOSカーネル15-iのページング対象メモリ領域を示すメモリ領域情報(開始仮想アドレス及び終了仮想アドレスの対)が含まれているかを判定する。つまりVMMページングモジュール114は、ゲストOS13-1のゲストOSカーネル15-1がページャブルカーネルであり、且つ当該ゲストOSカーネル15-1がページング対象としているメモリ領域が予め通知されているかを判定する(ステップ408)。   On the other hand, if the page fault occurred when the guest OS 13-1 is in the kernel mode (Yes in Step 405), the VMM paging module 114 refers to the VMM memory management table 117 based on the ID of the guest OS 13-1. (Step 407). The VMM paging module 114 stores the service request information including the ID of the guest OS 13-1 in the VMM memory management table 117, and the guest OS kernel 13- of the guest OS 13-1 according to the flag included in the service request information. Whether 1 is pageable and the service request information includes memory area information (a pair of start virtual address and end virtual address) indicating the paging target memory area of the guest OS kernel 15-i judge. That is, the VMM paging module 114 determines whether the guest OS kernel 15-1 of the guest OS 13-1 is a pageable kernel and the memory area targeted by the guest OS kernel 15-1 has been notified in advance ( Step 408).

ステップ408の判定がYesの場合、VMMページングモジュール114はVMMメモリ管理テーブル117を参照した結果に基づき、ページフォルトとなったページは、予めゲストOSカーネル15-1から通知されている、当該ゲストOSカーネル15-1(を含むゲストOS13-1)がページング対象としているメモリ領域内にあるかを判定する(ステップ409)。このステップ409の判定は、ページフォルトとなったページの仮想アドレスが、参照されたサービス要求情報に含まれているメモリ領域情報によって示される、ゲストOS13-1(のゲストOSカーネル15-1)がページング対象としているメモリ領域の開始仮想アドレスと終了仮想アドレスとの間に入っているかを調べることにより実現される。   If the determination in step 408 is Yes, the VMM paging module 114 determines that the page that has a page fault is notified in advance from the guest OS kernel 15-1 based on the result of referring to the VMM memory management table 117. It is determined whether the kernel 15-1 (including the guest OS 13-1) is in the memory area targeted for paging (step 409). In step 409, the guest OS 13-1 (the guest OS kernel 15-1) in which the virtual address of the page that has caused the page fault is indicated by the memory area information included in the referenced service request information. This is realized by checking whether it is between the start virtual address and the end virtual address of the memory area to be paged.

もし、ページフォルトとなったページが、ゲストOS13-1(のゲストOSカーネル15-1)がページング対象としているメモリ領域内にある場合には(ステップ409がYes)、VMMページングモジュール114はステップ406に進む。つまり、ゲストOS13-1(のゲストOSカーネル15-1)がページャブルカーネルであり、且つゲストOS13-1(のゲストOSカーネル15-1)がページング対象としているメモリ領域内のページへのアクセスでページフォルトが発生した場合、VMMページングモジュール114はステップ406に進む。   If the page that has a page fault is in the memory area targeted for paging by the guest OS 13-1 (the guest OS kernel 15-1) (Yes in Step 409), the VMM paging module 114 executes Step 406. Proceed to In other words, the guest OS 13-1 (the guest OS kernel 15-1) is a pageable kernel, and the guest OS 13-1 (the guest OS kernel 15-1) accesses a page in the memory area targeted for paging. If a page fault has occurred, the VMM paging module 114 proceeds to step 406.

さて、ステップ409の判定がYesの場合、ゲストOS13-1が起こしたページフォルトを、当該ゲストOS13-1で処理できる。つまりステップ409の判定がYesであることは、ゲストOS13-1内でページフォルトを起こしたカーネルスレッドをブロックして他のスレッドにスイッチすることができることを示す。そのためステップ409の判定がYesの場合、VMMページングモジュール114(のトラップ配信モジュール)はステップ406に進み、ゲストOS13-1にページフォルトトラップを配信する。   If the determination in step 409 is Yes, a page fault caused by the guest OS 13-1 can be processed by the guest OS 13-1. In other words, the determination in step 409 being Yes indicates that the kernel thread that caused the page fault in the guest OS 13-1 can be blocked and switched to another thread. Therefore, if the determination in step 409 is Yes, the VMM paging module 114 (its trap delivery module) proceeds to step 406 and delivers a page fault trap to the guest OS 13-1.

一方、ステップ408の判定がNoであるか、ステップ408の判定がYesであってもステップ409の判定がNoの場合には、ゲストOS13-1が処理できないカーネルモードでのページフォルトである。この場合、VMMページングモジュール114は、ページフォルトを起こしたゲストOS13-1の状態を、VMM11(内のVMMページングモジュール114)によるページイン処理の完了を待つページイン待ち状態(VMMページイン処理完了待ち)に設定する(ステップ410)。つまりVMMページングモジュール114は、ゲストOS13-1をブロックする。   On the other hand, if the determination in step 408 is No or the determination in step 409 is No even if the determination in step 408 is Yes, it is a page fault in the kernel mode that cannot be processed by the guest OS 13-1. In this case, the VMM paging module 114 changes the state of the guest OS 13-1 that has caused the page fault to a page-in waiting state (waiting for the completion of the VMM page-in processing) waiting for the completion of the page-in processing by the VMM 11 (internal VMM paging module 114). (Step 410). That is, the VMM paging module 114 blocks the guest OS 13-1.

するとゲストOS実行管理機構112は、ページフォルトを起こしたゲストOS13-1から当該ゲストOS13-1に割り当てられていたCPUを横取りし、当該ゲストOS13-1のコンテクスト(つまり実行状態)を例えば外部記憶装置20に保存する(ステップ411)。   Then, the guest OS execution management mechanism 112 intercepts the CPU assigned to the guest OS 13-1 from the guest OS 13-1 that caused the page fault, and stores the context (that is, the execution state) of the guest OS 13-1 in, for example, an external storage The data is stored in the device 20 (step 411).

次にゲストOS実行管理機構112は、ゲストOS13-1〜13-nの中から、ゲストOS13-1以外の実行可能な1つのゲストOSを選択して、当該選択されたゲストOSにCPUを割り当てる再スケジューリングを行う(ステップ412)。これにより、ページフォルト発生時のVMM11による処理は終了する。   Next, the guest OS execution management mechanism 112 selects one executable guest OS other than the guest OS 13-1 from the guest OSs 13-1 to 13-n, and assigns a CPU to the selected guest OS. Rescheduling is performed (step 412). Thereby, the processing by the VMM 11 when the page fault occurs is completed.

次に、ページフォルトを起こしたゲストOS13-1にVMM11(内のVMMページングモジュール114)からページフォルトトラップが配信されたときに、当該ゲストOS13-1によって実行される処理について、図5のフローチャートを参照して説明する。   Next, when the page fault trap is delivered from the VMM 11 (internal VMM paging module 114) to the guest OS 13-1 that has caused the page fault, the flowchart shown in FIG. The description will be given with reference.

なお、VMM11がゲストOS13-1にページフォルトトラップを配信した際には、通常の実計算機で発生する各種トラップ、割り込みと同様、それを当該ゲストOS13-1で処理するために必要な情報が、VMM11から当該ゲストOS13-1に何らかの形で(例えばレジスタを用いて)渡されることを前提とする。この情報は、ページフォルトトラップの例では、
(1)そもそも例外がページフォルトトラップであることを示す情報
(2)ページフォルトとなったページのアドレス(ページフォルト発生アドレス)、及び例外発生時の特権モード情報を含むトラップ情報
を含む。
When the VMM 11 delivers a page fault trap to the guest OS 13-1, as with various traps and interrupts that occur in a normal real computer, information necessary to process it in the guest OS 13-1 It is assumed that the VMM 11 is transferred to the guest OS 13-1 in some form (for example, using a register). This information is the page fault trap example:
(1) Information indicating that an exception is a page fault trap in the first place (2) Address of a page that has become a page fault (page fault occurrence address) and trap information including privileged mode information when an exception occurs.

ページフォルトトラップの場合、このような情報に加えて、前述のステップ406の処理で説明したように、ページフォルトの要因がVMM11がページアウトしたページへのアクセスにあることを示す情報も、当該VMM11(内のVMMページングモジュール114)からゲストOS13-1に渡される。   In the case of a page fault trap, in addition to such information, as described in the processing of step 406 described above, information indicating that the cause of the page fault is an access to a page paged out by the VMM 11 is also included in the VMM 11. (From the VMM paging module 114) to the guest OS 13-1.

さて、VMM11からゲストOS13-1にページフォルトトラップが配信されると、ゲストOS13-1に含まれているメモリマネージャ17内のページングモジュール171は、ページフォルトの要因が、VMM11がページアウトしたページへのアクセスにあるかを判定する(ステップ501)。   When the page fault trap is distributed from the VMM 11 to the guest OS 13-1, the paging module 171 in the memory manager 17 included in the guest OS 13-1 causes the page fault to be a page that the VMM 11 has paged out. It is determined whether it is in the access (step 501).

もし、ページフォルトの要因が、VMM11がページアウトしたページへのアクセス以外にある場合には(ステップ501がNo)、メモリマネージャ17内のページングモジュール171は、実計算機で動作する通常のゲストOSがページフォルトに対するのと同様のページイン処理を行う(ステップ502)。即ちページングモジュール171は、ページフォルトの要因となったアクセスが試みられたページに実ページを割り当て、外部記憶装置20のゲストOSページング領域22-1に退避(ページアウト)されていたデータを読み込んで、当該読み込まれたデータを、そのページに復帰するページイン処理を行う(ステップ502)。また、ステップ502においてページングモジュール171は、ページフォルトを起こしたゲストOS13-1において実行中のユーザプロセス14またはカーネルスレッドの状態(つまりページフォルトを起こした処理)を、通常のゲストOSによるページイン処理の場合と同様に、ゲストOS13-1によるページイン処理の完了を待つページイン待ち状態(ゲストOSページイン処理完了待ち)に設定する。   If the cause of the page fault is other than the access to the page paged out by the VMM 11 (No in step 501), the paging module 171 in the memory manager 17 has a normal guest OS running on the real computer. A page-in process similar to that for a page fault is performed (step 502). In other words, the paging module 171 allocates a real page to the page that is attempted to be accessed causing the page fault, and reads the data saved (paged out) in the guest OS paging area 22-1 of the external storage device 20. Then, page-in processing for returning the read data to the page is performed (step 502). In step 502, the paging module 171 changes the state of the user process 14 or the kernel thread (that is, the process that caused the page fault) being executed in the guest OS 13-1 that caused the page fault to the page-in process by the normal guest OS. As in the case of, a page-in waiting state (waiting for guest OS page-in processing completion) waiting for completion of page-in processing by the guest OS 13-1 is set.

なお、不正アドレスへのアクセスに伴うページフォルトトラップの場合にも、ステップ501の判定がNoとなる。この場合、ステップ502では、ユーザプロセス14が起こしたページフォルトであるならば、当該ユーザプロセス14を停止したり、カーネルが起こしたページフォルトならば、ゲストOS13-1を周知のパニックモードに移行するなどの、エラー処理が行われる。ここでは、便宜的に、不正アドレスへのアクセスに伴うページフォルトトラップは発生していないものとする。   Even in the case of a page fault trap accompanying access to an illegal address, the determination in step 501 is No. In this case, in step 502, if the page fault is caused by the user process 14, the user process 14 is stopped, or if the page fault is caused by the kernel, the guest OS 13-1 is shifted to a known panic mode. Error handling is performed. Here, for the sake of convenience, it is assumed that a page fault trap associated with access to an illegal address has not occurred.

一方、ページフォルトの要因が、VMM11がページアウトしたページへのアクセスにある場合には(ステップ501がYes)、ページングモジュール171は、ページフォルトを起こしたユーザプロセス14またはカーネルスレッドの状態(処理)を、VMM11(内のVMMページングモジュール114)によるページイン処理の完了を待つページイン待ち状態(VMMページイン処理完了待ち)に設定する(ステップ503)。このステップ503では、先のステップ502と異なり、ページングモジュール171によるページイン処理(ページインのためのI/O処理)は行われないことに注意する。   On the other hand, when the cause of the page fault is an access to a page paged out by the VMM 11 (Yes in step 501), the paging module 171 indicates the state (processing) of the user process 14 or kernel thread that caused the page fault. Is set to a page-in waiting state (waiting for VMM page-in processing completion) waiting for completion of page-in processing by the VMM 11 (internal VMM paging module 114) (step 503). Note that in this step 503, unlike the previous step 502, page-in processing (I / O processing for page-in) by the paging module 171 is not performed.

ゲストOS13-1は、ステップ502及び503のうちのいずれが実行された場合にも、ページフォルトを起こしたユーザプロセス14またはカーネルスレッド(処理)から当該ユーザプロセス14またはカーネルスレッドに割り当てられていたCPUを横取りし、当該ユーザプロセス14またはカーネルスレッドのコンテクスト(つまり実行状態)を例えば外部記憶装置20に保存する(ステップ504)。   When any of steps 502 and 503 is executed, the guest OS 13-1 receives the CPU assigned to the user process 14 or kernel thread from the user process 14 or kernel thread (processing) that caused the page fault. And the context (that is, the execution state) of the user process 14 or the kernel thread is stored in, for example, the external storage device 20 (step 504).

続いてゲストOS13-1は、他の実行可能なユーザプロセス14またはカーネルスレッド(つまり他の実行可能な処理)をゲストOS13-1内から選択して、当該選択されたユーザプロセス14またはカーネルスレッドにCPUを割り当てる再スケジューリングを行う(ステップ505)。   Subsequently, the guest OS 13-1 selects another executable user process 14 or kernel thread (that is, another executable process) from the guest OS 13-1, and selects the selected user process 14 or kernel thread. Rescheduling for CPU allocation is performed (step 505).

さて、本実施形態では、上記ステップ404の処理、即ちVMM11のVMMページングモジュール114によるページイン処理が完了した際に、ページフォルトを起こしたゲストOS(ここではゲストOS13-1)に対し、その旨が、VMM11のVMMページイン完了時処理モジュール115によって通知される。このVMM11のVMMページングモジュール114によるページイン処理の完了時の処理について、図6のフローチャートを参照して説明する。   In the present embodiment, when the processing in step 404, that is, the page-in processing by the VMM paging module 114 of the VMM 11, is completed, the guest OS (in this case, the guest OS 13-1) that caused the page fault is notified to that effect. Is notified by the VMM page-in completion processing module 115 of the VMM 11. Processing when the page-in processing by the VMM paging module 114 of the VMM 11 is completed will be described with reference to the flowchart of FIG.

今、VMMページングモジュール114によるページイン処理が完了したものとする。この場合、VMMページイン完了時処理モジュール115に制御が渡る。VMMページイン完了時処理モジュール115は、VMMページアウトメモリ管理テーブル116から、ページイン処理が完了したページのページアウト管理情報を削除する(ステップ601)。   Assume that the page-in processing by the VMM paging module 114 has been completed. In this case, control is passed to the VMM page-in completion processing module 115. The VMM page-in completion processing module 115 deletes the page-out management information of the page for which the page-in processing has been completed from the VMM page-out memory management table 116 (step 601).

次にVMMページイン完了時処理モジュール115は、ページイン処理が完了したページを所有するゲストOS13-1の状態が、VMM11(内のVMMページングモジュール114)によるページイン処理の完了を待つページイン待ち状態(VMMページイン処理完了待ち)にあるかを判定する(ステップ602)。明らかなように、前述のステップ410が実行された場合には、ゲストOS13-1はページイン待ち状態(VMMページイン処理完了待ち)にあることから、ステップ602の判定はYesとなる。   Next, the VMM page-in completion processing module 115 waits for the completion of page-in processing by the VMM 11 (internal VMM paging module 114) in the state of the guest OS 13-1 that owns the page for which page-in processing has been completed. It is determined whether it is in a state (waiting for VMM page-in processing completion) (step 602). Obviously, when the above-described step 410 is executed, the guest OS 13-1 is in the page-in waiting state (waiting for the completion of the VMM page-in process), so the determination in step 602 is Yes.

この状態のときには、ゲストOS13-1のゲストOSカーネル15-1のページャブルでないメモリ領域内のページをVMM11(内のVMMページングモジュール114)がページアウトしているために、当該ゲストOS13-1全体が動けない状態になっている。そこでステップ602の判定がYesの場合、VMM11のVMMページングモジュール114は、ゲストOS13-1(つまりVMMページイン処理が完了したページを所有するゲストOS13-1)の状態を実行可能状態に設定する(ステップ603)。   In this state, since the VMM 11 (inside the VMM paging module 114) has paged out a page in the non-pageable memory area of the guest OS kernel 15-1 of the guest OS 13-1, the entire guest OS 13-1 is It is in a state where it cannot move. Therefore, when the determination in step 602 is Yes, the VMM paging module 114 of the VMM 11 sets the state of the guest OS 13-1 (that is, the guest OS 13-1 that owns the page for which the VMM page-in processing has been completed) to an executable state ( Step 603).

するとVMM11のゲストOS実行管理機構112は、ステップ603で実行可能状態に設定されたゲストOS13-1を含むゲストOS13-1〜13-nの中から、実行可能な1つのゲストOSを選択して、当該選択されたゲストOSにCPUを割り当てる再スケジューリングを行う(ステップ604)。   Then, the guest OS execution management mechanism 112 of the VMM 11 selects one executable guest OS from the guest OSs 13-1 to 13-n including the guest OS 13-1 set to be executable in step 603. Then, rescheduling for assigning a CPU to the selected guest OS is performed (step 604).

一方、ページイン処理が完了したページを所有するゲストOS13-1がページイン待ち状態(VMMページイン処理完了待ち)にないものとする(ステップ602がNo)。明らかなように、前述のステップ406が実行された場合には、ゲストOS13-1内のページフォルトを起こしたユーザプロセス14またはカーネルスレッド(処理)はページイン待ち状態(VMMページイン処理完了待ち)にあるものの、ゲストOS13-1自体はページイン待ち状態(VMMページイン処理完了待ち)にないことから、ステップ602の判定はNoとなる。この場合、ゲストOS13-1内にページフォルトを起こしたユーザプロセス14またはカーネルスレッド(処理)が存在し、当該ページフォルトを起こしたユーザプロセス14またはカーネルスレッド(処理)がページイン処理の完了を待っている。   On the other hand, it is assumed that the guest OS 13-1 that owns the page for which page-in processing has been completed is not in a page-in waiting state (waiting for VMM page-in processing completion) (No in step 602). As is apparent, when the above-described step 406 is executed, the user process 14 or kernel thread (processing) that has caused a page fault in the guest OS 13-1 is in a page-in wait state (waiting for VMM page-in processing completion). However, since the guest OS 13-1 itself is not in a page-in waiting state (waiting for VMM page-in processing completion), the determination in step 602 is No. In this case, the user process 14 or kernel thread (processing) that caused the page fault exists in the guest OS 13-1, and the user process 14 or kernel thread (processing) that caused the page fault waits for the completion of the page-in processing. ing.

そこで、ステップ602の判定がNoの場合、VMMページイン完了時処理モジュール115は、ゲストOS13-1に、VMM11によるページイン処理(VMMページイン処理)の完了、及びページフォルト発生アドレスを通知すると共に、VMMページイン処理の完了を通知する割り込み(VMMページイン完了通知割り込み)を当該ゲストOS13-1に配信する(ステップ605)。   Therefore, if the determination in step 602 is No, the VMM page-in completion processing module 115 notifies the guest OS 13-1 of the completion of the page-in processing (VMM page-in processing) by the VMM 11 and the page fault occurrence address. Then, an interrupt (VMM page-in completion notification interrupt) for notifying the completion of the VMM page-in process is distributed to the guest OS 13-1 (step 605).

次に、上述のステップ605でVMM11のVMMページイン完了時処理モジュール115が配信したVMMページイン完了通知割り込みをゲストOS13-1が受信した場合に当該ゲストOS13-1によって実行される処理について、図7のフローチャートを参照して説明する。   Next, the processing executed by the guest OS 13-1 when the VMM page-in completion notification interrupt distributed by the VMM page-in completion processing module 115 of the VMM 11 in step 605 described above is received by the guest OS 13-1 is shown in FIG. This will be described with reference to the flowchart of FIG.

まずゲストOS13-1は、VMM11のVMMページイン完了時処理モジュール115からのVMMページイン完了通知割り込みを受け取ると、VMM11によるページイン処理(VMMページイン処理)の完了を待っていたユーザプロセス14またはカーネルスレッド(処理)の状態を実行可能状態に設定する(ステップ701)。   First, upon receiving the VMM page-in completion notification interrupt from the VMM page-in completion processing module 115 of the VMM 11, the guest OS 13-1 receives the user process 14 waiting for the completion of the page-in processing (VMM page-in processing) by the VMM 11 or The kernel thread (process) state is set to an executable state (step 701).

次にゲストOS13-1は、(ステップ701で実行可能状態に設定されたユーザプロセス14またはカーネルスレッドを含めて)実行可能な1つのユーザプロセス14またはカーネルスレッド(処理)をゲストOS13-1内から選択して、当該選択されたユーザプロセス14またはカーネルスレッドにCPUを割り当てる再スケジューリングを行う(ステップ702)。   Next, the guest OS 13-1 sends one executable user process 14 or kernel thread (processing) from within the guest OS 13-1 (including the user process 14 or kernel thread set to the executable state in Step 701). Select and reschedule to assign a CPU to the selected user process 14 or kernel thread (step 702).

従来の仮想計算機システムにおいて実行されるVMMによるデマンドページングは、ゲストOSがその中で行うデマンドページングとは独立して行われていた。ここでは、ゲストOS内のユーザプロセスのメモリ空間を対象とするページングであっても、ゲストOSがページアウトしたページへのアクセスでのページフォルトでは、当該ゲストOS内の他のユーザプロセスに切り替わってゲストOSとしては処理が継続できる。   The demand paging by the VMM executed in the conventional virtual machine system is performed independently of the demand paging performed in the guest OS. Here, even when paging is performed on the memory space of the user process in the guest OS, a page fault in accessing a page paged out by the guest OS switches to another user process in the guest OS. Processing can be continued as a guest OS.

ところが、上記のページを、VMM11がページアウトしていた場合には、ゲストOS内で他のユーザプロセスにスイッチすることはできず、つまり当該ゲストOSはブロックされる。このため従来の仮想計算機システムでは、効率のよいゲストOS内スケジューリング(ユーザプロセス及び/またはカーネルスレッドのディスパッチ)が行えないという問題があった。   However, when the VMM 11 has paged out the above page, it cannot be switched to another user process within the guest OS, that is, the guest OS is blocked. For this reason, the conventional virtual machine system has a problem in that it cannot perform efficient scheduling within the guest OS (dispatching user processes and / or kernel threads).

これに対して本実施形態では、ゲストOSがページフォルトの要因が、VMM11によってページアウトされたページへのアクセスにあることが、VMM11のメモリマネージャ113(内のVMMページングモジュール114)から当該ゲストOSに通知される。この通知により、当該通知を受けたゲストOSは、VMM11のメモリマネージャ113と連携することで、当該ゲストOSをブロックすることなく、VMM11によるページイン処理の完了を待つことができる。その結果、通知を受けたゲストOS(つまりページフォルトを起こした処理を実行していたゲストOS)において、他の処理(他のユーザプロセスまたはカーネル内スレッド)の実行に切り替えて動作を継続することができ、VMM11によるページングを実現しながら、効率のよいゲストOS内スケジューリングを図ることができる。   On the other hand, in the present embodiment, the guest OS causes the page fault to be the access to the page paged out by the VMM 11 from the memory manager 113 (the VMM paging module 114 in the VMM 11). Will be notified. By this notification, the guest OS that has received the notification can wait for the completion of page-in processing by the VMM 11 without linking the guest OS, in cooperation with the memory manager 113 of the VMM 11. As a result, in the notified guest OS (that is, the guest OS that was executing the process that caused the page fault), the operation is switched to the execution of another process (another user process or a thread in the kernel). Therefore, efficient scheduling within the guest OS can be achieved while paging by the VMM 11 is realized.

なお、本発明は、上記実施形態そのままに限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で構成要素を変形して具体化できる。また、上記実施形態に開示されている複数の構成要素の適宜な組み合わせにより種々の発明を形成できる。例えば、実施形態に示される全構成要素から幾つかの構成要素を削除してもよい。   Note that the present invention is not limited to the above-described embodiment as it is, and can be embodied by modifying the constituent elements without departing from the scope of the invention in the implementation stage. In addition, various inventions can be formed by appropriately combining a plurality of components disclosed in the embodiment. For example, some components may be deleted from all the components shown in the embodiment.

本発明の一実施形態に係る仮想計算機システムの構成を示すブロック図。1 is a block diagram showing a configuration of a virtual computer system according to an embodiment of the present invention. 図1に示されるVMMページアウトメモリ管理テーブルのデータ構造例を示す図。The figure which shows the example of a data structure of the VMM page out memory management table shown by FIG. 図2に示されるVMMメモリ管理テーブルのデータ構造例を示す図。The figure which shows the data structure example of the VMM memory management table shown by FIG. ゲストOSによるページアクセスでページフォルトが発生した場合にVMM(仮想計算機管理機構)によって実行される処理の手順を示すフローチャート。6 is a flowchart showing a procedure of processing executed by a VMM (Virtual Machine Management Mechanism) when a page fault occurs during page access by a guest OS. ページフォルトを起こしたゲストOSにVMMからページフォルトトラップが配信されたときに実行される処理の手順を示すフローチャート。The flowchart which shows the procedure of the process performed when a page fault trap is delivered from VMM to the guest OS which caused the page fault. VMMによるページイン処理の完了時に当該VMMによって実行される処理の手順を示すフローチャート。6 is a flowchart showing a procedure of processing executed by the VMM when page-in processing by the VMM is completed. VMMが配信したVMMページイン完了通知割り込みをゲストOSが受信した場合に実行される処理の手順を示すフローチャート。The flowchart which shows the procedure of the process performed when a guest OS receives the VMM page-in completion notification interruption delivered by VMM.

10…計算機本体、11…VMM(仮想計算機管理機構)、12-1〜12-n…仮想計算機、13-1〜13-n…ゲストOS、14…ユーザプロセス、15-1〜15-n…ゲストOSカーネル、16-1〜16-n…カーネル内メモリ領域、17…メモリマネージャ、20…外部記憶装置、21…VMMページング領域、22-1〜22-n…ゲストOSページング領域、111…ゲストOSインターフェイス機構、112…ゲストOS実行管理機構、113…メモリマネージャ、114…VMMページングモジュール、115…VMMページイン完了時処理モジュール、116…VMMページアウトメモリ管理テーブル、117…VMMメモリ管理テーブル、171…ページングモジュール、172…ページイン完了時処理モジュール。   DESCRIPTION OF SYMBOLS 10 ... Computer main body, 11 ... VMM (virtual computer management mechanism), 12-1 to 12-n ... Virtual computer, 13-1 to 13-n ... Guest OS, 14 ... User process, 15-1-15-n ... Guest OS kernel, 16-1 to 16-n: In-kernel memory area, 17 ... Memory manager, 20 ... External storage device, 21 ... VMM paging area, 22-1-22-n ... Guest OS paging area, 111 ... Guest OS interface mechanism 112 ... Guest OS execution management mechanism 113 ... Memory manager 114 ... VMM paging module 115 ... VMM page-in completion processing module 116 ... VMM page-out memory management table 117 ... VMM memory management table 171 ... Paging module, 172 ... Page-in completion processing module.

Claims (10)

CPUを含むハードウェアを仮想化することによって複数の仮想計算機を構築し、当該複数の仮想計算機で複数のゲストOSを実行させるための管理を行う仮想計算機管理機構において、
前記複数のゲストOSに割り当てられたメモリ領域に対してページを単位にページアウト処理を含むデマンドページング処理を行うページング手段と、
前記ページング手段によってページアウトされたページに関するページアウト管理情報を保持するページアウト管理情報保持手段とを具備し、
前記ページング手段は、ページアウトされたページに対してゲストOSがアクセスしたことによりページフォルトが発生した際に、当該ページフォルトが発生したページに関するページアウト管理情報が前記ページアウト管理情報保持手段に保持されていることをもって、当該ページフォルトの要因が前記ページング手段によってページアウトされたページへのアクセスにあると判定して、その旨を当該ページフォルトが発生したページにアクセスした前記ゲストOSに通知すると共に当該ゲストOSにページフォルトトラップを配信し、且つ当該ページアウトされたページにデータを復帰するためのページイン処理を実行する
ことを特徴とする仮想計算機管理機構。
In a virtual machine management mechanism that performs management for constructing a plurality of virtual machines by virtualizing hardware including a CPU and executing a plurality of guest OSes in the plurality of virtual machines,
Paging means for performing demand paging processing including page-out processing in units of pages with respect to memory areas allocated to the plurality of guest OSes;
Page-out management information holding means for holding page-out management information related to a page paged out by the paging means,
When a page fault occurs due to a guest OS accessing a page that has been paged out, the paging means holds page-out management information related to the page where the page fault has occurred in the page-out management information holding means. Therefore, it is determined that the cause of the page fault is an access to the page paged out by the paging means, and that is notified to the guest OS that has accessed the page where the page fault has occurred. A virtual machine management mechanism characterized by delivering a page fault trap to the guest OS and executing page-in processing for restoring data to the page-out page.
前記ページング手段によるページイン処理の完了に応じて、その旨を通知するための特定の完了割り込みを、前記ページフォルトが発生したページにアクセスした前記ゲストOSに発行するページイン完了時処理手段を更に具備することを特徴とする請求項1記載の仮想計算機管理機構。   In response to completion of page-in processing by the paging means, page-in completion processing means for issuing a specific completion interrupt for notifying the fact to the guest OS that has accessed the page where the page fault has occurred. The virtual machine management mechanism according to claim 1, further comprising: 前記複数のゲストOSの各々が前記仮想計算機管理機構に特定のサービスを予め要求するのに用いられるゲストOSインターフェイス機構であって、前記特定のサービスは、当該特定のサービスを要求するゲストOSが前記仮想計算機管理機構の前記ページング手段によってページアウトされたページに対してアクセスしたことを要因としてページフォルトが発生した場合に、その旨を当該ゲストOSに通知すると共にページフォルトトラップを当該ゲストOSに配信するサービスであるゲストOSインターフェイス機構と、
前記ゲストOSから前記仮想計算機管理機構に前記特定のサービスが要求されたことを示すサービス要求情報を保持するサービス要求情報保持手段とを更に具備し、
前記ページング手段は、前記ページフォルトの要因が当該ページング手段によってページアウトされたページへのアクセスにあると判定した場合、当該ページにアクセスしたゲストOSから前記特定のサービスが要求されていることを示す前記サービス要求情報が前記サービス要求情報保持手段に保持されていることをもって、前記要因の通知と前記ページフォルトトラップの配信とを行うことを特徴とする請求項1または2に記載の仮想計算機管理機構。
Each of the plurality of guest OSs is a guest OS interface mechanism that is used to request a specific service from the virtual machine management mechanism in advance, and the specific service includes a guest OS that requests the specific service. When a page fault occurs due to access to a page paged out by the paging means of the virtual machine management mechanism, this is notified to the guest OS and a page fault trap is delivered to the guest OS A guest OS interface mechanism that is a service to
Service request information holding means for holding service request information indicating that the specific service is requested from the guest OS to the virtual machine management mechanism;
When the paging unit determines that the cause of the page fault is an access to a page paged out by the paging unit, the paging unit indicates that the specific service is requested from the guest OS that has accessed the page. 3. The virtual machine management mechanism according to claim 1, wherein the notification of the factor and the delivery of the page fault trap are performed when the service request information is held in the service request information holding unit. .
前記ゲストOSインターフェイス機構は、前記複数のゲストOSの各々が前記特定のサービスを要求するのに加えて、当該ゲストOSのカーネルがカーネルモードでページングを実施するページャブルカーネルであることと、当該ページングの対象となるメモリ領域とを当該ゲストOSが前記仮想計算機管理機構に予め通知するのに用いられ、
前記サービス要求情報保持手段に保持されている前記サービス要求情報は、当該サービス要求情報によって示される前記特定のサービスを要求したゲストOSのカーネルが前記ページャブルカーネルであるかを示すフラグ情報及び前記ページャブルカーネルである場合に前記ページングの対象となるメモリ領域を示すメモリ領域情報を含み、
前記ページング手段は、当該ページング手段によってページアウトされたページに前記カーネルモードでアクセスした前記ゲストOSのカーネルが前記ページャブルカーネルであることが前記サービス要求情報に含まれている前記フラグ情報によって示され、且つ当該ページアウトされたページが前記サービス要求情報に含まれている前記メモリ領域情報の示すメモリ領域内にある場合に、前記ゲストOSへの前記要因の通知と前記ページフォルトトラップの配信とを行う
ことを特徴とする請求項3記載の仮想計算機管理機構。
The guest OS interface mechanism includes a paging kernel in which the guest OS kernel performs paging in a kernel mode in addition to each of the plurality of guest OSs requesting the specific service. Used by the guest OS to notify the virtual machine management mechanism in advance of the target memory area,
The service request information held in the service request information holding means includes flag information indicating whether a kernel of a guest OS that requested the specific service indicated by the service request information is the pageable kernel, and the pager. Including a memory area information indicating a memory area to be subjected to the paging in the case of a bull kernel,
The paging means is indicated by the flag information included in the service request information that the guest OS kernel accessing the page paged out by the paging means in the kernel mode is the pageable kernel. When the page-out page is in the memory area indicated by the memory area information included in the service request information, notification of the factor to the guest OS and delivery of the page fault trap are performed. The virtual machine management mechanism according to claim 3, wherein the virtual machine management mechanism is performed.
前記複数のゲストOSの実行を管理するゲストOS実行管理手段を更に具備し、
前記ページング手段は、当該ページング手段によってページアウトされたページに前記カーネルモードでアクセスした前記ゲストOSのカーネルが前記ページャブルカーネルでないことが前記サービス要求情報に含まれている前記フラグ情報によって示されている場合、前記要因の通知と前記ページフォルトトラップの配信とを抑止し、
前記ゲストOS実行管理手段は、前記要因の通知と前記ページフォルトトラップの配信とが抑止された前記ゲストOSから前記複数のゲストOSのうちの他のゲストOSの実行に切り替える
ことを特徴とする請求項4記載の仮想計算機管理機構。
Further comprising guest OS execution management means for managing execution of the plurality of guest OSes,
The paging means is indicated by the flag information included in the service request information that the guest OS kernel accessing the page paged out by the paging means in the kernel mode is not the pageable kernel. The notification of the factor and the delivery of the page fault trap,
The guest OS execution managing means switches from execution of the guest OS in which the notification of the factor and the delivery of the page fault trap are suppressed to execution of another guest OS of the plurality of guest OSs. Item 5. The virtual machine management mechanism according to Item 4.
前記ページング手段は、当該ページング手段によってページアウトされたページにアクセスした前記ゲストOSから前記特定のサービスが要求されていることを示す前記サービス要求情報が前記サービス要求情報保持手段に保持されていない場合、前記要因の通知と前記ページフォルトトラップの配信とを抑止し、
前記ゲストOS実行管理手段は、前記要因の通知と前記ページフォルトトラップの配信とが抑止された前記ゲストOSから前記複数のゲストOSのうちの他のゲストOSの実行に切り替える
ことを特徴とする請求項5記載の仮想計算機管理機構。
When the service request information indicating that the specific service is requested from the guest OS accessing the page paged out by the paging means is not held in the service request information holding means. , Suppress notification of the factor and delivery of the page fault trap,
The guest OS execution managing means switches from execution of the guest OS in which the notification of the factor and the delivery of the page fault trap are suppressed to execution of another guest OS of the plurality of guest OSs. Item 6. The virtual machine management mechanism according to Item 5.
CPUを含むハードウェアを仮想化することによって複数の仮想計算機を構築し、当該複数の仮想計算機で複数のゲストOSを実行させるための管理を行う仮想計算機管理機構を有する仮想計算機システムにおいて、
前記仮想計算機管理機構は、
前記複数のゲストOSに割り当てられたメモリ領域に対してページを単位にページアウト処理を含むデマンドページング処理を行うページング手段と、
前記ページング手段によってページアウトされたページに関するページアウト管理情報を保持するページアウト管理情報保持手段とを具備し、
前記ページング手段は、ページアウトされたページに対してゲストOSがアクセスしたことによりページフォルトが発生した際に、当該ページフォルトが発生したページに関するページアウト管理情報が前記ページアウト管理情報保持手段に保持されていることをもって、当該ページフォルトの要因が前記ページング手段によってページアウトされたページへのアクセスにあると判定して、その旨を当該ページフォルトが発生したページにアクセスした前記ゲストOSに通知すると共に当該ゲストOSにページフォルトトラップを配信し、且つ当該ページアウトされたページにデータを復帰するためのページイン処理を実行し、
前記複数のゲストOSの各々は、前記ページフォルトの発生に応じて前記仮想計算機管理機構の前記ページング手段からページフォルトトラップが配信されると共に当該ページフォルトの要因が前記ページング手段によってページアウトされたページへのアクセスにある旨が通知された場合に、前記ページフォルトを起こした処理を前記ページング手段によるページイン処理の完了待ちの状態に設定する
ことを特徴とする仮想計算機システム。
In a virtual machine system having a virtual machine management mechanism for constructing a plurality of virtual machines by virtualizing hardware including a CPU and performing a plurality of guest OSes on the plurality of virtual machines,
The virtual machine management mechanism is:
Paging means for performing demand paging processing including page-out processing in units of pages with respect to memory areas allocated to the plurality of guest OSes;
Page-out management information holding means for holding page-out management information related to a page paged out by the paging means,
When a page fault occurs due to a guest OS accessing a page that has been paged out, the paging means holds page-out management information related to the page where the page fault has occurred in the page-out management information holding means. Therefore, it is determined that the cause of the page fault is an access to the page paged out by the paging means, and that is notified to the guest OS that has accessed the page where the page fault has occurred. A page fault trap is delivered to the guest OS, and a page-in process for returning data to the page-out page is executed.
In each of the plurality of guest OSs, a page fault trap is delivered from the paging unit of the virtual machine management mechanism according to the occurrence of the page fault, and the page fault factor is paged out by the paging unit. A virtual computer system characterized in that, when it is notified that access is to a page, the process causing the page fault is set to a state waiting for completion of page-in processing by the paging means.
前記複数のゲストOSの各々は、前記ページフォルトを起こした処理を前記ページング手段によるページイン処理の完了待ちの状態に設定した場合、前記ページフォルトを起こした処理以外の実行可能な処理の実行に切り替えることを特徴とする請求項7記載の仮想計算機システム。   Each of the plurality of guest OSs executes an executable process other than the process causing the page fault when the process causing the page fault is set to a state waiting for completion of the page-in process by the paging unit. 8. The virtual machine system according to claim 7, wherein the virtual machine system is switched. 前記仮想計算機管理機構は、前記ページング手段によるページイン処理の完了に応じて、その旨を通知するための特定の完了割り込みを、前記ページフォルトが発生したページにアクセスした前記ゲストOSに発行するページイン完了時処理手段を更に具備し、
前記複数のゲストOSの各々は、自身宛に前記特定の完了割り込みが発行された場合、前記ページイン処理の完了待ちの状態に設定されている処理を実行可能状態に切り替える
ことを特徴とする請求項7または8に記載の仮想計算機システム。
In response to the completion of the page-in processing by the paging unit, the virtual machine management mechanism issues a specific completion interrupt for notifying the fact to the guest OS that has accessed the page in which the page fault has occurred. In-completion processing means is further provided,
Each of the plurality of guest OSs switches a process set in a state waiting for completion of the page-in process to an executable state when the specific completion interrupt is issued to the guest OS. Item 9. The virtual computer system according to Item 7 or 8.
CPUを含むハードウェアを仮想化することによって複数の仮想計算機を構築し、当該複数の仮想計算機で複数のゲストOSを実行させるための管理を行う仮想計算機管理機構と、前記仮想計算機管理機構によってページアウトされたページに関するページアウト管理情報を保持するページアウト管理情報保持手段とを有する仮想計算機システムにおけるページング処理方法であって、
ページアウトされたページに対してゲストOSがアクセスしたことによりページフォルトが発生した際に、前記仮想計算機管理機構が前記ページアウト管理情報保持手段を参照して、当該ページフォルトが発生したページに関するページアウト管理情報が保持されているかによって、当該ページフォルトの要因が前記仮想計算機管理機構によってページアウトされたページへのアクセスにあるかを判定するステップと、
前記ページフォルトの要因が前記仮想計算機管理機構によってページアウトされたページへのアクセスにあると判定された場合、前記仮想計算機管理機構が、当該ページアウトされたページにデータを復帰するためのページイン処理を実行するステップと、
前記ページフォルトの要因が前記仮想計算機管理機構によってページアウトされたページへのアクセスにあると判定された場合、前記仮想計算機管理機構が、その旨を当該ページフォルトが発生したページにアクセスした前記ゲストOSに通知すると共に当該ゲストOSにページフォルトトラップを配信するステップと
を具備することを特徴とする仮想計算機システムにおけるページング処理方法。
A virtual machine management mechanism that performs management for building a plurality of virtual machines by virtualizing hardware including a CPU and executing a plurality of guest OSes on the plurality of virtual machines, and a page by the virtual machine management mechanism A paging processing method in a virtual machine system having page-out management information holding means for holding page-out management information related to an out page,
When a page fault occurs due to a guest OS accessing a page that has been paged out, the virtual machine management mechanism refers to the page-out management information holding unit, and a page related to the page where the page fault has occurred Determining whether the cause of the page fault is an access to a page paged out by the virtual machine management mechanism depending on whether the out management information is retained;
When it is determined that the cause of the page fault is an access to a page paged out by the virtual machine management mechanism, the virtual machine management mechanism uses the page-in for returning data to the page-out page. Executing the process;
When it is determined that the cause of the page fault is an access to a page paged out by the virtual machine management mechanism, the virtual machine management mechanism notifies the guest that has accessed the page in which the page fault has occurred. And a step of notifying the OS and delivering a page fault trap to the guest OS.
JP2009010085A 2009-01-20 2009-01-20 Virtual computer management mechanism, virtual computer system having the management mechanism, and paging processing method in the system Active JP4769308B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009010085A JP4769308B2 (en) 2009-01-20 2009-01-20 Virtual computer management mechanism, virtual computer system having the management mechanism, and paging processing method in the system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009010085A JP4769308B2 (en) 2009-01-20 2009-01-20 Virtual computer management mechanism, virtual computer system having the management mechanism, and paging processing method in the system

Publications (2)

Publication Number Publication Date
JP2010170210A true JP2010170210A (en) 2010-08-05
JP4769308B2 JP4769308B2 (en) 2011-09-07

Family

ID=42702326

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009010085A Active JP4769308B2 (en) 2009-01-20 2009-01-20 Virtual computer management mechanism, virtual computer system having the management mechanism, and paging processing method in the system

Country Status (1)

Country Link
JP (1) JP4769308B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012033001A (en) * 2010-07-30 2012-02-16 Toshiba Corp Information processing apparatus and information processing method
DE102011051642A1 (en) 2010-07-09 2012-03-29 Denso Corporation Rotating electrical machine with improved load-dump protection
US9696933B2 (en) 2014-08-15 2017-07-04 International Business Machines Corporation Virtual machine manager initiated page-in of kernel pages
JP2022522339A (en) * 2019-03-08 2022-04-18 インターナショナル・ビジネス・マシーンズ・コーポレーション Program interrupts for page import / export

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10241924B2 (en) 2016-07-18 2019-03-26 International Business Machines Corporation Reducing over-purging of structures associated with address translation using an array of tags
US10168902B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing purging of structures associated with address translation
US10176111B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Host page management using active guest page table indicators
US10802986B2 (en) 2016-07-18 2020-10-13 International Business Machines Corporation Marking to indicate memory used to back address translation structures
US10176006B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Delaying purging of structures associated with address translation
US10180909B2 (en) 2016-07-18 2019-01-15 International Business Machines Corporation Host-based resetting of active use of guest page table indicators
US10282305B2 (en) 2016-07-18 2019-05-07 International Business Machines Corporation Selective purging of entries of structures associated with address translation in a virtualized environment
US10248573B2 (en) 2016-07-18 2019-04-02 International Business Machines Corporation Managing memory used to back address translation structures
US10223281B2 (en) 2016-07-18 2019-03-05 International Business Machines Corporation Increasing the scope of local purges of structures associated with address translation
US10169243B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing over-purging of structures associated with address translation
US10162764B2 (en) 2016-07-18 2018-12-25 International Business Machines Corporation Marking page table/page status table entries to indicate memory used to back address translation structures
US10176110B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Marking storage keys to indicate memory used to back address translation structures

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62251942A (en) * 1986-04-25 1987-11-02 Hitachi Ltd Virtual computer system
JPH03217949A (en) * 1990-01-23 1991-09-25 Hitachi Ltd Computer system
JPH10260850A (en) * 1997-03-19 1998-09-29 Hitachi Ltd Virtual computer system
JP2006196005A (en) * 2005-01-14 2006-07-27 Intel Corp Virtualization of physical memory in virtual machine system
JP2008513909A (en) * 2004-09-30 2008-05-01 インテル・コーポレーション Method and apparatus for providing support for a timer associated with a virtual machine monitor
JP2008529176A (en) * 2005-01-28 2008-07-31 インテル・コーポレーション Method and apparatus for supporting address translation in a virtual machine environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62251942A (en) * 1986-04-25 1987-11-02 Hitachi Ltd Virtual computer system
JPH03217949A (en) * 1990-01-23 1991-09-25 Hitachi Ltd Computer system
JPH10260850A (en) * 1997-03-19 1998-09-29 Hitachi Ltd Virtual computer system
JP2008513909A (en) * 2004-09-30 2008-05-01 インテル・コーポレーション Method and apparatus for providing support for a timer associated with a virtual machine monitor
JP2006196005A (en) * 2005-01-14 2006-07-27 Intel Corp Virtualization of physical memory in virtual machine system
JP2008529176A (en) * 2005-01-28 2008-07-31 インテル・コーポレーション Method and apparatus for supporting address translation in a virtual machine environment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102011051642A1 (en) 2010-07-09 2012-03-29 Denso Corporation Rotating electrical machine with improved load-dump protection
JP2012033001A (en) * 2010-07-30 2012-02-16 Toshiba Corp Information processing apparatus and information processing method
US9696933B2 (en) 2014-08-15 2017-07-04 International Business Machines Corporation Virtual machine manager initiated page-in of kernel pages
JP2022522339A (en) * 2019-03-08 2022-04-18 インターナショナル・ビジネス・マシーンズ・コーポレーション Program interrupts for page import / export
JP7461694B2 (en) 2019-03-08 2024-04-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Program interruption for importing/exporting pages

Also Published As

Publication number Publication date
JP4769308B2 (en) 2011-09-07

Similar Documents

Publication Publication Date Title
JP4769308B2 (en) Virtual computer management mechanism, virtual computer system having the management mechanism, and paging processing method in the system
US8799554B1 (en) Methods and system for swapping memory in a virtual machine environment
US10776151B2 (en) Adaptive CPU NUMA scheduling
JP5091215B2 (en) System and method for enhancing coprocessor performance
US8595361B2 (en) Virtual machine software license management
JP5385347B2 (en) Method and computer for enlarging free memory in main memory
US7552293B2 (en) Kernel and application cooperative memory management
JP5433676B2 (en) Processor device, multi-thread processor device
US20180225155A1 (en) Workload optimization system
US10705849B2 (en) Mode-selectable processor for execution of a single thread in a first mode and plural borrowed threads in a second mode
US8793439B2 (en) Accelerating memory operations using virtualization information
JP2009110404A (en) Virtual machine system and guest os scheduling method in the same system
JP2004272894A (en) Multithread kernel of graphics processing unit
JP2021048513A (en) Information processing device, information processing method, and virtual machine connection management program
KR20040028805A (en) System for Yielding to a Processor
JP2007220086A (en) Input/output controller, input/output control system, and input/output control method
JP2006350780A (en) Cache allocation control method
WO2012061941A1 (en) Managing memory across a network of cloned virtual machines
US20130347000A1 (en) Computer, virtualization mechanism, and scheduling method
KR20110094764A (en) Virtualization apparatus for providing transactional input and output interface and method thereof
US7818558B2 (en) Method and apparatus for EFI BIOS time-slicing at OS runtime
JP2009223842A (en) Virtual machine control program and virtual machine system
CN112162818B (en) Virtual memory allocation method and device, electronic equipment and storage medium
Kilic et al. Overcoming virtualization overheads for large-vcpu virtual machines
JP4862770B2 (en) Memory management method and method in virtual machine system, and program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110114

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110125

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110328

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110617

R150 Certificate of patent or registration of utility model

Ref document number: 4769308

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140624

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350