JP2012043089A - Information processor and program - Google Patents

Information processor and program Download PDF

Info

Publication number
JP2012043089A
JP2012043089A JP2010182218A JP2010182218A JP2012043089A JP 2012043089 A JP2012043089 A JP 2012043089A JP 2010182218 A JP2010182218 A JP 2010182218A JP 2010182218 A JP2010182218 A JP 2010182218A JP 2012043089 A JP2012043089 A JP 2012043089A
Authority
JP
Japan
Prior art keywords
shared memory
capacity
area
storage
allocated
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.)
Pending
Application number
JP2010182218A
Other languages
Japanese (ja)
Inventor
Tadao Michimura
唯夫 道村
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP2010182218A priority Critical patent/JP2012043089A/en
Publication of JP2012043089A publication Critical patent/JP2012043089A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To allocate a shared memory to an OS having no virtual storage functions even if a free space in the shared memory of a virtual machine fragments.SOLUTION: An information processor specifies a free space allocated to none of processes within a shared memory 103A when a first OS 300 that controls a first process 310 requesting allocation of the shared memory 103A has no virtual storage functions. When the free space with consecutive physical addresses that has a capacity equal to or greater than a requested amount is not extracted, the information processor writes a memory content in an allocated memory area into another memory area within the shared memory so as to obtain the free space with consecutive physical addresses that has a capacity equal to or greater than the requested amount, notifies the first process 310 of a location of free space with consecutive physical addresses and notifies a process corresponding to a memory content written into another memory area of a memory location of the memory content.

Description

本発明は、情報処理装置及びプログラムに関する。   The present invention relates to an information processing apparatus and a program.

1台のコンピュータ上で複数のOS(Operating System)を並列的に動作させることによって1台のコンピュータを複数のコンピュータとして使用する仮想計算機が知られている。仮想計算機においては、仮想計算機を実現するための基本プログラムであるハイパーバイザを動作させ、ハイパーバイザの制御下で複数のOSを動作させる。
ハイパーバイザの役割の1つが、主記憶装置の記憶領域の管理である。例えば、特許文献1に記載された発明では、まず、第1の記憶領域を第1のOSに割り当て、第2の記憶領域を第2のOSに割り当て、第1の記憶領域の一部分を共有メモリに設定する。第1のOS、第2のOSは、記憶領域の物理アドレスと仮想アドレスとを対応付ける変換テーブルを有し、第2のOSがハイパーバイザに共有メモリの使用を要求すると、ハイパーバイザが、第2のOSの変換テーブルに記憶されている第2の記憶領域の先頭の物理アドレスを共有メモリの先頭の物理アドレスに書き換える。
There is known a virtual machine that uses one computer as a plurality of computers by operating a plurality of OSs (Operating Systems) in parallel on one computer. In the virtual machine, a hypervisor which is a basic program for realizing the virtual machine is operated, and a plurality of OSs are operated under the control of the hypervisor.
One of the roles of the hypervisor is to manage the storage area of the main storage device. For example, in the invention described in Patent Document 1, first, a first storage area is assigned to a first OS, a second storage area is assigned to a second OS, and a part of the first storage area is shared memory. Set to. The first OS and the second OS have a conversion table that associates the physical address and the virtual address of the storage area. When the second OS requests the hypervisor to use the shared memory, the hypervisor The top physical address of the second storage area stored in the OS conversion table is rewritten to the top physical address of the shared memory.

特許第3874603号公報Japanese Patent No. 3874603

本発明は、仮想計算機の共有メモリの空き領域が断片化した場合であっても、仮想記憶機能を有しないOSに対して共有メモリを割り当てることを目的とする。   An object of the present invention is to allocate a shared memory to an OS that does not have a virtual storage function even when a free area of the shared memory of a virtual machine is fragmented.

請求項1に係る発明は、第1のプロセスから主記憶装置の共有メモリの割り当ての要求を受け付ける受付手段と、前記受付手段によって要求を受け付けた場合に、前記第1のプロセスを制御するOS(Operating System)が仮想記憶機能を有するか否かを判別する判別手段と、前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する抽出手段と、前記抽出手段によって前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が抽出されなかった場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が得られるように、前記第1のプロセス以外のプロセスに割り当て済みの記憶領域の記憶内容を共有メモリ内の別の記憶領域に書き込む書込手段と、前記書込手段によって得られた、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域の場所を前記第1のプロセスに通知し、前記書込手段によって書き込まれた記憶内容の記憶場所を当該記憶内容に対応するプロセスに通知する通知手段とを有することを特徴とする情報処理装置を提供する。   The invention according to claim 1 is a receiving unit that receives a request to allocate a shared memory of the main storage device from the first process, and an OS that controls the first process when the request is received by the receiving unit. The operating system is assigned to any process in the shared memory when it is determined by the determining means that the OS does not have a virtual storage function. An unoccupied free area, and extracting means for extracting a continuous free area of physical addresses having a capacity greater than or equal to the requested amount from the first process; and an amount greater than the requested amount from the first process by the extracting means A physical address having a capacity equal to or greater than the requested amount from the first process when a continuous free area of the physical address having a capacity of A writing means for writing storage contents of a storage area allocated to a process other than the first process to another storage area in the shared memory, so that a continuous free area can be obtained. The obtained storage location of the storage content written by the writing means is notified to the first process of the location of the continuous free area of the physical address having a capacity larger than the requested amount from the first process. An information processing apparatus is provided that includes notification means for notifying a process corresponding to the stored content.

