A Paging Example

There are many types of virtual pages. Some are private to one process; others are shared. They may be assigned to represent a block in an image file or allocated to hold new data. They may be writeable or read-only, or they may be accessible only at certain privileged access modes. This example will use an ordinary process-private data page for illustration.

Let's start with the idea of a page already in physical memory that was modified by its owner process several seconds ago. A few seconds later, let's say that several other processes suddenly increase their memory requirements. The computer is now running low on free memory.

The system must do something to make more memory pages available. Our example memory page is selected by the memory management subsystem to be freed. Because the process has modified the page, its contents must be preserved before the physical page can be freed. The memory management subsystem takes several steps that result in the page being copied to a special file on disk called a pagefile. The page tables are updated to reflect the location of the data, and the physical page is made available for other processes.

Some time later, the process makes a reference to a memory address previously contained on that page. During the virtual-to-physical address translation, the memory management hardware discovers that the virtual page is not currently in physical memory. It signals a condition called translation not valid, otherwise known as a page fault. The process is placed into PFW (page fault wait) state while waiting for the page to be made ready. The memory-management subsystem locates a free page of memory and fills it with the contents stored in the pagefile. When this is complete, the page tables are updated with the new address information. The process is placed into COM state, and when it is selected for execution, the same instruction that caused the page fault will be retried. This time, it will not cause a page fault, and the process will continue.



Getting Started with OpenVMS(c) A Guide for New Users
Getting Started with OpenVMS: A Guide for New Users (HP Technologies)
ISBN: 1555582796
EAN: 2147483647
Year: 2005
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net