Delaying interrupts for virtual machines
AssigneeRed Hat, Inc.
InventorMichael Tsirkin
Life of this patent
Estimating the term…
Abstract
A computing device can detect an interrupt associated with a virtual machine. Based on detecting the interrupt, the computing device can determine whether the virtual machine is in an idle state. Based on determining that the virtual machine is in the idle state, the computing device can delay the interrupt by storing the interrupt in an interrupt register for a period of time and preventing the interrupt from being transmitted to the virtual machine during the period of time. After storing the interrupt in the interrupt register, the computing device can determine that the virtual machine is in an awake state. In response to determining that the virtual machine is in the awake state, the computing device can transmit the interrupt from the interrupt register to the virtual machine.
Claims20
A non-transitory computer-readable medium comprising program code that is executable by a processor to:
- detect a first interrupt associated with a first device, wherein the first interrupt is intended for a virtual machine;
- based on detecting the first interrupt:
- determine whether the virtual machine is in an idle state;
- determine that a first device type associated with the first device is on a list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt;
- and
- based on determining that the virtual machine is in the idle state, and that the first device type is on the list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt, delay the first interrupt by storing the first interrupt in an interrupt register and preventing the first interrupt from being transmitted to the virtual machine at least until the virtual machine is awakened by an event other than the first interrupt, such that the first interrupt is not used as a basis for awakening the virtual machine from the idle state;
- subsequent to storing the first interrupt in the interrupt register to delay delivery of the first interrupt to the virtual machine:
- determine that the virtual machine is in an awake state;
- and
- in response to determining that the virtual machine is in the awake state, release the delay by transmitting the first interrupt from the interrupt register to the virtual machine, thereby ending the delay of the first interrupt;
- detect a second interrupt associated with a second device that is different from the first device, wherein the second interrupt is also intended for the virtual machine;
- determine that a second device type associated with the second device is not on the list of device types for which interrupts are to be delayed;
- and
- based on determining that the second device type is not on the list of device types for which interrupts are to be delayed, transmit the second interrupt to the virtual machine without delaying the second interrupt and without storing the second interrupt in the interrupt register.
A method comprising:
- detecting, by a processor, a first interrupt associated with a first device, wherein the first interrupt is intended for a virtual machine;
- based on detecting the first interrupt:
- determining, by the processor, whether the virtual machine is in an idle state;
- determining, by the processor, that a first device type associated with the first device is on a list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt;
- and
- based on determining that the virtual machine is in the idle state, and that the first device type is on the list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt, delaying, by the processor, the first interrupt by storing the first interrupt in an interrupt register and preventing the first interrupt from being transmitted to the virtual machine at least until the virtual machine is awakened by an event other than the first interrupt, such that the first interrupt is not used as a basis for awakening the virtual machine from the idle state;
- subsequent to storing the first interrupt in the interrupt register to delay delivery of the first interrupt to the virtual machine:
- determining, by the processor, that the virtual machine is in an awake state;
- and
- in response to determining that the virtual machine is in the awake state, releasing, by the processor, the delay by transmitting the first interrupt from the interrupt register to the virtual machine, thereby ending the delay of the first interrupt;
- detecting, by the processor, a second interrupt associated with a second device that is different from the first device, wherein the second interrupt is also intended for the virtual machine;
- determining, by the processor, that a second device type associated with the second device is not on the list of device types for which interrupts are to be delayed;
- and
- based on determining that the second device type is not on the list of device types for which interrupts are to be delayed, transmitting, by the processor, the second interrupt to the virtual machine without delaying the second interrupt and without storing the second interrupt in the interrupt register.
A system comprising:
- a processor;
- and
- a memory comprising instructions that are executable by the processor to:
- detect a first interrupt associated with a first device, wherein the first interrupt is intended for a virtual machine;
- based on detecting the first interrupt:
- determine whether the virtual machine is in an idle state;
- determine that a first device type associated with the first device is on a list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt;
- and
- based on determining that the virtual machine is in the idle state, and that the first device type is on the list of device types for which interrupts are to be delayed at least until the virtual machine is awakened by an event other than the first interrupt, delay the first interrupt by storing the first interrupt in an interrupt register and preventing the first interrupt from being transmitted to the virtual machine at least until the virtual machine is awakened by an event other than the first interrupt, such that the first interrupt is not used as a basis for awakening the virtual machine from the idle state;
- subsequent to storing the first interrupt in the interrupt register to delay delivery of the first interrupt to the virtual machine:
- determine that the virtual machine is in an awake state;
- and
- in response to determining that the virtual machine is in the awake state, release the delay by transmitting the first interrupt from the interrupt register to the virtual machine, thereby ending the delay of the first interrupt;
- detect a second interrupt associated with a second device that is different from the first device, wherein the second interrupt is also intended for the virtual machine;
- determine that a second device type associated with the second device is not on the list of device types for which interrupts are to be delayed;
- and
- based on determining that the second device type is not on the list of device types for which interrupts are to be delayed, transmit the second interrupt to the virtual machine without delaying the second interrupt and without storing the second interrupt in the interrupt register.
Dependencies are inferred from the claim text.