請求項2に係る発明は、前記抽出手段は、前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、特定された空き領域の容量の合計が前記第1のプロセスからの要求量以上である場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出することを特徴とする請求項1に記載の情報処理装置を提供する。   According to a second aspect of the present invention, the extracting unit specifies a free area that is not allocated to any process in the shared memory when the determining unit determines that the OS does not have a virtual storage function. If the total capacity of the specified free areas is equal to or larger than the requested amount from the first process, continuous free areas of physical addresses having a capacity larger than the requested amount from the first process are extracted. The information processing apparatus according to claim 1 is provided.

請求項3に係る発明は、コンピュータを、第1のプロセスから主記憶装置の共有メモリの割り当ての要求を受け付ける受付手段と、前記受付手段によって要求を受け付けた場合に、前記第1のプロセスを制御するOS(Operating System)が仮想記憶機能を有するか否かを判別する判別手段と、前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する抽出手段と、前記抽出手段によって前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が抽出されなかった場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が得られるように、前記第1のプロセス以外のプロセスに割り当て済みの記憶領域の記憶内容を共有メモリ内の別の記憶領域に書き込む書込手段と、前記書込手段によって得られた、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域の場所を前記第1のプロセスに通知し、前記書込手段によって書き込まれた記憶内容の記憶場所を当該記憶内容に対応するプロセスに通知する通知手段として機能させるためのプログラムを提供する。   The invention according to claim 3 controls the first process when the computer accepts a request for allocation of the shared memory of the main storage device from the first process and the request by the accepting unit. A determination unit that determines whether or not an operating system (OS) to operate has a virtual storage function, and which process in the shared memory when the determination unit determines that the OS does not have a virtual storage function An unassigned free area, and extracting means for extracting continuous free areas of physical addresses having a capacity equal to or greater than the requested amount from the first process; and from the first process by the extracting means When a continuous free area of a physical address having a capacity larger than the requested amount is not extracted, the capacity larger than the requested amount from the first process Writing means for writing the storage contents of a storage area allocated to a process other than the first process to another storage area in a shared memory, so that a continuous free area of physical addresses having The storage contents obtained by the writing means are notified to the first process of the location of the continuous free area of the physical address having a capacity equal to or larger than the requested amount from the first process. A program for causing the storage location to function as notification means for notifying the process corresponding to the storage content is provided.

請求項1、3に係る発明によれば、仮想計算機の共有メモリの空き領域が断片化した場合であっても、仮想記憶機能を有しないOSに対して共有メモリを割り当てることができる。
請求項2に係る発明によれば、無駄な処理を省くことができる。
According to the first and third aspects of the invention, even when the free area of the shared memory of the virtual machine is fragmented, the shared memory can be allocated to an OS that does not have a virtual storage function.
According to the second aspect of the invention, useless processing can be omitted.

情報処理装置1の構成を概念的に表す図である。1 is a diagram conceptually illustrating a configuration of an information processing device 1. FIG. ハードウェア100の構成を表す図である。2 is a diagram illustrating a configuration of hardware 100. FIG. 共有メモリ管理テーブル201を表す図である。6 is a diagram illustrating a shared memory management table 201. FIG. ハイパーバイザ200が記憶領域を割り当てる処理の手順を表す図である。It is a figure showing the procedure of the process which the hypervisor 200 allocates a storage area. 共有メモリの割り当ての様子を表す図である。It is a figure showing the mode of allocation of a shared memory. 共有メモリの割り当ての様子を表す図である。It is a figure showing the mode of allocation of a shared memory. 共有メモリの割り当ての様子を表す図である。It is a figure showing the mode of allocation of a shared memory. 共有メモリの割り当ての様子を表す図である。It is a figure showing the mode of allocation of a shared memory.

これより、実施形態について説明する。
(1)構成
図1は、本実施形態の情報処理装置1の構成を概念的に表す図である。情報処理装置1は、例えば画像形成装置を制御する制御装置として画像形成装置に組み込まれる。
図2は、ハードウェア100の構成を表す図である。ハードウェア100は、CPU(Central Processing Unit)101、ROM(Read Only Memory)102、RAM(Random Access Memory)103、記憶部104、操作部105、表示部106を備えている。
The embodiment will now be described.
(1) Configuration FIG. 1 is a diagram conceptually showing the configuration of the information processing apparatus 1 of the present embodiment. The information processing apparatus 1 is incorporated in an image forming apparatus as a control device that controls the image forming apparatus, for example.
FIG. 2 is a diagram illustrating the configuration of the hardware 100. The hardware 100 includes a CPU (Central Processing Unit) 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, a storage unit 104, an operation unit 105, and a display unit 106.

