Previous Topic: 2.3.4.3.2 Working Set Trim

Next Topic: 2.3.5 Case Study

2.3.4.3.3 Logical Swapping

MVS/SE1 introduced the concept of logical swapping.  The
consumption of CPU and I/O resources by swapping had limited
the throughput of large TSO systems, primarily because
completion of each TSO transaction initiated a physical
swap-out.  The purpose of logical swapping is, where
possible, to avoid actual swap-out page transfer to the ASM
data sets.  To describe logical swapping, we first consider
the steps in the life of a transaction in a system prior to
MVS/SE1:

 1.  Swap-in of the LSQA pages (stage 1).

 2.  Swap-in of the private pages (stage 2).

 3.  Restore processing - ready the address space for
     execution.

 4.  Execution phase.

 5.  Quiesce processing - stop all tasks, SRBs, and I/O.

 6.  Working set trim.

 7.  Swap-out of changed non-LSQA pages and LSQA pages.

The decision to do a physical or logical swap is made at the
completion of quiesce processing and is based on two
variables:  (1) the user think time and (2) the system think
time.  Prior to MVS/SP 1.3, only TSO address spaces that were
quiesced due to a terminal wait condition (input or output)
were considered for logical swapping.

Starting in MVS/SP 1.3, any swappable task that enters a
detected or long wait condition is considered for logical
swapping.  User think time is calculated as the time from the
end of quiesce processing to the end of restore processing,
and hence accounts for user idle time, time keying in data,
swap-in time, and any communications delays.

System think time is calculated as a function of the
available storage.  Consult the Initialization and Tuning
Guide for the appropriate level of your system for the exact
calculation used.  The value of system think time may be
plotted over time.  This value is controlled by parameters in
the SYS1.PARMLIB member IEAOPTnn that define the range of
values, the length of the available frame queue, and the
system unreferenced interval count (UIC) value.

With MVS/SP 1.3 and beyond, the amount of fixed storage and
the amount of storage fixed or allocated from page-in or
page-out operations is also considered.  An address space is
logically swapped if the previous user think time is less
than the current value of system think time.  When a
logically swapped address space remains idle for longer than
the system think time, it is physically swapped.

TSO users receive an extra 2-second grace period, but the
physical swap is not actually performed until real storage
frames are needed.  Hence, an address space may remain
logically swapped far longer than might be expected.

Non-TSO address spaces are also candidates for logical
swapping.  The criteria for non-TSO logical swapping are:

    o  System think time must be greater than five seconds.

    o  The current high UIC must be greater than logical swap
       high threshold (default is 30).

    o  The average number of fixed frames below 16 megabytes
       is below that logical swap threshold.

When all the above conditions are met, a swappable non-TSO
address space entering a detected or long wait will be
considered for logical swapping.

Given sufficient real storage, logical swapping greatly
improves TSO response.  There are so many interactions
between an ASM configuration and the amount of real memory,
the type of swapping (extended swap or not), and page
stealing that it is difficult to give firm guidelines on how
to use these facilities.  You should perform all basic system
tuning first, however, before you make any changes to the
system-provided defaults.  Some general strategies are
discussed in Section 2.3.2 of this guide.

In an expanded storage environment, logical swapping is still
utilized in an attempt to save the processor cycles and
expanded storage or I/O overhead of physical swapping.  As
noted above, a TSO address space in a terminal wait condition
or any class of address space in a long or detected wait
condition is eligible for logical swapping.  When this
happens, the LSQA, fixed, and most recently referenced pages
are kept in central storage.  The only real impact of
expanded storage on the logical swap process is to mitigate
the degradation that might occur when a logical swap must be
converted to a physical swap.

Just as a logical swap is effective only if the address space
is swapped back in before being converted to a physical swap,
an expanded storage physical swap is effective only if the
address space is swapped back in before being migrated
through central to auxiliary storage.