2. PERFORMANCE REPORTING ANALYSIS › 2.3 Auxiliary Storage Management Analysis › 2.3.4 MVS Concepts › 2.3.4.3 Swapping
2.3.4.3 Swapping
Swapping is the means by which MVS frees real storage frames
occupied by inactive or low priority address spaces and makes
them available for use by higher priority active address
spaces.
This section describes the swapping algorithms and explains
swap data set configuration changes. A brief introduction to
the evolution of the swap process provides a framework for
this discussion. Some recommendations on swap data set
sizing are given.
Before the availability of logical swapping and the extended
swap IUP, only LSQA pages were written to swap data sets, and
a physical swap-out was initiated when SRM analysis showed
that an address space would be, or should be, made idle for
an extended period. An address space was swapped:
o Between transactions (for TSO address spaces).
o For all explicit long wait conditions.
o In other wait conditions that were "too long" (i.e.,
detected waits or ENQ contention).
o Unilaterally by the SRM for multiprocessing level
contention and resource under or over utilization.
A swap-out is performed in three steps:
1. Execution is halted if the address space is not already
in a wait state and the address space is quiesced (i.e.,
put in a wait state).
2. The pages held by the address space are trimmed.
Non-LSQA pages unchanged since their last page-in have
their frames placed on the available frame queue, where
they are immediately available for stealing.
3. Non-LSQA working set pages that have been changed since
their last page-in are paged-out to the local data sets,
and their slot locations recorded in a control block in
the LSQA. The LSQA is then paged-out to the swap data
sets, if available; otherwise, the LSQA is paged-out to
the local data sets.
The swap-in process is the reverse of a swap-out:
1. LSQA is paged-in.
2. Page-ins are scheduled for non-LSQA pages marked as
referenced at swap-out.
3. The address space is restored and marked dispatchable,
possibly before the page-ins from step two have
completed.
Starting with MVS/SE2, logical swapping was introduced for
TSO address spaces. The effect of this change was to avoid
physically swapping a TSO address space if: (1) the user is
actively entering commands, and (2) there is enough real
storage available.
A second major change was in the form of an installed user
program (IUP) to modify the swap process. With the extended
swap IUP, those pages marked as referenced at swap-out are
treated as LSQA and paged-out to the swap data sets. Swap-in
step one brings in all the pages necessary to continue
execution of the address space, so swap-in step two is
effectively skipped. Swap-in step three is also
significantly shortened, because it is unnecessary to wait
for page-ins scheduled by step two.
The swap process is discussed in the following sections.
1 - Physical Swap Algorithm
2 - Working Set Trim
3 - Logical Swapping