Previous topic |
Next topic |
Contact z/OS |
Coding cross memory services to avoid the loss of ASIDs from reuse
z/OS MVS Programming: Extended Addressability Guide
A reusable ASID is one which has at some time been assigned to an address space created by a START command which specified REUSASID=YES, or an ASCRE macro which specified ATTR=REUSASID. Other ASIDs are referred to as ordinary ASIDs. All ASIDs are initially ordinary ASIDs. If no reusable ASIDs are available when a START command or ASCRE requests a reusable ASID, the system converts an available ordinary ASID into a reusable ASID. Once converted, an available reusable ASID can be used only to satisfy a request for a reusable ASID. The system honors a request for a reusable ASID only if REUSASID(YES) is specified in parmlib member DIAGxx. Otherwise, the system assigns an ordinary ASID. This allows the installation to enable reusable ASIDs only after testing its product set to verify that any maintenance required to support reusable ASIDs has been installed.
As you code cross memory services, try whenever possible to allow the ASID of an address space to be free for reuse at address space termination. To do this, you need to know the circumstances under which the system does not reuse an ordinary ASID. When an ordinary address space terminates, the system considers reusing the ASID that is associated with that address space. Whether the ordinary ASID is available for reuse depends on the cross memory connections that have been established between that address space and other address spaces.
An ordinary ASID is unavailable for reuse when the address space owns entry tables that contain space switch entries (created through SSWITCH=YES on the ETDEF macro), and when one of the following is true:
The ASID of an ordinary address space with no entry tables, or with entry tables that contain only non-space switch entries (created through SSWITCH=NO on the ETDEF macro), is available for reuse when the address space terminates. A reusable ASID is available for reuse when the address space terminates (but only by a subsequent request for a reusable ASID) regardless of non-system LX or system LX connections.
For an example of ordinary ASID reuse, see Figure 1, which describes the cross memory relationships between four ordinary address spaces. Address spaces A, B, and C own entry tables with space switch entries. Address space B is a server address space. It has a system LX; its PC routines are available to all address spaces. Address spaces A and C have non-system LXs; their PC routines are available to selected address spaces. Address space D owns no entry tables.
Figure 1. Cross memory connections between address spaces
To maintain the integrity of an address space, the system does not reuse an ASID until all programs that could potentially access that address space have completed. This means that the system reuses the ASIDs of the address spaces in the figure as follows:
A's and B's ASIDs are the lost ASIDs. Because programs in all address spaces potentially have the ability to transfer control to address space B, and programs in B can transfer control to address space A, A's and B's ASIDs are not reusable within an IPL. (Consider the consequences of the system reusing A's ASID at termination of A. Then, a program in B could pass control to code running in the address space that received the reused ASID.)
Connecting an entry table with space-switch entries through a non-system LX to a system address space or a long-running address space (such as VTAM®, CICS®, DB2®, or JES) makes the ordinary ASID of the owner of the entry table non-reusable. Therefore, to avoid unnecessary loss of ASIDs, IBM® recommends that you follow these rules:
Copyright IBM Corporation 1990, 2014