When a request to allocate a slot for virtual storage paging is
received by DMKPGTGT and the slot aust be allocated on a moveable head
(2314/2319, 3330, 3340, or 3350) device, a cylinder and slot are
selected in the following manner:
1. CP tries to allocate a space on the cylinder at which the arm on
the selected device is currently positioned.
2. If slots are not available on the current cylinder, CP tries to
allocate space on a cylinder for which paging I/O has been queued.
3. If the above conditions cannot be met, CP allocates space as close
to the center of the volume as is possible.
Before DMKIOSQR is called, the queue of IOBLOKs currently scheduled
on the device is examined. If paging I/O has already been scheduled on
a device, the paging channel programs are slot-sorted and chained together with TICs.
PAGING I/O DMKPAGIO handles all input/output requests for virtual storage and
spooling pages. DMKPAGIO constructs the necessary task blocks and
channel programs, expands the compressed slot addresses, and maintains a
queue of CPEXBLOKs for pages to be moved. Once the I/O scheduled by DMKPAGIO completes, it unchains the CPEXBLOKs that have been queued and
calls DMKSTKCP to stack them for execution. DMKPAGIC is entered by a GOTO from: DMKPTRAH to read and write virtual storage pages DMKRPA to read and write virtual storage spool buffers
In either case, all that needs to be passed to DMKP1GIO is the
address of the CORT1BLE entry for the page that is to be .oved, the
address of a SWPTABLE entry for the slot, a read or write operation
code, and the address of a CPEXBLOK that is to be stacked for
dispatching after the 110 associated with the page has completed. DMKPAGIO obtains an IOBLOK and builds a channel program to do the
necessary I/O, and uses the device code that is part of the page address
to index into the syste.'s OWHDLIST and locate the real device to which
the I/O request should be directed. If the device is capable of
rotational position sensing, the required sector is computed and a SET SECTOR co.mand is inserted into the channel program. The real SIO supervisor DKKIOSQR is then called to schedule the operation on the
proper device. When the interruption for the paging operation is processed by the
primary I/O interruption handler, the IOBLOK that controls the operation
is unstacked to the interruption return address, waitpage, in DKKP1GIO. waitpage then unchains the CPEXBLOKs that are queued to DKKP1GO. and
then stacks the queued CPEXBLOKs, by calls to DKKSTKCP, in the order in
which they were received. The address of the real page frame is filed
into the appropriate page table entry and the pointers denoting the
ownership of the real page fraae are filed into the CORT1BLE entry by
the processing routines in DKKPTR1H. If a fatal I/O error occurred for
the related page fraae, the CPEXBLOKs associated with it are flagged,
and the dispatcher, DMKSDPCH. sets a nonzero condition code when it
activates the pending task. The error recovery followed depends on the
operation being perforaed. Paging I/O errors associated with spooling
operations are discussed in "D1SD Errors During Spooling" in this
CP Introduction 1-113
section, while errors associated with
are discussed later in the section
Recovery".
virtual storage paging operations "Virtual Storage Paging Error DMKPAGIO maintains its own subpool of preformatted paging IOBLOKs.
As I/O operations complete, their IOBLOKs are added to a list of
available blocks; as new blocks are needed, they are taken fro. this
list. If the list is empty, DMKFREE is called to obtain storage for a
new block. DMKPAGIO also periodically calculates system paging
overhead. After 200 pages have been moved (read or written), the
elapsed time for the 200 page moves is computed, and the paging rate is
calculated in page moves per second. The recent paging load, expressed
as the percentage of time that more than one half of the system's pages
were idle due to page-wait, is averaged with the previous load and
re-projected as the expected load for the next interval.
PAGING SUBSYSTEK The paging subsystem has three major components that have resource
optimization algorithms associated with them: I The page replacement and page selection algorithm that manages the I allocation of real storage frames and selects which virtual page to I replace. I An algorithm for the allocation of DASD backing store pages. I An algorithm for ordering the queue of page I/O reqests.
PAGE REPLACEMENT IND PAGE SELECTION ALGORITHM VM/370 is a demand paging system. programs run in virtual storage and
when a storage reference is made to a virtual page not currently in real
storage, a page fault occurs. A page fault is a program interruption
that occurs when a page marked "not in real storage" is referred to by
an acti!e page. This page fault represents a demand for a real storage frame 1n which to place the virtual page. The page replacement algorithm chooses which real storage frame will be allocated to fulfill
such a demand. If all real frames in real storage are occupied by other
virtual pages, a real frame can only be obtained by replacing one of
those virtual pages. The selection of which virtual page to replace is
carried out by the page selection algorithm. The scheduler aids the page selection algorithm by notifying it of
virtual machines that are no longer eligible for dispatching (either
because they have been dispatched, or because they are being held
suspended in the eligible list). The scheduler calls the page reset
routine when a virtual machine is dropped froa a queue and reset routine
when a virtual aachine is dropped from a queue and does not immediately reenter the dispatch list. Under heavy paging loads, it is the
responsibility of the page reset routine to group all in-storage virtual
pages belonging to the virtual machine; it groups them on an available
(or flush) list for easy selection by the page replacement algorithm. The page reset routine cycles through the virtual machine's segment table looking for valid segment entries. When it finds a valid entry,
it turns on the segment table entry invalid flag and the page reset
routine begins to process the page table associated with that segment table entry_ The page table header is timestaaped, and if it is a
1-114 IBM VK/370 system Logic and Problem Determination--Voluae 1
Previous Page Next Page