RAM103は、主記憶装置であり、CPU101が各種プログラムを実行する際にプログラム本体や処理の対象となるデータを書き出すためのワークエリアとして使用される。
記憶部104は、ハードディスク記憶装置等の補助記憶装置であり、ハイパーバイザ200、第1のOS(Operating System)300、第2のOS400、アプリケーションプログラム等が記憶されている。ROM102には、ハイパーバイザ200及びOSの読み出しと実行の手順を表すプログラムが記憶されている。
操作部105は、キーボード及びマウスである。表示部106は、例えば液晶表示装置である。
The RAM 103 is a main storage device, and is used as a work area for writing the program body and data to be processed when the CPU 101 executes various programs.
The storage unit 104 is an auxiliary storage device such as a hard disk storage device, and stores a hypervisor 200, a first OS (Operating System) 300, a second OS 400, application programs, and the like. The ROM 102 stores a program representing a procedure for reading and executing the hypervisor 200 and the OS.
The operation unit 105 is a keyboard and a mouse. The display unit 106 is a liquid crystal display device, for example.

ハイパーバイザ200は、ハードウェア100上で複数のOSを並列的に動作させるための制御を行うプログラムである。第1のOS300、第2のOS400は、ハイパーバイザの制御下で並列的に動作し、第1のプロセス310、第2のプロセス410は、それぞれ第1のOS300、第2のOS400の制御下で動作する。
ハイパーバイザ200は、RAM103が有する記憶領域の一部を、複数のプロセスからアクセス可能な共有メモリに設定し、共有メモリの各プロセスへの割り当てを行う。ハイパーバイザ200は、図3に示す共有メモリ管理テーブル201を有し、共有メモリにおいて各プロセスに割り当てられている領域の先頭アドレス及び容量を、プロセスの識別子と対応付けて共有メモリ管理テーブル201に記憶する。
The hypervisor 200 is a program that performs control for operating a plurality of OSs in parallel on the hardware 100. The first OS 300 and the second OS 400 operate in parallel under the control of the hypervisor, and the first process 310 and the second process 410 are under the control of the first OS 300 and the second OS 400, respectively. Operate.
The hypervisor 200 sets a part of the storage area of the RAM 103 as a shared memory accessible from a plurality of processes, and assigns the shared memory to each process. The hypervisor 200 has the shared memory management table 201 shown in FIG. 3, and stores the top address and capacity of the area allocated to each process in the shared memory in association with the process identifier in the shared memory management table 201. To do.

なお、ここでは、2つのOSを並列的に動作させる例を示すが、並列的に動作させるOSの数はいくつでもよい。また、各OSの制御下で動作するプロセスの数はいくつでもよい。また、各プロセスは、各OSが実行する処理の単位としてのプロセスでもよいし、各OSの制御下で動作するアプリケーションプログラムが実行する処理の単位としてのプロセスでもよい。また、第1のOS300、第2のOS400とは別のOSをハードウェア100上で動作させ、このOSの制御下でハイパーバイザ200を動作させるようにしてもよい。   Although an example in which two OSs are operated in parallel is shown here, any number of OSs may be operated in parallel. Further, the number of processes operating under the control of each OS is not limited. Each process may be a process as a unit of processing executed by each OS, or may be a process as a unit of processing executed by an application program operating under the control of each OS. Further, an OS other than the first OS 300 and the second OS 400 may be operated on the hardware 100, and the hypervisor 200 may be operated under the control of the OS.

第1のOS300は、仮想記憶機能を有しないOSであり、例えば、リアルタイムOSや、OSに組み込まれたデバイスドライバである。仮想計算機においては、複数のOSのうちの或るOSに割り当てられた記憶領域が開放されたために空き領域が断片化する場合がある。この場合、空き領域の物理アドレスは、不連続となる。従って、第1のOS300が、断片化した各空き領域よりも大きな容量の記憶領域の割り当てを要求した場合、第1のOS300に断片化した空き領域を割り当てたとしても、第1のOS300は空き領域に正しくアクセスすることができない。   The first OS 300 is an OS that does not have a virtual storage function, and is, for example, a real-time OS or a device driver incorporated in the OS. In a virtual machine, a free area may become fragmented because a storage area allocated to a certain OS among a plurality of OSs is released. In this case, the physical address of the free area is discontinuous. Accordingly, when the first OS 300 requests allocation of a storage area having a capacity larger than each fragmented free area, the first OS 300 is free even if the fragmented free area is allocated to the first OS 300. The area cannot be accessed correctly.

一方、第2のOS400は、仮想記憶機能を有するOSである。第2のOS400は、RAM103上の物理アドレスと仮想アドレスとを対応付けて記憶するアドレス変換テーブル401を有する。仮想アドレス空間では、先頭アドレスから末尾アドレスまでが連続している。第2のOS400の制御下で動作する第2のプロセス410を起動する場合、ハイパーバイザ200は、RAM103上の空き領域を第2のプロセス410に割り当てるが、この際、空き領域の物理アドレスと仮想アドレスとを低位アドレス側から順に1対1に対応付けてアドレス変換テーブル401に書き込む。RAM103にアクセスする場合、第2のプロセス410は、アドレス変換テーブル401に基づいて、仮想アドレスを物理アドレスに変換し、当該物理アドレスに対応する記憶領域にアクセスする。   On the other hand, the second OS 400 is an OS having a virtual storage function. The second OS 400 has an address conversion table 401 that stores a physical address and a virtual address on the RAM 103 in association with each other. In the virtual address space, the head address to the tail address are continuous. When starting the second process 410 that operates under the control of the second OS 400, the hypervisor 200 allocates a free area on the RAM 103 to the second process 410. At this time, the physical address and virtual address of the free area are allocated. Addresses are written to the address conversion table 401 in a one-to-one correspondence from the lower address side. When accessing the RAM 103, the second process 410 converts the virtual address into a physical address based on the address conversion table 401, and accesses the storage area corresponding to the physical address.

