8
What are two disadvantages of multi-level page tables?
1) Each level in a multi-level page table increases the number of physical memory accesses by one e.g. a two-level page table will require three physical memory accesses.2) The M-L page table introduces additional complexity in the design of the memory management unit hardware.
Describe how the 'use bit' marks pages in the Clock Algorithm. How is the use bit used to select a page for replacement?
1. The frame table maintains a use bit (UB) for every memory frame. The UB is an indicator of whether the frame has been referenced in the recent past. The Clock page replacement policy (algorithm) scans the frame table until a frame with its UB = 0 is located which is selected for replacement. During this scan, if the frame's UB = 1, it is set to 0 and the next frame examined. Every time a process references a frame (i.e. references the page in the frame), the frame's UB is set to 1. So frames (pages) that have not been recently referenced will have a UB=0 and their page will be selected for replacement.
Describe Page Fault Rate (PFR).
1. The page fault rate is a metric that describes the number of page faults that occur over some time period e.g. PFs per minute.
Describe Thrashing.
1. Thrashing occurs when the system's page fault rate (PFR) rises to a point that no processes can make progress i.e. each time the process is scheduled for execution (is made runnable) its execution takes it to a non-resident page and the page fault blocks the process's execution.
How many page table entries are needed with a 32 bit address bus and a page size of 8192?
A 32 bit address range with a page size of 213 bits permits (32-13) 219 (524288) pages.
If there is no empty frame available in memory, the OS must selected an occupied frame for page replacement with the new page.
A dirty page is one that has been modified by the process while resident in memory (in a frame). When a dirty page is selected for replacement, the modified page must be written back to the system drive before it can be replaced with the new needed page. This means that replacing a dirty page requires two I/O operations.
Describe Page Fault
A page fault is the interrupt generated by the memory management unit when the process references a page that is not resident in memory i.e. the page table entry is not present.
What is the result of setting a process's resident set size too large?
A resident set that is too large wastes memory (frames) by maintaining process pages in memory that are no longer being referenced by the process. This has the effect of reducing the overall number of processes that can be maintained in memory.
What is the result of setting a process's resident set size too small?
A resident set that is too small will cause an increase in the number of page faults and so will cause the process to begin thrashing.
Describe Demand Paging and Prepaging policies.
Demand paging policy installs a page into a frame when the process executes instructions or data on the page i.e. only the single page is made resident. Prepaging policy installs pages into frames before the process access the page. For example, installing page I and page i + 1 when page i is faulted. It is designed to avoid page faults during the process's execution.
What occurs when the system has no unassigned frames available?
If there is no empty frame available in memory, the OS must selected an occupied frame for page replacement with the new page.
What three pieces of information is maintained in a page table entry (as described in the slides)?
Mainly each entry maintains the upper N bits of the physical address of the memory frame containing the page. The PT Entry also maintains a 'Present bit' that indicates whether the page is resident (1) or must be retrieved from disk (0). The PT entry also maintains a 'modified bit' that indicates whether the page has been written to (modified) since it was made resident.
What is the technique described in the book used to reduce the size of the page table with large address ranges i.e. modern 64 bit architectures?
Multi-Level Page Table. That is, dividing the page table into multiple levels greatly reduces the number of PTE that must be maintained in memory (Figure 5.8).
Describe the L=S Criteria approach to determining how many processes to maintain in a ready state.
The L=S Criterion method maintains the number of executable processes such that the average time between page faults is equal to the average time needed to swap a page from disk (length of the IO operation). Too high a page fault rate indicates that too many processes are active and some need to be suspended to free up frames for the remaining processes.
In theory, how does the Least Recently Used page replacement policy select a page to be replaced when a new page must be made resident?
The LRU policy selects the page that has not been referenced in the longest amount of time. According to the principle of locality, the LRU page is least likely to be referenced in the near future.
Generally, how is a process's page fault frequency used to adjust a process's resident set size i.e. how should the resident set size be adjusted if the process's page fault rate increases and why?
The OS can monitor the PF Frequency and use it as an indicator of how to adjust the process's resident set size up or down. If the resident set is smaller than the working set, the PF Frequency will rise providing an indication that the process's resident set's size must be increased. When the resident set contains the working set, the PF Frequency will drop to near zero indicating that the resident set may be reduced.
Describe the purpose and role of the Translation Lookaside Buffer during the system's processing of a processor memory reference.
The Translation Lookaside Buffer (Page Entry Cache) is a fast memory cache for page table entries. When the TLB cache hits, it avoids the additional memory reference needed to retrieve one or more page table entries from memory depending on whether a 1, 2, 3, etc. level page table is being employed. Without a TLB, every virtual memory reference would require one or more memory reads for the page tables (depending on whether it is a 1, 2, etc. level page table) plus an additional reference to read the target frame.
Describe a process's Working Set.
The Working Set is the set of pages that the process currently needs to execute i.e. the process's locality. Any page in the working set that is not resident must be paged in.
Describe the Operating System's Fetch Policy.
The fetch policy determines when a page is made resident i.e. paged from disk into memory.
Describe the goal of a Load Control Policy.
The load control policy determines the number of processes to make active (i.e. not suspended) with the goal of maximizing the number of processes that can be installed. Install too many processes, the sum of their resident sets will exceed the system physical memory and the system will begin to thrash.
Describe a process's Resident Set.
The resident set is the set of process pages that are resident in memory i.e. are contained in a memory frame.
What are the two characteristics of simple memory paging that lead to, and the fundamental idea defines virtual memory? Hint: Three parts in slides.
The two characteristics of simple paging are: 1. Because of the indirection between logical and physical addresses made possible with the page table, a process's pages can be located in any frame of memory and can be moved (relocated) from one frame to another. The frames occupied by a process's pages do not need to be contiguous i.e. they can be spread throughout physical memory. And the fundamental idea in virtual memory is: 3. Not all of a process's pages need to be resident in physical memory for the process to execute. Only those pages in the process's working set need to be resident.
Describe the relationship between the size of a process's working set and its resident set.
The working set size should smaller than the resident set size i.e. the resident set should include at least the working set. If the resident set is smaller than the process's working set, the process will begin to thrash. If the resident set is much larger than the working set, the system is wasting frames (memory) on unneeded resident pages.
Describe the goal of a Page Replacement Policy. What does a replacement policy seek to minimize?
To reduce the page fault rate by selecting pages for replacement that will not be referenced in the near future, if at all. A replacement policy seeks to reduce the number of page faults by picking unused pages for replacement. That is, to pick pages for replacement that are no longer in the owning process's working set.
Describe how the OS responds to a page fault from the MMU.
When responding to a page fault, the OS will need to copy the needed page from the system drive and into an empty memory frame. The process generating the page fault is blocked like any I/O syscall. The page is copied from the process image on disk into an available frame. The process's page table entry is updated with the frame address. The process is moved from blocked to ready, and scheduled for execution.
Describe how a process's Working Set can be used to determine which processes to maintain in a ready state or which to suspend.
When the system begins to thrash, the OS will suspend processes whose current working set does not fit into its current resident set and continue to schedule processes whose working set fits into its resident set.