This preview shows page 1. Sign up to view the full content.
Unformatted text preview: disk, and mark it as absent. The physical memory can then be allocated to a different use. If the program attempts to access Memory management 287 an absent page or segment the exception is raised and the operating system can bring the page or segment back into main memory, then allow the program to retry the access. When implemented with the paged memory management scheme, this process is known as demand-paged virtual memory. A program can be written to occupy a virtual memory space that is larger than the available physical memory space in the computer where it is run, since the operating system can wheel bits of program and data in as they are needed. Typical programs work some parts of their code very hard and rarely touch others; leaving the infrequently used routines out on disk will not noticeably affect performance. However, over-exploiting this facility causes the operating system to switch pages in and out of memory at a high rate. This is described as thrashing, and will adversely affect performance. Restartable instructions An important requirement in a virtual memory system is that any instruction that can cause a memory access fault must leave the processor in a state that allows the operating system to page-in the requested memory and resume the original program as though the fault had not happened. This is often achieved by making all instructions that access memory restartable. The processor must retain enough state to allow the operating system to recover enough of the register values so that, when the page is in main memory, the faulting instruction is retried with identical results to those that would have been obtained had the page been resident at the first attempt. This requirement is usually the most difficult one to satisfy in the design of a processor while retaining high-performance and minimum hardware redundancy. The paging scheme described above gives the programmer complete freedom and transparency in the use of memory, but it would seem that this has been achieved at considerable cost in performance since each memory access appears to have incurred an overhead of two additional memory accesses, one to the page directory and one to the page table, be...
View Full Document
This document was uploaded on 10/30/2011 for the course CSE 378 380 at SUNY Buffalo.
- Spring '09