(2)動作
図4は、ハイパーバイザ200がプロセスに記憶領域を割り当てる処理の手順を表す図である。ここで、CPU101は、ハイパーバイザ200、第1のOS300及び第2のOS400を実行中である。いずれかのOSの制御下で新規にプロセスが起動され、当該プロセスが或る容量の共有メモリの割り当てをCPU101に要求した場合に、CPU101が、以下に示す処理を実行する。つまり、以下に示す処理は、CPU101がハイパーバイザ200を実行することによって実現される処理であって、動作の物理的な主体はCPU101であるが、便宜上、ハイパーバイザ200を動作の主体として説明する。
(2) Operation FIG. 4 is a diagram illustrating a procedure of processing in which the hypervisor 200 allocates a storage area to a process. Here, the CPU 101 is executing the hypervisor 200, the first OS 300, and the second OS 400. When a process is newly activated under the control of any OS and the process requests the CPU 101 to allocate a certain amount of shared memory, the CPU 101 executes the following processing. That is, the processing shown below is processing realized by the CPU 101 executing the hypervisor 200, and the physical subject of the operation is the CPU 101. However, for convenience, the hypervisor 200 will be described as the subject of the operation. .

ステップA01では、ハイパーバイザ200が、共有メモリの割り当てを要求したプロセスを制御するOSが仮想記憶機能を有するか否かを当該プロセス又は当該OSに問い合わせる。当該OSが仮想記憶機能を有する場合(ステップA01:YES)には、ステップA08に進み、仮想記憶機能を有しない場合(ステップA01:NO)には、ステップA02に進む。
要するに、CPU101は、第1のプロセスから主記憶装置の共有メモリの割り当ての要求を受け付ける受付手段と、前記受付手段によって要求を受け付けた場合に、前記第1のプロセスを制御するOS(Operating System)が仮想記憶機能を有するか否かを判別する判別手段の一例である。
In step A01, the hypervisor 200 inquires of the process or the OS whether the OS that controls the process that requested the allocation of the shared memory has a virtual storage function. If the OS has a virtual storage function (step A01: YES), the process proceeds to step A08. If the OS does not have a virtual storage function (step A01: NO), the process proceeds to step A02.
In short, the CPU 101 receives a request for allocation of the shared memory of the main storage device from the first process, and an OS (Operating System) that controls the first process when the request is received by the receiving means. 3 is an example of a determination unit that determines whether or not has a virtual storage function.

ステップA02では、ハイパーバイザ200は、共有メモリ管理テーブル201を参照し、どのプロセスにも割り当てられていない領域(空き領域)の先頭アドレスと容量を特定する。空き領域が断片化している場合、先頭アドレスと容量の組が複数特定される。そして、空き領域の容量を合計し、空き容量の合計がプロセスからの要求量以上であるか否かを判断する。空き容量の合計が要求量以上である場合(ステップA02:YES)には、ステップA03に進み、要求量以上でない場合(ステップA02:NO)には、共有メモリの割り当てが不可能である旨を当該プロセスに通知し、処理を終了する。   In step A02, the hypervisor 200 refers to the shared memory management table 201 and identifies the start address and capacity of an area (free area) that is not assigned to any process. When the free area is fragmented, a plurality of sets of head address and capacity are specified. Then, the capacities of the free areas are summed, and it is determined whether or not the sum of the free capacities is equal to or greater than the request amount from the process. If the total free capacity is equal to or greater than the requested amount (step A02: YES), the process proceeds to step A03. If not greater than the requested amount (step A02: NO), it is indicated that the shared memory cannot be allocated. The process is notified and the process ends.

ステップA03では、ハイパーバイザ200は、ステップA02で特定された容量に基づいて、要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する。要求量以上の容量を有する物理アドレスの連続した空き領域が抽出された場合(ステップA03:YES)には、ステップA04に進み、このような空き領域が抽出されなかった場合(ステップA03:NO)には、ステップA05に進む。
要するに、CPU101は、前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する抽出手段の一例である。
In step A03, the hypervisor 200 extracts continuous free areas of physical addresses having a capacity equal to or larger than the requested amount based on the capacity specified in step A02. When a continuous free area of physical addresses having a capacity larger than the requested amount is extracted (step A03: YES), the process proceeds to step A04, and when such a free area is not extracted (step A03: NO). The process proceeds to step A05.
In short, when the CPU 101 determines that the OS does not have a virtual storage function by the determination unit, the CPU 101 specifies a free area that is not allocated to any process in the shared memory, and starts from the first process. It is an example of the extraction means which extracts the continuous empty area | region of the physical address which has the capacity | capacitance more than the required amount of.

