Virtual Machine Scheduling and Dispatching

Through its virtual machine scheduling function, CP attempts to keep as many of the logged-on virtual machines as possible operating concurrently. It takes into account the availability of processing time, paging resources, and real storage (as compared to virtual machine requirements for these resources), as well as limits in effect on the number of virtual machines waiting to be given processor control. The availability of, and requirements for, I/O resources are not factored into the scheduler's calculations.

Each virtual machine is permitted to remain in the set of virtual machines that are competing for use of the real processor for an interval of time called an elapsed time slice. A virtual machine is permitted to have processor control only for a portion of the elapsed time slice (called the dispatch time slice) each time it is dispatched. When a virtual machine has accumulated its dispatch time slice, its priority is readjusted in relation to the other competing virtual machines. When a virtual machine has accumulated its elapsed time slice, it is dropped from the set of competing virtual machines and the scheduler attempts to add as many waiting virtual machines to the competing set as possible.

Therefore, the scheduler controls the level of multiprogramming in effect in the real machine at any given time. Using its virtual machine dispatching function, CP allocates the processing power of the available real processors on a time-sliced basis to the set of virtual machines that are currently permitted to operate concurrently.

The dispatch time slice is computed at CP initialization, but can be queried and changed at any time. While it is difficult to predict changes in system behavior resulting from changes in the dispatch time slice, you may want to make small changes based on the workload characteristics of your system.

To query the current time slice, use the following command:
QUERY SRM DSPSLICE
To change the current time slice, use the following command:
SET SRM DSPSLICE
The scheduling and dispatching routines that are implemented in CP are designed to favor:
  • Interactive (conversational) virtual machines over noninteractive (batch-oriented) virtual machines. Scheduling and dispatching priority is given to interactive virtual machines so that good response time can be provided to users entering commands at displays.
  • Installation-specified virtual machines. The installation can explicitly favor certain virtual machines over others. z/VM commands can be used to designate quick dispatch virtual machines and assign high absolute or relative shares to selected virtual machines.

When CP is ready to add one or more logged-on virtual machines to the set of virtual machines that is currently competing for use of the real processor, waiting virtual machines that are currently favored are considered for addition before those that are not.

Note: For the purposes of this scheduling discussion, the terms “virtual machine” and “virtual machine definition block” are generally synonymous. However, a multiprocessing virtual machine has multiple virtual machine definition blocks in its virtual configuration to represent multiple virtual processors. The scheduling of virtual multiprocessors is discussed in more detail in Scheduling Virtual Multiprocessors.