The VMM uses a time-slice scheduler and execution priority to carry out pre-emptive multitasking for virtual machines. The VMM grants time slices to the virtual machines that have the highest execution priority. Virtual machines with execution priorities lower than the highest priority do not receive time slices. The VMM assigns an execution priority to a virtual machine when it creates the virtual machine. The VMM and virtual devices can subsequently raise or lower the execution priority to cause task switching between virtual machines. The VMM often raises the execution priority for a virtual machine that needs to service a high-priority device event, such as an interrupt that must be serviced in a timely manner.
The VMM relies on time-slice priorities and flags to determine how much CPU time it grants to the virtual machines. Every virtual machine has a foreground and a background time-slice priority in addition to the virtual machine's execution priority. The virtual machine with the largest time-slice priority receives a greatest share of CPU time. The VMM uses the foreground priority to determine the amount of CPU time to grant a virtual machine if the virtual machine has the execution focus (is the foreground virtual machine). Otherwise, the VMM uses the background priority. If a virtual machine is not the foreground virtual machine, it receives no time slices unless the CB_VM_Status field in its control block specifies the VMStat_Background or VMStat_High_Pri_Back values. If a virtual machine has the VMStat_Exclusive value, no other virtual machine receives time slices while the exclusive virtual machine has the execution focus.
Share with your friends: |