ステップA04では、ハイパーバイザ200は、要求量以上の容量を有する物理アドレスの連続した空き領域のうち、先頭アドレスが最も低位である空き領域を当該プロセスに割り当てる。具体的には、ハイパーバイザ200は、当該空き領域の先頭アドレスと容量を当該プロセスの識別子と対応付けて、共有メモリ管理テーブル201に書き込み、当該先頭アドレスを当該プロセスに通知する。   In step A04, the hypervisor 200 allocates, to the process, a free area with the lowest start address among consecutive free areas of physical addresses having a capacity larger than the requested amount. Specifically, the hypervisor 200 associates the start address and capacity of the free area with the identifier of the process, writes them in the shared memory management table 201, and notifies the process of the start address.

一方、ステップA05では、ハイパーバイザ200は、アドレスの低位側から、空き領域の容量を、その和が要求量以上になるまで加算する。具体的には、先頭アドレスが最も低位である空き領域と先頭アドレスが2番目に低位である空き領域の容量の和を求める。求められた和が要求量以上でない場合は、先頭アドレスが3番目に低位である空き領域の容量を和に加算し、容量の和が要求量以上となるまでこの手順を繰り返す。そして、既にプロセスに割り当てられている領域のうち、最後に容量を加算した空き領域よりも先頭アドレスが低位である領域を抽出する。抽出された領域を要移動領域と呼ぶ。そして、要移動領域を割り当てられているプロセスを共有メモリ管理テーブル201から特定し、特定されたプロセスに対して、要移動領域の記憶内容の移動を通知する。   On the other hand, in step A05, the hypervisor 200 adds the capacity of the free area from the lower address side until the sum exceeds the required amount. Specifically, the sum of the capacities of the empty area with the lowest start address and the empty area with the second lowest start address is obtained. If the calculated sum is not equal to or greater than the required amount, the capacity of the empty area whose head address is the third lowest is added to the sum, and this procedure is repeated until the sum of the capacities exceeds the required amount. Then, out of the areas already allocated to the process, an area having a head address lower than the empty area to which the capacity is added last is extracted. The extracted area is called a movement required area. Then, the process to which the required movement area is allocated is specified from the shared memory management table 201, and the movement of the storage contents of the required movement area is notified to the specified process.

ステップA06では、ハイパーバイザ200が、記憶内容の移動を通知されたプロセスから承諾の通知を受けるまで待機し、通知を受けたならば(ステップA06:YES)、ステップA07に進む。記憶内容の移動を通知されたプロセスは、記憶内容の移動が可能になり次第、移動の承諾をCPU101に通知する。   In step A06, the hypervisor 200 waits until it receives a notification of acceptance from the process that has been notified of the movement of the stored contents. If the notification is received (step A06: YES), the process proceeds to step A07. The process notified of the movement of the stored contents notifies the CPU 101 of the approval of the movement as soon as the stored contents can be moved.

ステップA07では、ハイパーバイザ200が、要移動領域の記憶内容の複製を共有メモリの先頭アドレスから連続させて書き込み、書き込みが完了したならば、書き込んだ領域の末尾の次のアドレスからステップA05で最後に容量を加算した空き領域の末尾のアドレスまでの記憶内容を消去し、記憶内容を消去した領域の先頭アドレスと容量を、共有メモリの割り当てを要求したプロセスの識別子と対応付けて、共有メモリ管理テーブル201に書き込み、当該プロセスに対して、当該先頭アドレスを通知する。さらに、記憶内容の移動の対象となったプロセスに対して、移動先の領域の先頭アドレスを通知し、処理を終了する。
要するに、CPU101は、前記抽出手段によって前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が抽出されなかった場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が得られるように、前記第1のプロセス以外のプロセスに割り当て済みの記憶領域の記憶内容を共有メモリ内の別の記憶領域に書き込む書込手段と、前記書込手段によって得られた、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域の場所を前記第1のプロセスに通知し、前記書込手段によって書き込まれた記憶内容の記憶場所を当該記憶内容に対応するプロセスに通知する通知手段の一例である。
In step A07, the hypervisor 200 writes a copy of the storage contents of the area to be moved continuously from the start address of the shared memory. When the writing is completed, the hypervisor 200 ends the process in step A05 from the next address at the end of the written area. The memory contents up to the last address of the free area plus the capacity are deleted, and the start address and capacity of the area where the memory contents are erased are associated with the identifier of the process that requested the allocation of shared memory, and the shared memory management Write to the table 201 and notify the process of the start address. Further, the start address of the destination area is notified to the process whose storage contents are to be moved, and the process is terminated.
In short, the CPU 101 has a capacity larger than the required amount from the first process when the continuous free area of the physical address having a larger capacity than the required amount from the first process is not extracted by the extracting unit. Writing means for writing the storage contents of a storage area allocated to a process other than the first process to another storage area in a shared memory, so that a continuous free area of physical addresses having The storage contents obtained by the writing means are notified to the first process of the location of the continuous free area of the physical address having a capacity equal to or larger than the requested amount from the first process. This is an example of notification means for notifying the process corresponding to the stored contents of the storage location.

