DISPATCHING AND SCHEDULING The scheduler, D!KSCH, selects dispatchable virtual aachines froa the
virtual machine population. The auxiliary routine that assists the
scheduler and dispatcher is the request stack maintenance routine, DMKSTK. To make decisions on dispatching and scheduling, the control prograa
places all virtual machines into various categories, and recognizes user
aachines as being in one of several states. The virtual aachine
categories either interactive or noninteractive virtual .achin9, are defined in the following way: An interactive virtual machine is one whose use of the systea is
punctuated by regular and frequent terminal I/O, and does not have
long processor execution times. A virtual machine becomes eligible
to enter interactive status whenever a channel prograa for virtual
console I/O has completed, or whenever I/O for a dedicated or dialed
virtual telecoamunications line has completed. A non-interactive virtual aachine is one that has violated an
interactive criterion, or one that has entered an idle wait state by
entering console function mode (equivalent to stopped state), or by
loading a wait state PSi that is not enabled for any busy channel. CP schedules interactive users ahead of non-interactive users.
Non-interactive users are subdivided into several classes. Bormal non-interactive virtual machines are scheduled by a priority scheme described below. A virtual machine is allowed to execute for a
specified time period and then it is placed in a list of those
machines that are waiting.
To give preference to certain classes of virtual machines, a priority
scheduling scheme allows virtual machines to be scheduled with a
priority class. The priority is a number assigned by the directory;
however, the number may be altered by the system operator.
To efficiently manage the large inventory of potential virtual machines that are logged on to the system, CP defines several states that a
virtual machine may occupy. The scheduler can move a virtual machine from one state to another; however, a virtual machine may exist in only
one state at any given instant. CP can then make scheduling and
dispatching decisions by looking only at the subset of virtual machines that are in the appropriate state. To do this search, it also maintains
lists of virtual machines in certain executable states.
1 user's virtual machine may be in one of the following states: State --1--
2
3
4
5
6
7
8
1-128 Meani.!!!l Interactive and dispatchable (in queue1, in dispatch list)
Interactive and not dispatchable (in queue1, in dispatch list)
Interactive and eligible for queue 1" but no available real
storage (waiting for queue1, in eligible list)
In wait state with terminal read or write active
Non-interactive and dispatchable (in queue2, in dispatch list)
Non-interactive and not dispatchable (in queue2, in dispatch
list)
Non-interactive and eligible for queue2, but no available real
storage (waiting for queue2, in eligible list)
Idle - waiting for asynchronous I/O or external interruption, or
stopped (in console function mode) IBM VM/370 System Logic and Problem Detersination--Voluae 1
Entries on the dispatch list are the VKBLOKs for those virtual
machines in states 1, 2, 5, and 6, and represent the virtual machines
that can be run at any given time. (States 2 and 6 remain in the
dispatch list even though they are not dispatchable.) The dispatch list
is sorted by dispatching priority, which is the ratio of processor tille
to wait tille over the length of the current virtual machine task. A task is defined as that execution that takes place between terminal
reads or entry to enabled wait (that is, lIovement from state 4 or 8 to
state 1) and is re-projected for a virtual machine each time it is
dropped froll a queue. Virtual machines entering state 1 always have a priority- o-f9-. The eligible list contains virtual machines in states 3 and 7: these
virtual lIachines are potentially executable, but due to the current load
on the system they are not allowed to compete for the processor. Is soon as a virtual machine in the dispatch list is dropped froll queue,
the highest-priority virtual machine(s) in the eligible list is added to
the dispatch list. Conditions can arise where the virtual machine that
is added to the dispatch list has a prOjected working set size that far
exceeds the remaining system capacity. The eligible list has two cOllponents; a section composed of those virtual machines waiting for Q1
(interactive) and a section composed of those virtual machines waiting
for 02 (non-interactive). Each section of the list is sorted by
scheduling priority, which is determined at the time the virtual machine is added to the eligible list, as follows:
1. The virtual machine's prOjected working set size, calculated the
last time it was dropped from a queue, is expressed as a percentage
of the amount of main storage'- available for paging. This
percentage, usually between 0 and 100, is multiplied by the paging
bias factor (stored at DKKSCHPB). 2. The virtual machine's priority (the priority set by the directory
or the class A SET PRIORITY command) is multiplied by the user bias
factor (stored at DftKSCHUB). and is added to the paging bias
calculated in step 1.
3. The sum of paging and user bias is divided by the sum of the bias
factors to obtain a weighted average. 4. 1 base priority is obtained by storing the TOO clock and using the leftmost word, which increases by 1 approximately once per second.
This word is then modified by shifting it left or right based on
the priority delay factor (stored at DBKSCHPDj. If DBKSCHPD is positive, it indicates a right shift, thereby increasing the delay
interval of the base priority. A negative value indicates a left
shift.
5. The weighted average obtained in step 3 is then logically added to
the adjusted base obtained in step 4. 6. If the virtual machine is entering 02 for the first time after
being dropped from Q1, the interactive bias factor (stored at DKKSCHIB) is subtracted froll the priority obtained in step 5. If
the virtual machine is entering Q1, or if it was last dropped from 02, the interactive bias is not applied.
7. The result of steps 1 through 6 is the scheduling or eligible list
priority, and is stored in the VKEPRIOR field of the VKBLOK. The V!BLOK is then sorted into the appropriate section of the
eligible list in ascending value of VKEPRIOR. The effects of the
various biases and the delay factor are illustrated by the following examples. CP Introduction 1-129
Previous Page Next Page