Virtual machine, virtual machine monitor and computer control method
Abstract
This record has no abstract on file.
Term
Projected expiry 15 January 2030.
- Priority and filed
- Granted
- Today
- Projected expiry
18 claims: 12 independent, 6 dependent
- 1A computer including a memory, a processor, a timer, and an input / output device, and a virtual computer monitor that is expanded on the memory and executed by the processor, and is executed on the processor of at least one guest OS (Operating System). The virtual computer monitor is provided with a virtual computer monitor that receives a processing request from the guest OS to the computer and delivers the execution result of the processing request by the computer to the guest OS. When the guest OS inputs / outputs data to / from the input / output device through the virtual computer monitor and a means for receiving a timer setting for setting the occurrence of a timer interrupt after the set period from the OS to the timer elapses on behalf of the timer. In addition, the relationship between the input / output waiting time recognized by the guest OS and the input / output processing time other than the input / output waiting time approaches the relationship between the input / output waiting time recognized by the virtual computer monitor and the input / output processing time. In addition, a timer changing means for changing the setting period of the timer setting, and a virtual computer that functions the processor as a means for notifying the guest OS of the occurrence of the timer interrupt when the timer interrupt is received. メモリ、プロセッサ、タイマおよび入出力装置を含む計算機と、 前記メモリ上に展開され、前記プロセッサで実行される仮想計算機モニタであって、少なくとも1つのゲストOS(Operating System)の前記プロセッサ上での実行を制御するとともに、前記ゲストOSから前記計算機への処理要求を受け付け、前記処理要求に対する前記計算機での実行結果を前記ゲストOSに引き渡す仮想計算機モニタと、を備え、 前記仮想計算機モニタは、 前記ゲストOSから前記タイマへの設定期間経過後のタイマ割り込みの発生を設定するタイマ設定を前記タイマに代わって受け取る手段と、 前記ゲストOSが前記仮想計算機モニタを通じて前記入出力装置にデータを入出力するときに、前記ゲストOSが認識する入出力待ち時間と入出力待ち時間以外の入出力処理時間との関係が、前記仮想計算機モニタが認識する入出力待ち時間と入出力処理時間との関係に近づくように、前記タイマ設定の設定期間を変更するタイマ変更手段と、 前記タイマ割り込みを受信したときに、前記タイマ割り込みの発生を前記ゲストOSに通知する手段として前記プロセッサを機能させる仮想計算機。
- 4It is executed by the computer of a computer including a memory, a processor, a timer, and an input / output device, controls execution of at least one guest OS (Operating System) on the processor, and requests processing from the guest OS to the computer. A virtual computer monitor that receives the above and delivers the execution result of the computer in response to the processing request to the guest OS, and sets a timer setting for setting a timer interrupt generation setting period sent from the guest OS to the timer. A means for receiving instead of a timer, and input / output processing other than the input / output waiting time and the input / output waiting time recognized by the guest OS when the guest OS inputs / outputs data to / from the input / output device through the virtual computer monitor. The timer changing means for changing the setting period and the timer setting for changing the setting organization are described so that the relationship with time approaches the relationship between the input / output waiting time recognized by the virtual computer monitor and the input / output processing time. A virtual computer monitor that functions the processor as a means for setting a timer and a means for notifying the guest OS of the occurrence of the timer interrupt when a timer interrupt is received from the timer. メモリ、プロセッサ、タイマおよび入出力装置を含む計算機の前記プロセッサで実行され、少なくとも1つのゲストOS(Operating System)の前記プロセッサ上での実行を制御するとともに、前記ゲストOSから前記計算機への処理要求を受け付け、前記処理要求に対する前記計算機での実行結果を前記ゲストOSに引き渡す仮想計算機モニタであって、 前記ゲストOSから前記タイマへ送られる、タイマ割り込み発生の設定期間を設定するタイマ設定を、前記タイマに代わって受け取る手段と、 前記ゲストOSが前記仮想計算機モニタを通じて前記入出力装置にデータを入出力するときに、前記ゲストOSが認識する入出力待ち時間と入出力待ち時間以外の入出力処理時間との関係が、前記仮想計算機モニタが認識する入出力待ち時間と入出力処理時間との関係に近づくように、前記設定期間を変更するタイマ変更手段と、 設定機関を変更したタイマ設定を前記タイマに設定する手段と、 前記タイマからタイマ割り込みを受信したときに、前記タイマ割り込みの発生を前記ゲストOSに通知する手段として前記プロセッサを機能させる仮想計算機モニタ。
- 7A computer control method executed by a computer that operates a virtual computer monitor that includes a memory, a processor, a timer, and an input / output device, and controls the execution of one guest OS and the guest OS on the processor. A step in which the computer monitor receives a timer setting issued by the guest OS to the timer for a set period in which the timer generates a timer interrupt on behalf of the timer, and a step in which the guest OS receives the virtual computer monitor. The relationship between the input / output waiting time recognized by the guest OS and the input / output processing time other than the input / output waiting time when data is input to / output from the input / output device is the input / output waiting recognized by the virtual computer monitor. A timer change step in which the computer monitor changes the setting period of the timer setting and a timer setting in which the setting period is changed from the computer monitor to the timer so as to approach the relationship between the time and the input / output processing time. A computer control method for executing a step of setting and a step of notifying the guest OS of the occurrence of the timer interrupt when the timer interrupt is received from the timer. メモリ、プロセッサ、タイマおよび入出力装置を含み、前記プロセッサ上で、1つのゲストOSと、前記ゲストOSの実行を制御する仮想計算機モニタが動作する計算機が実行する計算機の制御方法であって、前記計算機が、 前記ゲストOSが前記タイマに発行する、前記タイマがタイマ割込みを発生する設定期間設定するタイマ設定を、前記計算機モニタが前記タイマに代わって受け取るステップと、 前記ゲストOSが前記仮想計算機モニタを通じて前記入出力装置にデータを入出力するときに、前記ゲストOSが認識する入出力待ち時間と入出力待ち時間以外の入出力処理時間との関係が、前記仮想計算機モニタが認識する入出力待ち時間と入出力処理時間との関係に近づくように、前記タイマ設定の設定期間を前記計算機モニタが変更するタイマ変更ステップと、 前記計算機モニタから前記タイマに、前記設定期間が変更されたタイマ設定を設定するステップと、 前記タイマから前記タイマ割り込みを受信したときに、前記タイマ割り込みの発生を前記計算機モニタから前記ゲストOSに通知するステップと、を実行する計算機の制御方法。
Independent claims3
52 paragraphs, as filed
The present invention relates to a technique for managing execution time of processing on a virtual computer.
Figure 1 shows a configuration example of a computer system called a virtual computer. As an example of a virtual computer, it is virtual on hardware such as CPU (Central Processing Unit) and memory. A system equipped with a computer program called a computer monitor is known. In a virtual computer, one or more guest operating systems run on the virtual computer monitor. Furthermore, the application program runs on the guest OS. A virtual computer is also called a virtual machine, a virtual computer, a VM (Virtual Machine), or the like.
A virtual computer monitor is a computer program that is also called a VMM (Virtual Machine Monitor) or a hypervisor. Virtual computer monitor is all virtual computers Control the body. For example, the virtual computer monitor executes a guest OS dispatch process, that is, a process of determining a guest OS to which a CPU is allocated and a process of starting the guest OS when a plurality of guest OSs are running. In addition, the virtual computer monitor executes the emulation of privileged instructions executed by each guest OS. For example, when the guest OS requests the execution of a privileged instruction in the user state, the virtual computer monitor intercepts the privileged instruction requested to be executed by exception handling and executes a process of simulating the privileged instruction requested to be executed.
In addition, the virtual computer monitor is started when the virtual computer is booted, and executes processing such as start / stop of the guest OS and management / control of the virtual computer. However, the virtual computer may be managed and controlled via a special guest OS called the host OS. In addition, as a function called service control, the management and control of the virtual computer may be executed by a computer program different from the virtual computer monitor.
Further, the virtual computer monitor executes the input / output process in the physical device in response to the input / output request from the guest OS. Input / output processing on a physical device is also called actual I / O processing. For example, each guest OS requests an input / output process from a virtual computer monitor through an interface called a hypervisor call. Then, the virtual computer monitor accesses a physical device, for example, a display, an external storage device, a LAN (Local Area Network), or the like through a device driver, for example. However, a guest OS called a driver OS (driver domain), which is dedicated to performing actual I / O processing, or a configuration in which the above-mentioned host OS performs actual I / O processing is also known.
On the other hand, the guest OS can be exemplified as an OS that does not have actual I / O on a virtual computer. The guest OS provides the application program with virtual resources on the hardware via the virtual computer monitor. Therefore, in relation to the application program, the guest OS can be considered as a normal OS. Note that each guest OS, host OS, and driver OS on the virtual computer monitor may be regarded as different computers and may be referred to as virtual computers.
In the virtual computer, the application program is executed on the guest OS, and the guest OS is executed on the virtual computer monitor. Then, when the application program requests the guest OS for input / output processing, the guest OS issues an input / output instruction. The issued input / output instruction is intercepted by the virtual computer monitor, for example, and the input / output process for the physical device is executed through the driver of the virtual computer monitor, the guest OS, or the host OS. To. However, the guest OS may pass I / O instructions to the virtual computer monitor by hypervisor call. In any case, the operation of the virtual computer from the request for input / output processing of the application program to the input / output processing for the physical device is complicated.
<p><patcit num="1"><text>Japanese Unexamined Patent Publication No. 2008-225655</text></patcit><patcit num="2"><text>Japanese Unexamined Patent Publication No. 2006-059052</text></patcit></p>
<p> As described above, in the virtual computer, the route from the request for input / output processing to the input / output to the actual physical device is complicated, and the guest OS receives a virtual interrupt via the virtual computer monitor. And measure the time. Therefore, in the virtual computer, there is a problem that the guest OS cannot accurately acquire performance information such as execution time of processing involving input / output processing.</p>
<p> Therefore, one aspect of the disclosed technology can be exemplified as a virtual computer including a computer including a memory, a processor, a timer, and an input / output device, and a virtual computer monitor developed on the memory and executed by the processor. The virtual computer monitor has at least one guest operating system (Operating). It controls the execution of System) on the processor, accepts the processing request from the guest OS to the computer, and passes the execution result of the processing request on the computer to the guest OS. For example, the virtual computer monitor may function as a means for receiving the timer setting for setting the occurrence of the timer interrupt after the set period from the guest OS to the timer, instead of the timer. Further, the virtual computer monitor may function the processor as a timer changing means. Here, the timer changing means changes the timer setting when the guest OS inputs / outputs data to / from the input / output device through the virtual computer monitor. For example, in the timer changing means, the ratio of the input / output waiting time recognized by the guest OS to the input / output processing time other than the input / output waiting time is the ratio of the input / output waiting time recognized by the virtual computer monitor to the input / output processing time. Change the timer setting so that it approaches. Further, the virtual computer monitor may make the processor function as a means for notifying the guest OS of the occurrence of the timer interrupt when the timer interrupt is received.</p>
<p> According to the disclosed technology, it is possible to improve the accuracy of the performance information acquired by the guest OS for the processing involving the input / output processing in the virtual computer.</p>
<figref num="1">It is a figure which shows the configuration example of a computer system.</figref><figref num="2">It is a figure which illustrates the structure of the computer system which concerns on a comparative example.</figref><figref num="3">It is a figure which shows the schedule example of the guest OS which concerns on the comparative example.</figref><figref num="4A">It is a figure which shows the example of the processing time for each state on a physical computer.</figref><figref num="4B">It is a figure which shows the processing time example for each state on a virtual computer.</figref><figref num="4C">It is a figure which contrasts and shows the time ratio for each state in a physical computer and a virtual computer.</figref><figref num="5">It is a figure which shows the example of the processing time of the input / output processing in the virtual computer which concerns on Example 1 in comparison with the virtual computer of the comparative example.</figref><figref num="6">It is a figure which shows the configuration example of the virtual computer which concerns on Example 1. FIG.</figref><figref num="7">It is a figure which illustrates the component which concerns the processing at the time of setting a timer interrupt and after the occurrence of a timer interrupt.</figref><figref num="8">It is a figure which shows the example of virtual CPU management data.</figref><figref num="9">It is a figure which illustrates the kind of time measured by a virtual computer.</figref><figref num="10">It is a figure which illustrates the process of the process scheduler in a physical OS.</figref><figref num="11">It is a figure which illustrates the virtual CPU state table table.</figref><figref num="12">It is a figure which illustrates the processing flow of the virtual CPU state determination means.</figref><figref num="13">It is a figure which illustrates the relationship between the timer cycle μ set by a guest OS, and the virtual timer cycle returned by a virtual computer monitor to a guest OS.</figref><figref num="14">It is a figure which illustrates the processing flow of the virtual CPU usage statistics calculation means.</figref><figref num="15">It is a figure which illustrates the processing flow at the time of timer setting of a timer modulation means.</figref><figref num="16">It is a figure which illustrates the processing flow at the time of transferring a virtual timer interrupt to a guest OS by a timer modulation means.</figref><figref num="17">It is a figure which illustrates the configuration of the virtual computer which does not have the virtual CPU state determination means.</figref>
Hereinafter, the computer system according to the embodiment will be described with reference to the drawings. The configuration of the following embodiment is an example, and the computer system is not limited to the configuration of the embodiment.
The computer system 300 according to the comparative example will be described with reference to FIGS. 2 to 4. FIG. 2 illustrates the configuration of the computer system 300 according to the comparative example. As shown in FIG. 2, the computer system 300 includes, for example, a processing device 300A including a CPU and a memory, and a physical disk 302 as hardware. The CPU corresponds to the processor. A virtual computer monitor 301 operates on the processing device 300A to manage and control the computer system 300.
Further, on the virtual computer monitor 301, the guest virtual computer 310-1 including the front-end driver 310A-1, the guest OS310B-1, and the application program 310C-1 is running. Further, on the virtual computer monitor 301, the guest virtual computer 310-2 including the front-end driver 310A-2, the guest OS310B-2, and the application program 310C-2 is running. Here, the guest virtual computers 310-1 and 310-2 are collectively referred to as the guest virtual computer 310. The front-end drivers 310A-1,310A-2, guest OS310B-1,310B-2, and application programs 310C-1,310C-2 are collectively referred to as front-end drivers 310A, guest OS310B, and application program 310C, respectively.
As shown in FIG. 2, the virtual computer monitor 301 includes a back-end driver 304, a timer mechanism 305, a scheduler 306, and an actual I / O driver 307. The back-end driver 304 functions as an interface with the front-end driver 310A connected to the guest OS 310. For example, the back-end driver 304 shares a shared memory (not shown) with the front-end driver 310A to exchange data.
On the computer system 300, the virtual computer monitor 301 schedules processing by the guest virtual computer 310. That is, the virtual computer monitor 301 saves the register value of the guest virtual computer 310 in a predetermined memory area, and then switches the guest virtual computer 310 to which the CPU is allocated. When switching the guest virtual computer, for example, the CPU is released from the guest virtual computer 310-1, and the CPU is allocated to the guest virtual computer 310-2 instead. More specifically, the CPU is released from the guest OS310B-1 and the CPU is assigned to the guest OS310B-2. The CPU is allocated to the guest OS 310B by the scheduler 306. The scheduler 306 is also called a virtual CPU scheduler. Also, the computer program seen from the guest OS 310B The execution environment of the CPU, for example, the resource including the register set, is called a virtual CPU.
The scheduler 306 executes a dispatch process that allocates a CPU to the guest OS 310B. For example, the scheduler 306 sequentially starts the guest OS 310B-1 and 310B-2 by time sharing. Further, for example, the scheduler 306 saves the current register set in a predetermined memory area when the guest OS 310B-1 is running. Then, the scheduler 306 stops the guest OS 310-1. Further, the scheduler 306 passes the saved contents of the register set of the guest OS 310B-2 whose processing is currently suspended to the guest OS 310-2. Then, the scheduler 306 starts the guest OS 310-2.
The timer mechanism 305 sets the address of the interrupt processing program in the interrupt vector of the CPU built in the processing device 300A, and also specifies a predetermined time to set the timer interrupt in the register. Then, a timer interrupt is generated for the CPU after a predetermined time elapses, and the CPU starts the processing of the interrupt processing program set at the predetermined address in the memory space corresponding to the generated timer interrupt. The virtual computer monitor 301 recognizes the passage of a predetermined time by processing the interrupt processing program. The virtual computer monitor 301 measures the time by repeatedly receiving the timer interrupt by the interrupt processing program. The interrupt processing program is also called a handler or a callback function.
Input / output instructions for a physical device such as a physical disk 302 are processed as follows, for example. The application program 310C running on the guest OS 310B calls the input / output instructions of the guest OS 310B by a system call. Then, the guest OS 310B sets an input / output request in the shared memory through the front-end driver 310A, and requests the virtual computer monitor 301 for processing by a function called a hypervisor call. Then, the back-end driver 304 reads the input / output request set in the shared memory and hands it over to the virtual computer monitor 301. The virtual computer monitor 301 activates the device driver that accesses the physical device according to the passed input / output request, and executes the input / output process.
In the input / output process, when the device driver executes a data transfer instruction, the data in the buffer area secured in the predetermined area of the memory is passed to the I / O controller (not shown). The data passed includes commands to the I / O controller and input / output data. After issuing the data transfer instruction, the scheduler 306 puts the guest virtual computer 310 in the input / output wait state. As a result, the guest virtual computer 310 in the I / O waiting state temporarily suspends its operation. Then, while the operation of the guest virtual computer 310 in the input / output waiting state is temporarily suspended, the CPU assigned to the guest computer whose operation is suspended is allocated to the other guest virtual computer 310 by the scheduler 306. .. The completion of the input / output processing on the physical device is notified from the I / O controller to the CPU by an interrupt.
However, instead of the guest OS 310B requesting the virtual computer monitor 301 for input / output processing by a hypervisor call, the following procedure can also be used. For example, when the guest OS 310B calls a system call for an I / O request in the user state, the CPU detects a privilege instruction violation. Next, the CPU may transfer control to the virtual computer monitor 301, and the virtual computer monitor 301 may emulate the input / output processing from the system call.
The virtual computer monitor 301 activates a plurality of guest virtual computers 310-1 and 310-2 in a time division manner, for example. The driver OS and host OS are equipped with a back-end driver. , The driver OS or host OS may perform actual I / O control. Hereinafter, the guest virtual computer 310 is also simply referred to as a virtual computer 310.
Figure 3 shows an example of the schedule of guest OS 310B in computer system 300. In FIG. 3, guest OS310B-1 is shown as guest 1, and guest OS310B-2 is shown as guest 2. In the computer system 300, a plurality of guest OS 310Bs are operated by allocating the CPUs of the processing device 300A to guest 1 and guest 2 alternately, for example, by time division. The time allocation time for each time division can be fixedly defined in the virtual computer monitor 301. The allocation time can be set by system parameters and the like.
Also, if the guest OS cannot use the given time due to a low load on one of the guest OS 310Bs, the scheduler 306 will use the CPU usage rights of the guest OS with the lower load, for example, guest OS 310B-1. And allocate a CPU to another guest OS, for example, guest OS310B-2, to run guest OS310B-2. CPU resources can be effectively used by managing the CPU allocation to the guest OS 310B as shown in Fig. 3.
Guest OS310B continues to collect various statistical information using the timer mechanism through the virtual computer monitor 301. The statistical information includes, for example, the user time (user time) indicating the time when each process running on the guest OS 310B has been running in the user state, and the process. It is necessary to wait for input / output and system time (sys time), which indicates the time when the kernel was operated as an extension. The input / output waiting time (iowait time), etc., which indicates the time spent, is included. Statistical information is also useful for performance tuning of application programs and middleware.
In the computer system 300 including the virtual computer, the virtual computer monitor 301 converts the input / output request of the guest OS 310B into the actual I / O processing for the physical device and processes it by using the back-end driver 304 and the front-end driver 310A. ing. Alternatively, in the computer system 300, the virtual computer monitor 301 converts the input / output request of the guest OS 310B into an actual I / O for the physical device and processes it by using the emulation of the input / output instruction by the virtual computer monitor 301.
FIG. 4A-FIG. 4C shows an example of input / output processing in the computer system 300 including the virtual computer 310 in comparison with a normal computer not including the virtual computer. Hereinafter, a normal computer that does not include a virtual computer will be referred to as a physical computer. The physical computer includes a physical CPU. An OS that runs on a physical computer is called a physical OS.
FIG. 4A shows an example of the time recognized by the physical OS in the input / output processing of the physical computer. In Figure 4A, the "application" line shows that the physical CPU is running the application program. Hereinafter, the application program is also simply referred to as an application. While the application is running, the processes executed by the physical CPU are in the user state. Also, in Figure 4A, the "kernel" line indicates that the process executed by the physical CPU is in the kernel state. The user state and the kernel state will be described in Example 1 described later. In addition, the "Physical device" line in Figure 4A shows the processing on the physical device.
In the example shown in Figure 4A, while the physical computer process is executing the application in the user state (user-A1), an I / O request is generated from the application and the processing in the kernel state (sys-A1) is executed. There is. Then, in the processing in the kernel state (sys-A1), the physical device I / O is issued to the physical device, and actual I / O processing is performed to the physical device. Then, the processing in the kernel state becomes input / output wait (iowait-A). In Fig. 4A, processing in the kernel state (sys-A1) starts due to an I / O request from the application, and processing in the kernel state (sys-A1) waits for input / output due to issuance of I / O to the physical device. Become. Input / output During the wait (iowait-A), processing in the kernel state of the physical OS is deprived of CPU usage rights. In Fig. 4A, the section where the kernel state processing is waiting for input is indicated by the blank section of the kernel line corresponding to iowait-A in the physical device line, but the blank section of the kernel line corresponding to iowait-A. The section is also referred to by "iowait-A".
Then, after the input / output to the physical device is completed, the processing in the kernel state (sys-A2) Is executed. Furthermore, due to the end of processing (sys-A2) in the kernel state, the user state Processing (user-A2) is being executed. In Figure 4A, processing in the kernel state (sys-A1), Assume that the I / O wait (iowait-A) for the physical device and the kernel state processing (sys-A2) time are TSA1, TWA, and TSA2, respectively.
FIG. 4B shows an example of the time recognized by the guest OS 310B and the time recognized by the virtual computer monitor 301 in the input / output processing of the virtual computer 310. In the example of FIG. 4B, the application in the user state is executed on the guest OS 310B in the virtual computer 310. I / O required from the application while the application is running in the user state (user-B1) A request has occurred and processing (sys-B11) in the kernel state of guest OS310B is being executed. .. Processing in the kernel state (sys-B11) is, for example, the processing of the front-end driver 310A. Including the reason.
Then, in the processing in the kernel state (sys-B11), the input / output processing for the virtual device The demand for reason is made. The input / output processing for the virtual device is converted into the processing by the real I / O driver for the physical device on the virtual computer monitor 301, and the processing by the real I / O driver (sys-B21) is executed. Then, in the processing by the actual I / O driver (sys-B21), I / O is issued to the physical device, and the processing by the actual I / O driver (sys-B21) waits for input / output to the physical device. (iowait-B2). In Fig. 4B, the processing (sys-A1) in the kernel state of guest OS310B starts by the I / O request from the application. Then, in the processing (sys-B21) by the real I / O driver in which the input / output processing for the virtual device is converted, the I / O is issued to the physical device. Place in Figure 4B In this case, the processing in the kernel state of the guest OS 310B is from the I / O request from the application to the input / output processing request to the virtual device, and corresponds to the kernel state processing in the case of the physical OS in Fig. 4A. .. Therefore, the same hatching is attached to the processing of the sys-A1 part in FIG. 4A and the processing of the sys-B11 in FIG. 4B.
Then, when the input / output processing for the physical device is completed, the control returns to the processing (sys-B22) by the actual I / O driver. Furthermore, the processing in the kernel state (sys-B12) in the guest OS 310B is executed by the end of the processing (sys-B22) in the actual I / O driver. The processing of sys-B12 also includes the processing by the front-end driver 301A as well as the processing of sys-B11.
Furthermore, by the end of processing in the kernel state (sys-B12) in guest OS310B Therefore, control is returned to the application processing (user-B2) in the user state. Figure 4B In, the processing in the kernel state (sys-B12) in the guest OS 310B is the car in Fig. 4A. Corresponds to processing in the flannel state (sys-A2). Therefore, the same hatching is attached to the processing of the sys-A2 part in FIG. 4A and the processing of the sys-B12 in FIG. 4B.
Then, as shown in Fig. 4B, the guest OS310B processes in the kernel state (sys-B11). In, the virtual I / O processing (iowait-B1) for the virtual device is started and then terminated. The time until I / O is recognized as the I / O wait time (iowait time) for the virtual device.
In Fig. 4B, the processing time (sys-B11) in the kernel state on the guest OS 310B, the virtual data I / O wait time for vise (iowait-B1) and processing in kernel state (sys-B12) ) Are TSB11, TWB1, and TSB12, respectively.
Further, in FIG. 4B, the real I / O driver processing (sys-B21) time, the physical device input / output wait (iowait-B2) time, and the real I / O driver processing in the virtual computer monitor 301. The processing time of (sys-B22) was TSB21, TWB2, and TSB22, respectively. Suppose.
As mentioned above, the processing in the kernel state of guest OS310B (sys-B11) is a virtual device. While the processing to the chair (iowait-B1) is executed, it will be in the input / output wait state. Guest OS31 While the processing in the kernel state of 0B (sys-B11) is waiting for I / O (the section where the virtual device is iowait-B1), the guest OS310B is deprived of CPU usage rights by scheduling the scheduler 306.
Here, of the processing time in guest OS310B, the time until the processing in the kernel state is deprived of the CPU usage right (TSB11 time by sys-B11 processing) is the guest OS3. It is counted as 10 system hours (sys hours). The time from the kernel state of guest OS310B to returning to the user state (the time of TSB12 by the processing of sys-B12) after the end of I / O wait (the section where the virtual device is iowait-B1) is also the time of guest OS310. Sith It is recorded as system time (sys time).
On the other hand, the processing in the kernel state of guest OS310B (sys-B11) is for the virtual device. While waiting for input / output (iowait-B1), the virtual computer monitor 301 uses the actual I / O driver. Processing (sys-B21) is executed, and I / O is issued to the physical device from the processing (sys-B21) by the actual I / O driver. Then, after issuing the I / O to the physical device, the processing (sys-B21) by the actual I / O driver waits for input / output.
However, the time (TSB21 and TSB22) that the real I / O driver of the virtual computer monitor 301 is processing (sys-B21 and sys-B22) is the I / O wait time (iowait time) as the statistical information of the guest OS310B. ) Will be recorded. That is, in the guest OS 310B, the time T of the I / O wait (iowait-B1) for the virtual device. WB1 is input in addition to the input / output wait (iowait-B2) time TWB2 for the physical device. The actual I / O driver processing (sys-B21 and sys-B22) time before and after waiting for output is the time obtained by adding TSB21 and TSB22.
Comparing the processing time seen from the physical OS in the case of Fig. 4A and the processing time seen from the virtual OS 310B in Fig. 4B is as follows. In the physical OS, the processing time after the I / O request is made from the application is the time TSA1 of the processing (sys-A1) until the I / O issuance in the kernel state in the physical OS, and from the I / O issuance. Includes TWA, which is the waiting time until I / O is completed (time corresponding to the iowait-A interval), and TSA2, which is the processing time from I / O completion to I / O acceptance (sys-A2).
On the other hand, in the case of the virtual computer system 300 of FIG. 4B, the time TSB21 of the processing (sys-B21) by the actual I / O driver corresponds to the time TSA1 of FIG. 4A. Similarly, the TSB in Figure 4B 22 corresponds to the time TSA2 in Figure 4A. Then, the time TWB2 of the input / output wait (iowait-B2) for the physical device corresponds to the time TWA of FIG. 4A. Therefore, virtual calculation Time of actual I / O driver processing (sys-B21, sys-B22) on machine monitor 301 TSB21 Relationship between + TSB22 and TWB2, which is the time of I / O wait (iowait-B2) for a physical device. The person in charge almost corresponds to the case of the physical OS. That is, the relationship between the time TSA1 + TSA2 for processing in the kernel state (sys-A1, sys-A2) and the time TWA for input / output wait (iowait-A) for the physical device in the case of a physical OS is the virtual computer monitor. Time TSB2 at 301 Corresponds to the relationship between 1 + TSB22 and time TWB2.
However, the time relationship related to the input / output process seen from the guest OS 310B in FIG. 4B does not necessarily correspond to the time relationship related to the input / output process seen from the physical OS in FIG. 4A. That is, as shown in FIG. 4B, the time TWB1 of the guest 310B waiting for input / output to the virtual device (iowait-B1) is the time TSB21 + TSB22 of the actual I / O driver processing (sys-B21, sys-B22). And the I / O wait (iowait-B2) time for the physical device TWB2 And include. Therefore, the I / O wait (iowait-B1) time for the virtual device TWB1 Is also the actual I / O due to the I / O wait (iowait-B2) time TWB2 for the physical device. The driver processing (sys-B21, sys-B22) time is increased by TSB21 + TSB22.
As a result, the time TSB11 + TSB12 of the processing in the kernel state (sys-B11, sysB12) and the time TWB of the I / O wait (iowait-B1) for the virtual device as seen from the guest OS310B. The relationship with 1 is different from the relationship between time TSA1 + TSA2 and time TWA on the virtual computer monitor 301, which corresponds to the physical OS running on the physical computer.
As shown in Fig. 4B, the input / output waiting time TWB1 seen from the guest OS 310B is the time including the system time TSB21 + TSB22 in which the virtual computer monitor 301 operates in the kernel state and the input / output waiting time TWB2 of the virtual computer monitor 301. is there. Therefore, the I / O waiting time TWB1 required for input / output waiting in the virtual computer 310 as seen from the guest OS 310B is longer than the I / O waiting time TWB2 required for input / output waiting of the actual I / O executed by the virtual computer monitor. Measured as a period.
FIG. 4C shows a comparison between the processing time in the kernel state and the input / output waiting time for the physical OS on the physical computer and the guest OS 310B on the virtual computer 310. Time TSA of sys-A1 and sys-A2 on the line with the string "For physical OS" as shown in Figure 4C Compared to 1 + TSA2, the processing time of sys-B11 and sys-B12 on the line with the character string "For guest OS" TSB11 + TSB12 is shorter. On the other hand, "in the case of physical OS" The time TWB1 of iowait-B on the line with the string "For guest OS" is longer than the time TWA of iowait-A on the line with the string. Therefore, the statistical information provided by the guest OS 310B is less reliable as a clue in performance tuning.
Figure 4B shows the processing when there is one guest OS 310B. When multiple guest OS 310Bs are running, it creates a more complicated situation with respect to statistics. Since the situation was as shown in Fig. 4A-Fig. 4C, the statistical information seen from the guest OS 310B is trusted when performing performance tuning of the application program 310C on the guest OS 310B or the middleware on the guest OS 310B. It will be difficult. Therefore, for example, it is conceivable to use the statistical information collected by the virtual computer monitor 301 instead of the statistical information viewed from the guest OS 310B. However, the statistical information of the virtual computer monitor 301 is usually not disclosed to the user of the guest OS 310B from the viewpoint of security and access authority.
In the computer system according to the present embodiment, a mechanism for correcting the timer mechanism is provided so that the statistical information collected by the guest OS and the statistical information viewed from the physical computer are equivalent without modifying the guest OS. The computer system according to the present embodiment provides statistical information more effective than the computer system 300 according to the comparative example in the performance tuning of the application program and middleware running on the guest OS by the mechanism for correcting the timer mechanism.
<p> The computer system (hereinafter referred to as a virtual system) according to the first embodiment will be described with reference to FIGS. 5 to 16. FIG. 5 shows an example of processing time management of input / output processing in the virtual system of Example 1 in comparison with the computer system 300 of the comparative example. In FIG. 5, the upper row indicated by the reference numeral C1 is an example of the processing time in the input / output processing in the computer system 300 according to the comparative example, and the lower row indicated by the reference numerals C2 and C3 is the input of the virtual system according to the first embodiment. This is an example of processing time in output processing. The dashed line in the vertical direction in FIG. 5 illustrates the time step detected by the timer. However, since the timer ticking on the guest OS 310B and the timer ticking on the virtual computer monitor 301 that manages the guest OS 310B are the same, the timer ticking on the virtual computer monitor 301 is omitted in C1 of FIG. There is. Also, user-B1, user-B2, sys-B11, iowait-B1, sys-B12, sys-B21, iowait-B2, The process shown in sys-B22 is the same as in Figure 4B. .. However, in the first embodiment, the timing at which the virtual computer monitor notifies the guest OS of the timer interrupt is adjusted. Due to the timing adjustment, the timer tick on the guest OS and the timer tick on the virtual computer monitor may not match. Therefore, in FIG. 5, C2 shows the timer ticking in the guest OS according to the first embodiment, and C3 shows the timer ticking in the virtual computer monitor according to the first embodiment. Here, the timer step in the guest OS is shown as the time of the timer interrupt observed by the guest OS. Further, the timer step on the virtual computer monitor is indicated as the time of the timer interrupt observed by the virtual computer monitor.</p><p> The time of the timer interrupt observed by the guest OS in the first embodiment is indicated by a vertical broken line in the range indicated by the C21 arrow in the column of reference numeral C2. In the column of the symbol C2, the broken line above the range indicated by the C21 arrow is a reference line for showing the relationship with the timer interrupt time in the C1 column. Further, the time of the timer interrupt observed by the virtual computer monitor of the first embodiment is indicated by a broken line in the vertical direction in the column of reference numeral C3. Hereinafter, the timer started by the guest OS of the virtual computer 10 is referred to as a virtual timer, and the timer started by the virtual computer monitor is referred to as an actual timer.</p><p> In the first embodiment, the reliability of the statistical information collected by the guest OS is improved by adjusting the timer interrupt timing by the virtual computer monitor without changing the timer mechanism of the guest OS and without modifying the guest OS. To do. Therefore, in the virtual computer monitor of the first embodiment, the relationship between the system time and the input / output waiting time for the virtual device as seen from the guest OS is equivalent to the relationship between the system time for the physical computer and the input / output waiting time for the physical device. Adjust the timing to notify the guest OS of the timer interrupt so that. That is, in the first embodiment, the timing of the timer interrupt by the virtual timer is adjusted while keeping the number of occurrences of the timer interrupt by the virtual timer of the guest OS matching with the number of occurrences of the timer interrupt by the actual timer of the virtual computer monitor. Time of processing in kernel state (sys-B11, sys-B12) in guest OS Number of timer interrupt occurrences in TSB11 + TSB12 time of input / output wait (iowait-B1) time for virtual device To Let R1 be the ratio to R1. Also, processing in the kernel state on the virtual computer monitor (sys-B21, sys-B22) time TSB21 + TSB22 timer interrupt occurrence count, input / output wait (iowait-B2) time for physical device TWB2 timer interrupt occurrence Let R2 be the ratio to the number of times. In the first embodiment shown in FIG. 5, the interrupt generation timing of the virtual timer is modified so that R1 and R2 are close to each other.</p><p> Hereinafter, the ratio of the time of the kernel state and the time of the input / output wait state and the number of occurrences of each to the total number of occurrences of the combined time of the kernel state and the input / output wait state will be referred to as a timer density. In the first embodiment shown in FIG. 5, the timer density of the virtual timer is modified as follows. The total number of timer interrupts for the combined time of the kernel state and the I / O wait state is called the total number of timer interrupts associated with I / O processing. (a) Keep the number of dashed lines in C1 and the number of dashed lines in C2 matched. And (b) Processing in the kernel state of the guest OS indicated by the C21 arrow (sys-B11, sys-B12) Modify the timer density within the period so that it is as close as possible to the timer density within the period of processing in the kernel state (sys-B21, sys-B22) in the virtual computer monitor in column C3. And, (c) Timer density within the I / O wait (iowait-B1) period for the virtual device in column C2 Keep the timer density within the I / O wait (iowait-B2) period for the physical device in column C3 as much as possible. Correct it so that it is closer.</p><p> By the above processing, the processing in the kernel state of the guest OS (sys-B11, sys-B12) and virtual The timing of timer interrupts is adjusted so that the timer density becomes common with the processing in the kernel state on the computer monitor. Also, I / O wait for virtual device (iowait-B1) The timer density is the same for the period of and the I / O wait for the physical device (iowait-B2). The timing of the timer interrupt is adjusted in the direction. As a result, the ratio R1 approaches the ratio R2.</p><p> For example, in the virtual computer monitor 301 according to the comparative example in column C1, a total of 24 timer interrupts are generated during the processing period of sys-B11, iowait-B, and sys-B12. More specifically, the timer interrupts twice, 20 times, and 2 times in each period of sys-B11, iowait-B, and sys-B12. Only is occurring. In terms of the ratio of timer frequency, timer interrupts occur at 1:10: 1. Therefore, the timer density is 1/12 for each of the processing sys-B11 and sys-B12 in the kernel state. Also, the timer density in I / O wait (iowait-B1) for the virtual device. Is 11/12.</p><p> On the other hand, in Example 1 shown in column C3, the processing period of sys-B21, iowait-B2, and sys-B22 is also included. At least 21 timer interrupts have occurred. More specifically, timer interrupts are generated 7, 7, and 7 times in each period of sys-B21, iowait-B2, and sys-B22. Timer frequency The timer interrupt occurs at a ratio of 1: 1: 1. Therefore, kernel-like Processing in the state The timer density of sys-B21 and sys-B22 is 1/3, respectively. In addition, the timer density for input / output wait (iowait-B2) for physical devices is 1/3.</p><p> That is, the ratio of the number of times the timer interrupt of the guest 310B according to the comparative example occurs between the kernel state and the input / output waiting state is different from that of the virtual computer monitor of the first embodiment or the physical OS of the physical computer. ,It does not match. The ratio of the number of times the timer interrupt occurs in the virtual computer monitor of the first embodiment between the kernel state and the input / output waiting state can be considered to be the same as in the case of the physical OS in the physical computer.</p><p> Therefore, in the C2 column according to the first embodiment, eight times for each of sys-B11, iowait-B1, and sys-B12. , 8 times, 8 times, that is, adjust the timing at which the virtual computer monitor transmits the virtual timer interrupt to the guest OS so that the virtual timer interrupt is generated at 1/3: 1/3: 1/3 as much as possible in terms of timer density. .. As a result of the timing adjustment, as is clear from the comparison between C2 and C3 in FIG. 5, the timer density is common between the period of sys-B11 of C2 and the period of sys-B21 of C3. In addition, the timer density is common between the period of iowait-B1 of C2 and the period of iowait-B2 of C3. In addition, the timer density is common between the period of sys-B12 of C2 and the period of sys-B22 of C3.</p><p> According to FIG. 5, in the C1 column and the C2 column, the total number of timer interrupts associated with one input / output process is the same (common). There is no error in the clock with the guest OS according to Example 1.</p><p> On the other hand, by adjusting the virtual timer interrupt timing, the guest OS according to the first embodiment is provisionally The timing difference between the virtual timer and the physical timer of the virtual computer monitor is sys-B11, iowait-B1, sys-B12 in the guest OS shown in C2, and sys-B11 in the virtual computer monitor shown in C3. , Iowait-B1, sys-B12. Therefore, the time lag observed by the guest OS according to the first embodiment is limited to the range in which the guest OS is operating in the kernel state. The OS is designed so that the operation in the kernel state is about several ms. Therefore, it is unlikely that the time lag observed by the guest OS will affect the time information detected by the application program.</p><p> <Virtual system configuration> FIG. 6 shows a configuration example of the virtual system 11 as the computer system according to the first embodiment. The virtual system 11 of FIG. 6 includes a physical CPU, a memory, and a timer. In addition, the memory holds a computer program including the virtual computer monitor 1 and the guest OS 10B. Hereinafter, the physical CPU is also simply referred to as a CPU. In the first embodiment, the entire computer system including the physical CPU, memory, hardware such as a timer, the virtual computer monitor, and the guest OS executed on the virtual computer monitor is referred to as the virtual system 11.</p><p> As shown in FIG. 6, the virtual computer monitor 1 includes a virtual CPU scheduler 2, a virtual CPU state determination means 3, a physical CPU usage statistics calculation means 4, a virtual CPU usage statistics calculation means 5, and a timer modulation means 6. The physical CPU of the virtual system 11 is a computer program as a virtual computer monitor 1 including a virtual CPU scheduler 2, a virtual CPU state determination means 3, a physical CPU usage statistics calculation means 4, a virtual CPU usage statistics calculation means 5, and a timer modulation means 6. To execute. Further, the virtual system 11 has virtual CPU management data 7 managed by the virtual computer monitor 1 in the memory. On the other hand, the guest OS 10B has a timer processing setting means 8. The physical CPU of the virtual system 11 executes the computer program as the guest OS 10B including the timer processing setting means 8.</p><p> <Process scheduler and virtual CPU scheduler> In the first embodiment, the virtual computer monitor 1 handles a plurality of virtual CPUs and allocates a physical CPU to the virtual CPUs. Virtual CPU is a concept that includes the processing status and resources of the physical CPU when allocating the physical CPU to the guest OS. That is, the virtual CPU can be considered as a concept corresponding to individual processes in a multi-process environment realized by a physical OS that operates directly on a conventional physical computer. Alternatively, from the perspective of the guest operating system, the virtual CPU can be treated as an individual CPU in a multiprocessor system.</p><p> In a computer system including a virtual computer, for example, one guest OS may use a plurality of virtual CPUs properly, but in the first embodiment, a case where one guest OS has one virtual CPU is considered.</p><p> The process of allocating a physical CPU to a virtual CPU that the guest OS requests to execute is called dispatch. Therefore, in order to prevent mutual interference even if the virtual CPUs are switched one after another, the virtual computer monitor 1 temporarily saves the execution context such as the register value to a predetermined area on the memory when switching the virtual CPUs, and then saves the execution context to a predetermined area on the memory. Stop the running virtual CPU. Then, the virtual computer monitor 1 restores the execution context of the stopped virtual CPU again, and resumes the execution of the stopped virtual CPU. This execution context is included in virtual CPU management data 7. The virtual computer monitor 1 repeats the processes of execution, save, stop, and restart by saving the execution contexts of each of the plurality of virtual CPUs. The virtual CPU scheduler 2 determines the time and order in which virtual CPUs are allocated to physical CPUs according to a predetermined rule.</p><p> Figure 10 shows the virtual CPU scheduler along with the process scheduler in the physical OS. The process of 2 is illustrated. The process in the physical OS and the role of the virtual CPU in the virtual computer monitor 1 are similar in some respects. Therefore, in Fig. 10, the processing of the process scheduler and the processing of the virtual CPU scheduler 2 are summarized in one figure. Hereinafter, the process in the physical OS will be mainly described, but the virtual CPU in the virtual computer monitor 1 also takes the same state as the process state in the physical CPU.</p><p> The process scheduler has a FIFO (First In First Out) and sequentially dispatches processes waiting to be allocated on the FIFO to the CPU. The process schedule status is divided into active, queued, and unqueued in FIG. Active refers to the state of a process to which a CPU has been allocated. active can also be said to be the state of a process running on the CPU. Queued means that the process is waiting for CPU allocation on the FIFO. In the active or queued state, the process managed by the physical OS or the virtual CPU managed by the virtual computer monitor 1 is divided into the user state (user) or the kernel state (sys). Divided.</p><p> In addition, unqueued refers to the state of a process that is not running on the CPU, is not in the CPU allocation waiting state, and is not on the FIFO. The unqueued process is in the I / O wait state (iowait) waiting for the completion of I / O processing, or in the idle state (idle) where nothing is done.</p><p> The physical OS can distinguish between idle and I / O-waiting unqueued processes that are not connected to the FIFO from the management information for each process. Similarly, the virtual computer monitor 1 can distinguish between an idle virtual CPU and an I / O waiting state among unqueued virtual CPUs that are not connected to the FIFO from the management information for each virtual CPU.</p><p> <Calculation of statistical information> As described above, the virtual system 11 puts the process of the physical computer or the virtual CPU of the virtual system 11 into the user state (user), the kernel state (sys), and the input / output wait state (iowait). ), Idle state (idle). These states are determined by the CPU mode and schedule state. The CPU mode is a concept that indicates the state set in the CPU, the presence or absence of privileges, or the execution level in order to classify the instructions that can be executed by the CPU. For example, user mode is the mode with no or lowest privileges. In the first embodiment, the term "state" is used for a process (or virtual CPU) to distinguish it from the CPU mode. Therefore, in the first embodiment, when the CPU executing the process (or the real CPU to which the virtual CPU is assigned) is in the user mode, the process (or the virtual CPU) is in the user state.</p><p> Also, kernel mode is a privileged or higher privileged mode than user mode. Kernel mode may be referred to as privileged mode. However, the privileged mode may include modes with different levels in which the CPU states are further subdivided, but in the first embodiment, these modes are not distinguished. In Example 1, when the CPU running the process (or the real CPU to which the virtual CPU is assigned) is in kernel mode or various privileged modes, the process (or virtual CPU) is in the kernel state.</p><p> When control is transferred from the application program to the guest OS10B by, for example, a system call, the virtual CPU is in the kernel state. In the kernel state, the virtual CPU usage statistics calculation means 5 aggregates and stores the elapsed time from the timer as the system time (sys time). Stack.</p><p> In the kernel state, for example, when the device driver transfers the data input / output to the I / O controller of the physical device, the virtual CPU (process) is connected to the queue, and the execution of the virtual CPU (process) is suspended. The virtual CPU (process) is waiting for I / O. In the I / O wait state, the virtual CPU usage statistics calculation means 5 aggregates and accumulates the elapsed time from the timer as the I / O wait time (iowait time).</p><p> If the user process is not executing, a system call is being executed, or I / O is not waiting, the virtual CPU (process) is idle. In the idle state, the virtual CPU usage statistics calculation means 5 aggregates and accumulates the elapsed time from the timer as the idle time (idle time).</p><p> The virtual computer monitor 1, guest OS, or physical OS distinguishes between I / O latency and idle time, depending on why the process scheduler or virtual CPU scheduler 2 put the process or virtual CPU in the unqueued state described below. .. For example, in a physical computer, when a device driver executed by a physical OS transfers an I / O request to an I / O controller (not shown) by a data transfer instruction and suspends the process, the process is measured in the suspended state. The processing time is the input / output waiting time. Further, when the process is in the unqueued state due to a cause other than the input / output request, the processing time becomes the idle time.</p><p> FIG. 9 illustrates the types of time measured by the virtual computer 10. Each time is measured in units of time based on the CPU cycle, for example, the occurrence of a timer interrupt. The user time (user time) is the time when the application program is executed or the cumulative total thereof. System time (sys time) is the time when the kernel program code is executed. Or the cumulative total. The input / output wait time (iowait time) is the time during which neither the application program nor the kernel program is executed and waiting for the device processing to be completed, or the cumulative total. The idle time (idle time) is the time during which neither the application program nor the kernel program is executed and waiting for the processing of the physical device to be completed, or the cumulative total thereof.</p><p> The physical CPU usage statistics calculation means 4 aggregates the elapsed time by classifying it into user time, sys time, iowait time, and idle time according to the user, sys, iowait, and idle states of the process running on the physical CPU. In FIG. 6, the physical CPU usage statistics calculation means 4 is in the virtual computer monitor 1.</p><p> The virtual CPU usage statistics calculation means 5 also aggregates the elapsed time in the same manner as the physical CPU usage statistics calculation means 4, except that the elapsed time in the virtual CPU is aggregated according to the virtual CPU state.</p><p> As already mentioned, the virtual CPU can be said to be an execution environment including computer resources and a register set when the guest OS is executed on the physical CPU. The virtual CPU is assigned a physical CPU by the virtual CPU scheduler 2 of the virtual computer monitor 1. Then, the execution environment such as the register set of the virtual CPU is handed over to the guest OS 10B, and the guest OS 10B is started. The virtual CPU processing starts when the guest OS10B is started. The virtual CPU state determining means 3 uses various data (see <Management data and data structure>) held in the virtual computer monitor 1 to use the virtual CPU states user, sys, iowait, and so on. Determine idle.</p><p> The virtual CPU usage statistics calculation means 5 identifies the virtual CPU state according to the determination of the virtual CPU state determination means 3, and identifies the user time (user time), system time (sys time), and input / output wait. Each of the time (iowait time) and idle time (idle time) is totaled for a predetermined period, and then Calculate the accumulated value of each.</p><p> <Management data and data structure> Figure 8 shows an example of virtual CPU management data 7. The execution context is data indicating the state of each virtual CPU. The execution context has, for example, a register value. When the guest OS is switched, the execution context at the time of guest OS execution that was executed before the switch is saved in the memory. On the other hand, for the guest OS executed after switching, registers are set according to the execution context saved in the memory, and the guest OS executed after switching is started.</p><p> The Exit flag is a flag for determining whether the virtual CPU is in the user state (user) or the kernel state (sys). Guest OS10B executes privileged instruction and virtual calculation Before the processing is transferred to the machine monitor 1, the virtual computer monitor 1 sets the Exit flag for the virtual CPU running the guest OS 10B to 1. Conversely, when processing returns from the virtual computer monitor 1 to the guest OS 10B, the virtual computer monitor 1 sets the Exit flag to 0. The virtual system 11 uses the Exit flag as one judgment factor for the virtual CPU state determination means 3.</p><p> The number of I / Os waiting for completion indicates the number of incomplete I / O processes among the I / O requests issued by the guest OS 10B. The number of I / O waiting for completion is calculated by, for example, the following procedure. When the control is transferred to the virtual computer monitor 1 triggered by the input / output request from the guest OS 10B, the virtual computer monitor 1 adds 1 to the number of I / O waiting to be completed. Then, when the physical I / O is completed and the I / O response is returned to the guest OS 10B, the virtual computer monitor 1 subtracts 1 from the number of I / Os waiting for completion. The number of I / O waiting for completion is also a judgment factor of the virtual CPU state determination means 3.</p><p> In the first embodiment, the virtual computer monitor 1 calculates the number of waiting I / O for each guest OS 10. However, in the first embodiment, the calculated number of waiting I / O for each guest OS 10 is retained in the virtual CPU management data 7 so that it can be identified by the virtual CPU on which the guest OS 10B is executed. In the first embodiment, it is assumed that one guest OS 10B is executed by one virtual CPU. Therefore, if the virtual CPU can be specified, the virtual CPU state determination means 3 waits for completion in the virtual CPU. Can be obtained.</p><p> FIG. 11 illustrates a virtual CPU status table table for the virtual computer monitor 1 to identify the virtual CPU status (user, sys, iowait, idle). The virtual CPU status table table is included in the virtual CPU management data 7 in FIG.</p><p> The virtual CPU status table in FIG. 11 has the number of execution status in the first column, the Exit flag in the second column, and the number of waiting for completion I / O in the third column. The execution state refers to the state of the process described with reference to FIG. 10, that is, one of the active, queued, and unqueued states. The virtual computer monitor 1 inquires the virtual CPU scheduler 2 about the execution status of the virtual CPU. On the other hand, as explained in FIG. 8, the Exit flag and the number of I / O waiting for completion are already held in the virtual CPU management data 7.</p><p> Therefore, when the execution status of the virtual CPU is "active" or "queued", the virtual computer monitor 1 determines whether the virtual CPU status is user or sys, depending on the value of the Exit flag. Can be identified.</p><p> However, when the virtual CPU is unqueued, it is difficult for the virtual computer monitor 1 to determine whether it is in the idle or iowait state. The virtual computer monitor 1 acts for input / output from guest OS10B, but completes the number of input / output requests and processing in guest OS10B. It does not manage up to the number of times. Therefore, in the first embodiment, information indicating the number of I / O waiting to be completed is provided in the virtual CPU management data 7. Then, the virtual computer monitor 1 increases or decreases the number of I / Os waiting for completion at the time of input / output request from each guest OS 10B and at the completion of actual I / O for input / output, and holds each guest OS 10B. Then, when the virtual CPU is unqueued, the virtual computer monitor 1 identifies that the state of the virtual CPU is iowait when the number of I / Os waiting for completion is larger than 0. Further, the virtual computer monitor 1 identifies that the state of the virtual CPU is idle when the virtual CPU is unqueued and the number of I / Os waiting for completion is 0. In the first embodiment, since it is assumed that one guest OS is executed by one virtual CPU, the virtual computer monitor 1 holds the number of waiting I / O for each virtual CPU. Therefore, the virtual computer monitor 1 can identify the state of the virtual CPU from the number of I / Os waiting for completion for each virtual CPU.</p><p> In addition, when one guest OS10B is executed by a plurality of virtual CPUs, the processing may be changed as follows. That is, when one guest OS10B is executed by a plurality of virtual CPUs, the guest OS10B is associated with a specific virtual CPU called a virtual primary CPU. When the guest OS10B is first booted, it is first booted on the virtual primary CPU and then optionally executed on another virtual CPU. Therefore, the number of I / O waiting to be completed may be retained in the virtual CPU management data 7 so that it can be identified by the virtual primary CPU. Therefore, if the virtual CPU state determination means 3 can identify the virtual primary CPU, the number of I / O waiting to be completed in the guest OS 10B executed by the virtual primary CPU can be acquired. That is, by having the number of I / Os waiting for completion of a plurality of virtual CPUs as the information of the primary virtual CPU in total, the number of I / Os waiting for completion of the plurality of virtual CPUs as a whole is waiting for the completion of each virtual CPU. Approximately, it is sufficient to identify whether each virtual CPU is iowait or idle by regarding it as the number of I / Os.</p><p> <Explanation of timer processing> Hereinafter, timer processing in the virtual computer 10 will be described. The timer processing of the guest OS10B is basically the same as the timer processing of the physical computer. In timer processing, the callback function is first registered in the timer, and a timer interrupt is generated when the specified time elapses. In the wake of this timer interrupt, the physical OS releases the callback function from the timer and then calls the callback function. In the callback function, after executing a predetermined process to be periodically performed by the timer interrupt, the callback function is registered in the timer again. As a result, the callback function will be called periodically. Callback functions are also called handlers and interrupt processing programs. The specific implementation of the timer depends on the physical OS.</p><p> The points that the timer processing of the guest OS 10B differs from the timer processing of the physical computer are as follows. The timer registration process involves a privileged instruction. Therefore, when the process of registering the callback function in the timer is executed, control is once passed from the guest OS 10B to the virtual computer monitor 1. The virtual computer monitor 1 inputs a virtual timer interrupt to the guest OS 10B after the time specified by the guest OS 10B has elapsed, and further wakes up the virtual CPU. To wake up the virtual CPU means to allocate the physical CPU after restoring the execution context to the guest OS10B executed by the virtual CPU. However, the virtual computer monitor 1 sets the occurrence of a timer interrupt in the execution context to be passed to the guest OS 10B. Then, after the virtual CPU wakes up, the guest OS 10B receives the virtual timer interrupt. By the above method, the virtual computer monitor 1 virtually substitutes the timer processing started from the guest OS 10B. In the first embodiment, the virtual computer monitor 1 further includes a timer modulation means 6, and executes the timer adjustment process shown in FIG. 5 by appropriately modifying the time specified by the virtual computer 10.</p><p> FIG. 7 illustrates the components related to the processing when the timer interrupt is set and after the timer interrupt occurs. Suppose virtual system 11 contains one physical CPU. Guest OS 10B runs on one physical CPU. Guest OS10B sets the timer interrupt to the hardware timer at the first timer interval (arrow A1). In physical computers other than virtual system 11, the timer interrupt is set in the hardware timer ATM by the route of the dotted line AB2 in FIG.</p><p> However, since the timer interrupt setting is a privileged instruction, an exception occurs in the physical CPU in the case of virtual system 11. The exception transfers control from guest OS 10B to virtual computer monitor 1. The virtual computer monitor 1 whose control has been transferred from the guest OS 10B intercepts the timer interrupt request set by the guest OS 10B (arrow A2). Intercept means that the guest OS 10B receives the timer setting that sets the occurrence of the timer interrupt after the lapse of the set period for the hardware timer ATM on behalf of the hardware timer ATM. In the virtual computer 10 of the first embodiment, the virtual computer monitor 1 intercepts the timer setting via exception handling. As a result of interception, the timer interrupt setting by guest OS10B is not set for the hardware timer. The physical CPU executes a computer program expanded in memory as a means of receiving timer settings instead of the hardware timer ATM.</p><p> The virtual computer monitor 1 that intercepts the timer setting by the guest OS 10B sets the timer interrupt to the hardware timer ATM at the modulated second timer interval instead of the first timer interval set by the guest OS 10B (arrow A3). ). When setting the timer interrupt, the virtual computer monitor 1 sets the address of the guest timer wake-up handler AAH in the interrupt vector AIV1 processed for the timer interrupt. The timer hand is a function that is activated when a timer interrupt occurs. Also in FIG. 7, the guest timer wake-up handler AAH is activated when a timer interrupt occurs, and notifies the guest OS 10B of the timer interrupt.</p><p> When a timer interrupt occurs, an interrupt flag is set in the timer interrupt register AIR1 of the CPU (A4), and the guest timer wake-up handler AAH is started based on the address set in the interrupt vector AIV1 corresponding to the timer interrupt.</p><p> The activated guest timer wake-up handler AAH sets an interrupt flag in the timer interrupt register AIR2 in the execution context AC including the contents of the register set of guest OS10B, and sends a virtual interrupt to guest OS10B (arrow A5).</p><p> When the guest OS10B receives a virtual interrupt, control is transferred to the timer handler ATH set in the interrupt vector AIV2, and timer processing is performed. After processing by the timer handler ATH, control moves to the normal processing of guest OS10B (arrow A6). With the above configuration, the virtual computer monitor 1 sets a timer interrupt in the hardware timer ATM at the modulated second timer interval instead of the first timer interval set by the guest OS 10B. Then, the virtual computer monitor 1 notifies the guest OS 10B of the virtual timer interrupt instead of the hardware timer ATM.</p><p> <Timer modulation means> Hereinafter, a method in which the timer modulation means 6 adjusts the timer cycle specified by the guest OS 10B will be described. Figure 12 shows the timer cycle μ set by the guest OS10B (hypervisor) and the virtual timer cycles μsys and μio returned by the virtual computer monitor 1 (VM) to the guest OS10B. Illustrate the relationship.</p><p> Guest OS10B sets the period shown by tsys and the period shown by Tsys in Fig. 12. Timer cycle μ and the virtual timer cycle μsys returned by virtual computer monitor 1 to guest OS 10B The relationship with is shown by Equation 1 below. (Equation 1) μsys = μ tsys / Tsys; In Equation 1, tsys is the running period of the kernel program recognized by guest OS 10B in one input / output (eg, the process from I / O request to I / O acceptance in Figures 4 and 5). , Corresponds to TSB11 + TSB12) in Fig. 4B. In addition, Tsys once mentioned above Corresponds to the execution period of the kernel program recognized by the virtual computer monitor 1 (for example, TSB21 + TSB22 in FIG. 4B) in the input / output of. Actually, tsys can obtain the execution time of the kernel program calculated by the virtual CPU usage statistics calculation means 5 as a cumulative value accumulated for a predetermined period. Here, the cumulative value means the total value collected for a predetermined period. However, as the cumulative value, the average value during the predetermined period may be used. However, instead of the cumulative value of the execution time calculated by the virtual CPU usage statistics calculation means 5, the execution time of the kernel program included in the usage statistics calculated in the past by the guest OS 10B in a predetermined period may be used. Of course, for the usage statistics calculated by the guest OS 10B in the past, the usage statistics in the state where the virtual timer cycle μsys according to Equation 1 is not modulated may be used. Corresponds to the reference value of the processing time in the privileged state recognized by the guest OS by tsys.</p><p> In addition, Tsys is used when the kernel program calculated by the physical CPU usage statistics calculation means 4 is executed. The interval can be calculated as a cumulative cumulative value. Tsys is recognized by virtual computer monitor 10 Corresponds to the reference value of the processing time in the privileged mode.</p><p> As a timer cycle that replaces the timer cycle μ set by the guest OS10B, the frequency of occurrence of virtual timer interrupts that occur in the period tsys is the frequency of occurrence of physical timer interrupts that occur in the period Tsys. The timer period μsys modulated to match the degree is determined by Equation 1. According to Equation 1 For example, the timer cycle will be modulated at a tsys / Tsys ratio.</p><p> When Equation 1 is transformed, tsys / μsys = Tsys / μ, and the number of timer interrupts generated at μsys intervals recognized by guest OS10B within the cumulative time tsys is recognized by the virtual computer monitor 1 in the cumulative time Tsys. The virtual timer is modulated in a direction that matches the number of timer interrupts that occur at intervals of, μ. That is, the timer density in the virtual timer in the period tsys And the timer density of the physical timer in the period Tsys is common.</p><p> On the other hand, during the period shown by tio and the period shown by Tio in Fig. 12, guest OS10B is installed. The relationship between the determined timer cycle μ and the virtual timer cycle μio returned by the virtual computer monitor 1 to the guest OS 10B is shown by Equation 2 below. (Equation 2) μio = μ tio / Tio; In Equation 2, tio accepts I / O from a single I / O request (eg, I / O request in Figures 4 and 5). (Processing up to) corresponds to the I / O wait period (for example, TWB1 in FIG. 4B) for the virtual device recognized by the guest OS 10B. Further, Tio corresponds to the period of waiting for input / output to the physical device recognized by the virtual computer monitor 1 (for example, TWB2 in FIG. 4B) in the above-mentioned one input / output. Actually, tio is calculated as the cumulative value of the input / output waiting time calculated by the virtual CPU usage statistics calculation means 5. However, instead of the cumulative value tio calculated by the virtual CPU usage statistics calculation means 5, the input / output waiting time during the predetermined period included in the usage statistics calculated by the guest OS 10B may be used. Of course, for the usage statistics calculated by the guest OS 10B in the past, the usage statistics in the state where the virtual timer cycle μio according to Equation 2 is not modulated may be used. Corresponds to the reference value of the I / O wait time recognized by the guest OS by tio. In addition, Tio is the cumulative value of the input / output waiting time during the predetermined period calculated by the physical CPU usage statistics calculation means 4. Corresponds to the reference value of the input / output waiting time recognized by the virtual computer monitor by Tio.</p><p> Issued within the period tio as a timer cycle that replaces the timer cycle μ set by guest OS10B Equation 1 determines the timer period μio modulated so that the frequency of occurrence of virtual timer interrupts that occur matches the frequency of occurrence of physical timer interrupts that occur within the period Tio.</p><p> When Equation 2 is transformed, tio / μio = Tio / μ, and the number of timer interrupts generated at μio intervals recognized by guest OS10B within the cumulative time tio is recognized by the virtual computer monitor 1 in the cumulative time Tio. It matches the number of timer interrupts that occur at μ intervals. Therefore, the timer is modulated in the direction in which the number of occurrences of the timer interrupt in the input / output waiting time recognized by the guest OS 10B coincides with the number of occurrences of the timer interrupt in the input / output waiting time recognized by the virtual computer monitor 1. That is, the timer density of the virtual timer in the period tio and the timer density of the physical timer in the period Tio are common.</p><p> Furthermore, since tsys / μsys + tio / μio = (Tsys + Tio) / μ, guest OS1 The total number of interrupts recognized by 0B in the kernel state and the I / O waiting state matches the total number of interrupts recognized by the virtual computer monitor 1.</p><p> FIG. 13 illustrates the processing flow of the virtual CPU state determining means 3. The virtual CPU status determining means 3 manages and refers to the virtual CPU status table table of FIG. 11 to determine the status of each virtual CPU. For example, the virtual CPU state determining means 3 determines the state of each virtual CPU in response to a request from the virtual CPU usage statistics calculating means 5.</p><p> The physical CPU executes a computer program as a virtual CPU state determination means 3. However, in the first embodiment, the virtual CPU state determining means 3 will be described as executing the process of FIG. In the process of FIG. 13, the virtual CPU state determining means 3 queries the virtual CPU scheduler 2 for the schedule status of each virtual CPU (F1). Then, based on the response from the virtual CPU scheduler 2, the virtual CPU state determining means 3 determines whether or not each virtual CPU is in either the active or queued state (F2).</p><p> If the virtual CPU is either active or queued (F2 YES), the virtual CPU state determination means 3 gets the Exit flag from the virtual CPU management table (F3). Then, the virtual CPU state determination means 3 advances the control to F5. On the other hand, when the virtual CPU is neither active nor queued, that is, when it is unqueued (F2 NO), the virtual CPU state determining means 3 advances the process to F4. In this case, the virtual CPU state determination means 3 acquires the number of I / O waiting for completion from the virtual CPU management data (F4).</p><p> Then, the virtual CPU state determining means 3 refers to the virtual CPU state table using the Exit flag acquired by F3 or the completion waiting I / O flag acquired by F4, and refers to the virtual CPU state, that is, user, sys, Judge either iowait or idle and output the judgment result to the virtual CPU usage statistics calculation means (F5).</p><p> For example, when the virtual CPU is active or queued and the EXIT flag is 0, the virtual CPU state determining means 3 outputs the user state (user). Also, if the virtual CPU is active or queued and the EXIT flag is 1, the virtual CPU state determination means 3 exits the kernel state (sys). Power. If the virtual CPU is neither active nor queued (unqueued) and the number of I / O waiting for completion is 0 or less, the virtual CPU state determination means 3 outputs an idle. When the virtual CPU is neither active nor queued (unqueued) and the number of waiting I / O is 1 or more If so, the virtual CPU state determination means 3 outputs an I / O completion wait (iowait).</p><p> As described above, the virtual CPU state determination means 3 distinguishes between user, sys, iowait, and idle. If the virtual computer monitor 1 monitors the status of the virtual CPU on a regular basis, for example, the virtual CPU usage statistical information can be calculated.</p><p> FIG. 14 illustrates the processing flow of the virtual CPU usage statistics calculation means 5. The physical CPU executes the computer program included in the virtual computer monitor 1 as the virtual CPU usage statistics calculation means 5. Hereinafter, it is assumed that the virtual CPU usage statistics calculation means 5 executes the process shown in FIG. The process of FIG. 14 is started when the state of each virtual CPU is switched to either active, queued, or unqueued by the virtual CPU schedule 2, or when the number of I / O waiting for completion changes.</p><p> The process of FIG. 14 may be started at predetermined time intervals. When the process of FIG. 14 is started at a predetermined time interval, for example, the state of the virtual CPU (user, sys, iowait, Compared to the period during which idle) changes, the processing shown in FIG. 14 occurs in a short period that can be tolerated as an error. Just move it.</p><p> The virtual CPU usage statistics calculation means 5 first determines the current state, user, sys, iowait, and idle of the virtual CPU (F21). The current state of the virtual CPU is determined by the process of FIG. 13 virtual CPU state determining means 3.</p><p> Next, the virtual CPU usage statistics calculation means 5 subtracts the previous processing end time from the current time to obtain the elapsed time from the previous processing end (F22). The current time is the current time recognized by the virtual computer monitor 1 when the F22 process is executed.</p><p> Next, the virtual CPU usage statistics calculation means 5 determines whether or not the current state of the virtual CPU obtained in F11 is the kernel state (sys) (F23). The current state of the virtual CPU is kernel-like In the case of the state (sys) (F23 YES), the virtual CPU usage statistics calculation means 5 adds the elapsed time calculated by F22 to the cumulative value tsys of sys time (F24). And virtual CPU Usage statistics calculation means 5 shifts control to F27.</p><p> On the other hand, if the current state of the virtual CPU is not the kernel state (sys) (S23 NO), The virtual CPU usage statistics calculation means 5 determines whether or not the current state of the virtual CPU obtained in F21 is I / O wait (iowait) (F25). When the current state of the virtual CPU is I / O wait (iowait) (F25 YES), the virtual CPU usage statistics calculation means 5 adds the elapsed time calculated by F22 to the cumulative value tio of the iowait time (F26). .. Then, the virtual CPU usage statistics calculation means 5 moves the control to F27.</p><p> Next, the virtual CPU usage statistics calculation means 5 records the current time as the end time in a static memory, for example, a shared memory (F27). Then, the virtual CPU usage statistics calculation means 5 ends the process.</p><p> Although omitted in the process of FIG. 14, the user time when the virtual CPU is in the user state or the idle time when the virtual CPU is idle can be calculated in the same manner.</p><p> Further, the processing of the physical CPU usage statistics calculation means 4 is the same as the processing executed by the conventional physical OS except that the processing is executed by the virtual computer monitor 1. That is, the virtual computer monitor 1 can handle the processing on the hypervisor in the same manner as the process of the physical OS in the physical computer. Therefore, the physical CPU usage statistics calculation means 4 is a hyperbar. It is possible to determine whether the processing state on the isa is the user state (user), the kernel state (sys), the I / O completion wait (iowait), or the idle (idle). On the hypervisor When the processing state of is in the kernel state, the processing of the actual I / O driver in Fig. 4B (sys-B21, An example is given when sys-B22) is running. Therefore, for example, the physical CPU usage statistics calculation means 4 may determine that the processing state on the hypervisor is in the kernel state when the process of the actual I / O driver shown in FIG. 4B is being executed. Then, the physical CPU usage statistics calculation means 4 sets the execution time (sys time) in the kernel state for a predetermined cumulative period as the cumulative value Tsys. Further, the physical CPU usage statistics calculation means 4 sets the input / output waiting time (iowait time) of a predetermined cumulative period as the cumulative value Tio.</p><p> 15 and 16 illustrate the processing flow of the timer modulation means 6. The physical CPU executes the computer program included in the virtual computer monitor 1 as the timer modulation means 6. Hereinafter, the timer modulation means 6 will be described as executing the processes of FIGS. 15 and 16. The timer modulation means 6 modulates the generation time of the virtual timer interrupt to be transferred to the guest OS 10B according to Equations 1 and 2. Since μ is the timer cycle specified by the guest OS 10B, the timer modulation means 6 calculates the modulated timer cycle according to the result of the virtual CPU state determination means 3. FIG. 15 shows the process when the timer is set, and FIG. 16 shows the process when the virtual timer interrupt is transferred to the guest OS 10B after the timer interrupt occurs. The program that executes the process shown in FIG. 16 is called a guest timer wake-up handler. The physical CPU executes the process shown in FIG. 16 by the computer program expanded in the memory as a means for notifying the guest OS of the occurrence of the timer interrupt.</p><p> When guest OS10B sets a timer interrupt, an exception occurs in the physical CPU because the timer interrupt setting is a privileged instruction. The virtual computer monitor 1 intercepts the timer interrupt setting set by the guest OS 10B through the exception generated by the CPU, and activates the processing of the timer modulation means 6 in FIG. The CPU intercepts the timer interrupt settings according to the computer program expanded in memory (arrow B1 in Fig. 6).</p><p> The timer modulation means 6 queries the virtual CPU state determination means 3 and acquires the state of the virtual CPU (F31). Then, the timer modulation means 6 determines the state of the virtual CPU being executed (F32).</p><p> If the state of the virtual CPU is the kernel state (sys), the timer modulation means 6 is set to Equation 1. Therefore, the timer interval μsys after modulation is calculated. In addition, the data set by guest OS10B The imma interval μ can be acquired when the timer interrupt set by the guest OS 10B is intercepted. Then, the timer modulation means 6 sets the timer interrupt to the hardware timer with the timer interval after modulation as μsys instead of the timer interval μ set by the guest OS 10B. To do. Further, the timer modulation means 6 sets a guest timer wake-up handler for waking up the guest OS 10B as a timer handler that receives the set timer interrupt (F33).</p><p> When the state of the virtual CPU is the user state (user) or the idle state (idle), the timer modulation means 6 interrupts the timer by the timer interval μ set by the guest OS 10B without modulating the timer interval. (F34). Further, the timer modulation means 6 sets a guest timer wake-up handler for waking up the guest OS 10B as a timer handler that accepts the set timer interrupt. That is, in the modulation method of the first embodiment, the timer interval is not modulated by the user and idle time.</p><p> When the state of the virtual CPU is I / O wait (iowait), the timer interval μio after modulation is calculated according to Equation 2. Then, the timer modulation means 6 is set by the guest OS 10B. Instead of the imma interval μ, set the timer interrupt with the timer interval after modulation as μio. Further, the timer modulation means 6 sets a guest timer wake-up handler for waking up the guest OS 10B as a timer handler that accepts the set timer interrupt (F35).</p><p> When the timer interrupt set according to the process shown in FIG. 15 occurs, the guest timer wake-up handler is activated and the process shown in FIG. 16 is executed. The guest timer wake-up handler first cancels the activation setting of the guest timer wake-up handler when a timer interrupt occurs. That is, the guest timer wake-up handler setting is cleared from the interrupt vector for the timer interrupt (F41).</p><p> Next, the guest timer wake-up handler sets the interrupt flag in the timer interrupt register AIR2 in the execution context AC of the virtual CPU (see Fig. 7). Then, the guest timer wake-up handler starts the guest OS10B.</p><p> The started guest OS 10B sets various register values included in the context to the registers of the CPU of the virtual computer 10 and starts processing. Then, it looks like a timer interrupt has occurred in the virtual CPU. That is, the guest timer wake-up handler notifies the virtual CPU of the virtual timer interrupt (F42). As described above, in the guest OS10B, the timer handler is activated by the virtual timer interrupt. Therefore, although the guest OS10B was actually notified of the interrupt at the timer interval μsys or the timer interval μio, Instead, it behaves as if an interrupt was notified at the timer interval μ.</p><p> As described above, according to the virtual system 11 of the first embodiment, the virtual CPU usage statistics calculation means 5 has the cumulative value tsys of the execution time of the kernel state in the virtual computer 10 and the execution time of the input / output wait state. Calculate the cumulative value tio. In addition, the physical CPU usage statistics calculation means 4 waits for input / output and the cumulative value Tsys of the execution time of the kernel state in the physical CPU included in the virtual system 11. Calculate the cumulative value Tio of the state execution time. Then, the timer modulation means 6 intercepts the timer interrupt setting by the guest OS 10B, changes the timer interval according to the equations 1 and 2, and sets the timer interrupt for the actual physical CPU. Further, the timer modulation means 6 sets the guest timer wake-up handler shown in FIG. 16 as the timer handler.</p><p> Therefore, the timer interval is changed according to Equation 1 or Equation 2 between the kernel state and the I / O waiting state, and a virtual timer interrupt is generated in the guest OS 10B at the changed timer interval. That is, as shown in columns C2 and C3 of FIG. 5, the total number of timer interrupt occurrences in the kernel state and the input / output waiting state is maintained in one input / output process in the guest OS 10B. Then, while the total number of timer interrupt occurrences is maintained, the ratio of the number of timer occurrences in the kernel state by the virtual CPU in the guest OS 10B and the input / output wait state is adjusted. That is, the ratio of the number of timer occurrences in the kernel state by the virtual CPU and the I / O wait state in the guest OS 10B matches the ratio of the timer occurrence count in the process kernel state and the I / O wait state in the physical CPU. In addition, the timer interval is changed.</p><p> Therefore, in the virtual OS, the statistical information on the kernel execution time and the input / output waiting execution time at the time of executing the input / output process approaches the statistical information under the conditions similar to those measured by the actual physical computer. That is, as shown in FIG. 5, when the guest OS 10B inputs / outputs data to / from the input / output device through the virtual computer monitor 1, the input / output waiting time recognized by the guest OS 10B and the processing time other than the input / output waiting time are The ratio approaches the ratio of the I / O waiting time recognized by the virtual computer monitor 1 to the processing time other than the I / O waiting time.</p><p> By the way, in Example 1, the case of using one virtual CPU has been described. Multiple virtual Even when using a CPU, Example 1 can be applied as it is. The reason is that the user time and idle time do not need to be modulated, only the sys time and iowait time. The user time does not need to be modulated in the first place, and the idle time is in the virtual CPU usage statistics. Modulation of the sys and iowait times is sufficient, as they are other values of no interest. However However, as shown in Example 1, when the virtual computer monitor 1 calculates physical CPU usage statistics for the entire physical system, the ratio of sys and iowait times in the virtual CPU usage statistics of all virtual computers. Is a first-order approximation method that modulates so that ing.</p><p> The cumulative values tio and tsys illustrated in Example 1 are the values obtained by estimating the iowait time and sys time actually observed by the guest OS 10B as clues for the number of completion waiting I / O newly provided by the virtual computer monitor 1. There are other methods of estimation.</p><p> Below are several other ways to improve the accuracy of the iowait and sys time approximations and to estimate the iowait and sys times for guest OS 10B.</p><p> <Modification example 1> As a policy for performing timer modulation with high accuracy, physical CPU usage statistics may be calculated for each virtual CPU. That is, since the virtual computer monitor 1 identifies and manages each virtual CPU, the virtual computer monitor 1 identifies the virtual CPU to which the usage statistics are calculated from the physical CPU usage statistics information calculation means 4. Information may be passed and physical CPU usage statistics may be calculated for each virtual CPU. For that purpose, Tsys and Tio are provided with only different entries that are distinguished by the information that identifies each virtual CPU. And Tio are accumulated. Then, the timer modulation means 6 shown in FIG. 14 refers to Tsys and Tio, which are statistical information of the corresponding virtual CPU, based on the information for identifying the virtual CPU to be modulated, and according to Equations 1 and 2, according to Equations 1 and 2. Calculate μsys and μio.</p><p> The method of calculating physical CPU usage statistics for each virtual CPU is suitable when different types of loads are applied to each physical CPU. For example, when one guest OS frequently accesses a disk and another guest OS frequently accesses a network, each guest OS always uses a fixed physical CPU.</p><p> Further, since the virtual computer monitor 1 identifies and manages each physical device, the virtual computer monitor 1 identifies the physical device for which the usage statistics are calculated from the physical CPU usage statistics information calculation means 4. Information may be passed and physical CPU usage statistics may be calculated for each physical device. Therefore, Tsys and Tio are familiar with individual physical devices. Tsys and Tio need only be accumulated by preparing only different entries distinguished by different information. .. Then, the timer modulation means 6 shown in FIG. 14 refers to the corresponding statistical information Tsys, Tio based on the information for identifying the physical device that is the target of the input / output process currently being executed, and refers to Equation 1 and Equation 1. Μsys and μio may be calculated according to Equation 2.</p><p> The process of calculating Tsys and Tio for each individual physical device is suitable for handling a plurality of physical devices having different characteristics. For example, with USB devices, SAN disks, IDE disks, etc. is there.</p><p> <Transformation example 2> FIG. 17 illustrates the configuration of a virtual computer without the virtual CPU state determining means 3. Note that, in FIG. 17, the same components as those in FIG. 6 are designated by the same reference numerals and the description thereof will be omitted.</p><p> In the configuration shown in FIG. 17, the guest OS 10B has a virtual CPU in the virtual CPU management data 7. Clarify whether usage statistics calculation means 5 should be counted for user, sys, idle, or iowait. Fill in the target. That is, the guest OS10B clearly indicates that the process is in the user state in the state flag on the shared memory before the process for prompting the issuance of a privileged instruction such as a system call is executed. In addition, the guest OS10B clearly indicates in the status flag on the shared memory that the process is in the kernel state until the privileged instruction is completed after the process for prompting the issuance of the privileged instruction such as a system call is executed. In addition, the guest OS10B clearly indicates in the status flag on the shared memory that it is in the I / O waiting state until the I / O processing is completed after executing the I / O request. On the other hand, the virtual CPU usage statistics calculation means 5 accumulates the elapsed time in the idle time when the input / output waiting time is not specified in the shared memory flag. User, sys, as above In order for guest OS10B to specify iowait, guest OS1 Although a slight correction is required for 0B, there is no need to change the timer processing itself. In this case, the virtual CPU state determination means 3 can be omitted. In addition, the guest OS10B uses the virtual CPU usage statistics calculation means for user, sys, and iowait recognized by the guest OS10B itself. Since it instructs 5, user time, sys time, and iowait time are aggregated and accumulated with high accuracy. it can.</p><p> Furthermore, simply, guest OS10B has user time, sys time, and iowait time. May be aggregated and accumulated. Then, the virtual computer monitor 1 may read the user time, sys time, and iowait time that the guest OS 10B aggregates and accumulates. .. The virtual CPU usage statistics calculation means 5 is the user time, sys time, recognized by the guest OS 10B. By receiving the and iowait time from the guest OS10B, statistical information can be obtained more accurately. Therefore, the tsys and tio shown in Equation 1 and Equation 2 can be obtained accurately. To.</p><p> Further, the I / O time modulation rate tio / Tio and the kernel time modulation rate tsys / Tsys may be used as values obtained experimentally and empirically in advance. Specifically, the same business system is operated on each of the guest OS 10B on the virtual system 11 and the physical OS on the physical system 300, and the I / O time and kernel time at this time are set to tio, tsys, and Tio, respectively. Measure as Tsys. Equations (1) and (2) are calculated using the modulation rate of the I / O time and the modulation rate of the kernel time calculated using these values.</p><p> << Computer-readable recording medium >> A program that enables a computer or other machine or device (hereinafter, computer or the like) to realize any of the above functions can be recorded on a recording medium that can be read by the computer or the like. Then, the function can be provided by causing a computer or the like to read and execute the program of this recording medium.</p><p> Here, a recording medium that can be read by a computer or the like is a recording medium that can store information such as data and programs by electrical, magnetic, optical, mechanical, or chemical action and can be read from the computer or the like. To say. Among such recording media, those that can be removed from a computer or the like include, for example, a memory such as a flexible disk, a magneto-optical disk, a CD-ROM, a CD-R / W, a DVD, a Blu-ray disk, a DAT, an 8 mm tape, or a flash memory. There are cards etc. In addition, there are hard disks, ROMs (read-only memories), and the like as recording media fixed to computers and the like.</p>
1,301 virtual computer monitor 2 Virtual CPU scheduler 3 Virtual CPU state determination means 4 Physical CPU usage statistics calculation method 5 Virtual CPU usage statistics calculation method 6 Timer modulation means 8 Timer processing setting means 10 virtual computer 10B, 310B Guest OS 300 computer system 301 virtual computer monitor 302 physical disk 304 backend driver 305 Timer mechanism 306 Scheduler 310A front-end driver 310C application program
Every citation, both waysCites: the store holds 1 of 2
| Document | Relation | Office |
|---|---|---|
| JP2001166954A | Cites | Japan |
| 高橋浩和,「仮想マシンモニター Xen 3.0解読室 第7回 時計」,オープンソースマガジン,ソフトバンククリエイティブ株式会社,2006年10月 1日,第15巻,第10号,通巻第171号,p.147-155 | Non-patent | – |
7 members in 3 offices
Priority claims2
| Document | Office | Kind | Date |
|---|---|---|---|
| 2010007426 | Japan | A | |
| JP20100007426 | – | – | – |
Members7
| Document | Office | Kind | |
|---|---|---|---|
| US2011179417A1 | United States of America | A1 | |
| JP2011145956A | Japan | A | |
| EP2372542A2 | European Patent Office (EPO) | A2 | |
| EP2372542A3 | European Patent Office (EPO) | A3 | |
| US8539010B2 | United States of America | B2 | |
| JP5434616B2This record | Japan | B2 | |
| EP2372542B1 | European Patent Office (EPO) | B1 |
8 legal events, as the office reported them to INPADOC
Over the term
Point at a mark for the eventEvents
| Event | Code | |
|---|---|---|
| Cancellation because of no payment of annual feesLAPS | LAPS | |
| Certificate of patent or registration of utility modelJAPANESE INTERMEDIATE CODE: R150R150 | R150 | |
| Certificate of patent or registration of utility modelJAPANESE INTERMEDIATE CODE: R150R150 | R150 | |
| First payment of annual fees (during grant procedure)JAPANESE INTERMEDIATE CODE: A61A61 | A61 | |
| Written decision to grant a patent or to grant a registration (utility model)JAPANESE INTERMEDIATE CODE: A01A01 | A01 | |
| Report on retrievalJAPANESE INTERMEDIATE CODE: A971007A977 | A977 | |
| Decision of grant or rejection writtenTRDD | TRDD | |
| Written request for application examinationJAPANESE INTERMEDIATE CODE: A621A621 | A621 |
Numbers
- Publication
- 5434616
- Publication, DOCDB
- 5434616
- Publication, EPODOC
- JP5434616B
- Application
- 7426
- Application, DOCDB
- 2010007426
- Application, EPODOC
- JP20100007426
Titles2
- Japanese
- 仮想計算機、仮想計算機モニタ、および計算機の制御方法
- English
- Virtual computer, virtual computer monitor, and computer control method
Classification
- CPC, 3
- G06J1/00
- G06F9/45558
- G06F2009/45579
- IPC, 3
- G06F9 46
- G06F9 48
- G06F13 10