ステップA08では、ハイパーバイザ200が、共有メモリ管理テーブル201を参照し、空き領域の先頭アドレスと容量を特定し、アドレスの低位側から空き領域をプロセスに割り当てる。具体的には、空き領域の先頭アドレスと容量をプロセスの識別子と対応付けて共有メモリ管理テーブル201に書き込み、当該先頭アドレスをプロセスに通知する。空き領域が断片化している場合、先頭アドレスが最も低位の空き領域だけでは要求量を満たさないことがあり得るが、この場合には、断片化した複数の空き領域をアドレスの低位側から要求量を満たすまで順に割り当てる。割り当てが完了したならば、処理を終了する。
以上が、ハイパーバイザ200がプロセスに記憶領域を割り当てる処理の手順である。
In step A08, the hypervisor 200 refers to the shared memory management table 201, identifies the start address and capacity of the free area, and assigns the free area to the process from the lower address side. Specifically, the free space start address and capacity are written in the shared memory management table 201 in association with the process identifier, and the start address is notified to the process. If the free space is fragmented, the request amount may not be satisfied with only the free space with the lowest start address, but in this case, the request amount of the fragmented free regions from the low address side Assign in order until it meets. When the assignment is completed, the process is terminated.
The above is the procedure of the process in which the hypervisor 200 allocates a storage area to the process.

次に、上記の手順に従って行われる割り当ての具体例について説明する。
図5は、共有メモリ103Aの割り当ての様子を表す図である。この例では、ハイパーバイザ200は、共有メモリ103Aの記憶領域を4kB(kilobyte)を1ブロックとして管理し、共有メモリ103Aとして使用可能な容量は、最大で2MB(megabyte)すなわち512ブロックである。同図は、第1のプロセス310に対して先頭から256ブロックが割り当てられた状態を表す。なお、RAM103上では、共有メモリ103Aとは別の記憶領域が、各OS、各プロセスに専用の記憶領域として割り当てられるが、ここでは、共有メモリ103Aに設定された記憶領域のみ図示している。
Next, a specific example of assignment performed according to the above procedure will be described.
FIG. 5 is a diagram illustrating how the shared memory 103A is allocated. In this example, the hypervisor 200 manages the storage area of the shared memory 103A as 4 kB (kilobyte) as one block, and the maximum usable capacity as the shared memory 103A is 2 MB (megabyte), that is, 512 blocks. This figure shows a state in which 256 blocks are allocated to the first process 310 from the top. On the RAM 103, a storage area different from the shared memory 103A is allocated as a dedicated storage area for each OS and each process, but only the storage area set in the shared memory 103A is shown here.

次に、第2のプロセス410が、16ブロックの割り当てをハイパーバイザ200に要求したとする。すると、図6に示すように、既に第1のプロセス310に割り当てられているブロックの末尾の次のブロックを先頭として、16ブロックが割り当てられる。
次に、第1のプロセス310が、割り当てられたブロックの解放をハイパーバイザ200に通知したとする。すると、図7に示すように、先頭から256ブロックが解放されるが、空き領域は、第2のプロセス410に割り当てられたブロックにより、先頭から256ブロックの部分と末尾から240ブロックの部分に断片化されてしまう。
Next, it is assumed that the second process 410 requests the hypervisor 200 to allocate 16 blocks. Then, as shown in FIG. 6, 16 blocks are allocated with the next block at the end of the block already allocated to the first process 310 as the head.
Next, it is assumed that the first process 310 notifies the hypervisor 200 of the release of the allocated block. Then, as shown in FIG. 7, 256 blocks are released from the beginning, but the free space is fragmented into a portion of 256 blocks from the beginning and a portion of 240 blocks from the end by the block allocated to the second process 410. It will be converted.

次に、第1のプロセス310が、384ブロックの割り当てをハイパーバイザ200に要求したとする。この場合、第1のプロセス310を制御する第1のOSは仮想記憶機能を有しないから、図7のように断片化した2つの空き領域を割り当てられると、2つの空き領域の物理アドレスが連続していないため、第1のプロセス310は共有メモリ103Aに正しくアクセスすることができない。そこで、ハイパーバイザ200は、図8に示すように、第2のプロセス410に割り当てられた16ブロックの記憶内容を共有メモリ103Aの先頭の16ブロックに移動させ、その結果、物理アドレスが連続した496ブロックの空き領域を得る。そして、この空き領域の先頭から384ブロックを第1のプロセス310に割り当てる。割り当てられた領域は、物理アドレスが連続している。   Next, it is assumed that the first process 310 requests the hypervisor 200 to allocate 384 blocks. In this case, since the first OS that controls the first process 310 does not have a virtual storage function, when two free areas fragmented as shown in FIG. 7 are allocated, the physical addresses of the two free areas are consecutive. Therefore, the first process 310 cannot correctly access the shared memory 103A. Therefore, as shown in FIG. 8, the hypervisor 200 moves the storage contents of 16 blocks allocated to the second process 410 to the first 16 blocks of the shared memory 103A, and as a result, 496 with physical addresses consecutive. Get free space in the block. Then, 384 blocks from the head of this empty area are allocated to the first process 310. In the allocated area, physical addresses are continuous.

