Patent ID: 9697041
Date: 2017-07-04
CPC Classifications: G06F

Claim:
1. A method for dynamic interrupt balanced mapping based on the current scheduling states of Virtual CPUs (VCPUs), comprising following steps: (a) whenever virtual hardware generates a virtual interrupt, a virtual I/O Advanced Programmable Interrupt Controller (APIC) receives the virtual interrupt and transmits the virtual interrupt to the virtual local APIC of a target VCPU; (b) an interrupt balanced allocator intercepts the virtual interrupt before the virtual interrupt is transmitted to the virtual local APIC of the target VCPU; (c) the interrupt balanced allocator analyzes the scheduling state information provided by a scheduler so as to obtain a list of the VCPUs in active state; (d) the interrupt balanced allocator reselects a target VCPU according to the list of the VCPUs in the active state; (e) the interrupt balanced allocator transmits the virtual interrupt to the virtual local APIC of the target VCPU reselected in step (d); and (f) the virtual local APIC of the target VCPU injects the virtual interrupt into the target VCPU; wherein the method for selecting the target VCPU in step (d) comprises following steps: (d1) obtain the number of the VCPUs in the list of the VCPUs in the active state; (d2) if the number is zero, select the target VCPU according to the scheduling state information; if the number is one, select the VCPU in the list of the VCPUs in the active state as the target VCPU; if the number is greater than one, select the target VCPU according to the interrupt loads of the VCPUs in the list of the VCPUs in the active state.