z/OS concepts
Previous topic | Next topic | Contents | Glossary | Contact z/OS | PDF


How paging works in z/OS

z/OS concepts

In addition to the DAT hardware and the segment and page tables required for address translation, paging activity involves a number of system components to handle the movement of pages and several additional tables to keep track of the most current version of each page.

To understand how paging works, assume that DAT encounters an invalid page table entry during address translation, indicating that a page is required that is not in a central storage frame. To resolve this page fault, the system must bring the page in from auxiliary storage. First, however, it must locate an available central storage frame. If none is available, the request must be saved and an assigned frame freed. To free a frame, the system copies its contents to auxiliary storage and marks its corresponding page table entry as invalid. This operation is called a page-out.

After a frame is located for the required page, the contents of the page are copied from auxiliary storage to central storage and the page table invalid bit is set off. This operation is called a page-in.

Paging can also take place when z/OS® loads an entire program into virtual storage. z/OS obtains virtual storage for the user program and allocates a central storage frame to each page. Each page is then active and subject to the normal paging activity; that is, the most active pages are retained in central storage while the pages not currently active might be paged out to auxiliary storage.

z/OS tries to keep an adequate supply of available central storage frames on hand. When a program refers to a page that is not in central storage, z/OS uses a central storage page frame from a supply of available frames.

When this supply becomes low, z/OS uses page stealing to replenish it, that is, it takes a frame assigned to an active user and makes it available for other work. The decision to steal a particular page is based on the activity history of each page currently residing in a central storage frame. Pages that have not been active for a relatively long time are good candidates for page stealing.

z/OS uses a sophisticated paging algorithm to efficiently manage virtual storage based on which pages were most recently used. An unreferenced interval count indicates how long it has been since a program referenced the page. At regular intervals, the system checks the reference bit for each page frame. If the reference bit is off– that is, the frame has not been referenced– the system adds to the frame's unreferenced interval count. It adds the number of seconds since this address space last had the reference count checked. If the reference bit is on, the frame has been referenced and the system turns it off and sets the unreferenced interval count for the frame to zero. Frames with the highest unreferenced interval counts are the ones most likely to be stolen.





Copyright IBM Corporation 1990, 2010