(3)変形例
以下に示す変形例は互いに組み合わせてもよい。
(3.1)変形例1
実施形態では、第2のOS400が仮想記憶機能を有するものとしたが、ハイパーバイザ200の制御下で動作させるすべてのOSが仮想記憶機能を有しない構成でもよい。
(3.2)変形例2
実施形態では、プロセスからの要求量を確保するのに必要なだけ記憶内容を移動させるようにしたが、既に他のプロセスに割り当てられている領域の記憶内容をすべて移動させるようにしてもよい。また、実施形態では、要移動量域の記憶内容を物理アドレスの低位側に移動させるようにしたが、高位側に移動させるようにしてもよい。要するに、プロセスからの要求量以上の容量を有する物理アドレスの連続した記憶領域が得られるように、既に他のプロセスに割り当てられている領域の記憶内容を移動させる構成であればよい。
(3) Modifications Modifications shown below may be combined with each other.
(3.1) Modification 1
In the embodiment, the second OS 400 has the virtual storage function. However, all the OSs operated under the control of the hypervisor 200 may have a configuration that does not have the virtual storage function.
(3.2) Modification 2
In the embodiment, the stored contents are moved as much as necessary to secure the requested amount from the process. However, all the stored contents in the areas already allocated to other processes may be moved. In the embodiment, the storage content of the required movement amount area is moved to the lower side of the physical address, but may be moved to the higher side. In short, the storage contents of an area already allocated to another process may be moved so that a continuous storage area of physical addresses having a capacity larger than the amount required by the process can be obtained.

(3.3)変形例3
実施形態では、プロセスに割り当てる領域の先頭アドレスと容量とを共有メモリ管理テーブル201に記憶させるようにしたが、先頭アドレスと末尾アドレスを記憶させるようにしてもよい。
(3.4)変形例4
実施形態のステップA02の処理を省略してもよい。
(3.5)変形例5
実施形態では、プロセスを制御するOSが仮想記憶機能を有するか否かをハイパーバイザ200がプロセスに問い合わせるようにしたが、プロセスが共有メモリの割り当てを要求する際に、OSが仮想記憶機能を有するか否かを示す情報を当該要求に含ませるようにしてもよい。
(3.6)変形例6
実施形態では、CPUがプログラムを実行することによって共有メモリの割り当てに関する処理を実行する例を示したが、同様の機能を電子回路に実装するようにしてもよい。
(3.3) Modification 3
In the embodiment, the head address and the capacity of the area allocated to the process are stored in the shared memory management table 201. However, the head address and the tail address may be stored.
(3.4) Modification 4
You may abbreviate | omit the process of step A02 of embodiment.
(3.5) Modification 5
In the embodiment, the hypervisor 200 inquires of the process whether or not the OS that controls the process has the virtual memory function. However, when the process requests allocation of the shared memory, the OS has the virtual memory function. Information indicating whether or not the request may be included in the request.
(3.6) Modification 6
In the embodiment, the example in which the CPU executes the process related to the allocation of the shared memory by executing the program has been described. However, the same function may be mounted on the electronic circuit.

1…情報処理装置、100…ハードウェア、101…CPU、102…ROM、103…RAM、103A…共有メモリ、104…記憶部、105…操作部、106…表示部、200…ハイパーバイザ、300…第1のOS、400…第2のOS、310…第1のプロセス、410…第2のプロセス、201…共有メモリ管理テーブル、401…アドレス変換テーブル DESCRIPTION OF SYMBOLS 1 ... Information processing apparatus, 100 ... Hardware, 101 ... CPU, 102 ... ROM, 103 ... RAM, 103A ... Shared memory, 104 ... Memory | storage part, 105 ... Operation part, 106 ... Display part, 200 ... Hypervisor, 300 ... 1st OS, 400 ... 2nd OS, 310 ... 1st process, 410 ... 2nd process, 201 ... Shared memory management table, 401 ... Address conversion table

Claims (3)

