6. DATA SOURCES › 6.7 Memory Measurements › 6.7.3 Paging and Swapping
6.7.3 Paging and Swapping
The CPU requires that instructions and data be in central
storage before it can operate on them. In the MVS
environment, the memory requirements of high multiprogramming
levels often significantly exceed the available real memory.
MVS manages the limited real memory resource with paging and
swapping. The SMF type 30 records provide a number of
statistics on paging, swapping, and related activity.
CA MICS, in turn, provides a number of data elements in the
step level files that quantify these measurements.
PAGING
MVS makes optimum use of limited real memory by keeping only
a few pages of an address space in real memory at any given
time. When an address space is created by the initiation of
a job step or TSO session, MVS loads all of the pages unique
to the address space in auxiliary storage (unless V=R was
specified, in which case the pages are kept in central
storage for the duration of the step). The pages containing
the instructions needed to start the program are loaded into
central storage and execution begins. When the next
instruction to be executed is not in central storage, a page
fault occurs and the relevant page is copied from auxiliary
to real storage so that execution can continue.
PAGE STEALS
The Real Storage Manager (RSM) manages the 4 KB page frames
that make up central storage. There are control bits and
counters associated with each frame that the RSM uses in
memory management. They indicate:
o How long since the page has been referenced (used)
o Has the data in the page been altered?
The RSM always maintains an Available Frame Queue (AVQ),
which is a list of central storage page frames currently
unused and available. As page faults occur and the available
frames are used up, RSM examines all the frames in central
storage and "steals" frames from address spaces that have a
high Unreferenced Interval Count (UIC). Since all the frames
in central storage have copies in auxiliary storage (except
for address spaces that specify V=R and cannot have pages
stolen or paged out), it is better to steal a page that has
not been altered. An unaltered page may be overlaid
immediately by a new page, but an altered page must first be
written to auxiliary storage.
PAGE RECLAIMS
When a page is stolen and placed on the AFQ, there is a
chance that the program from which the page was stolen may
reference instructions or data on the page. If this occurs
before the page is reassigned to another address space, the
page may be reclaimed. This means that the page is removed
from the AFQ and reassigned to the address space from which
it was stolen. This is a page reclaim and it is accomplished
in microseconds as opposed to the milliseconds it would take
to move the page from auxiliary storage to central storage.
SWAPPING
The MVS System Resource Manager (SRM) attempts to maximize
the use of the systems resources without overcommitting them,
which would cause overall degradation in throughput and
response time. When certain levels of resource use are
exceeded, the SRM reduces the multiprogramming level by
address space swapping. A swap involves moving all the
central storage pages associated with an active address space
to a swap data set on DASD. While swapped out, an address
space is not executing. The address space is swapped back in
after waiting in the swap data sets for a while, and can
continue executing where it left off.
Complex criteria are used by the SRM to determine which
address space is swapped out. Domains, performance groups,
performance periods, service levels, and service received are
all examined. The selection process is dependent upon how
the work load is defined at each individual MVS site. The
main thing to realize about swapping is that it is an
indication that the system is overcommitted. Address space
swapping does not take place unless the SRM concludes that
the processing facility has too many tasks competing for the
system's resources.
SMF provides a great deal of information about the activities
presented above. CA MICS, in turn, provides a number of data
elements that quantify the memory management measures.
The CA MICS data elements on paging and swapping activities
found in the step level files are shown below:
PAGING
PGMPGIN - Non VIO, Non Swap Page Ins
PGMCPGIN - Common Area Page Ins
PGMLPAPG - Link Pack Area Page Ins
PGMVPGIN - VIO Page Ins
PGMHIPI - Hiperspace Page Ins
PGMPGOUT - Non VIO, Non Swap Page Outs
PGMVPGOT - VIO Page Outs
PGMHIPO - Hiperspace Page Outs
PAGE RECLAIMS
PGMVRCLM - VIO Reclaims
PAGE STEALING
PGMPGST - Pages Stolen
ADDRESS SPACE SWAPPING
PGMPGSWI - Pages Swapped In
PGMPGSWO - Pages Swapped Out
PGMSWAPS - Address Space Swap Sequences
Paging and swapping statistics are useful primarily at the
step level, so CA MICS does not propagate these values to the
job-level CA MICS files, with two exceptions. JOBHIPI and
JOBHIPO (hiperspace page ins and page outs) are carried in
the job-level files. These two data elements are the only
measurement available on hiperspace data movement.