A method of controlling a virtual machine system, the virtual machine system comprising:
- a physical computer comprising a plurality of physical processors and a physical memory, at least one of the physical processors including an interrupt controller, and the interrupt controller including an interrupt timer, the memory storing instructions that cause the physical processors to execute a virtualization module configured to allocate a computer resource of the physical computer to a plurality of virtual machines and to control allocation of the physical processors, the method comprising:
- a first step of generating, by the virtualization module, the plurality of virtual machines by respectively generating for each of the virtual machines:
- a virtual processor comprising a virtual interrupt timer obtained by virtualizing the interrupt timer and a virtual interrupt controller obtained by virtualizing the interrupt controller to which the computer resource of the physical processors is allocated;
- and
- a virtual memory to which the computer resource of the physical memory is allocated;
- a second step of setting, by the virtualization module, a processor scheduling mode to any one of:
- a shared processor mode in which one of the physical processors allocated to the plurality of virtual machines is shared among a plurality of the virtual processors;
- and
- an exclusive processor mode in which one of the physical processors allocated to the plurality of virtual machines is occupied by a specific virtual processor;
- and
- a third step of setting, by the virtualization module, in conjunction with the processor scheduling mode, a timer scheduling mode to any one of:
- a shared timer mode in which the interrupt timer of the one of the physical processors for which any one of the shared processor mode and the exclusive processor mode is set is shared among timer events for the plurality of virtual machines;
- and
- an exclusive timer mode in which the interrupt timer of the one of the physical processors is occupied by a virtual timer of the specific virtual processor,
- wherein, on the one of the physical processors in the shared timer mode, the virtualization module receiving a timer event of a timer interrupt generated by the interrupt controller of the one of the physical processors, and, when the timer event is for at least one of the plurality of virtual machines, notifying the at least one of the plurality of virtual machines corresponding to the timer event, and causing the at least one of the virtual machines to execute a predetermined processing corresponding to the timer event, and wherein, on the one of the physical processors in the exclusive timer mode, the virtualization module directly notifying the specific virtual processor of a timer interrupt generated by the interrupt controller of the one of the physical processors, and causing the specific virtual processor to execute a predetermined processing corresponding to the timer interrupt.