第1のプロセスから主記憶装置の共有メモリの割り当ての要求を受け付ける受付手段と、
前記受付手段によって要求を受け付けた場合に、前記第1のプロセスを制御するOS(Operating System)が仮想記憶機能を有するか否かを判別する判別手段と、
前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する抽出手段と、
前記抽出手段によって前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が抽出されなかった場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が得られるように、前記第1のプロセス以外のプロセスに割り当て済みの記憶領域の記憶内容を共有メモリ内の別の記憶領域に書き込む書込手段と、
前記書込手段によって得られた、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域の場所を前記第1のプロセスに通知し、前記書込手段によって書き込まれた記憶内容の記憶場所を当該記憶内容に対応するプロセスに通知する通知手段と
を有することを特徴とする情報処理装置。
Receiving means for receiving a request for allocation of the shared memory of the main storage device from the first process;
A determination unit that determines whether an OS (Operating System) that controls the first process has a virtual storage function when a request is received by the reception unit;
When the determination unit determines that the OS does not have a virtual storage function, it identifies a free area that is not allocated to any process in the shared memory, and exceeds the amount requested from the first process. Extraction means for extracting continuous free space of physical addresses having a capacity;
When a continuous free area of a physical address having a capacity larger than the requested amount from the first process is not extracted by the extracting unit, a physical address having a larger capacity than the requested amount from the first process is extracted. Writing means for writing storage contents of a storage area allocated to a process other than the first process to another storage area in the shared memory so that a continuous free area can be obtained;
Notifying the first process of the location of consecutive free areas of physical addresses having a capacity equal to or greater than the requested amount from the first process, obtained by the writing means, and written by the writing means An information processing apparatus comprising: a notification unit configured to notify a storage location of stored content to a process corresponding to the stored content.
前記抽出手段は、前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、特定された空き領域の容量の合計が前記第1のプロセスからの要求量以上である場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する
ことを特徴とする請求項1に記載の情報処理装置。
The extraction unit specifies a free area that is not allocated to any process in the shared memory when the determination unit determines that the OS does not have a virtual storage function, and The continuous free area of physical addresses having a capacity equal to or greater than the requested amount from the first process is extracted when the total capacity is equal to or greater than the requested amount from the first process. The information processing apparatus according to 1.
コンピュータを、
第1のプロセスから主記憶装置の共有メモリの割り当ての要求を受け付ける受付手段と、
前記受付手段によって要求を受け付けた場合に、前記第1のプロセスを制御するOS(Operating System)が仮想記憶機能を有するか否かを判別する判別手段と、
前記判別手段によって前記OSが仮想記憶機能を有しないと判別された場合に、前記共有メモリ内でどのプロセスにも割り当てられていない空き領域を特定し、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域を抽出する抽出手段と、
前記抽出手段によって前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が抽出されなかった場合に、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域が得られるように、前記第1のプロセス以外のプロセスに割り当て済みの記憶領域の記憶内容を共有メモリ内の別の記憶領域に書き込む書込手段と、
前記書込手段によって得られた、前記第1のプロセスからの要求量以上の容量を有する物理アドレスの連続した空き領域の場所を前記第1のプロセスに通知し、前記書込手段によって書き込まれた記憶内容の記憶場所を当該記憶内容に対応するプロセスに通知する通知手段
として機能させるためのプログラム。
Computer
Receiving means for receiving a request for allocation of the shared memory of the main storage device from the first process;
A determination unit that determines whether an OS (Operating System) that controls the first process has a virtual storage function when a request is received by the reception unit;
When the determination unit determines that the OS does not have a virtual storage function, it identifies a free area that is not allocated to any process in the shared memory, and exceeds the amount requested from the first process. Extraction means for extracting continuous free space of physical addresses having a capacity;
When a continuous free area of a physical address having a capacity larger than the requested amount from the first process is not extracted by the extracting unit, a physical address having a larger capacity than the requested amount from the first process is extracted. Writing means for writing storage contents of a storage area allocated to a process other than the first process to another storage area in the shared memory so that a continuous free area can be obtained;
Notifying the first process of the location of consecutive free areas of physical addresses having a capacity equal to or greater than the requested amount from the first process, obtained by the writing means, and written by the writing means A program for functioning as a notification means for notifying a process corresponding to a storage content of the storage content.
JP2010182218A 2010-08-17 2010-08-17 Information processor and program Pending JP2012043089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010182218A JP2012043089A (en) 2010-08-17 2010-08-17 Information processor and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010182218A JP2012043089A (en) 2010-08-17 2010-08-17 Information processor and program

Publications (1)

Publication Number Publication Date
JP2012043089A true JP2012043089A (en) 2012-03-01

Family

ID=45899345

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010182218A Pending JP2012043089A (en) 2010-08-17 2010-08-17 Information processor and program

Country Status (1)

Country Link
JP (1) JP2012043089A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017111641A (en) * 2015-12-17 2017-06-22 株式会社日立産機システム Programmable controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017111641A (en) * 2015-12-17 2017-06-22 株式会社日立産機システム Programmable controller

Similar Documents

Publication Publication Date Title
CN109542333B (en) Memory system and control method for controlling nonvolatile memory
JP6524039B2 (en) Memory system and control method
US9183157B2 (en) Method for creating virtual machine, a virtual machine monitor, and a virtual machine system
JP6785204B2 (en) Memory system and control method
TW201818249A (en) Method of operating storage device managing multi-namespace
JP2012523623A (en) Partitioning flash memory data storage devices
JP2019079463A (en) Memory system and control method
KR102077149B1 (en) Method for managing memory and apparatus thereof
JP2014206884A (en) Information processor, information processing method, and program
US8499138B2 (en) Demand-based memory management of non-pagable data storage
US20220066928A1 (en) Pooled memory controller for thin-provisioning disaggregated memory
JP6653710B2 (en) Computer and computer control method
US11151064B2 (en) Information processing apparatus and storage device access control method
CN112162818B (en) Virtual memory allocation method and device, electronic equipment and storage medium
CN112214162A (en) Storage device and control method
US20220382672A1 (en) Paging in thin-provisioned disaggregated memory
US20100299672A1 (en) Memory management device, computer system, and memory management method
KR101549569B1 (en) Method for performing garbage collection and flash memory apparatus using the method
JP2012043089A (en) Information processor and program
JP6696052B2 (en) Storage device and storage area management method
US7757053B2 (en) Apparatus and method for managing stacks for efficient memory usage
JP7102482B2 (en) Memory system and control method
US20230168822A1 (en) Memory management method and semiconductor device adjusting size of contiguous memory allocation area
CN112947867A (en) Full flash memory array high-performance storage system and electronic equipment
JP2022179798A (en) Memory system and control method